summaryrefslogtreecommitdiff
path: root/fs/nfsd/nfscache.c
diff options
context:
space:
mode:
authorYan Burman <burman.yan@gmail.com>2006-12-08 02:39:41 -0800
committerLinus Torvalds <torvalds@woody.osdl.org>2006-12-08 08:29:02 -0800
commit4b3bb06bea649396490094780f90d315c152f6ab (patch)
tree7aa0dac29fe4837735d215effa1dce469e792ab5 /fs/nfsd/nfscache.c
parent14d2b59e8c1634ceb995097b162592b0af139578 (diff)
downloadlinux-3.10-4b3bb06bea649396490094780f90d315c152f6ab.tar.gz
linux-3.10-4b3bb06bea649396490094780f90d315c152f6ab.tar.bz2
linux-3.10-4b3bb06bea649396490094780f90d315c152f6ab.zip
[PATCH] nfsd: replace kmalloc+memset with kcalloc + simplify NULL check
Replace kmalloc+memset with kcalloc and simplify Signed-off-by: Yan Burman <burman.yan@gmail.com> Cc: Neil Brown <neilb@cse.unsw.edu.au> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'fs/nfsd/nfscache.c')
-rw-r--r--fs/nfsd/nfscache.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/fs/nfsd/nfscache.c b/fs/nfsd/nfscache.c
index 6100bbe2743..f90d7047585 100644
--- a/fs/nfsd/nfscache.c
+++ b/fs/nfsd/nfscache.c
@@ -66,14 +66,13 @@ nfsd_cache_init(void)
printk (KERN_ERR "nfsd: cannot allocate all %d cache entries, only got %d\n",
CACHESIZE, CACHESIZE-i);
- hash_list = kmalloc (HASHSIZE * sizeof(struct hlist_head), GFP_KERNEL);
+ hash_list = kcalloc (HASHSIZE, sizeof(struct hlist_head), GFP_KERNEL);
if (!hash_list) {
nfsd_cache_shutdown();
printk (KERN_ERR "nfsd: cannot allocate %Zd bytes for hash list\n",
HASHSIZE * sizeof(struct hlist_head));
return;
}
- memset(hash_list, 0, HASHSIZE * sizeof(struct hlist_head));
cache_disabled = 0;
}