Skip to content

Commit c6d59cd

Browse files
Wei YongjunDavid Woodhouse
authored andcommitted
[JFFS2] kmem_cache_alloc/memset -> kmem_cache_zalloc
Used kmem_cache_zalloc instead of kmem_cache_alloc/memset. Signed-off-by: Wei Yongjun <yjwei@cn.fujitsu.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
1 parent bfc4925 commit c6d59cd

1 file changed

Lines changed: 2 additions & 4 deletions

File tree

‎fs/jffs2/malloc.c‎

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -284,10 +284,9 @@ void jffs2_free_inode_cache(struct jffs2_inode_cache *x)
284284
struct jffs2_xattr_datum *jffs2_alloc_xattr_datum(void)
285285
{
286286
struct jffs2_xattr_datum *xd;
287-
xd = kmem_cache_alloc(xattr_datum_cache, GFP_KERNEL);
287+
xd = kmem_cache_zalloc(xattr_datum_cache, GFP_KERNEL);
288288
dbg_memalloc("%p\n", xd);
289289

290-
memset(xd, 0, sizeof(struct jffs2_xattr_datum));
291290
xd->class = RAWNODE_CLASS_XATTR_DATUM;
292291
xd->node = (void *)xd;
293292
INIT_LIST_HEAD(&xd->xindex);
@@ -303,10 +302,9 @@ void jffs2_free_xattr_datum(struct jffs2_xattr_datum *xd)
303302
struct jffs2_xattr_ref *jffs2_alloc_xattr_ref(void)
304303
{
305304
struct jffs2_xattr_ref *ref;
306-
ref = kmem_cache_alloc(xattr_ref_cache, GFP_KERNEL);
305+
ref = kmem_cache_zalloc(xattr_ref_cache, GFP_KERNEL);
307306
dbg_memalloc("%p\n", ref);
308307

309-
memset(ref, 0, sizeof(struct jffs2_xattr_ref));
310308
ref->class = RAWNODE_CLASS_XATTR_REF;
311309
ref->node = (void *)ref;
312310
return ref;

0 commit comments

Comments
 (0)