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
3745efd6
Commit
3745efd6
authored
Sep 13, 2019
by
Kent Overstreet
Committed by
Kent Overstreet
Oct 22, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bcachefs: Improve btree_iter_pos_in_node()
Signed-off-by:
Kent Overstreet
<
kent.overstreet@linux.dev
>
parent
a9d1f910
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
3 deletions
+14
-3
fs/bcachefs/btree_iter.c
fs/bcachefs/btree_iter.c
+14
-3
No files found.
fs/bcachefs/btree_iter.c
View file @
3745efd6
...
@@ -742,18 +742,29 @@ static void btree_iter_verify_new_node(struct btree_iter *iter, struct btree *b)
...
@@ -742,18 +742,29 @@ static void btree_iter_verify_new_node(struct btree_iter *iter, struct btree *b)
btree_node_unlock
(
iter
,
b
->
c
.
level
+
1
);
btree_node_unlock
(
iter
,
b
->
c
.
level
+
1
);
}
}
static
inline
bool
btree_iter_pos_before_node
(
struct
btree_iter
*
iter
,
struct
btree
*
b
)
{
return
bkey_cmp
(
iter
->
pos
,
b
->
data
->
min_key
)
<
0
;
}
static
inline
bool
btree_iter_pos_after_node
(
struct
btree_iter
*
iter
,
static
inline
bool
btree_iter_pos_after_node
(
struct
btree_iter
*
iter
,
struct
btree
*
b
)
struct
btree
*
b
)
{
{
return
__btree_iter_pos_cmp
(
iter
,
NULL
,
int
cmp
=
bkey_cmp
(
b
->
key
.
k
.
p
,
iter
->
pos
);
bkey_to_packed
(
&
b
->
key
),
true
)
<
0
;
if
(
!
cmp
&&
(
iter
->
flags
&
BTREE_ITER_IS_EXTENTS
)
&&
bkey_cmp
(
b
->
key
.
k
.
p
,
POS_MAX
))
cmp
=
-
1
;
return
cmp
<
0
;
}
}
static
inline
bool
btree_iter_pos_in_node
(
struct
btree_iter
*
iter
,
static
inline
bool
btree_iter_pos_in_node
(
struct
btree_iter
*
iter
,
struct
btree
*
b
)
struct
btree
*
b
)
{
{
return
iter
->
btree_id
==
b
->
c
.
btree_id
&&
return
iter
->
btree_id
==
b
->
c
.
btree_id
&&
bkey_cmp
(
iter
->
pos
,
b
->
data
->
min_key
)
>=
0
&&
!
btree_iter_pos_before_node
(
iter
,
b
)
&&
!
btree_iter_pos_after_node
(
iter
,
b
);
!
btree_iter_pos_after_node
(
iter
,
b
);
}
}
...
...
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