Explorar o código

[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" <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>
NeilBrown %!s(int64=18) %!d(string=hai) anos
pai
achega
44c556000a
Modificáronse 1 ficheiros con 1 adicións e 1 borrados
  1. 1 1
      fs/nfsd/nfssvc.c

+ 1 - 1
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;