Skip to content

Commit daba90f

Browse files
author
Kent Overstreet
committed
bcachefs: kill thing_it_points_to arg to backpointer_not_found()
This can be calculated locally. Signed-off-by: Kent Overstreet <[email protected]>
1 parent aa98266 commit daba90f

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

fs/bcachefs/backpointers.c

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -220,8 +220,7 @@ int bch2_get_next_backpointer(struct btree_trans *trans,
220220
static void backpointer_not_found(struct btree_trans *trans,
221221
struct bpos bp_pos,
222222
struct bch_backpointer bp,
223-
struct bkey_s_c k,
224-
const char *thing_it_points_to)
223+
struct bkey_s_c k)
225224
{
226225
struct bch_fs *c = trans->c;
227226
struct printbuf buf = PRINTBUF;
@@ -231,7 +230,7 @@ static void backpointer_not_found(struct btree_trans *trans,
231230
return;
232231

233232
prt_printf(&buf, "backpointer doesn't match %s it points to:\n ",
234-
thing_it_points_to);
233+
bp.level ? "btree node" : "extent");
235234
prt_printf(&buf, "bucket: ");
236235
bch2_bpos_to_text(&buf, bucket);
237236
prt_printf(&buf, "\n ");
@@ -303,7 +302,7 @@ struct bkey_s_c bch2_backpointer_get_key(struct btree_trans *trans,
303302
return bkey_s_c_null;
304303
}
305304

306-
backpointer_not_found(trans, bp_pos, bp, k, "extent");
305+
backpointer_not_found(trans, bp_pos, bp, k);
307306
}
308307

309308
return bkey_s_c_null;
@@ -338,8 +337,7 @@ struct btree *bch2_backpointer_get_node(struct btree_trans *trans,
338337
if (b && btree_node_will_make_reachable(b)) {
339338
b = ERR_PTR(-BCH_ERR_backpointer_to_overwritten_btree_node);
340339
} else {
341-
backpointer_not_found(trans, bp_pos, bp,
342-
bkey_i_to_s_c(&b->key), "btree node");
340+
backpointer_not_found(trans, bp_pos, bp, bkey_i_to_s_c(&b->key));
343341
b = NULL;
344342
}
345343
err:
@@ -797,7 +795,8 @@ static int check_one_backpointer(struct btree_trans *trans,
797795

798796
if (fsck_err_on(!k.k, c,
799797
backpointer_to_missing_ptr,
800-
"backpointer for missing extent\n %s",
798+
"backpointer for missing %s\n %s",
799+
bp.v->level ? "btree node" : "extent",
801800
(bch2_bkey_val_to_text(&buf, c, bp.s_c), buf.buf))) {
802801
ret = bch2_btree_delete_at_buffered(trans, BTREE_ID_backpointers, bp.k->p);
803802
goto out;

0 commit comments

Comments
 (0)