1

bcachefs: Delete atomic_inc_bug()

These were wrappers around atomic operations that verified that the
counter wasn't negative, but they're dead code - delete.

Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
This commit is contained in:
Kent Overstreet 2022-11-13 20:53:24 -05:00
parent b2d1d56b1d
commit 961cbdef3c

View File

@ -23,33 +23,9 @@
struct closure;
#ifdef CONFIG_BCACHEFS_DEBUG
#define EBUG_ON(cond) BUG_ON(cond)
#define atomic_dec_bug(v) BUG_ON(atomic_dec_return(v) < 0)
#define atomic_inc_bug(v, i) BUG_ON(atomic_inc_return(v) <= i)
#define atomic_sub_bug(i, v) BUG_ON(atomic_sub_return(i, v) < 0)
#define atomic_add_bug(i, v) BUG_ON(atomic_add_return(i, v) < 0)
#define atomic_long_dec_bug(v) BUG_ON(atomic_long_dec_return(v) < 0)
#define atomic_long_sub_bug(i, v) BUG_ON(atomic_long_sub_return(i, v) < 0)
#define atomic64_dec_bug(v) BUG_ON(atomic64_dec_return(v) < 0)
#define atomic64_inc_bug(v, i) BUG_ON(atomic64_inc_return(v) <= i)
#define atomic64_sub_bug(i, v) BUG_ON(atomic64_sub_return(i, v) < 0)
#define atomic64_add_bug(i, v) BUG_ON(atomic64_add_return(i, v) < 0)
#else /* DEBUG */
#else
#define EBUG_ON(cond)
#define atomic_dec_bug(v) atomic_dec(v)
#define atomic_inc_bug(v, i) atomic_inc(v)
#define atomic_sub_bug(i, v) atomic_sub(i, v)
#define atomic_add_bug(i, v) atomic_add(i, v)
#define atomic_long_dec_bug(v) atomic_long_dec(v)
#define atomic_long_sub_bug(i, v) atomic_long_sub(i, v)
#define atomic64_dec_bug(v) atomic64_dec(v)
#define atomic64_inc_bug(v, i) atomic64_inc(v)
#define atomic64_sub_bug(i, v) atomic64_sub(i, v)
#define atomic64_add_bug(i, v) atomic64_add(i, v)
#endif
#if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__