diff options
author | Kent Overstreet <kent.overstreet@gmail.com> | 2022-04-03 17:50:01 -0400 |
---|---|---|
committer | Kent Overstreet <kent.overstreet@linux.dev> | 2023-10-22 17:09:30 -0400 |
commit | f0ac7df23d04f3c6d4cd82899aad7f06f6a0b1d4 (patch) | |
tree | e11cada7a81e2d1daab091b4552a498055bdce31 /fs/bcachefs/lru.c | |
parent | d1d7737fd9df0cc57cd276b0189faf8c92c1426f (diff) | |
download | linux-f0ac7df23d04f3c6d4cd82899aad7f06f6a0b1d4.tar.gz linux-f0ac7df23d04f3c6d4cd82899aad7f06f6a0b1d4.tar.bz2 linux-f0ac7df23d04f3c6d4cd82899aad7f06f6a0b1d4.zip |
bcachefs: Convert .key_invalid methods to printbufs
Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com>
Diffstat (limited to 'fs/bcachefs/lru.c')
-rw-r--r-- | fs/bcachefs/lru.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/fs/bcachefs/lru.c b/fs/bcachefs/lru.c index 4f0e6960e597..c20a3bc2336b 100644 --- a/fs/bcachefs/lru.c +++ b/fs/bcachefs/lru.c @@ -8,14 +8,18 @@ #include "lru.h" #include "recovery.h" -const char *bch2_lru_invalid(const struct bch_fs *c, struct bkey_s_c k) +int bch2_lru_invalid(const struct bch_fs *c, struct bkey_s_c k, + struct printbuf *err) { const struct bch_lru *lru = bkey_s_c_to_lru(k).v; - if (bkey_val_bytes(k.k) < sizeof(*lru)) - return "incorrect value size"; + if (bkey_val_bytes(k.k) < sizeof(*lru)) { + pr_buf(err, "incorrect value size (%zu < %zu)", + bkey_val_bytes(k.k), sizeof(*lru)); + return -EINVAL; + } - return NULL; + return 0; } void bch2_lru_to_text(struct printbuf *out, struct bch_fs *c, |