All of lore.kernel.org
 help / color / mirror / Atom feed
* [patch] alloc_buffer_head() cleanup
@ 2005-08-25  8:37 Coywolf Qi Hunt
  2005-08-25 15:35 ` [patch] alloc_buffer_head() and free_buffer_head() cleanup Coywolf Qi Hunt
  0 siblings, 1 reply; 2+ messages in thread
From: Coywolf Qi Hunt @ 2005-08-25  8:37 UTC (permalink / raw)
  To: akpm; +Cc: linux-kernel

Hello,

This cleanups up alloc_buffer_head(), by using a single get_cpu_var().
Boot tested.

	Coywolf


Signed-off-by: Coywolf Qi Hunt <qiyong@fc-cn.com>
---

 buffer.c |    5 ++---
 1 files changed, 2 insertions(+), 3 deletions(-)

--- 2.6.13-rc6-mm2/fs/buffer.c~orig	2005-08-23 13:42:04.000000000 +0800
+++ 2.6.13-rc6-mm2/fs/buffer.c	2005-08-25 14:14:22.000000000 +0800
@@ -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;
 }

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2005-08-25 15:34 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-08-25  8:37 [patch] alloc_buffer_head() cleanup Coywolf Qi Hunt
2005-08-25 15:35 ` [patch] alloc_buffer_head() and free_buffer_head() cleanup Coywolf Qi Hunt

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.