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
4e3d1899
Commit
4e3d1899
authored
Feb 04, 2023
by
Kent Overstreet
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bcachefs: Inline bch2_btree_path_traverse() fastpath
Signed-off-by:
Kent Overstreet
<
kent.overstreet@linux.dev
>
parent
419fc65f
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
27 deletions
+17
-27
fs/bcachefs/btree_iter.c
fs/bcachefs/btree_iter.c
+5
-27
fs/bcachefs/btree_iter.h
fs/bcachefs/btree_iter.h
+12
-0
No files found.
fs/bcachefs/btree_iter.c
View file @
4e3d1899
...
...
@@ -962,8 +962,6 @@ static __always_inline int btree_path_down(struct btree_trans *trans,
return
ret
;
}
static
int
btree_path_traverse_one
(
struct
btree_trans
*
,
struct
btree_path
*
,
unsigned
,
unsigned
long
);
static
int
bch2_btree_path_traverse_all
(
struct
btree_trans
*
trans
)
{
...
...
@@ -1009,7 +1007,7 @@ static int bch2_btree_path_traverse_all(struct btree_trans *trans)
*/
if
(
path
->
uptodate
)
{
__btree_path_get
(
path
,
false
);
ret
=
btree_path_traverse_one
(
trans
,
path
,
0
,
_THIS_IP_
);
ret
=
b
ch2_b
tree_path_traverse_one
(
trans
,
path
,
0
,
_THIS_IP_
);
__btree_path_put
(
path
,
false
);
if
(
bch2_err_matches
(
ret
,
BCH_ERR_transaction_restart
)
||
...
...
@@ -1114,10 +1112,10 @@ static inline unsigned btree_path_up_until_good_node(struct btree_trans *trans,
* On error, caller (peek_node()/peek_key()) must return NULL; the error is
* stashed in the iterator and returned from bch2_trans_exit().
*/
static
int
btree_path_traverse_one
(
struct
btree_trans
*
trans
,
struct
btree_path
*
path
,
unsigned
flags
,
unsigned
long
trace_ip
)
int
bch2_
btree_path_traverse_one
(
struct
btree_trans
*
trans
,
struct
btree_path
*
path
,
unsigned
flags
,
unsigned
long
trace_ip
)
{
unsigned
depth_want
=
path
->
level
;
int
ret
=
-
((
int
)
trans
->
restarted
);
...
...
@@ -1181,26 +1179,6 @@ static int btree_path_traverse_one(struct btree_trans *trans,
return
ret
;
}
int
__must_check
bch2_btree_path_traverse
(
struct
btree_trans
*
trans
,
struct
btree_path
*
path
,
unsigned
flags
)
{
if
(
0
&&
IS_ENABLED
(
CONFIG_BCACHEFS_DEBUG
))
{
unsigned
restart_probability_bits
=
4
<<
min
(
trans
->
restart_count
,
32U
);
u64
max
=
~
(
~
0ULL
<<
restart_probability_bits
);
if
(
!
get_random_u32_below
(
max
))
{
trace_and_count
(
trans
->
c
,
trans_restart_injected
,
trans
,
_RET_IP_
);
return
btree_trans_restart
(
trans
,
BCH_ERR_transaction_restart_fault_inject
);
}
}
if
(
path
->
uptodate
<
BTREE_ITER_NEED_RELOCK
)
return
0
;
return
bch2_trans_cond_resched
(
trans
)
?:
btree_path_traverse_one
(
trans
,
path
,
flags
,
_RET_IP_
);
}
static
inline
void
btree_path_copy
(
struct
btree_trans
*
trans
,
struct
btree_path
*
dst
,
struct
btree_path
*
src
)
{
...
...
fs/bcachefs/btree_iter.h
View file @
4e3d1899
...
...
@@ -174,6 +174,18 @@ bch2_btree_path_set_pos(struct btree_trans *trans,
:
path
;
}
int
__must_check
bch2_btree_path_traverse_one
(
struct
btree_trans
*
,
struct
btree_path
*
,
unsigned
,
unsigned
long
);
static
inline
int
__must_check
bch2_btree_path_traverse
(
struct
btree_trans
*
trans
,
struct
btree_path
*
path
,
unsigned
flags
)
{
if
(
path
->
uptodate
<
BTREE_ITER_NEED_RELOCK
)
return
0
;
return
bch2_btree_path_traverse_one
(
trans
,
path
,
flags
,
_RET_IP_
);
}
int
__must_check
bch2_btree_path_traverse
(
struct
btree_trans
*
,
struct
btree_path
*
,
unsigned
);
struct
btree_path
*
bch2_path_get
(
struct
btree_trans
*
,
enum
btree_id
,
struct
bpos
,
...
...
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