Skip to content

Commit 8a81f16

Browse files
committed
NFSD: Add a "default" block size
We'd like to increase the maximum r/wsize that NFSD can support, but without introducing possible regressions. So let's add a default setting of 1MB. A subsequent patch will raise the maximum value but leave the default alone. No behavior change is expected. Reviewed-by: NeilBrown <neil@brown.name> Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
1 parent cdc2915 commit 8a81f16

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

fs/nfsd/nfsd.h

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,9 +44,14 @@ bool nfsd_support_version(int vers);
4444
#include "stats.h"
4545

4646
/*
47-
* Maximum blocksizes supported by daemon under various circumstances.
47+
* Default and maximum payload size (NFS READ or WRITE), in bytes.
48+
* The default is historical, and the maximum is an implementation
49+
* limit.
4850
*/
49-
#define NFSSVC_MAXBLKSIZE RPCSVC_MAXPAYLOAD
51+
enum {
52+
NFSSVC_DEFBLKSIZE = 1 * 1024 * 1024,
53+
NFSSVC_MAXBLKSIZE = RPCSVC_MAXPAYLOAD,
54+
};
5055

5156
struct readdir_cd {
5257
__be32 err; /* 0, nfserr, or nfserr_eof */

fs/nfsd/nfssvc.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -582,7 +582,7 @@ static int nfsd_get_default_max_blksize(void)
582582
*/
583583
target >>= 12;
584584

585-
ret = NFSSVC_MAXBLKSIZE;
585+
ret = NFSSVC_DEFBLKSIZE;
586586
while (ret > target && ret >= 8*1024*2)
587587
ret /= 2;
588588
return ret;

0 commit comments

Comments
 (0)