bcachefs: Rename for_each_btree_key2() -> for_each_btree_key()
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
This commit is contained in:
parent
27b2df982f
commit
5028b9078c
@ -544,8 +544,8 @@ int bch2_bucket_gens_init(struct bch_fs *c)
|
||||
u8 gen;
|
||||
int ret;
|
||||
|
||||
ret = for_each_btree_key2(trans, iter, BTREE_ID_alloc, POS_MIN,
|
||||
BTREE_ITER_PREFETCH, k, ({
|
||||
ret = for_each_btree_key(trans, iter, BTREE_ID_alloc, POS_MIN,
|
||||
BTREE_ITER_PREFETCH, k, ({
|
||||
/*
|
||||
* Not a fsck error because this is checked/repaired by
|
||||
* bch2_check_alloc_key() which runs later:
|
||||
@ -600,8 +600,8 @@ int bch2_alloc_read(struct bch_fs *c)
|
||||
const struct bch_bucket_gens *g;
|
||||
u64 b;
|
||||
|
||||
ret = for_each_btree_key2(trans, iter, BTREE_ID_bucket_gens, POS_MIN,
|
||||
BTREE_ITER_PREFETCH, k, ({
|
||||
ret = for_each_btree_key(trans, iter, BTREE_ID_bucket_gens, POS_MIN,
|
||||
BTREE_ITER_PREFETCH, k, ({
|
||||
u64 start = bucket_gens_pos_to_alloc(k.k->p, 0).offset;
|
||||
u64 end = bucket_gens_pos_to_alloc(bpos_nosnap_successor(k.k->p), 0).offset;
|
||||
|
||||
@ -628,8 +628,8 @@ int bch2_alloc_read(struct bch_fs *c)
|
||||
} else {
|
||||
struct bch_alloc_v4 a;
|
||||
|
||||
ret = for_each_btree_key2(trans, iter, BTREE_ID_alloc, POS_MIN,
|
||||
BTREE_ITER_PREFETCH, k, ({
|
||||
ret = for_each_btree_key(trans, iter, BTREE_ID_alloc, POS_MIN,
|
||||
BTREE_ITER_PREFETCH, k, ({
|
||||
/*
|
||||
* Not a fsck error because this is checked/repaired by
|
||||
* bch2_check_alloc_key() which runs later:
|
||||
@ -1427,7 +1427,7 @@ bkey_err:
|
||||
if (ret < 0)
|
||||
goto err;
|
||||
|
||||
ret = for_each_btree_key2(trans, iter,
|
||||
ret = for_each_btree_key(trans, iter,
|
||||
BTREE_ID_need_discard, POS_MIN,
|
||||
BTREE_ITER_PREFETCH, k,
|
||||
bch2_check_discard_freespace_key(trans, &iter));
|
||||
@ -1693,8 +1693,8 @@ static void bch2_do_discards_work(struct work_struct *work)
|
||||
* successful commit:
|
||||
*/
|
||||
ret = bch2_trans_run(c,
|
||||
for_each_btree_key2(trans, iter,
|
||||
BTREE_ID_need_discard, POS_MIN, 0, k,
|
||||
for_each_btree_key(trans, iter,
|
||||
BTREE_ID_need_discard, POS_MIN, 0, k,
|
||||
bch2_discard_one_bucket(trans, &iter, &discard_pos_done,
|
||||
&seen,
|
||||
&open,
|
||||
|
@ -1538,8 +1538,8 @@ static int bch2_gc_alloc_start(struct bch_fs *c, bool metadata_only)
|
||||
rcu_assign_pointer(ca->buckets_gc, buckets);
|
||||
}
|
||||
|
||||
ret = for_each_btree_key2(trans, iter, BTREE_ID_alloc, POS_MIN,
|
||||
BTREE_ITER_PREFETCH, k, ({
|
||||
ret = for_each_btree_key(trans, iter, BTREE_ID_alloc, POS_MIN,
|
||||
BTREE_ITER_PREFETCH, k, ({
|
||||
ca = bch_dev_bkey_exists(c, k.k->p.inode);
|
||||
g = gc_bucket(ca, k.k->p.offset);
|
||||
|
||||
@ -1676,8 +1676,8 @@ static int bch2_gc_reflink_start(struct bch_fs *c,
|
||||
c->reflink_gc_nr = 0;
|
||||
|
||||
ret = bch2_trans_run(c,
|
||||
for_each_btree_key2(trans, iter, BTREE_ID_reflink, POS_MIN,
|
||||
BTREE_ITER_PREFETCH, k, ({
|
||||
for_each_btree_key(trans, iter, BTREE_ID_reflink, POS_MIN,
|
||||
BTREE_ITER_PREFETCH, k, ({
|
||||
const __le64 *refcount = bkey_refcount_c(k);
|
||||
|
||||
if (!refcount)
|
||||
|
@ -725,8 +725,8 @@ transaction_restart: \
|
||||
_ret3; \
|
||||
})
|
||||
|
||||
#define for_each_btree_key2(_trans, _iter, _btree_id, \
|
||||
_start, _flags, _k, _do) \
|
||||
#define for_each_btree_key(_trans, _iter, _btree_id, \
|
||||
_start, _flags, _k, _do) \
|
||||
for_each_btree_key2_upto(_trans, _iter, _btree_id, _start, \
|
||||
SPOS_MAX, _flags, _k, _do)
|
||||
|
||||
@ -757,7 +757,7 @@ transaction_restart: \
|
||||
_start, _iter_flags, _k, \
|
||||
_disk_res, _journal_seq, _commit_flags,\
|
||||
_do) \
|
||||
for_each_btree_key2(_trans, _iter, _btree_id, _start, _iter_flags, _k,\
|
||||
for_each_btree_key(_trans, _iter, _btree_id, _start, _iter_flags, _k,\
|
||||
(_do) ?: bch2_trans_commit(_trans, (_disk_res),\
|
||||
(_journal_seq), (_commit_flags)))
|
||||
|
||||
|
@ -380,9 +380,9 @@ static ssize_t bch2_read_btree(struct file *file, char __user *buf,
|
||||
return ret;
|
||||
|
||||
trans = bch2_trans_get(i->c);
|
||||
ret = for_each_btree_key2(trans, iter, i->id, i->from,
|
||||
BTREE_ITER_PREFETCH|
|
||||
BTREE_ITER_ALL_SNAPSHOTS, k, ({
|
||||
ret = for_each_btree_key(trans, iter, i->id, i->from,
|
||||
BTREE_ITER_PREFETCH|
|
||||
BTREE_ITER_ALL_SNAPSHOTS, k, ({
|
||||
bch2_bkey_val_to_text(&i->buf, i->c, k);
|
||||
prt_newline(&i->buf);
|
||||
bch2_trans_unlock(trans);
|
||||
@ -478,9 +478,9 @@ static ssize_t bch2_read_bfloat_failed(struct file *file, char __user *buf,
|
||||
|
||||
trans = bch2_trans_get(i->c);
|
||||
|
||||
ret = for_each_btree_key2(trans, iter, i->id, i->from,
|
||||
BTREE_ITER_PREFETCH|
|
||||
BTREE_ITER_ALL_SNAPSHOTS, k, ({
|
||||
ret = for_each_btree_key(trans, iter, i->id, i->from,
|
||||
BTREE_ITER_PREFETCH|
|
||||
BTREE_ITER_ALL_SNAPSHOTS, k, ({
|
||||
struct btree_path_level *l = &iter.path->l[0];
|
||||
struct bkey_packed *_k =
|
||||
bch2_btree_node_iter_peek(&l->iter, l->b);
|
||||
|
@ -1841,8 +1841,8 @@ int bch2_stripes_read(struct bch_fs *c)
|
||||
int ret;
|
||||
|
||||
ret = bch2_trans_run(c,
|
||||
for_each_btree_key2(trans, iter, BTREE_ID_stripes, POS_MIN,
|
||||
BTREE_ITER_PREFETCH, k, ({
|
||||
for_each_btree_key(trans, iter, BTREE_ID_stripes, POS_MIN,
|
||||
BTREE_ITER_PREFETCH, k, ({
|
||||
if (k.k->type != KEY_TYPE_stripe)
|
||||
continue;
|
||||
|
||||
|
@ -2254,11 +2254,11 @@ static int check_nlinks_find_hardlinks(struct bch_fs *c,
|
||||
struct bch_inode_unpacked u;
|
||||
|
||||
int ret = bch2_trans_run(c,
|
||||
for_each_btree_key2(trans, iter, BTREE_ID_inodes,
|
||||
POS(0, start),
|
||||
BTREE_ITER_INTENT|
|
||||
BTREE_ITER_PREFETCH|
|
||||
BTREE_ITER_ALL_SNAPSHOTS, k, ({
|
||||
for_each_btree_key(trans, iter, BTREE_ID_inodes,
|
||||
POS(0, start),
|
||||
BTREE_ITER_INTENT|
|
||||
BTREE_ITER_PREFETCH|
|
||||
BTREE_ITER_ALL_SNAPSHOTS, k, ({
|
||||
if (!bkey_is_inode(k.k))
|
||||
continue;
|
||||
|
||||
@ -2300,10 +2300,10 @@ static int check_nlinks_walk_dirents(struct bch_fs *c, struct nlink_table *links
|
||||
snapshots_seen_init(&s);
|
||||
|
||||
int ret = bch2_trans_run(c,
|
||||
for_each_btree_key2(trans, iter, BTREE_ID_dirents, POS_MIN,
|
||||
BTREE_ITER_INTENT|
|
||||
BTREE_ITER_PREFETCH|
|
||||
BTREE_ITER_ALL_SNAPSHOTS, k, ({
|
||||
for_each_btree_key(trans, iter, BTREE_ID_dirents, POS_MIN,
|
||||
BTREE_ITER_INTENT|
|
||||
BTREE_ITER_PREFETCH|
|
||||
BTREE_ITER_ALL_SNAPSHOTS, k, ({
|
||||
ret = snapshots_seen_update(c, &s, iter.btree_id, k.k->p);
|
||||
if (ret)
|
||||
break;
|
||||
|
@ -59,8 +59,9 @@ int bch2_resume_logged_ops(struct bch_fs *c)
|
||||
int ret;
|
||||
|
||||
ret = bch2_trans_run(c,
|
||||
for_each_btree_key2(trans, iter,
|
||||
BTREE_ID_logged_ops, POS_MIN, BTREE_ITER_PREFETCH, k,
|
||||
for_each_btree_key(trans, iter,
|
||||
BTREE_ID_logged_ops, POS_MIN,
|
||||
BTREE_ITER_PREFETCH, k,
|
||||
resume_logged_op(trans, &iter, k)));
|
||||
if (ret)
|
||||
bch_err_fn(c, ret);
|
||||
|
@ -377,8 +377,8 @@ struct bch_io_opts *bch2_move_get_io_opts(struct btree_trans *trans,
|
||||
|
||||
io_opts->d.nr = 0;
|
||||
|
||||
ret = for_each_btree_key2(trans, iter, BTREE_ID_inodes, POS(0, extent_k.k->p.inode),
|
||||
BTREE_ITER_ALL_SNAPSHOTS, k, ({
|
||||
ret = for_each_btree_key(trans, iter, BTREE_ID_inodes, POS(0, extent_k.k->p.inode),
|
||||
BTREE_ITER_ALL_SNAPSHOTS, k, ({
|
||||
if (k.k->p.offset != extent_k.k->p.inode)
|
||||
break;
|
||||
|
||||
|
@ -617,11 +617,11 @@ int bch2_fs_quota_read(struct bch_fs *c)
|
||||
|
||||
trans = bch2_trans_get(c);
|
||||
|
||||
ret = for_each_btree_key2(trans, iter, BTREE_ID_quotas,
|
||||
POS_MIN, BTREE_ITER_PREFETCH, k,
|
||||
ret = for_each_btree_key(trans, iter, BTREE_ID_quotas, POS_MIN,
|
||||
BTREE_ITER_PREFETCH, k,
|
||||
__bch2_quota_set(c, k, NULL)) ?:
|
||||
for_each_btree_key2(trans, iter, BTREE_ID_inodes,
|
||||
POS_MIN, BTREE_ITER_PREFETCH|BTREE_ITER_ALL_SNAPSHOTS, k,
|
||||
for_each_btree_key(trans, iter, BTREE_ID_inodes, POS_MIN,
|
||||
BTREE_ITER_PREFETCH|BTREE_ITER_ALL_SNAPSHOTS, k,
|
||||
bch2_fs_quota_read_inode(trans, &iter, k));
|
||||
|
||||
bch2_trans_put(trans);
|
||||
|
@ -1402,16 +1402,16 @@ int bch2_delete_dead_snapshots(struct bch_fs *c)
|
||||
goto err;
|
||||
}
|
||||
|
||||
ret = for_each_btree_key2(trans, iter, BTREE_ID_snapshots,
|
||||
POS_MIN, 0, k,
|
||||
ret = for_each_btree_key(trans, iter, BTREE_ID_snapshots,
|
||||
POS_MIN, 0, k,
|
||||
bch2_snapshot_set_equiv(trans, k));
|
||||
if (ret) {
|
||||
bch_err_msg(c, ret, "in bch2_snapshots_set_equiv");
|
||||
goto err;
|
||||
}
|
||||
|
||||
ret = for_each_btree_key2(trans, iter, BTREE_ID_snapshots,
|
||||
POS_MIN, 0, k, ({
|
||||
ret = for_each_btree_key(trans, iter, BTREE_ID_snapshots,
|
||||
POS_MIN, 0, k, ({
|
||||
if (k.k->type != KEY_TYPE_snapshot)
|
||||
continue;
|
||||
|
||||
@ -1466,8 +1466,8 @@ int bch2_delete_dead_snapshots(struct bch_fs *c)
|
||||
bch2_trans_unlock(trans);
|
||||
down_write(&c->snapshot_create_lock);
|
||||
|
||||
ret = for_each_btree_key2(trans, iter, BTREE_ID_snapshots,
|
||||
POS_MIN, 0, k, ({
|
||||
ret = for_each_btree_key(trans, iter, BTREE_ID_snapshots,
|
||||
POS_MIN, 0, k, ({
|
||||
u32 snapshot = k.k->p.offset;
|
||||
u32 equiv = bch2_snapshot_equiv(c, snapshot);
|
||||
|
||||
@ -1693,13 +1693,13 @@ int bch2_snapshots_read(struct bch_fs *c)
|
||||
int ret = 0;
|
||||
|
||||
ret = bch2_trans_run(c,
|
||||
for_each_btree_key2(trans, iter, BTREE_ID_snapshots,
|
||||
POS_MIN, 0, k,
|
||||
for_each_btree_key(trans, iter, BTREE_ID_snapshots,
|
||||
POS_MIN, 0, k,
|
||||
bch2_mark_snapshot(trans, BTREE_ID_snapshots, 0, bkey_s_c_null, k, 0) ?:
|
||||
bch2_snapshot_set_equiv(trans, k) ?:
|
||||
bch2_check_snapshot_needs_deletion(trans, k)) ?:
|
||||
for_each_btree_key2(trans, iter, BTREE_ID_snapshots,
|
||||
POS_MIN, 0, k,
|
||||
for_each_btree_key(trans, iter, BTREE_ID_snapshots,
|
||||
POS_MIN, 0, k,
|
||||
(set_is_ancestor_bitmap(c, k.k->p.offset), 0)));
|
||||
if (ret)
|
||||
bch_err_fn(c, ret);
|
||||
|
@ -278,8 +278,8 @@ static int bch2_compression_stats_to_text(struct printbuf *out, struct bch_fs *c
|
||||
if (!btree_type_has_ptrs(id))
|
||||
continue;
|
||||
|
||||
ret = for_each_btree_key2(trans, iter, id, POS_MIN,
|
||||
BTREE_ITER_ALL_SNAPSHOTS, k, ({
|
||||
ret = for_each_btree_key(trans, iter, id, POS_MIN,
|
||||
BTREE_ITER_ALL_SNAPSHOTS, k, ({
|
||||
struct bkey_ptrs_c ptrs = bch2_bkey_ptrs_c(k);
|
||||
struct bch_extent_crc_unpacked crc;
|
||||
const union bch_extent_entry *entry;
|
||||
|
Loading…
Reference in New Issue
Block a user