diff options
author | Zheng Liu <wenqing.lz@taobao.com> | 2013-04-11 22:24:06 -0400 |
---|---|---|
committer | Jan Kara <jack@suse.cz> | 2013-04-25 09:25:23 -0400 |
commit | e162b2f835eeda0d255bd463753b5eb823735205 (patch) | |
tree | 9de115d27b3ca4ee4e5275a43e32838a9edb123c | |
parent | e678a4f0f50d4fa4f7aaa6de8eb3f071513356a0 (diff) |
jbd: use kmem_cache_zalloc instead of kmem_cache_alloc/memset
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>
-rw-r--r-- | fs/jbd/transaction.c | 1 | ||||
-rw-r--r-- | include/linux/jbd.h | 2 |
2 files changed, 1 insertions, 2 deletions
diff --git a/fs/jbd/transaction.c b/fs/jbd/transaction.c index 071d6905f0dd..e3e255c0a509 100644 --- a/fs/jbd/transaction.c +++ b/fs/jbd/transaction.c | |||
@@ -245,7 +245,6 @@ static handle_t *new_handle(int nblocks) | |||
245 | handle_t *handle = jbd_alloc_handle(GFP_NOFS); | 245 | handle_t *handle = jbd_alloc_handle(GFP_NOFS); |
246 | if (!handle) | 246 | if (!handle) |
247 | return NULL; | 247 | return NULL; |
248 | memset(handle, 0, sizeof(*handle)); | ||
249 | handle->h_buffer_credits = nblocks; | 248 | handle->h_buffer_credits = nblocks; |
250 | handle->h_ref = 1; | 249 | handle->h_ref = 1; |
251 | 250 | ||
diff --git a/include/linux/jbd.h b/include/linux/jbd.h index c8f32975f0e4..7e0b622503c4 100644 --- a/include/linux/jbd.h +++ b/include/linux/jbd.h | |||
@@ -887,7 +887,7 @@ extern struct kmem_cache *jbd_handle_cache; | |||
887 | 887 | ||
888 | static inline handle_t *jbd_alloc_handle(gfp_t gfp_flags) | 888 | static inline handle_t *jbd_alloc_handle(gfp_t gfp_flags) |
889 | { | 889 | { |
890 | return kmem_cache_alloc(jbd_handle_cache, gfp_flags); | 890 | return kmem_cache_zalloc(jbd_handle_cache, gfp_flags); |
891 | } | 891 | } |
892 | 892 | ||
893 | static inline void jbd_free_handle(handle_t *handle) | 893 | static inline void jbd_free_handle(handle_t *handle) |