diff options
author | Kent Overstreet <kent.overstreet@gmail.com> | 2019-01-24 17:12:00 -0500 |
---|---|---|
committer | Kent Overstreet <kent.overstreet@linux.dev> | 2023-10-22 17:08:15 -0400 |
commit | 2c5af169f72c1018e83b79ac82ffe387534910e8 (patch) | |
tree | 818bbcd3317dc579323e2a2dfa75cabeb12b3104 /fs/bcachefs/bcachefs_format.h | |
parent | 24547d097a520312cf9d727d3af8da1b0c985f98 (diff) | |
download | lwn-2c5af169f72c1018e83b79ac82ffe387534910e8.tar.gz lwn-2c5af169f72c1018e83b79ac82ffe387534910e8.zip |
bcachefs: reserve space in journal for fs usage entries
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
Diffstat (limited to 'fs/bcachefs/bcachefs_format.h')
-rw-r--r-- | fs/bcachefs/bcachefs_format.h | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/fs/bcachefs/bcachefs_format.h b/fs/bcachefs/bcachefs_format.h index f6cf4ccedcb1..bd41628f2995 100644 --- a/fs/bcachefs/bcachefs_format.h +++ b/fs/bcachefs/bcachefs_format.h @@ -1362,7 +1362,8 @@ static inline __u64 __bset_magic(struct bch_sb *sb) x(btree_root, 1) \ x(prio_ptrs, 2) \ x(blacklist, 3) \ - x(blacklist_v2, 4) + x(blacklist_v2, 4) \ + x(usage, 5) enum { #define x(f, nr) BCH_JSET_ENTRY_##f = nr, @@ -1392,6 +1393,20 @@ struct jset_entry_blacklist_v2 { __le64 end; }; +enum { + FS_USAGE_REPLICAS = 0, + FS_USAGE_INODES = 1, + FS_USAGE_KEY_VERSION = 2, + FS_USAGE_NR = 3 +}; + +struct jset_entry_usage { + struct jset_entry entry; + __le64 sectors; + __u8 type; + struct bch_replicas_entry r; +} __attribute__((packed)); + /* * On disk format for a journal entry: * seq is monotonically increasing; every journal entry has its own unique |