Loading fs/bcachefs/buckets.c +10 −0 Original line number Diff line number Diff line Loading @@ -798,6 +798,16 @@ static int __trigger_extent(struct btree_trans *trans, return ret; } if (level) { struct disk_accounting_pos acc_btree_key = { .type = BCH_DISK_ACCOUNTING_btree, .btree.id = btree_id, }; ret = bch2_disk_accounting_mod(trans, &acc_btree_key, &replicas_sectors, 1, gc); if (ret) return ret; } return 0; } Loading fs/bcachefs/disk_accounting.c +4 −0 Original line number Diff line number Diff line Loading @@ -2,6 +2,7 @@ #include "bcachefs.h" #include "bcachefs_ioctl.h" #include "btree_cache.h" #include "btree_journal_iter.h" #include "btree_update.h" #include "btree_write_buffer.h" Loading Loading @@ -149,6 +150,9 @@ void bch2_accounting_key_to_text(struct printbuf *out, struct disk_accounting_po case BCH_DISK_ACCOUNTING_snapshot: prt_printf(out, "id=%u", k->snapshot.id); break; case BCH_DISK_ACCOUNTING_btree: prt_printf(out, "btree=%s", bch2_btree_id_str(k->btree.id)); break; } } Loading fs/bcachefs/disk_accounting_format.h +7 −1 Original line number Diff line number Diff line Loading @@ -101,7 +101,8 @@ static inline bool data_type_is_hidden(enum bch_data_type type) x(replicas, 2) \ x(dev_data_type, 3) \ x(compression, 4) \ x(snapshot, 5) x(snapshot, 5) \ x(btree, 6) enum disk_accounting_type { #define x(f, nr) BCH_DISK_ACCOUNTING_##f = nr, Loading Loading @@ -134,6 +135,10 @@ struct bch_acct_snapshot { __u32 id; }; struct bch_acct_btree { __u32 id; }; struct disk_accounting_pos { union { struct { Loading @@ -146,6 +151,7 @@ struct disk_accounting_pos { struct bch_dev_stripe_buckets dev_stripe_buckets; struct bch_acct_compression compression; struct bch_acct_snapshot snapshot; struct bch_acct_btree btree; }; }; struct bpos _pad; Loading Loading
fs/bcachefs/buckets.c +10 −0 Original line number Diff line number Diff line Loading @@ -798,6 +798,16 @@ static int __trigger_extent(struct btree_trans *trans, return ret; } if (level) { struct disk_accounting_pos acc_btree_key = { .type = BCH_DISK_ACCOUNTING_btree, .btree.id = btree_id, }; ret = bch2_disk_accounting_mod(trans, &acc_btree_key, &replicas_sectors, 1, gc); if (ret) return ret; } return 0; } Loading
fs/bcachefs/disk_accounting.c +4 −0 Original line number Diff line number Diff line Loading @@ -2,6 +2,7 @@ #include "bcachefs.h" #include "bcachefs_ioctl.h" #include "btree_cache.h" #include "btree_journal_iter.h" #include "btree_update.h" #include "btree_write_buffer.h" Loading Loading @@ -149,6 +150,9 @@ void bch2_accounting_key_to_text(struct printbuf *out, struct disk_accounting_po case BCH_DISK_ACCOUNTING_snapshot: prt_printf(out, "id=%u", k->snapshot.id); break; case BCH_DISK_ACCOUNTING_btree: prt_printf(out, "btree=%s", bch2_btree_id_str(k->btree.id)); break; } } Loading
fs/bcachefs/disk_accounting_format.h +7 −1 Original line number Diff line number Diff line Loading @@ -101,7 +101,8 @@ static inline bool data_type_is_hidden(enum bch_data_type type) x(replicas, 2) \ x(dev_data_type, 3) \ x(compression, 4) \ x(snapshot, 5) x(snapshot, 5) \ x(btree, 6) enum disk_accounting_type { #define x(f, nr) BCH_DISK_ACCOUNTING_##f = nr, Loading Loading @@ -134,6 +135,10 @@ struct bch_acct_snapshot { __u32 id; }; struct bch_acct_btree { __u32 id; }; struct disk_accounting_pos { union { struct { Loading @@ -146,6 +151,7 @@ struct disk_accounting_pos { struct bch_dev_stripe_buckets dev_stripe_buckets; struct bch_acct_compression compression; struct bch_acct_snapshot snapshot; struct bch_acct_btree btree; }; }; struct bpos _pad; Loading