diff options
Diffstat (limited to 'fs/bcachefs/bcachefs_format.h')
-rw-r--r-- | fs/bcachefs/bcachefs_format.h | 22 |
1 files changed, 19 insertions, 3 deletions
diff --git a/fs/bcachefs/bcachefs_format.h b/fs/bcachefs/bcachefs_format.h index dbc9c15514bd..575fb7143cc0 100644 --- a/fs/bcachefs/bcachefs_format.h +++ b/fs/bcachefs/bcachefs_format.h @@ -343,7 +343,8 @@ static inline void bkey_init(struct bkey *k) x(stripe, 14) \ x(reflink_p, 15) \ x(reflink_v, 16) \ - x(inline_data, 17) + x(inline_data, 17) \ + x(btree_ptr_v2, 18) enum bch_bkey_type { #define x(name, nr) KEY_TYPE_##name = nr, @@ -599,6 +600,19 @@ struct bch_btree_ptr { struct bch_extent_ptr start[]; } __attribute__((packed, aligned(8))); +struct bch_btree_ptr_v2 { + struct bch_val v; + + __u64 mem_ptr; + __le64 seq; + __le16 sectors_written; + /* In case we ever decide to do variable size btree nodes: */ + __le16 sectors; + struct bpos min_key; + __u64 _data[0]; + struct bch_extent_ptr start[]; +} __attribute__((packed, aligned(8))); + struct bch_extent { struct bch_val v; @@ -630,7 +644,8 @@ struct bch_reservation { /* Btree pointers don't carry around checksums: */ #define BKEY_BTREE_PTR_VAL_U64s_MAX \ - ((sizeof(struct bch_extent_ptr)) / sizeof(u64) * BCH_REPLICAS_MAX) + ((sizeof(struct bch_btree_ptr_v2) + \ + sizeof(struct bch_extent_ptr) * BCH_REPLICAS_MAX) / sizeof(u64)) #define BKEY_BTREE_PTR_U64s_MAX \ (BKEY_U64s + BKEY_BTREE_PTR_VAL_U64s_MAX) @@ -1299,7 +1314,8 @@ LE64_BITMASK(BCH_SB_ERASURE_CODE, struct bch_sb, flags[3], 0, 16); x(new_siphash, 7) \ x(inline_data, 8) \ x(new_extent_overwrite, 9) \ - x(incompressible, 10) + x(incompressible, 10) \ + x(btree_ptr_v2, 11) enum bch_sb_feature { #define x(f, n) BCH_FEATURE_##f, |