[patch] alloc_buffer_head() cleanup

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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(-)

--- 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;
 }
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]
  Powered by Linux