diff options
author | Kent Overstreet <kent.overstreet@gmail.com> | 2021-12-10 17:04:26 -0500 |
---|---|---|
committer | Kent Overstreet <kent.overstreet@linux.dev> | 2023-10-22 17:09:25 -0400 |
commit | ae94c78fb1d5acc8315b7d17583ddb92df29bd3a (patch) | |
tree | 82ac0648987acfa9c228ae1421460b11a293df8a /fs/bcachefs/buckets.h | |
parent | 82697a10dd4b9a6f7c6f98a525778d032db2f2fb (diff) | |
download | linux-stable-ae94c78fb1d5acc8315b7d17583ddb92df29bd3a.tar.gz linux-stable-ae94c78fb1d5acc8315b7d17583ddb92df29bd3a.tar.bz2 linux-stable-ae94c78fb1d5acc8315b7d17583ddb92df29bd3a.zip |
bcachefs: bch2_trans_mark_key() now takes a bkey_i *
We're now coming up with triggers that modify the update being done. A
bkey_s_c is const - bkey_i is the correct type to be using here.
Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com>
Diffstat (limited to 'fs/bcachefs/buckets.h')
-rw-r--r-- | fs/bcachefs/buckets.h | 27 |
1 files changed, 26 insertions, 1 deletions
diff --git a/fs/bcachefs/buckets.h b/fs/bcachefs/buckets.h index 8a3cea6f94df..a04d15154304 100644 --- a/fs/bcachefs/buckets.h +++ b/fs/bcachefs/buckets.h @@ -235,7 +235,32 @@ int bch2_mark_update(struct btree_trans *, struct btree_path *, struct bkey_i *, unsigned); int bch2_trans_mark_key(struct btree_trans *, struct bkey_s_c, - struct bkey_s_c, unsigned); + struct bkey_i *, unsigned); + +static inline int bch2_trans_mark_old(struct btree_trans *trans, + struct bkey_s_c old, unsigned flags) +{ + struct bkey_i deleted; + + bkey_init(&deleted.k); + deleted.k.p = old.k->p; + + return bch2_trans_mark_key(trans, old, &deleted, + BTREE_TRIGGER_OVERWRITE|flags); +} + +static inline int bch2_trans_mark_new(struct btree_trans *trans, + struct bkey_i *new, unsigned flags) +{ + struct bkey_i deleted; + + bkey_init(&deleted.k); + deleted.k.p = new->k.p; + + return bch2_trans_mark_key(trans, bkey_i_to_s_c(&deleted), new, + BTREE_TRIGGER_INSERT|flags); +} + int bch2_trans_fs_usage_apply(struct btree_trans *, struct replicas_delta_list *); int bch2_trans_mark_metadata_bucket(struct btree_trans *, struct bch_dev *, |