diff options
| author | Kent Overstreet <kent.overstreet@linux.dev> | 2025-04-20 11:27:18 -0400 |
|---|---|---|
| committer | Kent Overstreet <kent.overstreet@linux.dev> | 2025-05-21 20:14:26 -0400 |
| commit | e14e06e91dadcd1c65f08ba5a02716d3e855fc74 (patch) | |
| tree | 624ee0c6e7bbd693790ebeca9c02ca1231ffe13f /fs/bcachefs/super.c | |
| parent | bcachefs: for_each_online_member_rcu() (diff) | |
| download | linux-e14e06e91dadcd1c65f08ba5a02716d3e855fc74.tar.gz linux-e14e06e91dadcd1c65f08ba5a02716d3e855fc74.zip | |
bcachefs: __bch2_fs_read_write() no longer depends on io_ref
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
Diffstat (limited to 'fs/bcachefs/super.c')
| -rw-r--r-- | fs/bcachefs/super.c | 19 |
1 files changed, 13 insertions, 6 deletions
diff --git a/fs/bcachefs/super.c b/fs/bcachefs/super.c index 834c68a273b4..cdcfed4dd283 100644 --- a/fs/bcachefs/super.c +++ b/fs/bcachefs/super.c @@ -471,10 +471,14 @@ static int __bch2_fs_read_write(struct bch_fs *c, bool early) clear_bit(BCH_FS_clean_shutdown, &c->flags); - __for_each_online_member(c, ca, BIT(BCH_MEMBER_STATE_rw), READ) { - bch2_dev_allocator_add(c, ca); - percpu_ref_reinit(&ca->io_ref[WRITE]); - } + rcu_read_lock(); + for_each_online_member_rcu(c, ca) + if (ca->mi.state == BCH_MEMBER_STATE_rw) { + bch2_dev_allocator_add(c, ca); + percpu_ref_reinit(&ca->io_ref[WRITE]); + } + rcu_read_unlock(); + bch2_recalc_capacity(c); /* @@ -1149,8 +1153,11 @@ int bch2_fs_start(struct bch_fs *c) */ mutex_unlock(&c->sb_lock); - for_each_rw_member(c, ca) - bch2_dev_allocator_add(c, ca); + rcu_read_lock(); + for_each_online_member_rcu(c, ca) + if (ca->mi.state == BCH_MEMBER_STATE_rw) + bch2_dev_allocator_add(c, ca); + rcu_read_unlock(); bch2_recalc_capacity(c); up_write(&c->state_lock); |
