]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
fs-buffer-do-not-use-unnecessary-atomic-operations-when-discarding-buffers-fix
authorAndrew Morton <akpm@linux-foundation.org>
Thu, 22 May 2014 00:43:22 +0000 (10:43 +1000)
committerStephen Rothwell <sfr@canb.auug.org.au>
Thu, 22 May 2014 00:43:22 +0000 (10:43 +1000)
move BUFFER_FLAGS_DISCARD into the .c file

Cc: Mel Gorman <mgorman@suse.de>
Cc: Johannes Weiner <hannes@cmpxchg.org>
Cc: Vlastimil Babka <vbabka@suse.cz>
Cc: Jan Kara <jack@suse.cz>
Cc: Michal Hocko <mhocko@suse.cz>
Cc: Hugh Dickins <hughd@google.com>
Cc: Dave Hansen <dave.hansen@intel.com>
Cc: Theodore Ts'o <tytso@mit.edu>
Cc: "Paul E. McKenney" <paulmck@linux.vnet.ibm.com>
Cc: Oleg Nesterov <oleg@redhat.com>
Cc: Rik van Riel <riel@redhat.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
fs/buffer.c
include/linux/buffer_head.h

index cd3aafe613a336f90fe0dedcbecfc9ba38126d03..b00b05b385313b98cb0fe0dcea3a54558080babf 100644 (file)
@@ -1483,6 +1483,12 @@ EXPORT_SYMBOL(set_bh_page);
 /*
  * Called when truncating a buffer on a page completely.
  */
+
+/* Bits that are cleared during an invalidate */
+#define BUFFER_FLAGS_DISCARD \
+       (1 << BH_Mapped | 1 << BH_New | 1 << BH_Req | \
+        1 << BH_Delay | 1 << BH_Unwritten)
+
 static void discard_buffer(struct buffer_head * bh)
 {
        unsigned long b_state, b_state_old;
@@ -1492,7 +1498,8 @@ static void discard_buffer(struct buffer_head * bh)
        bh->b_bdev = NULL;
        b_state = bh->b_state;
        for (;;) {
-               b_state_old = cmpxchg(&bh->b_state, b_state, (b_state & ~BUFFER_FLAGS_DISCARD));
+               b_state_old = cmpxchg(&bh->b_state, b_state,
+                                     (b_state & ~BUFFER_FLAGS_DISCARD));
                if (b_state_old == b_state)
                        break;
                b_state = b_state_old;
index 54cf52a36a6f87901e36143dff22d172a7fc10ac..e05c7ecdb24d13f037ab5ed222a8858d783e5a00 100644 (file)
@@ -77,11 +77,6 @@ struct buffer_head {
        atomic_t b_count;               /* users using this buffer_head */
 };
 
-/* Bits that are cleared during an invalidate */
-#define BUFFER_FLAGS_DISCARD \
-       (1 << BH_Mapped | 1 << BH_New | 1 << BH_Req | \
-        1 << BH_Delay | 1 << BH_Unwritten)
-
 /*
  * macro tricks to expand the set_buffer_foo(), clear_buffer_foo()
  * and buffer_foo() functions.