diff options
Diffstat (limited to 'include/linux/refcount.h')
-rw-r--r-- | include/linux/refcount.h | 27 |
1 files changed, 20 insertions, 7 deletions
diff --git a/include/linux/refcount.h b/include/linux/refcount.h index c36addd27dd5..53c5eca24d83 100644 --- a/include/linux/refcount.h +++ b/include/linux/refcount.h | |||
@@ -43,17 +43,30 @@ static inline unsigned int refcount_read(const refcount_t *r) | |||
43 | return atomic_read(&r->refs); | 43 | return atomic_read(&r->refs); |
44 | } | 44 | } |
45 | 45 | ||
46 | extern __must_check bool refcount_add_not_zero_checked(unsigned int i, refcount_t *r); | ||
47 | extern void refcount_add_checked(unsigned int i, refcount_t *r); | ||
48 | |||
49 | extern __must_check bool refcount_inc_not_zero_checked(refcount_t *r); | ||
50 | extern void refcount_inc_checked(refcount_t *r); | ||
51 | |||
52 | extern __must_check bool refcount_sub_and_test_checked(unsigned int i, refcount_t *r); | ||
53 | |||
54 | extern __must_check bool refcount_dec_and_test_checked(refcount_t *r); | ||
55 | extern void refcount_dec_checked(refcount_t *r); | ||
56 | |||
46 | #ifdef CONFIG_REFCOUNT_FULL | 57 | #ifdef CONFIG_REFCOUNT_FULL |
47 | extern __must_check bool refcount_add_not_zero(unsigned int i, refcount_t *r); | ||
48 | extern void refcount_add(unsigned int i, refcount_t *r); | ||
49 | 58 | ||
50 | extern __must_check bool refcount_inc_not_zero(refcount_t *r); | 59 | #define refcount_add_not_zero refcount_add_not_zero_checked |
51 | extern void refcount_inc(refcount_t *r); | 60 | #define refcount_add refcount_add_checked |
61 | |||
62 | #define refcount_inc_not_zero refcount_inc_not_zero_checked | ||
63 | #define refcount_inc refcount_inc_checked | ||
64 | |||
65 | #define refcount_sub_and_test refcount_sub_and_test_checked | ||
52 | 66 | ||
53 | extern __must_check bool refcount_sub_and_test(unsigned int i, refcount_t *r); | 67 | #define refcount_dec_and_test refcount_dec_and_test_checked |
68 | #define refcount_dec refcount_dec_checked | ||
54 | 69 | ||
55 | extern __must_check bool refcount_dec_and_test(refcount_t *r); | ||
56 | extern void refcount_dec(refcount_t *r); | ||
57 | #else | 70 | #else |
58 | # ifdef CONFIG_ARCH_HAS_REFCOUNT | 71 | # ifdef CONFIG_ARCH_HAS_REFCOUNT |
59 | # include <asm/refcount.h> | 72 | # include <asm/refcount.h> |