From 736c7b808f38f3bb72941345e11e236ec65dec3d Mon Sep 17 00:00:00 2001 From: Coywolf Qi Hunt Date: Tue, 6 Sep 2005 15:18:17 -0700 Subject: [PATCH] [PATCH] alloc_buffer_head() and free_buffer_head() cleanup Signed-off-by: Coywolf Qi Hunt Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- fs/buffer.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/fs/buffer.c b/fs/buffer.c index 6a25d7df89b1..a92b81403552 100644 --- a/fs/buffer.c +++ b/fs/buffer.c @@ -3046,10 +3046,9 @@ struct buffer_head *alloc_buffer_head(unsigned int __nocast gfp_flags) { struct buffer_head *ret = kmem_cache_alloc(bh_cachep, gfp_flags); if (ret) { - preempt_disable(); - __get_cpu_var(bh_accounting).nr++; + get_cpu_var(bh_accounting).nr++; recalc_bh_state(); - preempt_enable(); + put_cpu_var(bh_accounting); } return ret; } @@ -3059,10 +3058,9 @@ void free_buffer_head(struct buffer_head *bh) { BUG_ON(!list_empty(&bh->b_assoc_buffers)); kmem_cache_free(bh_cachep, bh); - preempt_disable(); - __get_cpu_var(bh_accounting).nr--; + get_cpu_var(bh_accounting).nr--; recalc_bh_state(); - preempt_enable(); + put_cpu_var(bh_accounting); } EXPORT_SYMBOL(free_buffer_head); -- 2.20.1