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/quota.c | 6 ------ 1 file changed, 6 deletions(-) (limited to 'fs/bcachefs/quota.c') diff --git a/fs/bcachefs/quota.c b/fs/bcachefs/quota.c index 331f22835d18..22cd662429d3 100644 --- a/fs/bcachefs/quota.c +++ b/fs/bcachefs/quota.c @@ -67,12 +67,6 @@ int bch2_quota_invalid(const struct bch_fs *c, struct bkey_s_c k, return -BCH_ERR_invalid_bkey; } - if (bkey_val_bytes(k.k) != sizeof(struct bch_quota)) { - prt_printf(err, "incorrect value size (%zu != %zu)", - bkey_val_bytes(k.k), sizeof(struct bch_quota)); - return -BCH_ERR_invalid_bkey; - } - return 0; } -- cgit v1.2.3