From 9dcee3f2d117f24dd9ed1f11581855f184e12dcd Mon Sep 17 00:00:00 2001 From: Trond Myklebust Date: Thu, 19 Jul 2007 10:03:37 -0400 Subject: [PATCH] --- yaml --- r: 61863 b: refs/heads/master c: d6ac02dfaa6c423874839fe289c7320624aa9288 h: refs/heads/master i: 61861: ac2e0c6a955277b61c8ab77a1168229d543db6f7 61859: 90f7d15023c72497ea58f012fdbe467728f6d2c3 61855: 2a252ee57037c887d316d5a87b03823c051608b9 v: v3 --- [refs] | 2 +- trunk/fs/nfs/nfs4xdr.c | 27 ++++++++++++++------------- 2 files changed, 15 insertions(+), 14 deletions(-) diff --git a/[refs] b/[refs] index 43aca522b2cf..3d3cb10e0d92 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 9104a55dc382c4aae42dff3f54351085cbcb7317 +refs/heads/master: d6ac02dfaa6c423874839fe289c7320624aa9288 diff --git a/trunk/fs/nfs/nfs4xdr.c b/trunk/fs/nfs/nfs4xdr.c index 5eb92f1e2e10..bec171a493a4 100644 --- a/trunk/fs/nfs/nfs4xdr.c +++ b/trunk/fs/nfs/nfs4xdr.c @@ -1168,12 +1168,10 @@ static int encode_read(struct xdr_stream *xdr, const struct nfs_readargs *args) static int encode_readdir(struct xdr_stream *xdr, const struct nfs4_readdir_arg *readdir, struct rpc_rqst *req) { - struct rpc_auth *auth = req->rq_task->tk_msg.rpc_cred->cr_auth; uint32_t attrs[2] = { FATTR4_WORD0_RDATTR_ERROR|FATTR4_WORD0_FILEID, FATTR4_WORD1_MOUNTED_ON_FILEID, }; - int replen; __be32 *p; RESERVE_SPACE(12+NFS4_VERIFIER_SIZE+20); @@ -1198,17 +1196,6 @@ static int encode_readdir(struct xdr_stream *xdr, const struct nfs4_readdir_arg attrs[0] & readdir->bitmask[0], attrs[1] & readdir->bitmask[1]); - /* set up reply kvec - * toplevel_status + taglen + rescount + OP_PUTFH + status - * + OP_READDIR + status + verifer(2) = 9 - */ - replen = (RPC_REPHDRSIZE + auth->au_rslack + 9) << 2; - xdr_inline_pages(&req->rq_rcv_buf, replen, readdir->pages, - readdir->pgbase, readdir->count); - dprintk("%s: inlined page args = (%u, %p, %u, %u)\n", - __FUNCTION__, replen, readdir->pages, - readdir->pgbase, readdir->count); - return 0; } @@ -1815,6 +1802,8 @@ static int nfs4_xdr_enc_readdir(struct rpc_rqst *req, __be32 *p, const struct nf struct compound_hdr hdr = { .nops = 2, }; + struct rpc_auth *auth = req->rq_task->tk_msg.rpc_cred->cr_auth; + int replen; int status; xdr_init_encode(&xdr, &req->rq_snd_buf, p); @@ -1823,6 +1812,18 @@ static int nfs4_xdr_enc_readdir(struct rpc_rqst *req, __be32 *p, const struct nf if(status) goto out; status = encode_readdir(&xdr, args, req); + + /* set up reply kvec + * toplevel_status + taglen + rescount + OP_PUTFH + status + * + OP_READDIR + status + verifer(2) = 9 + */ + replen = (RPC_REPHDRSIZE + auth->au_rslack + NFS4_dec_readdir_sz) << 2; + xdr_inline_pages(&req->rq_rcv_buf, replen, args->pages, + args->pgbase, args->count); + dprintk("%s: inlined page args = (%u, %p, %u, %u)\n", + __FUNCTION__, replen, args->pages, + args->pgbase, args->count); + out: return status; }