[PATCH] knfsd: fix auto-sizing of nfsd request/reply buffers
authorNeilBrown <neilb@suse.de>
Wed, 4 Oct 2006 09:16:15 +0000 (02:16 -0700)
committerLinus Torvalds <torvalds@g5.osdl.org>
Wed, 4 Oct 2006 14:55:21 +0000 (07:55 -0700)
totalram is measured in pages, not bytes, so PAGE_SHIFT must be used when
trying to find 1/4096 of RAM.

Cc: "J. Bruce Fields" <bfields@fieldses.org>
Signed-off-by: Neil Brown <neilb@suse.de>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
fs/nfsd/nfssvc.c

index 0603baad54266708f9e336669c0158d791845a50..6fa6340a5fb892e217e180218d3199bc4e4b3e55 100644 (file)
@@ -209,7 +209,7 @@ int nfsd_create_serv(void)
                 * Of course, this is only a default.
                 */
                nfsd_max_blksize = NFSSVC_MAXBLKSIZE;
-               i.totalram >>= 12;
+               i.totalram <<= PAGE_SHIFT - 12;
                while (nfsd_max_blksize > i.totalram &&
                       nfsd_max_blksize >= 8*1024*2)
                        nfsd_max_blksize /= 2;