• Shaohua Li's avatar
    atomic: implement generic atomic_dec_if_positive() · e79bee24
    Shaohua Li authored
    The x86 implementation of atomic_dec_if_positive is quite generic, so make
    it available to all architectures.
    
    This is needed for "swap: add a simple detector for inappropriate swapin
    readahead".
    
    [akpm@linux-foundation.org: do the "#define foo foo" trick in the conventional manner]
    Signed-off-by: default avatarShaohua Li <shli@fusionio.com>
    Cc: Stephen Rothwell <sfr@canb.auug.org.au>
    Cc: "David S. Miller" <davem@davemloft.net>
    Cc: Rik van Riel <riel@redhat.com>
    Cc: Ingo Molnar <mingo@elte.hu>
    Cc: Thomas Gleixner <tglx@linutronix.de>
    Cc: "H. Peter Anvin" <hpa@zytor.com>
    Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
    Cc: Michal Simek <monstr@monstr.eu>
    Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
    Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
    e79bee24
atomic.h 10.4 KB