diff options
author | Kent Overstreet <kent.overstreet@linux.dev> | 2023-12-16 21:51:34 -0500 |
---|---|---|
committer | Kent Overstreet <kent.overstreet@linux.dev> | 2024-01-01 11:47:42 -0500 |
commit | 44ddd8ad1e0be697cf090af669765b3a8b8965dc (patch) | |
tree | 858bdb69ca9fda16c63dd03d7e9e2be19c9bf07b /fs/bcachefs/fsck.c | |
parent | 3a860b5ad5f7fb851d1a9de5cd09b3e6e95362b2 (diff) | |
download | linux-44ddd8ad1e0be697cf090af669765b3a8b8965dc.tar.gz linux-44ddd8ad1e0be697cf090af669765b3a8b8965dc.tar.bz2 linux-44ddd8ad1e0be697cf090af669765b3a8b8965dc.zip |
bcachefs: kill for_each_btree_key_old_upto()
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
Diffstat (limited to 'fs/bcachefs/fsck.c')
-rw-r--r-- | fs/bcachefs/fsck.c | 30 |
1 files changed, 12 insertions, 18 deletions
diff --git a/fs/bcachefs/fsck.c b/fs/bcachefs/fsck.c index c3c0b9c1dba2..3e66f244a67e 100644 --- a/fs/bcachefs/fsck.c +++ b/fs/bcachefs/fsck.c @@ -30,16 +30,15 @@ static s64 bch2_count_inode_sectors(struct btree_trans *trans, u64 inum, struct btree_iter iter; struct bkey_s_c k; u64 sectors = 0; - int ret; - for_each_btree_key_old_upto(trans, iter, BTREE_ID_extents, - SPOS(inum, 0, snapshot), - POS(inum, U64_MAX), - 0, k, ret) + int ret = for_each_btree_key_upto(trans, iter, BTREE_ID_extents, + SPOS(inum, 0, snapshot), + POS(inum, U64_MAX), + 0, k, ({ if (bkey_extent_is_allocation(k.k)) sectors += k.k->size; - - bch2_trans_iter_exit(trans, &iter); + 0; + })); return ret ?: sectors; } @@ -49,22 +48,17 @@ static s64 bch2_count_subdirs(struct btree_trans *trans, u64 inum, { struct btree_iter iter; struct bkey_s_c k; - struct bkey_s_c_dirent d; u64 subdirs = 0; - int ret; - for_each_btree_key_old_upto(trans, iter, BTREE_ID_dirents, + int ret = for_each_btree_key_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; - - d = bkey_s_c_to_dirent(k); - if (d.v->d_type == DT_DIR) + 0, k, ({ + if (k.k->type == KEY_TYPE_dirent && + bkey_s_c_to_dirent(k).v->d_type == DT_DIR) subdirs++; - } - bch2_trans_iter_exit(trans, &iter); + 0; + })); return ret ?: subdirs; } |