diff options
author | Kent Overstreet <kent.overstreet@gmail.com> | 2022-04-03 21:50:25 -0400 |
---|---|---|
committer | Kent Overstreet <kent.overstreet@linux.dev> | 2023-10-22 17:09:30 -0400 |
commit | 275c8426fb8fd475e9991b3aa1b20f66069e594f (patch) | |
tree | f3e085040653dd86977f3fe73ce87730ab699556 /fs/bcachefs/reflink.c | |
parent | e1effd42a1cb40048002f594c12e823b5e33ed5d (diff) | |
download | linux-275c8426fb8fd475e9991b3aa1b20f66069e594f.tar.gz linux-275c8426fb8fd475e9991b3aa1b20f66069e594f.tar.bz2 linux-275c8426fb8fd475e9991b3aa1b20f66069e594f.zip |
bcachefs: Add rw to .key_invalid()
This adds a new parameter to .key_invalid() methods for whether the key
is being read or written; the idea being that methods can do more
aggressive checks when a key is newly created and being written, when we
wouldn't want to delete the key because of those checks.
Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com>
Diffstat (limited to 'fs/bcachefs/reflink.c')
-rw-r--r-- | fs/bcachefs/reflink.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/fs/bcachefs/reflink.c b/fs/bcachefs/reflink.c index e07f0339d87e..6a81eb9b41a0 100644 --- a/fs/bcachefs/reflink.c +++ b/fs/bcachefs/reflink.c @@ -26,7 +26,7 @@ static inline unsigned bkey_type_to_indirect(const struct bkey *k) /* reflink pointers */ int bch2_reflink_p_invalid(const struct bch_fs *c, struct bkey_s_c k, - struct printbuf *err) + int rw, struct printbuf *err) { struct bkey_s_c_reflink_p p = bkey_s_c_to_reflink_p(k); @@ -78,7 +78,7 @@ bool bch2_reflink_p_merge(struct bch_fs *c, struct bkey_s _l, struct bkey_s_c _r /* indirect extents */ int bch2_reflink_v_invalid(const struct bch_fs *c, struct bkey_s_c k, - struct printbuf *err) + int rw, struct printbuf *err) { struct bkey_s_c_reflink_v r = bkey_s_c_to_reflink_v(k); @@ -88,7 +88,7 @@ int bch2_reflink_v_invalid(const struct bch_fs *c, struct bkey_s_c k, return -EINVAL; } - return bch2_bkey_ptrs_invalid(c, k, err); + return bch2_bkey_ptrs_invalid(c, k, rw, err); } void bch2_reflink_v_to_text(struct printbuf *out, struct bch_fs *c, @@ -130,7 +130,7 @@ int bch2_trans_mark_reflink_v(struct btree_trans *trans, /* indirect inline data */ int bch2_indirect_inline_data_invalid(const struct bch_fs *c, struct bkey_s_c k, - struct printbuf *err) + int rw, struct printbuf *err) { if (bkey_val_bytes(k.k) < sizeof(struct bch_indirect_inline_data)) { pr_buf(err, "incorrect value size (%zu < %zu)", |