diff options
author | Kent Overstreet <kent.overstreet@linux.dev> | 2024-04-15 14:10:51 -0400 |
---|---|---|
committer | Kent Overstreet <kent.overstreet@linux.dev> | 2024-04-15 14:24:48 -0400 |
commit | 5aaa6422b6fdc9cda8f808f7152df2073626b1bd (patch) | |
tree | 19c64dc4c4073a4d6585b16553c84e1fc5e2e9ec /libbcachefs/util.h | |
parent | 5639fb38cabaa326b8b664d874a46509d4a60bf2 (diff) |
Update bcachefs sources to ad29cf999a91 bcachefs: set_btree_iter_dontneed also clears should_be_locked
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
Diffstat (limited to 'libbcachefs/util.h')
-rw-r--r-- | libbcachefs/util.h | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/libbcachefs/util.h b/libbcachefs/util.h index b7e7c292..5cf885b0 100644 --- a/libbcachefs/util.h +++ b/libbcachefs/util.h @@ -788,6 +788,14 @@ static inline int copy_from_user_errcode(void *to, const void __user *from, unsi #endif +static inline void mod_bit(long nr, volatile unsigned long *addr, bool v) +{ + if (v) + set_bit(nr, addr); + else + clear_bit(nr, addr); +} + static inline void __set_bit_le64(size_t bit, __le64 *addr) { addr[bit / 64] |= cpu_to_le64(BIT_ULL(bit % 64)); @@ -795,7 +803,7 @@ static inline void __set_bit_le64(size_t bit, __le64 *addr) static inline void __clear_bit_le64(size_t bit, __le64 *addr) { - addr[bit / 64] &= !cpu_to_le64(BIT_ULL(bit % 64)); + addr[bit / 64] &= ~cpu_to_le64(BIT_ULL(bit % 64)); } static inline bool test_bit_le64(size_t bit, __le64 *addr) |