summaryrefslogtreecommitdiff
path: root/fs/bcachefs/disk_accounting.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/bcachefs/disk_accounting.c')
-rw-r--r--fs/bcachefs/disk_accounting.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/fs/bcachefs/disk_accounting.c b/fs/bcachefs/disk_accounting.c
index a99f821c6a1c..b20ea162bfa3 100644
--- a/fs/bcachefs/disk_accounting.c
+++ b/fs/bcachefs/disk_accounting.c
@@ -282,6 +282,9 @@ void bch2_accounting_key_to_text(struct printbuf *out, struct disk_accounting_po
prt_str(out, "btree=");
bch2_btree_id_to_text(out, k->btree.id);
break;
+ case BCH_DISK_ACCOUNTING_rebalance_work_v2:
+ bch2_prt_rebalance_accounting_type(out, k->rebalance_work_v2.type);
+ break;
}
}
@@ -814,6 +817,8 @@ int bch2_accounting_read(struct bch_fs *c)
struct journal_keys *keys = &c->journal_keys;
struct journal_key *jk = keys->data;
+ move_gap(keys, keys->nr);
+
while (jk < &darray_top(*keys) &&
__journal_key_cmp(c, BTREE_ID_accounting, 0, POS_MIN, jk) > 0)
jk++;
@@ -829,9 +834,6 @@ int bch2_accounting_read(struct bch_fs *c)
iter.flags &= ~BTREE_ITER_with_journal;
int ret = for_each_btree_key_continue(trans, iter,
BTREE_ITER_prefetch|BTREE_ITER_all_snapshots, k, ({
- struct bkey u;
- struct bkey_s_c k = bch2_btree_path_peek_slot_exact(btree_iter_path(trans, &iter), &u);
-
if (k.k->type != KEY_TYPE_accounting)
continue;
@@ -860,7 +862,7 @@ int bch2_accounting_read(struct bch_fs *c)
struct disk_accounting_pos next_acc;
memset(&next_acc, 0, sizeof(next_acc));
next_acc.type = acc_k.type + 1;
- struct bpos next = disk_accounting_pos_to_bpos(&next_acc);
+ struct bpos next = bpos_predecessor(disk_accounting_pos_to_bpos(&next_acc));
if (jk < end)
next = bpos_min(next, journal_key_k(c, jk)->k.p);