diff options
author | Kent Overstreet <kent.overstreet@linux.dev> | 2025-05-24 23:33:39 +0300 |
---|---|---|
committer | Kent Overstreet <kent.overstreet@linux.dev> | 2025-06-01 07:03:12 +0300 |
commit | 18dad454cd16cbb4c219dbd19a0008af52eb294a (patch) | |
tree | 8719893c0092c15af59b41afcbdb37e90ff6a602 /fs/bcachefs/io_read.c | |
parent | 9cb49fbf734609c79ba29c43d98e1230ecd1361a (diff) | |
download | linux-18dad454cd16cbb4c219dbd19a0008af52eb294a.tar.xz |
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/io_read.c')
-rw-r--r-- | fs/bcachefs/io_read.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/fs/bcachefs/io_read.c b/fs/bcachefs/io_read.c index cc708d46557e..fb83c6942485 100644 --- a/fs/bcachefs/io_read.c +++ b/fs/bcachefs/io_read.c @@ -56,7 +56,7 @@ static bool bch2_target_congested(struct bch_fs *c, u16 target) if (!target) return false; - rcu_read_lock(); + guard(rcu)(); devs = bch2_target_to_mask(c, target) ?: &c->rw_devs[BCH_DATA_user]; @@ -73,7 +73,6 @@ static bool bch2_target_congested(struct bch_fs *c, u16 target) total += max(congested, 0LL); nr++; } - rcu_read_unlock(); return get_random_u32_below(nr * CONGESTED_MAX) < total; } |