diff options
author | Kent Overstreet <kent.overstreet@linux.dev> | 2023-12-28 05:19:09 +0100 |
---|---|---|
committer | Kent Overstreet <kent.overstreet@linux.dev> | 2024-01-06 05:24:19 +0100 |
commit | 717296c34c8d9d13d7aad4d710b0c3bdb285783b (patch) | |
tree | e458287091df3435dabd74d4cd34d2ebea33a019 /fs/bcachefs/bkey_methods.h | |
parent | bcachefs: Upgrading uses bch_sb.recovery_passes_required (diff) | |
download | linux-717296c34c8d9d13d7aad4d710b0c3bdb285783b.tar.xz linux-717296c34c8d9d13d7aad4d710b0c3bdb285783b.zip |
bcachefs: trans_mark now takes bkey_s
Prep work for disk space accounting rewrite: we're going to want to use
a single callback for both of our current triggers, so we need to change
them to have the same type signature first.
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
Diffstat (limited to 'fs/bcachefs/bkey_methods.h')
-rw-r--r-- | fs/bcachefs/bkey_methods.h | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/fs/bcachefs/bkey_methods.h b/fs/bcachefs/bkey_methods.h index 912adadfb4dd..fa68e28c4f82 100644 --- a/fs/bcachefs/bkey_methods.h +++ b/fs/bcachefs/bkey_methods.h @@ -29,7 +29,7 @@ struct bkey_ops { bool (*key_normalize)(struct bch_fs *, struct bkey_s); bool (*key_merge)(struct bch_fs *, struct bkey_s, struct bkey_s_c); int (*trans_trigger)(struct btree_trans *, enum btree_id, unsigned, - struct bkey_s_c, struct bkey_i *, unsigned); + struct bkey_s_c, struct bkey_s, unsigned); int (*atomic_trigger)(struct btree_trans *, enum btree_id, unsigned, struct bkey_s_c, struct bkey_s_c, unsigned); void (*compat)(enum btree_id id, unsigned version, @@ -120,10 +120,10 @@ enum btree_update_flags { static inline int bch2_trans_mark_key(struct btree_trans *trans, enum btree_id btree_id, unsigned level, - struct bkey_s_c old, struct bkey_i *new, + struct bkey_s_c old, struct bkey_s new, unsigned flags) { - const struct bkey_ops *ops = bch2_bkey_type_ops(old.k->type ?: new->k.type); + const struct bkey_ops *ops = bch2_bkey_type_ops(old.k->type ?: new.k->type); return ops->trans_trigger ? ops->trans_trigger(trans, btree_id, level, old, new, flags) @@ -139,18 +139,18 @@ static inline int bch2_trans_mark_old(struct btree_trans *trans, bkey_init(&deleted.k); deleted.k.p = old.k->p; - return bch2_trans_mark_key(trans, btree_id, level, old, &deleted, + return bch2_trans_mark_key(trans, btree_id, level, old, bkey_i_to_s(&deleted), BTREE_TRIGGER_OVERWRITE|flags); } static inline int bch2_trans_mark_new(struct btree_trans *trans, enum btree_id btree_id, unsigned level, - struct bkey_i *new, unsigned flags) + struct bkey_s new, unsigned flags) { struct bkey_i deleted; bkey_init(&deleted.k); - deleted.k.p = new->k.p; + deleted.k.p = new.k->p; return bch2_trans_mark_key(trans, btree_id, level, bkey_i_to_s_c(&deleted), new, BTREE_TRIGGER_INSERT|flags); |