summaryrefslogtreecommitdiff
path: root/net/9p/client.c
diff options
context:
space:
mode:
authorVenkateswararao Jujjuri (JV) <jvrao@linux.vnet.ibm.com>2011-02-17 05:43:20 +0300
committerEric Van Hensbergen <ericvh@gmail.com>2011-03-15 17:57:35 +0300
commit2c66523fd290edeea26cbe8cedd0af167d0f7e5f (patch)
treee2658302dfce599cd42545d0487a5650a187c7bd /net/9p/client.c
parent1fc52481c2b886c445bb167dfd16ee6de6922ef7 (diff)
downloadlinux-2c66523fd290edeea26cbe8cedd0af167d0f7e5f.tar.xz
[net/9p] readdir zerocopy changes for 9P2000.L protocol.
Modify p9_client_readdir() to check the transport preference and act according 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>
Diffstat (limited to 'net/9p/client.c')
-rw-r--r--net/9p/client.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/net/9p/client.c b/net/9p/client.c
index 412c52e1de74..6e07ef494ff2 100644
--- a/net/9p/client.c
+++ b/net/9p/client.c
@@ -1735,7 +1735,14 @@ int p9_client_readdir(struct p9_fid *fid, char *data, u32 count, u64 offset)
if (count < rsize)
rsize = count;
- req = p9_client_rpc(clnt, P9_TREADDIR, "dqd", fid->fid, offset, rsize);
+ if ((clnt->trans_mod->pref & P9_TRANS_PREF_PAYLOAD_MASK) ==
+ P9_TRANS_PREF_PAYLOAD_SEP) {
+ req = p9_client_rpc(clnt, P9_TREADDIR, "dqF", fid->fid,
+ offset, rsize, data);
+ } else {
+ req = p9_client_rpc(clnt, P9_TREADDIR, "dqd", fid->fid,
+ offset, rsize);
+ }
if (IS_ERR(req)) {
err = PTR_ERR(req);
goto error;
@@ -1749,7 +1756,7 @@ int p9_client_readdir(struct p9_fid *fid, char *data, u32 count, u64 offset)
P9_DPRINTK(P9_DEBUG_9P, "<<< RREADDIR count %d\n", count);
- if (data)
+ if (!req->tc->pbuf_size && data)
memmove(data, dataptr, count);
p9_free_req(clnt, req);