atomic: add *_dec_not_zero
Subsystems (13)
Introduce an *_dec_not_zero operation. Make this a special case of *_add_unless because batman-adv uses atomic_dec_not_zero in different places like re-broadcast queue or aggregation queue management. There are other non-final patches which may also want to use this macro.
---
Please check someone if this looks ok... I have to look through following people to check who would be interested in reviewing this patch:
Richard Henderson <[email protected]> (:ALPHA PORT)
Ivan Kokshaysky <[email protected]> (:ALPHA PORT)
Matt Turner <[email protected]> (:ALPHA PORT)
Russell King <[email protected]> (maintainer:ARM PORT,commit_signer:2/4=50%)
Hans-Christian Egtvedt <[email protected]> (supporter:AVR32 ARCHITECTURE)
Mike Frysinger <[email protected]> (supporter:BLACKFIN ARCHITEC...,commit_signer:1/2=50%)
Mikael Starvik <[email protected]> (maintainer:CRIS PORT)
Jesper Nilsson <[email protected]> (maintainer:CRIS PORT)
David Howells <[email protected]> (maintainer:FUJITSU FR-V (FRV...,commit_signer:1/3=33%,commit_signer:3/5=60%)
Yoshinori Sato <[email protected]> (supporter:UCLINUX FOR RENES...)
Tony Luck <[email protected]> (maintainer:IA64 (Itanium) PL...,commit_signer:1/3=33%)
Fenghua Yu <[email protected]> (maintainer:IA64 (Itanium) PL...)
Hirokazu Takata <[email protected]> (maintainer:M32R ARCHITECTURE)
Geert Uytterhoeven <[email protected]> (maintainer:M68K ARCHITECTURE,commit_signer:2/3=67%)
Roman Zippel <[email protected]> (maintainer:M68K ARCHITECTURE)
Ralf Baechle <[email protected]> (supporter:MIPS,commit_signer:3/5=60%,commit_signer:1/2=50%)
Koichi Yasutake <[email protected]> (maintainer:PANASONIC MN10300...)
Kyle McMartin <[email protected]> (maintainer:PARISC ARCHITECTURE)
Helge Deller <[email protected]> (maintainer:PARISC ARCHITECTURE)
"James E.J. Bottomley" <[email protected]> (maintainer:PARISC ARCHITECTURE)
Benjamin Herrenschmidt <[email protected]> (supporter:LINUX FOR POWERPC...)
Paul Mackerras <[email protected]> (supporter:LINUX FOR POWERPC...)
Martin Schwidefsky <[email protected]> (supporter:S390,commit_signer:3/5=60%)
Heiko Carstens <[email protected]> (supporter:S390,commit_signer:3/5=60%)
[email protected] (supporter:S390)
Paul Mundt <[email protected]> (supporter:SUPERH,commit_signer:1/3=33%,commit_signer:1/4=25%)
"David S. Miller" <[email protected]> (maintainer:SPARC + UltraSPAR...,commit_signer:2/4=50%)
Chris Metcalf <[email protected]> (supporter:TILE ARCHITECTURE,commit_signer:2/3=67%,commit_signer:3/4=75%)
Thomas Gleixner <[email protected]> (maintainer:X86 ARCHITECTURE...)
Ingo Molnar <[email protected]> (maintainer:X86 ARCHITECTURE...)
"H. Peter Anvin" <[email protected]> (maintainer:X86 ARCHITECTURE...)
[email protected] (maintainer:X86 ARCHITECTURE...)
Chris Zankel <[email protected]> (maintainer:TENSILICA XTENSA...)
Arnd Bergmann <[email protected]> (maintainer:GENERIC INCLUDE/A...,commit_signer:1/3=33%,commit_signer:2/4=50%)
Sven Eckelmann <[email protected]> (commit_signer:1/2=50%,commit_signer:1/1=100%,commit_signer:1/4=25%,commit_signer:1/3=33%,commit_signer:1/5=20%) Anton Blanchard <[email protected]> (commit_signer:1/2=50%,commit_signer:1/4=25%,commit_signer:1/3=33%,commit_signer:1/5=20%) Nicolas Pitre <[email protected]> (commit_signer:2/4=50%)
Will Deacon <[email protected]> (commit_signer:2/4=50%)
Greg Ungerer <[email protected]> (commit_signer:1/3=33%)
David Daney <[email protected]> (commit_signer:2/5=40%)
Deng-Cheng Zhu <[email protected]> (commit_signer:1/5=20%,commit_signer:1/2=50%)
Andrew Morton <[email protected]> (commit_signer:1/5=20%)
Peter Fritzsche <[email protected]> (commit_signer:1/5=20%)
Lucas De Marchi <[email protected]> (commit_signer:1/5=20%)
FUJITA Tomonori <[email protected]> (commit_signer:1/3=33%,commit_signer:1/4=25%)
[email protected] (open list:ALPHA PORT)
[email protected] (open list)
[email protected] (open list:ARM PORT)
[email protected] (open list:BLACKFIN ARCHITEC...)
[email protected] (open list:CRIS PORT)
[email protected] (open list:IA64 (Itanium) PL...)
[email protected] (open list:M32R ARCHITECTURE)
[email protected] (open list:M32R ARCHITECTURE)
[email protected] (open list:M68K ARCHITECTURE)
[email protected] (open list:MIPS)
[email protected] (open list:PANASONIC MN10300...)
[email protected] (open list:PARISC ARCHITECTURE)
[email protected] (open list:LINUX FOR POWERPC...)
[email protected] (open list:S390)
[email protected] (open list:SUPERH)
[email protected] (open list:SPARC + UltraSPAR...)
[email protected] (open list:GENERIC INCLUDE/A...)
arch/alpha/include/asm/atomic.h | 2 ++ arch/alpha/include/asm/local.h | 1 + arch/arm/include/asm/atomic.h | 2 ++ arch/avr32/include/asm/atomic.h | 1 + arch/blackfin/include/asm/atomic.h | 1 + arch/cris/include/asm/atomic.h | 1 + arch/frv/include/asm/atomic.h | 1 + arch/h8300/include/asm/atomic.h | 1 + arch/ia64/include/asm/atomic.h | 2 ++ arch/m32r/include/asm/atomic.h | 1 + arch/m32r/include/asm/local.h | 1 + arch/m68k/include/asm/atomic.h | 1 + arch/mips/include/asm/atomic.h | 2 ++ arch/mips/include/asm/local.h | 1 + arch/mn10300/include/asm/atomic.h | 1 + arch/parisc/include/asm/atomic.h | 2 ++ arch/powerpc/include/asm/atomic.h | 2 ++ arch/powerpc/include/asm/local.h | 1 + arch/s390/include/asm/atomic.h | 2 ++ arch/sh/include/asm/atomic.h | 1 + arch/sparc/include/asm/atomic_32.h | 1 + arch/sparc/include/asm/atomic_64.h | 2 ++ arch/tile/include/asm/atomic.h | 9 +++++++++ arch/tile/include/asm/atomic_32.h | 1 + arch/x86/include/asm/atomic.h | 1 + arch/x86/include/asm/atomic64_64.h | 1 + arch/xtensa/include/asm/atomic.h | 1 + include/asm-generic/atomic-long.h | 2 ++ include/asm-generic/atomic.h | 1 + include/asm-generic/atomic64.h | 1 + include/asm-generic/local.h | 1 + include/asm-generic/local64.h | 2 ++ 32 files changed, 50 insertions(+), 0 deletions(-)
arch/alpha/include/asm/atomic.h +2 -0
@@ -200,6 +200,7 @@ static __inline__ int atomic_add_unless(atomic_t *v, int a, int u) }#define atomic_inc_not_zero (v) atomic_add_unless((v), 1, 0) +#define atomic_dec_not_zero (v) atomic_add_unless((v), -1, 0)/** * atomic64_add_unless - add unless the number is a given value
@@ -226,6 +227,7 @@ static __inline__ int atomic64_add_unless(atomic64_t *v, long a, long u) }#define atomic64_inc_not_zero (v) atomic64_add_unless((v), 1, 0) +#define atomic64_dec_not_zero (v) atomic64_add_unless((v), -1, 0)#define atomic_add_negative (a, v) (atomic_add_return((a), (v)) < 0)#define atomic64_add_negative (a, v) (atomic64_add_return((a), (v)) < 0)
arch/alpha/include/asm/local.h +1 -0
@@ -79,6 +79,7 @@ static __inline__ long local_sub_return(long i, local_t * l) c != (u); \ })#define local_inc_not_zero (l) local_add_unless((l), 1, 0) +#define local_dec_not_zero (l) local_add_unless((l), -1, 0)#define local_add_negative (a, l) (local_add_return((a), (l)) < 0)
arch/arm/include/asm/atomic.h +2 -0
@@ -218,6 +218,7 @@ static inline int atomic_add_unless(atomic_t *v, int a, int u)return c != u; }#define atomic_inc_not_zero (v) atomic_add_unless((v), 1, 0) +#define atomic_dec_not_zero (v) atomic_add_unless((v), -1, 0)#define atomic_inc (v) atomic_add(1, v)#define atomic_dec (v) atomic_sub(1, v)
@@ -459,6 +460,7 @@ static inline int atomic64_add_unless(atomic64_t *v, u64 a, u64 u)#define atomic64_dec_return (v) atomic64_sub_return(1LL, (v))#define atomic64_dec_and_test (v) (atomic64_dec_return((v)) == 0)#define atomic64_inc_not_zero (v) atomic64_add_unless((v), 1LL, 0LL) +#define atomic64_dec_not_zero (v) atomic64_add_unless((v), -1LL, 0LL)#else /* !CONFIG_GENERIC_ATOMIC64 */ #include <asm-generic/atomic64.h>
arch/avr32/include/asm/atomic.h +1 -0
@@ -189,6 +189,7 @@ static inline int atomic_sub_if_positive(int i, atomic_t *v)#define atomic_add_negative (i, v) (atomic_add_return(i, v) < 0)#define atomic_inc_not_zero (v) atomic_add_unless(v, 1, 0) +#define atomic_dec_not_zero (v) atomic_add_unless((v), -1, 0)#define atomic_dec_if_positive (v) atomic_sub_if_positive(1, v)#define smp_mb__before_atomic_dec () barrier()
arch/blackfin/include/asm/atomic.h +1 -0
@@ -103,6 +103,7 @@ static inline int atomic_test_mask(int mask, atomic_t *v) c != (u); \ })#define atomic_inc_not_zero (v) atomic_add_unless((v), 1, 0) +#define atomic_dec_not_zero (v) atomic_add_unless((v), -1, 0)/* * atomic_inc_and_test - increment and test
arch/cris/include/asm/atomic.h +1 -0
@@ -151,6 +151,7 @@ static inline int atomic_add_unless(atomic_t *v, int a, int u)return ret != u; }#define atomic_inc_not_zero (v) atomic_add_unless((v), 1, 0) +#define atomic_dec_not_zero (v) atomic_add_unless((v), -1, 0)/* Atomic operations are already serializing */ #define smp_mb__before_atomic_dec () barrier()
arch/frv/include/asm/atomic.h +1 -0
@@ -257,6 +257,7 @@ static __inline__ int atomic_add_unless(atomic_t *v, int a, int u) }#define atomic_inc_not_zero (v) atomic_add_unless((v), 1, 0) +#define atomic_dec_not_zero (v) atomic_add_unless((v), -1, 0)#include <asm-generic/atomic-long.h> #endif /* _ASM_ATOMIC_H */
arch/h8300/include/asm/atomic.h +1 -0
@@ -117,6 +117,7 @@ static inline int atomic_add_unless(atomic_t *v, int a, int u)return ret != u; }#define atomic_inc_not_zero (v) atomic_add_unless((v), 1, 0) +#define atomic_dec_not_zero (v) atomic_add_unless((v), -1, 0)static __inline__void atomic_clear_mask (unsigned long mask,unsigned long *v) {
arch/ia64/include/asm/atomic.h +2 -0
@@ -106,6 +106,7 @@ static __inline__ int atomic_add_unless(atomic_t *v, int a, int u) }#define atomic_inc_not_zero (v) atomic_add_unless((v), 1, 0) +#define atomic_dec_not_zero (v) atomic_add_unless((v), -1, 0)static __inline__long atomic64_add_unless (atomic64_t *v,long a,long u) {
@@ -123,6 +124,7 @@ static __inline__ long atomic64_add_unless(atomic64_t *v, long a, long u) }#define atomic64_inc_not_zero (v) atomic64_add_unless((v), 1, 0) +#define atomic64_dec_not_zero (v) atomic64_add_unless((v), -1, 0)#define atomic_add_return (i,v) \ ({ \
arch/m32r/include/asm/atomic.h +1 -0
@@ -263,6 +263,7 @@ static __inline__ int atomic_add_unless(atomic_t *v, int a, int u) }#define atomic_inc_not_zero (v) atomic_add_unless((v), 1, 0) +#define atomic_dec_not_zero (v) atomic_add_unless((v), -1, 0)static __inline__void atomic_clear_mask (unsigned long mask,atomic_t *addr) {
arch/m32r/include/asm/local.h +1 -0
@@ -272,6 +272,7 @@ static inline int local_add_unless(local_t *l, long a, long u) }#define local_inc_not_zero (l) local_add_unless((l), 1, 0) +#define local_dec_not_zero (l) local_add_unless((l), -1, 0)static inline void local_clear_mask (unsigned long mask,local_t *addr) {
arch/m68k/include/asm/atomic.h +1 -0
@@ -199,6 +199,7 @@ static __inline__ int atomic_add_unless(atomic_t *v, int a, int u) }#define atomic_inc_not_zero (v) atomic_add_unless((v), 1, 0) +#define atomic_dec_not_zero (v) atomic_add_unless((v), -1, 0)/* Atomic operations are already serializing */ #define smp_mb__before_atomic_dec () barrier()
arch/mips/include/asm/atomic.h +2 -0
@@ -326,6 +326,7 @@ static __inline__ int atomic_add_unless(atomic_t *v, int a, int u)return c != (u); }#define atomic_inc_not_zero (v) atomic_add_unless((v), 1, 0) +#define atomic_dec_not_zero (v) atomic_add_unless((v), -1, 0)#define atomic_dec_return (v) atomic_sub_return(1, (v))#define atomic_inc_return (v) atomic_add_return(1, (v))
@@ -698,6 +699,7 @@ static __inline__ int atomic64_add_unless(atomic64_t *v, long a, long u) }#define atomic64_inc_not_zero (v) atomic64_add_unless((v), 1, 0) +#define atomic64_dec_not_zero (v) atomic64_add_unless((v), -1, 0)#define atomic64_dec_return (v) atomic64_sub_return(1, (v))#define atomic64_inc_return (v) atomic64_add_return(1, (v))
arch/mips/include/asm/local.h +1 -0
@@ -137,6 +137,7 @@ static __inline__ long local_sub_return(long i, local_t * l) c != (u); \ })#define local_inc_not_zero (l) local_add_unless((l), 1, 0) +#define local_dec_not_zero (l) local_add_unless((l), -1, 0)#define local_dec_return (l) local_sub_return(1, (l))#define local_inc_return (l) local_add_return(1, (l))
arch/mn10300/include/asm/atomic.h +1 -0
@@ -270,6 +270,7 @@ static inline void atomic_dec(atomic_t *v) })#define atomic_inc_not_zero (v) atomic_add_unless((v), 1, 0) +#define atomic_dec_not_zero (v) atomic_add_unless((v), -1, 0)/** * atomic_clear_mask - Atomically clear bits in memory
arch/parisc/include/asm/atomic.h +2 -0
@@ -221,6 +221,7 @@ static __inline__ int atomic_add_unless(atomic_t *v, int a, int u) }#define atomic_inc_not_zero (v) atomic_add_unless((v), 1, 0) +#define atomic_dec_not_zero (v) atomic_add_unless((v), -1, 0)#define atomic_add (i,v) ((void)(__atomic_add_return( (i),(v))))#define atomic_sub (i,v) ((void)(__atomic_add_return(-(i),(v))))
@@ -335,6 +336,7 @@ static __inline__ int atomic64_add_unless(atomic64_t *v, long a, long u) }#define atomic64_inc_not_zero (v) atomic64_add_unless((v), 1, 0) +#define atomic64_dec_not_zero (v) atomic64_add_unless((v), -1, 0)#else /* CONFIG_64BIT */
arch/powerpc/include/asm/atomic.h +2 -0
@@ -213,6 +213,7 @@ static __inline__ int atomic_add_unless(atomic_t *v, int a, int u) }#define atomic_inc_not_zero (v) atomic_add_unless((v), 1, 0) +#define atomic_dec_not_zero (v) atomic_add_unless((v), -1, 0)#define atomic_sub_and_test (a, v) (atomic_sub_return((a), (v)) == 0)#define atomic_dec_and_test (v) (atomic_dec_return((v)) == 0)
@@ -469,6 +470,7 @@ static __inline__ int atomic64_add_unless(atomic64_t *v, long a, long u) }#define atomic64_inc_not_zero (v) atomic64_add_unless((v), 1, 0) +#define atomic64_dec_not_zero (v) atomic64_add_unless((v), -1, 0)#else /* __powerpc64__ */ #include <asm-generic/atomic64.h>
arch/powerpc/include/asm/local.h +1 -0
@@ -134,6 +134,7 @@ static __inline__ int local_add_unless(local_t *l, long a, long u) }#define local_inc_not_zero (l) local_add_unless((l), 1, 0) +#define local_dec_not_zero (l) local_add_unless((l), -1, 0)#define local_sub_and_test (a, l) (local_sub_return((a), (l)) == 0)#define local_dec_and_test (l) (local_dec_return((l)) == 0)
arch/s390/include/asm/atomic.h +2 -0
@@ -109,6 +109,7 @@ static inline int atomic_add_unless(atomic_t *v, int a, int u) }#define atomic_inc_not_zero (v) atomic_add_unless((v), 1, 0) +#define atomic_dec_not_zero (v) atomic_add_unless((v), -1, 0)#undef __CS_LOOP
@@ -326,6 +327,7 @@ static inline long long atomic64_dec_if_positive(atomic64_t *v)#define atomic64_dec_return (_v) atomic64_sub_return(1, _v)#define atomic64_dec_and_test (_v) (atomic64_sub_return(1, _v) == 0)#define atomic64_inc_not_zero (v) atomic64_add_unless((v), 1, 0) +#define atomic64_dec_not_zero (v) atomic64_add_unless((v), -1, 0)#define smp_mb__before_atomic_dec () smp_mb()#define smp_mb__after_atomic_dec () smp_mb()
arch/sh/include/asm/atomic.h +1 -0
@@ -31,6 +31,7 @@#define atomic_sub_and_test (i,v) (atomic_sub_return((i), (v)) == 0)#define atomic_dec_and_test (v) (atomic_sub_return(1, (v)) == 0)#define atomic_inc_not_zero (v) atomic_add_unless((v), 1, 0) +#define atomic_dec_not_zero (v) atomic_add_unless((v), -1, 0)#define atomic_inc (v) atomic_add(1, (v))#define atomic_dec (v) atomic_sub(1, (v))
arch/sparc/include/asm/atomic_32.h +1 -0
@@ -53,6 +53,7 @@ extern void atomic_set(atomic_t *, int);#define atomic_sub_and_test (i, v) (atomic_sub_return(i, v) == 0)#define atomic_inc_not_zero (v) atomic_add_unless((v), 1, 0) +#define atomic_dec_not_zero (v) atomic_add_unless((v), -1, 0)/* This is the old 24-bit implementation. It's still used internally * by some sparc-specific code, notably the semaphore implementation.
arch/sparc/include/asm/atomic_64.h +2 -0
@@ -86,6 +86,7 @@ static inline int atomic_add_unless(atomic_t *v, int a, int u) }#define atomic_inc_not_zero (v) atomic_add_unless((v), 1, 0) +#define atomic_dec_not_zero (v) atomic_add_unless((v), -1, 0)#define atomic64_cmpxchg (v, o, n) \ ((__typeof__((v)->counter))cmpxchg(&((v)->counter), (o), (n)))
@@ -107,6 +108,7 @@ static inline long atomic64_add_unless(atomic64_t *v, long a, long u) }#define atomic64_inc_not_zero (v) atomic64_add_unless((v), 1, 0) +#define atomic64_dec_not_zero (v) atomic64_add_unless((v), -1, 0)/* Atomic operations are already serializing */ #define smp_mb__before_atomic_dec () barrier()
arch/tile/include/asm/atomic.h +9 -0
@@ -130,6 +130,15 @@ static inline int atomic_read(const atomic_t *v)*/ #define atomic_inc_not_zero (v) atomic_add_unless((v), 1, 0) +/** +* atomic_dec_not_zero - decrement unless the number is zero +* @v: pointer of type atomic_t +* +* Atomically decrement @v by 1, so long as @v is non-zero. +* Returns non-zero if @v was non-zero, and zero otherwise. +*/ +#define atomic_dec_not_zero (v) atomic_add_unless((v), -1, 0) +/* * We define xchg() and cmpxchg() in the included headers.
arch/tile/include/asm/atomic_32.h +1 -0
@@ -243,6 +243,7 @@ static inline void atomic64_set(atomic64_t *v, u64 n)#define atomic64_dec_return (v) atomic64_sub_return(1LL, (v))#define atomic64_dec_and_test (v) (atomic64_dec_return((v)) == 0)#define atomic64_inc_not_zero (v) atomic64_add_unless((v), 1LL, 0LL) +#define atomic64_dec_not_zero (v) atomic64_add_unless((v), -1LL, 0LL)/* * We need to barrier before modifying the word, since the _atomic_xxx()
arch/x86/include/asm/atomic.h +1 -0
@@ -245,6 +245,7 @@ static inline int atomic_add_unless(atomic_t *v, int a, int u) }#define atomic_inc_not_zero (v) atomic_add_unless((v), 1, 0) +#define atomic_dec_not_zero (v) atomic_add_unless((v), -1, 0)/* * atomic_dec_if_positive - decrement by 1 if old value positive
arch/x86/include/asm/atomic64_64.h +1 -0
@@ -220,6 +220,7 @@ static inline int atomic64_add_unless(atomic64_t *v, long a, long u) }#define atomic64_inc_not_zero (v) atomic64_add_unless((v), 1, 0) +#define atomic64_dec_not_zero (v) atomic64_add_unless((v), -1, 0)/* * atomic64_dec_if_positive - decrement by 1 if old value positive
arch/xtensa/include/asm/atomic.h +1 -0
@@ -249,6 +249,7 @@ static __inline__ int atomic_add_unless(atomic_t *v, int a, int u) }#define atomic_inc_not_zero (v) atomic_add_unless((v), 1, 0) +#define atomic_dec_not_zero (v) atomic_add_unless((v), -1, 0)static inline void atomic_clear_mask (unsigned int mask,atomic_t *v) {
include/asm-generic/atomic-long.h +2 -0
@@ -130,6 +130,7 @@ static inline long atomic_long_add_unless(atomic_long_t *l, long a, long u) }#define atomic_long_inc_not_zero (l) atomic64_inc_not_zero((atomic64_t *)(l)) +#define atomic_long_dec_not_zero (l) atomic64_dec_not_zero((atomic64_t *)(l))#define atomic_long_cmpxchg (l, old, new) \ (atomic64_cmpxchg((atomic64_t *)(l), (old), (new)))
@@ -247,6 +248,7 @@ static inline long atomic_long_add_unless(atomic_long_t *l, long a, long u) }#define atomic_long_inc_not_zero (l) atomic_inc_not_zero((atomic_t *)(l)) +#define atomic_long_dec_not_zero (l) atomic_dec_not_zero((atomic_t *)(l))#define atomic_long_cmpxchg (l, old, new) \ (atomic_cmpxchg((atomic_t *)(l), (old), (new)))
include/asm-generic/atomic.h +1 -0
@@ -139,6 +139,7 @@ static inline int atomic_add_unless(atomic_t *v, int a, int u) }#define atomic_inc_not_zero (v) atomic_add_unless((v), 1, 0) +#define atomic_dec_not_zero (v) atomic_add_unless((v), -1, 0)static inline void atomic_clear_mask (unsigned long mask,unsigned long *addr) {
include/asm-generic/atomic64.h +1 -0
@@ -38,5 +38,6 @@ extern int atomic64_add_unless(atomic64_t *v, long long a, long long u);#define atomic64_dec_return (v) atomic64_sub_return(1LL, (v))#define atomic64_dec_and_test (v) (atomic64_dec_return((v)) == 0)#define atomic64_inc_not_zero (v) atomic64_add_unless((v), 1LL, 0LL) +#define atomic64_dec_not_zero (v) atomic64_add_unless((v), -1LL, 0LL)#endif /* _ASM_GENERIC_ATOMIC64_H */
include/asm-generic/local.h +1 -0
@@ -44,6 +44,7 @@ typedef struct#define local_xchg (l, n) atomic_long_xchg((&(l)->a), (n))#define local_add_unless (l, _a, u) atomic_long_add_unless((&(l)->a), (_a), (u))#define local_inc_not_zero (l) atomic_long_inc_not_zero(&(l)->a) +#define local_dec_not_zero (l) atomic_long_dec_not_zero(&(l)->a)/* Non-atomic variants, ie. preemption disabled and won't be touched * in interrupt, etc. Some archs can optimize this case well. */
include/asm-generic/local64.h +2 -0
@@ -45,6 +45,7 @@ typedef struct {#define local64_xchg (l, n) local_xchg((&(l)->a), (n))#define local64_add_unless (l, _a, u) local_add_unless((&(l)->a), (_a), (u))#define local64_inc_not_zero (l) local_inc_not_zero(&(l)->a) +#define local64_dec_not_zero (l) local_dec_not_zero(&(l)->a)/* Non-atomic variants, ie. preemption disabled and won't be touched * in interrupt, etc. Some archs can optimize this case well. */
@@ -83,6 +84,7 @@ typedef struct {#define local64_xchg (l, n) atomic64_xchg((&(l)->a), (n))#define local64_add_unless (l, _a, u) atomic64_add_unless((&(l)->a), (_a), (u))#define local64_inc_not_zero (l) atomic64_inc_not_zero(&(l)->a) +#define local64_dec_not_zero (l) atomic64_dec_not_zero(&(l)->a)/* Non-atomic variants, ie. preemption disabled and won't be touched * in interrupt, etc. Some archs can optimize this case well. */
Signature · 1 line
1.7.4.4