diff options
author | Coywolf Qi Hunt <qiyong@fc-cn.com> | 2005-09-06 18:18:17 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2005-09-07 19:57:41 -0400 |
commit | 736c7b808f38f3bb72941345e11e236ec65dec3d (patch) | |
tree | 9cad1481bea573680fe0c89f32689dcf4b8c04cd /fs/buffer.c | |
parent | 3f4bb1f4199b7dc0c958447b1e4898980013b884 (diff) |
[PATCH] alloc_buffer_head() and free_buffer_head() cleanup
Signed-off-by: Coywolf Qi Hunt <qiyong@fc-cn.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'fs/buffer.c')
-rw-r--r-- | fs/buffer.c | 10 |
1 files 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) | |||
3046 | { | 3046 | { |
3047 | struct buffer_head *ret = kmem_cache_alloc(bh_cachep, gfp_flags); | 3047 | struct buffer_head *ret = kmem_cache_alloc(bh_cachep, gfp_flags); |
3048 | if (ret) { | 3048 | if (ret) { |
3049 | preempt_disable(); | 3049 | get_cpu_var(bh_accounting).nr++; |
3050 | __get_cpu_var(bh_accounting).nr++; | ||
3051 | recalc_bh_state(); | 3050 | recalc_bh_state(); |
3052 | preempt_enable(); | 3051 | put_cpu_var(bh_accounting); |
3053 | } | 3052 | } |
3054 | return ret; | 3053 | return ret; |
3055 | } | 3054 | } |
@@ -3059,10 +3058,9 @@ void free_buffer_head(struct buffer_head *bh) | |||
3059 | { | 3058 | { |
3060 | BUG_ON(!list_empty(&bh->b_assoc_buffers)); | 3059 | BUG_ON(!list_empty(&bh->b_assoc_buffers)); |
3061 | kmem_cache_free(bh_cachep, bh); | 3060 | kmem_cache_free(bh_cachep, bh); |
3062 | preempt_disable(); | 3061 | get_cpu_var(bh_accounting).nr--; |
3063 | __get_cpu_var(bh_accounting).nr--; | ||
3064 | recalc_bh_state(); | 3062 | recalc_bh_state(); |
3065 | preempt_enable(); | 3063 | put_cpu_var(bh_accounting); |
3066 | } | 3064 | } |
3067 | EXPORT_SYMBOL(free_buffer_head); | 3065 | EXPORT_SYMBOL(free_buffer_head); |
3068 | 3066 | ||