diff options
author | Zheng Liu <wenqing.lz@taobao.com> | 2013-04-19 17:49:23 -0400 |
---|---|---|
committer | Theodore Ts'o <tytso@mit.edu> | 2013-04-19 17:49:23 -0400 |
commit | 28daf4fae8693d4a285123494899fe01950cba50 (patch) | |
tree | b0eb2335ada7a6940190bba0f8b65f6bc8674ddf | |
parent | 2656497b26d45c1ca51a7727ab92c8307cb99305 (diff) |
jbd2: use kmem_cache_zalloc instead of kmem_cache_alloc/memset
The jbd2_alloc_handle() function 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: "Theodore Ts'o" <tytso@mit.edu>
-rw-r--r-- | fs/jbd2/transaction.c | 1 | ||||
-rw-r--r-- | include/linux/jbd2.h | 2 |
2 files changed, 1 insertions, 2 deletions
diff --git a/fs/jbd2/transaction.c b/fs/jbd2/transaction.c index 325bc019ed88..a1920da22802 100644 --- a/fs/jbd2/transaction.c +++ b/fs/jbd2/transaction.c | |||
@@ -332,7 +332,6 @@ static handle_t *new_handle(int nblocks) | |||
332 | handle_t *handle = jbd2_alloc_handle(GFP_NOFS); | 332 | handle_t *handle = jbd2_alloc_handle(GFP_NOFS); |
333 | if (!handle) | 333 | if (!handle) |
334 | return NULL; | 334 | return NULL; |
335 | memset(handle, 0, sizeof(*handle)); | ||
336 | handle->h_buffer_credits = nblocks; | 335 | handle->h_buffer_credits = nblocks; |
337 | handle->h_ref = 1; | 336 | handle->h_ref = 1; |
338 | 337 | ||
diff --git a/include/linux/jbd2.h b/include/linux/jbd2.h index f9fe88957b7a..6e051f472edb 100644 --- a/include/linux/jbd2.h +++ b/include/linux/jbd2.h | |||
@@ -1145,7 +1145,7 @@ extern struct kmem_cache *jbd2_handle_cache; | |||
1145 | 1145 | ||
1146 | static inline handle_t *jbd2_alloc_handle(gfp_t gfp_flags) | 1146 | static inline handle_t *jbd2_alloc_handle(gfp_t gfp_flags) |
1147 | { | 1147 | { |
1148 | return kmem_cache_alloc(jbd2_handle_cache, gfp_flags); | 1148 | return kmem_cache_zalloc(jbd2_handle_cache, gfp_flags); |
1149 | } | 1149 | } |
1150 | 1150 | ||
1151 | static inline void jbd2_free_handle(handle_t *handle) | 1151 | static inline void jbd2_free_handle(handle_t *handle) |