summaryrefslogtreecommitdiffstats
path: root/fs/bcachefs/extents.h
diff options
context:
space:
mode:
authorKent Overstreet <kent.overstreet@gmail.com>2022-04-03 21:50:25 -0400
committerKent Overstreet <kent.overstreet@linux.dev>2023-10-22 17:09:30 -0400
commit275c8426fb8fd475e9991b3aa1b20f66069e594f (patch)
treef3e085040653dd86977f3fe73ce87730ab699556 /fs/bcachefs/extents.h
parente1effd42a1cb40048002f594c12e823b5e33ed5d (diff)
downloadlinux-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/extents.h')
-rw-r--r--fs/bcachefs/extents.h10
1 files changed, 6 insertions, 4 deletions
diff --git a/fs/bcachefs/extents.h b/fs/bcachefs/extents.h
index 21f79e663c74..4f41f0fd6cb1 100644
--- a/fs/bcachefs/extents.h
+++ b/fs/bcachefs/extents.h
@@ -367,11 +367,11 @@ int bch2_bkey_pick_read_device(struct bch_fs *, struct bkey_s_c,
/* KEY_TYPE_btree_ptr: */
-int bch2_btree_ptr_invalid(const struct bch_fs *, struct bkey_s_c, struct printbuf *);
+int bch2_btree_ptr_invalid(const struct bch_fs *, struct bkey_s_c, int, struct printbuf *);
void bch2_btree_ptr_to_text(struct printbuf *, struct bch_fs *,
struct bkey_s_c);
-int bch2_btree_ptr_v2_invalid(const struct bch_fs *, struct bkey_s_c, struct printbuf *);
+int bch2_btree_ptr_v2_invalid(const struct bch_fs *, struct bkey_s_c, int, struct printbuf *);
void bch2_btree_ptr_v2_to_text(struct printbuf *, struct bch_fs *, struct bkey_s_c);
void bch2_btree_ptr_v2_compat(enum btree_id, unsigned, unsigned,
int, struct bkey_s);
@@ -409,7 +409,8 @@ bool bch2_extent_merge(struct bch_fs *, struct bkey_s, struct bkey_s_c);
/* KEY_TYPE_reservation: */
-int bch2_reservation_invalid(const struct bch_fs *, struct bkey_s_c, struct printbuf *);
+int bch2_reservation_invalid(const struct bch_fs *, struct bkey_s_c,
+ int, struct printbuf *);
void bch2_reservation_to_text(struct printbuf *, struct bch_fs *, struct bkey_s_c);
bool bch2_reservation_merge(struct bch_fs *, struct bkey_s, struct bkey_s_c);
@@ -615,7 +616,8 @@ bool bch2_bkey_matches_ptr(struct bch_fs *, struct bkey_s_c,
bool bch2_extent_normalize(struct bch_fs *, struct bkey_s);
void bch2_bkey_ptrs_to_text(struct printbuf *, struct bch_fs *,
struct bkey_s_c);
-int bch2_bkey_ptrs_invalid(const struct bch_fs *, struct bkey_s_c, struct printbuf *);
+int bch2_bkey_ptrs_invalid(const struct bch_fs *, struct bkey_s_c,
+ int, struct printbuf *);
void bch2_ptr_swab(struct bkey_s);