diff options
author | Kent Overstreet <kent.overstreet@linux.dev> | 2023-11-02 14:39:01 -0400 |
---|---|---|
committer | Kent Overstreet <kent.overstreet@linux.dev> | 2023-11-02 14:39:01 -0400 |
commit | 0a08ddf78c9cf4b6671ba64b049c37da64233f4f (patch) | |
tree | 5c373e315fd49da181fdf0b06ff6ba0fffe5dccf /libbcachefs/rebalance.c | |
parent | d320a4e927fd706b34c714b77130965a385ea4fb (diff) |
Update bcachefs sources to b9bd69421f73 bcachefs: x-macro-ify inode flags enumv1.3.1
Diffstat (limited to 'libbcachefs/rebalance.c')
-rw-r--r-- | libbcachefs/rebalance.c | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/libbcachefs/rebalance.c b/libbcachefs/rebalance.c index 6ee4d2e0..3319190b 100644 --- a/libbcachefs/rebalance.c +++ b/libbcachefs/rebalance.c @@ -1,6 +1,7 @@ // SPDX-License-Identifier: GPL-2.0 #include "bcachefs.h" +#include "alloc_background.h" #include "alloc_foreground.h" #include "btree_iter.h" #include "btree_update.h" @@ -282,15 +283,12 @@ static int do_rebalance_scan(struct moving_context *ctxt, u64 inum, u64 cookie) static void rebalance_wait(struct bch_fs *c) { struct bch_fs_rebalance *r = &c->rebalance; - struct bch_dev *ca; struct io_clock *clock = &c->io_clock[WRITE]; u64 now = atomic64_read(&clock->now); - u64 min_member_capacity = 128 * 2048; - unsigned i; + u64 min_member_capacity = bch2_min_rw_member_capacity(c); - for_each_rw_member(ca, c, i) - min_member_capacity = min(min_member_capacity, - ca->mi.nbuckets * ca->mi.bucket_size); + if (min_member_capacity == U64_MAX) + min_member_capacity = 128 * 2048; r->wait_iotime_end = now + (min_member_capacity >> 6); @@ -350,7 +348,7 @@ static int do_rebalance(struct moving_context *ctxt) !kthread_should_stop() && !atomic64_read(&r->work_stats.sectors_seen) && !atomic64_read(&r->scan_stats.sectors_seen)) { - bch2_trans_unlock(trans); + bch2_trans_unlock_long(trans); rebalance_wait(c); } |