Skip to content

Commit 20ac515

Browse files
author
Kent Overstreet
committed
bcachefs: bch_acct_rebalance_work
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
1 parent 6af9114 commit 20ac515

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

fs/bcachefs/buckets.c

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -808,6 +808,15 @@ static int __trigger_extent(struct btree_trans *trans,
808808
return ret;
809809
}
810810

811+
if (bch2_bkey_rebalance_opts(k)) {
812+
struct disk_accounting_pos acc = {
813+
.type = BCH_DISK_ACCOUNTING_rebalance_work,
814+
};
815+
ret = bch2_disk_accounting_mod(trans, &acc, &replicas_sectors, 1, gc);
816+
if (ret)
817+
return ret;
818+
}
819+
811820
return 0;
812821
}
813822

fs/bcachefs/disk_accounting_format.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,8 @@ static inline bool data_type_is_hidden(enum bch_data_type type)
102102
x(dev_data_type, 3) \
103103
x(compression, 4) \
104104
x(snapshot, 5) \
105-
x(btree, 6)
105+
x(btree, 6) \
106+
x(rebalance_work, 7)
106107

107108
enum disk_accounting_type {
108109
#define x(f, nr) BCH_DISK_ACCOUNTING_##f = nr,

0 commit comments

Comments
 (0)