Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 235016
b: refs/heads/master
c: 2c66523
h: refs/heads/master
v: v3
  • Loading branch information
Venkateswararao Jujjuri (JV) authored and Eric Van Hensbergen committed Mar 15, 2011
1 parent cc6e369 commit 213c690
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 3 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 1fc52481c2b886c445bb167dfd16ee6de6922ef7
refs/heads/master: 2c66523fd290edeea26cbe8cedd0af167d0f7e5f
11 changes: 9 additions & 2 deletions trunk/net/9p/client.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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);
Expand Down
18 changes: 18 additions & 0 deletions trunk/net/9p/protocol.c
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,15 @@ pdu_write_urw(struct p9_fcall *pdu, const char *kdata, const char __user *udata,
return 0;
}

static size_t
pdu_write_readdir(struct p9_fcall *pdu, const char *kdata, size_t size)
{
BUG_ON(pdu->size > P9_READDIRHDRSZ);
pdu->pkbuf = (char *)kdata;
pdu->pbuf_size = size;
return 0;
}

/*
b - int8_t
w - int16_t
Expand Down Expand Up @@ -466,6 +475,15 @@ p9pdu_vwritef(struct p9_fcall *pdu, int proto_version, const char *fmt,
errcode = -EFAULT;
}
break;
case 'F':{
int32_t cnt = va_arg(ap, int32_t);
const char *k = va_arg(ap, const void *);
errcode = p9pdu_writef(pdu, proto_version, "d",
cnt);
if (!errcode && pdu_write_readdir(pdu, k, cnt))
errcode = -EFAULT;
}
break;
case 'U':{
int32_t count = va_arg(ap, int32_t);
const char __user *udata =
Expand Down

0 comments on commit 213c690

Please sign in to comment.