diff options
author | Kent Overstreet <kent.overstreet@linux.dev> | 2024-03-19 00:04:52 -0400 |
---|---|---|
committer | Kent Overstreet <kent.overstreet@linux.dev> | 2024-04-05 23:43:22 -0400 |
commit | 1c15b5e2c2bb1ee1931ff7872559b08fd0b7900c (patch) | |
tree | 768f9a4935cf4fb1e3dfc35f743d326928674b1f | |
parent | b25c15214ea7c5d3add870119d3c5ff943bee5ae (diff) |
bcachefs: bch_acc_rebalance_work
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
-rw-r--r-- | fs/bcachefs/buckets.c | 9 | ||||
-rw-r--r-- | fs/bcachefs/disk_accounting_format.h | 3 |
2 files changed, 11 insertions, 1 deletions
diff --git a/fs/bcachefs/buckets.c b/fs/bcachefs/buckets.c index e09ff5bbcd54..d8542cf6114b 100644 --- a/fs/bcachefs/buckets.c +++ b/fs/bcachefs/buckets.c @@ -607,6 +607,15 @@ static int __trigger_extent(struct btree_trans *trans, return ret; } + if (bch2_bkey_rebalance_opts(k)) { + struct disk_accounting_pos acc = { + .type = BCH_DISK_ACCOUNTING_rebalance_work, + }; + ret = bch2_disk_accounting_mod(trans, &acc, &dirty_sectors, 1, gc); + if (ret) + return ret; + } + return 0; } diff --git a/fs/bcachefs/disk_accounting_format.h b/fs/bcachefs/disk_accounting_format.h index f95f6ab07aaa..32f85662ea14 100644 --- a/fs/bcachefs/disk_accounting_format.h +++ b/fs/bcachefs/disk_accounting_format.h @@ -102,7 +102,8 @@ static inline bool data_type_is_hidden(enum bch_data_type type) x(dev_stripe_buckets, 4) \ x(compression, 5) \ x(snapshot, 6) \ - x(btree, 7) + x(btree, 7) \ + x(rebalance_work, 8) enum disk_accounting_type { #define x(f, nr) BCH_DISK_ACCOUNTING_##f = nr, |