Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
linux
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
linux
Commits
44ddd8ad
Commit
44ddd8ad
authored
Dec 16, 2023
by
Kent Overstreet
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bcachefs: kill for_each_btree_key_old_upto()
Signed-off-by:
Kent Overstreet
<
kent.overstreet@linux.dev
>
parent
3a860b5a
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
27 deletions
+12
-27
fs/bcachefs/btree_iter.h
fs/bcachefs/btree_iter.h
+0
-9
fs/bcachefs/fsck.c
fs/bcachefs/fsck.c
+12
-18
No files found.
fs/bcachefs/btree_iter.h
View file @
44ddd8ad
...
...
@@ -784,15 +784,6 @@ transaction_restart: \
!((_ret) = bkey_err(_k)) && (_k).k; \
bch2_btree_iter_advance(&(_iter)))
#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)); \
(_k) = __bch2_btree_iter_peek_upto_and_restart((_trans), \
&(_iter), _end, _flags),\
!((_ret) = bkey_err(_k)) && (_k).k; \
bch2_btree_iter_advance(&(_iter)))
#define for_each_btree_key_norestart(_trans, _iter, _btree_id, \
_start, _flags, _k, _ret) \
for (bch2_trans_iter_init((_trans), &(_iter), (_btree_id), \
...
...
fs/bcachefs/fsck.c
View file @
44ddd8ad
...
...
@@ -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
;
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment