summaryrefslogtreecommitdiffstats
path: root/fs/nfsd/nfs4proc.c
diff options
context:
space:
mode:
authorJ. Bruce Fields <bfields@redhat.com>2014-01-20 16:37:11 -0500
committerJ. Bruce Fields <bfields@redhat.com>2014-05-30 17:32:03 -0400
commit561f0ed498ca4342573a870779cc645d3fd7dfe7 (patch)
treeaf3b710f0021e31502de81487de81a819368521d /fs/nfsd/nfs4proc.c
parent32aaa62ede574ff99b020b4ee3ff6f9cfc9f0099 (diff)
downloadlinux-561f0ed498ca4342573a870779cc645d3fd7dfe7.tar.gz
linux-561f0ed498ca4342573a870779cc645d3fd7dfe7.tar.bz2
linux-561f0ed498ca4342573a870779cc645d3fd7dfe7.zip
nfsd4: allow large readdirs
Currently we limit readdir results to a single page. This can result in a performance regression compared to NFSv3 when reading large directories. Signed-off-by: J. Bruce Fields <bfields@redhat.com>
Diffstat (limited to 'fs/nfsd/nfs4proc.c')
-rw-r--r--fs/nfsd/nfs4proc.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/fs/nfsd/nfs4proc.c b/fs/nfsd/nfs4proc.c
index 59c319528cf9..d95d9015e50a 100644
--- a/fs/nfsd/nfs4proc.c
+++ b/fs/nfsd/nfs4proc.c
@@ -1500,13 +1500,14 @@ static inline u32 nfsd4_read_rsize(struct svc_rqst *rqstp, struct nfsd4_op *op)
static inline u32 nfsd4_readdir_rsize(struct svc_rqst *rqstp, struct nfsd4_op *op)
{
+ u32 maxcount = svc_max_payload(rqstp);
u32 rlen = op->u.readdir.rd_maxcount;
- if (rlen > PAGE_SIZE)
- rlen = PAGE_SIZE;
+ if (rlen > maxcount)
+ rlen = maxcount;
- return (op_encode_hdr_size + op_encode_verifier_maxsz)
- * sizeof(__be32) + rlen;
+ return (op_encode_hdr_size + op_encode_verifier_maxsz +
+ XDR_QUADLEN(rlen)) * sizeof(__be32);
}
static inline u32 nfsd4_remove_rsize(struct svc_rqst *rqstp, struct nfsd4_op *op)