alloc_buffer_head() cleanup
PATCH 1/1 alloc_buffer_head() cleanup
Hello,
This cleanups up alloc_buffer_head(), by using a single get_cpu_var(). Boot tested.
Coywolf
Signed-off-by Coywolf Qi Hunt <[email protected]>
---
buffer.c | 5 ++--- 1 files changed, 2 insertions(+), 3 deletions(-)
fs/buffer.c renamed from fs/buffer.c~orig +2 -3
@@ -3049,10 +3049,9 @@ struct buffer_head *alloc_buffer_head(un {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; }
PATCH 1/1 alloc_buffer_head() and free_buffer_head() cleanup
Quoted 4 lines · Coywolf Qi Hunt
Hello,
This cleanups up
alloc_buffer_head(), by using a singleget_cpu_var(). Boot tested.
Also cleanup free_buffer_head().
Coywolf
Signed-off-by Coywolf Qi Hunt <[email protected]>
---
buffer.c | 10 ++++------ 1 files changed, 4 insertions(+), 6 deletions(-)
fs/buffer.c renamed from fs/buffer.c~orig +4 -6
@@ -3049,10 +3049,9 @@ struct buffer_head *alloc_buffer_head(un {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; }
@@ -3062,10 +3061,9 @@ void free_buffer_head(struct buffer_head {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);