patch-2.3.99-pre9 linux/fs/nfsd/nfscache.c

Next file: linux/fs/nfsd/nfsfh.c
Previous file: linux/fs/nfs/write.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.3.99-pre8/linux/fs/nfsd/nfscache.c linux/fs/nfsd/nfscache.c
@@ -49,16 +49,21 @@
 	struct svc_cacherep	*rp;
 	struct nfscache_head	*rh;
 	size_t			i;
+	unsigned long		order;
 
 	if (cache_initialized)
 		return;
 
 	i = CACHESIZE * sizeof (struct svc_cacherep);
-	nfscache = kmalloc (i, GFP_KERNEL);
+	for (order = 0; (PAGE_SIZE << order) < i; order++)
+		;
+	nfscache = (struct svc_cacherep *)
+		__get_free_pages(GFP_KERNEL, order);
 	if (!nfscache) {
 		printk (KERN_ERR "nfsd: cannot allocate %d bytes for reply cache\n", i);
 		return;
 	}
+	memset(nfscache, 0, i);
 
 	i = HASHSIZE * sizeof (struct nfscache_head);
 	hash_list = kmalloc (i, GFP_KERNEL);

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)