goto err;
if (ca->mi.freespace_initialized &&
- bch2_fs_inconsistent_on(old.k->type != old_type, c,
+ bch2_trans_inconsistent_on(old.k->type != old_type, trans,
"incorrect key when %s %s btree (got %s should be %s)\n"
" for %s",
set ? "setting" : "clearing",
goto write;
}
- if (bch2_fs_inconsistent_on(a->v.journal_seq > c->journal.flushed_seq_ondisk, c,
+ if (bch2_trans_inconsistent_on(a->v.journal_seq > c->journal.flushed_seq_ondisk, trans,
"clearing need_discard but journal_seq %llu > flushed_seq %llu\n"
"%s",
a->v.journal_seq,
goto out;
}
- if (bch2_fs_inconsistent_on(a->v.data_type != BCH_DATA_need_discard, c,
+ if (bch2_trans_inconsistent_on(a->v.data_type != BCH_DATA_need_discard, trans,
"bucket incorrectly set in need_discard btree\n"
"%s",
(bch2_bkey_val_to_text(&buf, c, k), buf.buf))) {
if (!k.k || k.k->p.inode != ca->dev_idx)
goto out;
- if (bch2_fs_inconsistent_on(k.k->type != KEY_TYPE_lru, c,
- "non lru key in lru btree"))
+ if (bch2_trans_inconsistent_on(k.k->type != KEY_TYPE_lru, trans,
+ "non lru key in lru btree"))
goto out;
idx = k.k->p.offset;
if (ret)
goto out;
- if (bch2_fs_inconsistent_on(idx != alloc_lru_idx(a->v), c,
+ if (bch2_trans_inconsistent_on(idx != alloc_lru_idx(a->v), trans,
"invalidating bucket with wrong lru idx (got %llu should be %llu",
idx, alloc_lru_idx(a->v)))
goto out;
static int lru_delete(struct btree_trans *trans, u64 id, u64 idx, u64 time)
{
- struct bch_fs *c = trans->c;
struct btree_iter iter;
struct bkey_s_c k;
u64 existing_idx;
goto err;
if (k.k->type != KEY_TYPE_lru) {
- bch2_fs_inconsistent(c,
+ bch2_trans_inconsistent(trans,
"pointer to nonexistent lru %llu:%llu",
id, time);
ret = -EIO;
existing_idx = le64_to_cpu(bkey_s_c_to_lru(k).v->idx);
if (existing_idx != idx) {
- bch2_fs_inconsistent(c,
+ bch2_trans_inconsistent(trans,
"lru %llu:%llu with wrong backpointer: got %llu, should be %llu",
id, time, existing_idx, idx);
ret = -EIO;