summaryrefslogtreecommitdiff
path: root/fs/bcachefs/btree_gc.c
diff options
context:
space:
mode:
authorKent Overstreet <kent.overstreet@linux.dev>2023-12-27 23:19:09 -0500
committerKent Overstreet <kent.overstreet@linux.dev>2024-01-05 23:24:19 -0500
commitad00bce07da8138c08f6585f153412b65c99b064 (patch)
tree5d102710a99d6d1dedbd49bceefd587704cf11d4 /fs/bcachefs/btree_gc.c
parent717296c34c8d9d13d7aad4d710b0c3bdb285783b (diff)
bcachefs: 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/btree_gc.c')
-rw-r--r--fs/bcachefs/btree_gc.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/fs/bcachefs/btree_gc.c b/fs/bcachefs/btree_gc.c
index 3143544ca24c..88e069d7a7bb 100644
--- a/fs/bcachefs/btree_gc.c
+++ b/fs/bcachefs/btree_gc.c
@@ -41,6 +41,14 @@
#define DROP_THIS_NODE 10
#define DROP_PREV_NODE 11
+static struct bkey_s unsafe_bkey_s_c_to_s(struct bkey_s_c k)
+{
+ return (struct bkey_s) {{{
+ (struct bkey *) k.k,
+ (struct bch_val *) k.v
+ }}};
+}
+
static bool should_restart_for_topology_repair(struct bch_fs *c)
{
return c->opts.fix_errors != FSCK_FIX_no &&
@@ -829,7 +837,7 @@ static int bch2_gc_mark_key(struct btree_trans *trans, enum btree_id btree_id,
}
ret = commit_do(trans, NULL, NULL, 0,
- bch2_mark_key(trans, btree_id, level, old, *k, flags));
+ bch2_mark_key(trans, btree_id, level, old, unsafe_bkey_s_c_to_s(*k), flags));
fsck_err:
err:
bch_err_fn(c, ret);