aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVenkateswararao Jujjuri (JV) <jvrao@linux.vnet.ibm.com>2011-02-13 19:23:59 -0500
committerEric Van Hensbergen <ericvh@gmail.com>2011-03-15 10:57:35 -0400
commit1fc52481c2b886c445bb167dfd16ee6de6922ef7 (patch)
tree5d854af0b495441e02ef895570e3d8fac4b0a6a3
parentbb2f8a55153ec58e66a496224504ac9be919c8f1 (diff)
[net/9p] Write side zerocopy changes for 9P2000.L protocol.
Modify p9_client_write() to check the transport preference and act accordingly. If the preference is P9_TRANS_PREF_PAYLOAD_SEP, send the payload separately instead of putting it directly on PDU. Signed-off-by: Venkateswararao Jujjuri <jvrao@linux.vnet.ibm.com> Signed-off-by: Eric Van Hensbergen <ericvh@gmail.com>
-rw-r--r--net/9p/client.c21
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;