diff options
author | Kent Overstreet <kent.overstreet@linux.dev> | 2023-04-29 13:24:18 -0400 |
---|---|---|
committer | Kent Overstreet <kent.overstreet@linux.dev> | 2023-10-22 17:10:00 -0400 |
commit | 174f930b8e1cad3915819a46bb20da214f68f2b5 (patch) | |
tree | 413eb321e97d3184f68716c8df8a4eef9c1e5b44 /fs/bcachefs/lru.h | |
parent | ab158fce47220df20f0fe2360767227328f6765b (diff) |
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 <kent.overstreet@linux.dev>
Diffstat (limited to 'fs/bcachefs/lru.h')
-rw-r--r-- | fs/bcachefs/lru.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/fs/bcachefs/lru.h b/fs/bcachefs/lru.h index 78a6076999ed..adb98429248e 100644 --- a/fs/bcachefs/lru.h +++ b/fs/bcachefs/lru.h @@ -51,6 +51,7 @@ void bch2_lru_pos_to_text(struct printbuf *, struct bpos); #define bch2_bkey_ops_lru ((struct bkey_ops) { \ .key_invalid = bch2_lru_invalid, \ .val_to_text = bch2_lru_to_text, \ + .min_val_size = 8, \ }) int bch2_lru_del(struct btree_trans *, u16, u64, u64); |