public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] replace kmem_cache_alloc with kmem_cache_zalloc to remove some following zero initializations.
@ 2007-07-13  1:41 Denis Cheng
  2007-07-13  8:19 ` Kirill Korotaev
  0 siblings, 1 reply; 5+ messages in thread
From: Denis Cheng @ 2007-07-13  1:41 UTC (permalink / raw)
  To: trivial, Denis; +Cc: linux-kernel

>From 4d87e14b67890f06885a76b5792ca034de2e9d06 Mon Sep 17 00:00:00 2001
From: Denis Cheng <crquan@gmail.com>
Date: Thu, 12 Jul 2007 11:53:58 +0800
Subject: [PATCH] replace kmem_cache_alloc with kmem_cache_zalloc to
remove some following zero initializations.

Signed-off-by: Denis Cheng <crquan@gmail.com>
---
 fs/dcache.c |   12 ++----------
 1 files changed, 2 insertions(+), 10 deletions(-)

diff --git a/fs/dcache.c b/fs/dcache.c
index 0e73aa0..8c559b2 100644
--- a/fs/dcache.c
+++ b/fs/dcache.c
@@ -898,7 +898,7 @@ struct dentry *d_alloc(struct dentry * parent, const
struct qstr *name)
 	struct dentry *dentry;
 	char *dname;
 
-	dentry = kmem_cache_alloc(dentry_cache, GFP_KERNEL); 
+	dentry = kmem_cache_zalloc(dentry_cache, GFP_KERNEL); 
 	if (!dentry)
 		return NULL;
 
@@ -921,15 +921,7 @@ struct dentry *d_alloc(struct dentry * parent,
const struct qstr *name)
 	atomic_set(&dentry->d_count, 1);
 	dentry->d_flags = DCACHE_UNHASHED;
 	spin_lock_init(&dentry->d_lock);
-	dentry->d_inode = NULL;
-	dentry->d_parent = NULL;
-	dentry->d_sb = NULL;
-	dentry->d_op = NULL;
-	dentry->d_fsdata = NULL;
-	dentry->d_mounted = 0;
-#ifdef CONFIG_PROFILING
-	dentry->d_cookie = NULL;
-#endif
+
 	INIT_HLIST_NODE(&dentry->d_hash);
 	INIT_LIST_HEAD(&dentry->d_lru);
 	INIT_LIST_HEAD(&dentry->d_subdirs);
-- 
1.5.2.2




^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2007-07-13 13:22 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-07-13  1:41 [PATCH] replace kmem_cache_alloc with kmem_cache_zalloc to remove some following zero initializations Denis Cheng
2007-07-13  8:19 ` Kirill Korotaev
2007-07-13  8:38   ` rae l
2007-07-13  9:10     ` Kirill Korotaev
2007-07-13 13:21       ` Pekka Enberg

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox