From 174f930b8e1cad3915819a46bb20da214f68f2b5 Mon Sep 17 00:00:00 2001 From: Kent Overstreet Date: Sat, 29 Apr 2023 13:24:18 -0400 Subject: bcachefs: bkey_ops.min_val_size This adds a new field to bkey_ops for the minimum size of the value, which standardizes that check and also enforces the new rule (previously done somewhat ad-hoc) that we can extend value types by adding new fields on to the end. To make that work we do _not_ initialize min_val_size with sizeof, instead we initialize it to the size of the first version of those values. Signed-off-by: Kent Overstreet --- fs/bcachefs/ec.h | 1 + 1 file changed, 1 insertion(+) (limited to 'fs/bcachefs/ec.h') diff --git a/fs/bcachefs/ec.h b/fs/bcachefs/ec.h index 7c08a49d7419..3995b7076427 100644 --- a/fs/bcachefs/ec.h +++ b/fs/bcachefs/ec.h @@ -17,6 +17,7 @@ void bch2_stripe_to_text(struct printbuf *, struct bch_fs *, .swab = bch2_ptr_swab, \ .trans_trigger = bch2_trans_mark_stripe, \ .atomic_trigger = bch2_mark_stripe, \ + .min_val_size = 8, \ }) static inline unsigned stripe_csums_per_device(const struct bch_stripe *s) -- cgit v1.2.3