diff options
| author | Kent Overstreet <kent.overstreet@linux.dev> | 2025-05-24 16:33:39 -0400 |
|---|---|---|
| committer | Kent Overstreet <kent.overstreet@linux.dev> | 2025-06-01 00:03:12 -0400 |
| commit | 18dad454cd16cbb4c219dbd19a0008af52eb294a (patch) | |
| tree | 8719893c0092c15af59b41afcbdb37e90ff6a602 /fs/bcachefs/alloc_background.h | |
| parent | 9cb49fbf734609c79ba29c43d98e1230ecd1361a (diff) | |
| download | linux-next-18dad454cd16cbb4c219dbd19a0008af52eb294a.tar.gz linux-next-18dad454cd16cbb4c219dbd19a0008af52eb294a.zip | |
bcachefs: Replace rcu_read_lock() with guards
The new guard(), scoped_guard() allow for more natural code.
Some of the uses with creative flow control have been left.
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
Diffstat (limited to 'fs/bcachefs/alloc_background.h')
| -rw-r--r-- | fs/bcachefs/alloc_background.h | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/fs/bcachefs/alloc_background.h b/fs/bcachefs/alloc_background.h index b97ae710219f..0cc5adc55b6f 100644 --- a/fs/bcachefs/alloc_background.h +++ b/fs/bcachefs/alloc_background.h @@ -13,11 +13,9 @@ static inline bool bch2_dev_bucket_exists(struct bch_fs *c, struct bpos pos) { - rcu_read_lock(); + guard(rcu)(); struct bch_dev *ca = bch2_dev_rcu_noerror(c, pos.inode); - bool ret = ca && bucket_valid(ca, pos.offset); - rcu_read_unlock(); - return ret; + return ca && bucket_valid(ca, pos.offset); } static inline u64 bucket_to_u64(struct bpos bucket) |
