Skip to content

Commit

Permalink
jbd: use kmem_cache_zalloc instead of kmem_cache_alloc/memset
Browse files Browse the repository at this point in the history
Now jbd_alloc_handle is only called by new_handle.  So this commit
uses kmem_cache_zalloc instead of kmem_cache_alloc/memset.

Signed-off-by: Zheng Liu <wenqing.lz@taobao.com>
Signed-off-by: Jan Kara <jack@suse.cz>
  • Loading branch information
gnehzuil authored and jankara committed Apr 25, 2013
1 parent e678a4f commit e162b2f
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 2 deletions.
1 change: 0 additions & 1 deletion fs/jbd/transaction.c
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,6 @@ static handle_t *new_handle(int nblocks)
handle_t *handle = jbd_alloc_handle(GFP_NOFS);
if (!handle)
return NULL;
memset(handle, 0, sizeof(*handle));
handle->h_buffer_credits = nblocks;
handle->h_ref = 1;

Expand Down
2 changes: 1 addition & 1 deletion include/linux/jbd.h
Original file line number Diff line number Diff line change
Expand Up @@ -887,7 +887,7 @@ extern struct kmem_cache *jbd_handle_cache;

static inline handle_t *jbd_alloc_handle(gfp_t gfp_flags)
{
return kmem_cache_alloc(jbd_handle_cache, gfp_flags);
return kmem_cache_zalloc(jbd_handle_cache, gfp_flags);
}

static inline void jbd_free_handle(handle_t *handle)
Expand Down

0 comments on commit e162b2f

Please sign in to comment.