summaryrefslogtreecommitdiff
path: root/fs/bcachefs/disk_accounting_format.h
diff options
context:
space:
mode:
authorKent Overstreet <kent.overstreet@linux.dev>2024-08-12 02:27:36 -0400
committerKent Overstreet <kent.overstreet@linux.dev>2024-08-13 23:00:50 -0400
commit58474f76a770bcc79d4b2d7232e4d6650e732b50 (patch)
tree483b52bc19698ce56eda1ea003a049161aa8af96 /fs/bcachefs/disk_accounting_format.h
parent5132b99bb62664c02bd6c0dd62ad3fedc75294d8 (diff)
bcachefs: bcachefs_metadata_version_disk_accounting_inum
This adds another disk accounting counter to track usage per inode number (any snapshot ID). This will be used for a couple things: - It'll give us a way to tell the user how much space a given file ista consuming in all snapshots; i.e. how much extra space it's consuming due to snapshot versioning. - It counts number of extents and total size of extents (both in btree keyspace sectors and actual disk usage), meaning it gives us average extent size: that is, it'll let us cheaply find fragmented files that should be defragmented. Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
Diffstat (limited to 'fs/bcachefs/disk_accounting_format.h')
-rw-r--r--fs/bcachefs/disk_accounting_format.h8
1 files changed, 7 insertions, 1 deletions
diff --git a/fs/bcachefs/disk_accounting_format.h b/fs/bcachefs/disk_accounting_format.h
index a93cf26ff4a9..7b6e6c97e6aa 100644
--- a/fs/bcachefs/disk_accounting_format.h
+++ b/fs/bcachefs/disk_accounting_format.h
@@ -103,7 +103,8 @@ static inline bool data_type_is_hidden(enum bch_data_type type)
x(compression, 4) \
x(snapshot, 5) \
x(btree, 6) \
- x(rebalance_work, 7)
+ x(rebalance_work, 7) \
+ x(inum, 8)
enum disk_accounting_type {
#define x(f, nr) BCH_DISK_ACCOUNTING_##f = nr,
@@ -136,6 +137,10 @@ struct bch_acct_btree {
__u32 id;
} __packed;
+struct bch_acct_inum {
+ __u64 inum;
+} __packed;
+
struct bch_acct_rebalance_work {
};
@@ -152,6 +157,7 @@ struct disk_accounting_pos {
struct bch_acct_snapshot snapshot;
struct bch_acct_btree btree;
struct bch_acct_rebalance_work rebalance_work;
+ struct bch_acct_inum inum;
} __packed;
} __packed;
struct bpos _pad;