diff options
-rw-r--r-- | net/9p/client.c | 21 |
1 files changed, 15 insertions, 6 deletions
diff --git a/net/9p/client.c b/net/9p/client.c index 82079f902f56..412c52e1de74 100644 --- a/net/9p/client.c +++ b/net/9p/client.c | |||
@@ -1333,12 +1333,21 @@ p9_client_write(struct p9_fid *fid, char *data, const char __user *udata, | |||
1333 | 1333 | ||
1334 | if (count < rsize) | 1334 | if (count < rsize) |
1335 | rsize = count; | 1335 | rsize = count; |
1336 | if (data) | 1336 | |
1337 | req = p9_client_rpc(clnt, P9_TWRITE, "dqD", fid->fid, offset, | 1337 | /* Don't bother zerocopy form small IO (< 1024) */ |
1338 | rsize, data); | 1338 | if (((clnt->trans_mod->pref & P9_TRANS_PREF_PAYLOAD_MASK) == |
1339 | else | 1339 | P9_TRANS_PREF_PAYLOAD_SEP) && (rsize > 1024)) { |
1340 | req = p9_client_rpc(clnt, P9_TWRITE, "dqU", fid->fid, offset, | 1340 | req = p9_client_rpc(clnt, P9_TWRITE, "dqE", fid->fid, offset, |
1341 | rsize, udata); | 1341 | rsize, data, udata); |
1342 | } else { | ||
1343 | |||
1344 | if (data) | ||
1345 | req = p9_client_rpc(clnt, P9_TWRITE, "dqD", fid->fid, | ||
1346 | offset, rsize, data); | ||
1347 | else | ||
1348 | req = p9_client_rpc(clnt, P9_TWRITE, "dqU", fid->fid, | ||
1349 | offset, rsize, udata); | ||
1350 | } | ||
1342 | if (IS_ERR(req)) { | 1351 | if (IS_ERR(req)) { |
1343 | err = PTR_ERR(req); | 1352 | err = PTR_ERR(req); |
1344 | goto error; | 1353 | goto error; |