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>

+8 -3
+7 -2
fs/nfsd/nfsd.h
··· 44 #include "stats.h" 45 46 /* 47 - * Maximum blocksizes supported by daemon under various circumstances. 48 */ 49 - #define NFSSVC_MAXBLKSIZE RPCSVC_MAXPAYLOAD 50 51 struct readdir_cd { 52 __be32 err; /* 0, nfserr, or nfserr_eof */
··· 44 #include "stats.h" 45 46 /* 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. 50 */ 51 + enum { 52 + NFSSVC_DEFBLKSIZE = 1 * 1024 * 1024, 53 + NFSSVC_MAXBLKSIZE = RPCSVC_MAXPAYLOAD, 54 + }; 55 56 struct readdir_cd { 57 __be32 err; /* 0, nfserr, or nfserr_eof */
+1 -1
fs/nfsd/nfssvc.c
··· 582 */ 583 target >>= 12; 584 585 - ret = NFSSVC_MAXBLKSIZE; 586 while (ret > target && ret >= 8*1024*2) 587 ret /= 2; 588 return ret;
··· 582 */ 583 target >>= 12; 584 585 + ret = NFSSVC_DEFBLKSIZE; 586 while (ret > target && ret >= 8*1024*2) 587 ret /= 2; 588 return ret;