fs: buffer: do not use unnecessary atomic operations when discarding buffers
Discarding buffers uses a bunch of atomic operations when discarding
buffers because ...... I can't think of a reason. Use a cmpxchg loop to
clear all the necessary flags. In most (all?) cases this will be a single
atomic operations.
[akpm@linux-foundation.org: move BUFFER_FLAGS_DISCARD into the .c file] Signed-off-by: Mel Gorman <redacted> Cc: Johannes Weiner <redacted> Cc: Vlastimil Babka <redacted> Cc: Jan Kara <redacted> Cc: Michal Hocko <redacted> Cc: Hugh Dickins <redacted> Cc: Dave Hansen <redacted> Cc: Theodore Ts'o <redacted> Cc: "Paul E. McKenney" <redacted> Cc: Oleg Nesterov <redacted> Cc: Rik van Riel <redacted> Cc: Peter Zijlstra <redacted> Signed-off-by: Andrew Morton <redacted> Signed-off-by: Linus Torvalds <redacted>