From: NeilBrown Date: Wed, 4 Oct 2006 09:16:15 +0000 (-0700) Subject: [PATCH] knfsd: fix auto-sizing of nfsd request/reply buffers X-Git-Tag: v2.6.19-rc1~100 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=44c556000a31e8079cfbb9a42a7edb93ca6b589a;p=linux-2.6 [PATCH] knfsd: fix auto-sizing of nfsd request/reply buffers 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" Signed-off-by: Neil Brown Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/fs/nfsd/nfssvc.c b/fs/nfsd/nfssvc.c index 0603baad54..6fa6340a5f 100644 --- a/fs/nfsd/nfssvc.c +++ b/fs/nfsd/nfssvc.c @@ -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;