diff options
author | Kent Overstreet <kent.overstreet@linux.dev> | 2023-04-29 19:24:18 +0200 |
---|---|---|
committer | Kent Overstreet <kent.overstreet@linux.dev> | 2023-10-22 23:10:00 +0200 |
commit | 174f930b8e1cad3915819a46bb20da214f68f2b5 (patch) | |
tree | 413eb321e97d3184f68716c8df8a4eef9c1e5b44 /fs/bcachefs/dirent.h | |
parent | bcachefs: Converting to typed bkeys is now allowed for err, null ptrs (diff) | |
download | linux-174f930b8e1cad3915819a46bb20da214f68f2b5.tar.xz linux-174f930b8e1cad3915819a46bb20da214f68f2b5.zip |
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/dirent.h')
-rw-r--r-- | fs/bcachefs/dirent.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/fs/bcachefs/dirent.h b/fs/bcachefs/dirent.h index ad131e8edc29..bf9ea2e35fae 100644 --- a/fs/bcachefs/dirent.h +++ b/fs/bcachefs/dirent.h @@ -12,6 +12,7 @@ void bch2_dirent_to_text(struct printbuf *, struct bch_fs *, struct bkey_s_c); #define bch2_bkey_ops_dirent ((struct bkey_ops) { \ .key_invalid = bch2_dirent_invalid, \ .val_to_text = bch2_dirent_to_text, \ + .min_val_size = 16, \ }) struct qstr; |