summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKent Overstreet <kent.overstreet@linux.dev>2023-12-17 03:46:23 +0100
committerKent Overstreet <kent.overstreet@linux.dev>2024-01-01 17:47:42 +0100
commit3a860b5ad5f7fb851d1a9de5cd09b3e6e95362b2 (patch)
tree8db9bb5c92af41462e18c6d5b1403d414f4e2ae4
parentbcachefs: bch2_dirent_lookup() -> lockrestart_do() (diff)
downloadlinux-3a860b5ad5f7fb851d1a9de5cd09b3e6e95362b2.tar.xz
linux-3a860b5ad5f7fb851d1a9de5cd09b3e6e95362b2.zip
bcachefs: for_each_btree_key_upto() -> for_each_btree_key_old_upto()
And for_each_btree_key2_upto -> for_each_btree_key_upto Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
-rw-r--r--fs/bcachefs/alloc_background.c2
-rw-r--r--fs/bcachefs/btree_iter.h12
-rw-r--r--fs/bcachefs/fsck.c16
-rw-r--r--fs/bcachefs/movinggc.c2
-rw-r--r--fs/bcachefs/tests.c14
5 files changed, 23 insertions, 23 deletions
diff --git a/fs/bcachefs/alloc_background.c b/fs/bcachefs/alloc_background.c
index 006ac48ec102..0aa1a8c6301c 100644
--- a/fs/bcachefs/alloc_background.c
+++ b/fs/bcachefs/alloc_background.c
@@ -1818,7 +1818,7 @@ static void bch2_do_invalidates_work(struct work_struct *work)
s64 nr_to_invalidate =
should_invalidate_buckets(ca, bch2_dev_usage_read(ca));
- ret = for_each_btree_key2_upto(trans, iter, BTREE_ID_lru,
+ ret = for_each_btree_key_upto(trans, iter, BTREE_ID_lru,
lru_pos(ca->dev_idx, 0, 0),
lru_pos(ca->dev_idx, U64_MAX, LRU_TIME_MAX),
BTREE_ITER_INTENT, k,
diff --git a/fs/bcachefs/btree_iter.h b/fs/bcachefs/btree_iter.h
index c8745d5bdc27..8e0e579400b5 100644
--- a/fs/bcachefs/btree_iter.h
+++ b/fs/bcachefs/btree_iter.h
@@ -701,8 +701,8 @@ transaction_restart: \
_ret2 ?: trans_was_restarted(_trans, _restart_count); \
})
-#define for_each_btree_key2_upto(_trans, _iter, _btree_id, \
- _start, _end, _flags, _k, _do) \
+#define for_each_btree_key_upto(_trans, _iter, _btree_id, \
+ _start, _end, _flags, _k, _do) \
({ \
int _ret3 = 0; \
\
@@ -726,7 +726,7 @@ transaction_restart: \
#define for_each_btree_key(_trans, _iter, _btree_id, \
_start, _flags, _k, _do) \
- for_each_btree_key2_upto(_trans, _iter, _btree_id, _start, \
+ for_each_btree_key_upto(_trans, _iter, _btree_id, _start, \
SPOS_MAX, _flags, _k, _do)
#define for_each_btree_key_reverse(_trans, _iter, _btree_id, \
@@ -772,11 +772,11 @@ transaction_restart: \
_start, _end, _iter_flags, _k, \
_disk_res, _journal_seq, _commit_flags,\
_do) \
- for_each_btree_key2_upto(_trans, _iter, _btree_id, _start, _end, _iter_flags, _k,\
+ for_each_btree_key_upto(_trans, _iter, _btree_id, _start, _end, _iter_flags, _k,\
(_do) ?: bch2_trans_commit(_trans, (_disk_res),\
(_journal_seq), (_commit_flags)))
-#define for_each_btree_key_old(_trans, _iter, _btree_id, \
+#define for_each_btree_key_old(_trans, _iter, _btree_id, \
_start, _flags, _k, _ret) \
for (bch2_trans_iter_init((_trans), &(_iter), (_btree_id), \
(_start), (_flags)); \
@@ -784,7 +784,7 @@ transaction_restart: \
!((_ret) = bkey_err(_k)) && (_k).k; \
bch2_btree_iter_advance(&(_iter)))
-#define for_each_btree_key_upto(_trans, _iter, _btree_id, \
+#define for_each_btree_key_old_upto(_trans, _iter, _btree_id, \
_start, _end, _flags, _k, _ret) \
for (bch2_trans_iter_init((_trans), &(_iter), (_btree_id), \
(_start), (_flags)); \
diff --git a/fs/bcachefs/fsck.c b/fs/bcachefs/fsck.c
index 52438f86530f..c3c0b9c1dba2 100644
--- a/fs/bcachefs/fsck.c
+++ b/fs/bcachefs/fsck.c
@@ -32,10 +32,10 @@ static s64 bch2_count_inode_sectors(struct btree_trans *trans, u64 inum,
u64 sectors = 0;
int ret;
- for_each_btree_key_upto(trans, iter, BTREE_ID_extents,
- SPOS(inum, 0, snapshot),
- POS(inum, U64_MAX),
- 0, k, ret)
+ for_each_btree_key_old_upto(trans, iter, BTREE_ID_extents,
+ SPOS(inum, 0, snapshot),
+ POS(inum, U64_MAX),
+ 0, k, ret)
if (bkey_extent_is_allocation(k.k))
sectors += k.k->size;
@@ -53,10 +53,10 @@ static s64 bch2_count_subdirs(struct btree_trans *trans, u64 inum,
u64 subdirs = 0;
int ret;
- for_each_btree_key_upto(trans, iter, BTREE_ID_dirents,
- SPOS(inum, 0, snapshot),
- POS(inum, U64_MAX),
- 0, k, ret) {
+ for_each_btree_key_old_upto(trans, iter, BTREE_ID_dirents,
+ SPOS(inum, 0, snapshot),
+ POS(inum, U64_MAX),
+ 0, k, ret) {
if (k.k->type != KEY_TYPE_dirent)
continue;
diff --git a/fs/bcachefs/movinggc.c b/fs/bcachefs/movinggc.c
index abe925e705a4..4aa8ef583037 100644
--- a/fs/bcachefs/movinggc.c
+++ b/fs/bcachefs/movinggc.c
@@ -161,7 +161,7 @@ static int bch2_copygc_get_buckets(struct moving_context *ctxt,
__func__, bch2_err_str(ret)))
return ret;
- ret = for_each_btree_key2_upto(trans, iter, BTREE_ID_lru,
+ ret = for_each_btree_key_upto(trans, iter, BTREE_ID_lru,
lru_pos(BCH_LRU_FRAGMENTATION_START, 0, 0),
lru_pos(BCH_LRU_FRAGMENTATION_START, U64_MAX, LRU_TIME_MAX),
0, k, ({
diff --git a/fs/bcachefs/tests.c b/fs/bcachefs/tests.c
index 2fc9e60c754b..7ffb58b80d3d 100644
--- a/fs/bcachefs/tests.c
+++ b/fs/bcachefs/tests.c
@@ -134,7 +134,7 @@ static int test_iterate(struct bch_fs *c, u64 nr)
i = 0;
- ret = for_each_btree_key2_upto(trans, iter, BTREE_ID_xattrs,
+ ret = for_each_btree_key_upto(trans, iter, BTREE_ID_xattrs,
SPOS(0, 0, U32_MAX), POS(0, U64_MAX),
0, k, ({
BUG_ON(k.k->p.offset != i++);
@@ -195,7 +195,7 @@ static int test_iterate_extents(struct bch_fs *c, u64 nr)
i = 0;
- ret = for_each_btree_key2_upto(trans, iter, BTREE_ID_extents,
+ ret = for_each_btree_key_upto(trans, iter, BTREE_ID_extents,
SPOS(0, 0, U32_MAX), POS(0, U64_MAX),
0, k, ({
BUG_ON(bkey_start_offset(k.k) != i);
@@ -257,7 +257,7 @@ static int test_iterate_slots(struct bch_fs *c, u64 nr)
i = 0;
- ret = for_each_btree_key2_upto(trans, iter, BTREE_ID_xattrs,
+ ret = for_each_btree_key_upto(trans, iter, BTREE_ID_xattrs,
SPOS(0, 0, U32_MAX), POS(0, U64_MAX),
0, k, ({
BUG_ON(k.k->p.offset != i);
@@ -274,7 +274,7 @@ static int test_iterate_slots(struct bch_fs *c, u64 nr)
i = 0;
- ret = for_each_btree_key2_upto(trans, iter, BTREE_ID_xattrs,
+ ret = for_each_btree_key_upto(trans, iter, BTREE_ID_xattrs,
SPOS(0, 0, U32_MAX), POS(0, U64_MAX),
BTREE_ITER_SLOTS, k, ({
if (i >= nr * 2)
@@ -326,7 +326,7 @@ static int test_iterate_slots_extents(struct bch_fs *c, u64 nr)
i = 0;
- ret = for_each_btree_key2_upto(trans, iter, BTREE_ID_extents,
+ ret = for_each_btree_key_upto(trans, iter, BTREE_ID_extents,
SPOS(0, 0, U32_MAX), POS(0, U64_MAX),
0, k, ({
BUG_ON(bkey_start_offset(k.k) != i + 8);
@@ -344,7 +344,7 @@ static int test_iterate_slots_extents(struct bch_fs *c, u64 nr)
i = 0;
- ret = for_each_btree_key2_upto(trans, iter, BTREE_ID_extents,
+ ret = for_each_btree_key_upto(trans, iter, BTREE_ID_extents,
SPOS(0, 0, U32_MAX), POS(0, U64_MAX),
BTREE_ITER_SLOTS, k, ({
if (i == nr)
@@ -760,7 +760,7 @@ static int seq_lookup(struct bch_fs *c, u64 nr)
struct bkey_s_c k;
return bch2_trans_run(c,
- for_each_btree_key2_upto(trans, iter, BTREE_ID_xattrs,
+ for_each_btree_key_upto(trans, iter, BTREE_ID_xattrs,
SPOS(0, 0, U32_MAX), POS(0, U64_MAX),
0, k,
0));