diff options
-rw-r--r-- | fs/buffer.c | 13 |
1 files changed, 2 insertions, 11 deletions
diff --git a/fs/buffer.c b/fs/buffer.c index 6fa530256bfd..bc3212e0cef9 100644 --- a/fs/buffer.c +++ b/fs/buffer.c | |||
@@ -3265,7 +3265,7 @@ static void recalc_bh_state(void) | |||
3265 | 3265 | ||
3266 | struct buffer_head *alloc_buffer_head(gfp_t gfp_flags) | 3266 | struct buffer_head *alloc_buffer_head(gfp_t gfp_flags) |
3267 | { | 3267 | { |
3268 | struct buffer_head *ret = kmem_cache_alloc(bh_cachep, gfp_flags); | 3268 | struct buffer_head *ret = kmem_cache_zalloc(bh_cachep, gfp_flags); |
3269 | if (ret) { | 3269 | if (ret) { |
3270 | INIT_LIST_HEAD(&ret->b_assoc_buffers); | 3270 | INIT_LIST_HEAD(&ret->b_assoc_buffers); |
3271 | get_cpu_var(bh_accounting).nr++; | 3271 | get_cpu_var(bh_accounting).nr++; |
@@ -3352,15 +3352,6 @@ int bh_submit_read(struct buffer_head *bh) | |||
3352 | } | 3352 | } |
3353 | EXPORT_SYMBOL(bh_submit_read); | 3353 | EXPORT_SYMBOL(bh_submit_read); |
3354 | 3354 | ||
3355 | static void | ||
3356 | init_buffer_head(void *data) | ||
3357 | { | ||
3358 | struct buffer_head *bh = data; | ||
3359 | |||
3360 | memset(bh, 0, sizeof(*bh)); | ||
3361 | INIT_LIST_HEAD(&bh->b_assoc_buffers); | ||
3362 | } | ||
3363 | |||
3364 | void __init buffer_init(void) | 3355 | void __init buffer_init(void) |
3365 | { | 3356 | { |
3366 | int nrpages; | 3357 | int nrpages; |
@@ -3369,7 +3360,7 @@ void __init buffer_init(void) | |||
3369 | sizeof(struct buffer_head), 0, | 3360 | sizeof(struct buffer_head), 0, |
3370 | (SLAB_RECLAIM_ACCOUNT|SLAB_PANIC| | 3361 | (SLAB_RECLAIM_ACCOUNT|SLAB_PANIC| |
3371 | SLAB_MEM_SPREAD), | 3362 | SLAB_MEM_SPREAD), |
3372 | init_buffer_head); | 3363 | NULL); |
3373 | 3364 | ||
3374 | /* | 3365 | /* |
3375 | * Limit the bh occupancy to 10% of ZONE_NORMAL | 3366 | * Limit the bh occupancy to 10% of ZONE_NORMAL |