summaryrefslogtreecommitdiff
path: root/fs/bcachefs/lru.c
diff options
context:
space:
mode:
authorKent Overstreet <kent.overstreet@linux.dev>2023-04-29 13:24:18 -0400
committerKent Overstreet <kent.overstreet@linux.dev>2023-10-22 17:10:00 -0400
commit174f930b8e1cad3915819a46bb20da214f68f2b5 (patch)
tree413eb321e97d3184f68716c8df8a4eef9c1e5b44 /fs/bcachefs/lru.c
parentab158fce47220df20f0fe2360767227328f6765b (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.c')
-rw-r--r--fs/bcachefs/lru.c8
1 files changed, 0 insertions, 8 deletions
diff --git a/fs/bcachefs/lru.c b/fs/bcachefs/lru.c
index c2dece27da2d..0e6193d6b5f8 100644
--- a/fs/bcachefs/lru.c
+++ b/fs/bcachefs/lru.c
@@ -13,14 +13,6 @@
int bch2_lru_invalid(const struct bch_fs *c, struct bkey_s_c k,
unsigned flags, struct printbuf *err)
{
- const struct bch_lru *lru = bkey_s_c_to_lru(k).v;
-
- if (bkey_val_bytes(k.k) < sizeof(*lru)) {
- prt_printf(err, "incorrect value size (%zu < %zu)",
- bkey_val_bytes(k.k), sizeof(*lru));
- return -BCH_ERR_invalid_bkey;
- }
-
if (!lru_pos_time(k.k->p)) {
prt_printf(err, "lru entry at time=0");
return -BCH_ERR_invalid_bkey;