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
22b383ad
Commit
22b383ad
authored
Sep 05, 2021
by
Kent Overstreet
Committed by
Kent Overstreet
Oct 22, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bcachefs: Kill retry loop in btree merge path
Signed-off-by:
Kent Overstreet
<
kent.overstreet@gmail.com
>
parent
f48361b0
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
34 deletions
+6
-34
fs/bcachefs/btree_update_interior.c
fs/bcachefs/btree_update_interior.c
+5
-29
fs/bcachefs/btree_update_interior.h
fs/bcachefs/btree_update_interior.h
+1
-5
No files found.
fs/bcachefs/btree_update_interior.c
View file @
22b383ad
...
...
@@ -1572,12 +1572,7 @@ int __bch2_foreground_maybe_merge(struct btree_trans *trans,
struct
btree
*
b
,
*
m
,
*
n
,
*
prev
,
*
next
,
*
parent
;
struct
bpos
sib_pos
;
size_t
sib_u64s
;
int
ret
=
0
,
ret2
=
0
;
retry:
ret
=
bch2_btree_path_traverse
(
trans
,
path
,
false
);
if
(
ret
)
return
ret
;
int
ret
=
0
;
BUG_ON
(
!
path
->
should_be_locked
);
BUG_ON
(
!
btree_node_locked
(
path
,
level
));
...
...
@@ -1587,7 +1582,7 @@ int __bch2_foreground_maybe_merge(struct btree_trans *trans,
if
((
sib
==
btree_prev_sib
&&
!
bpos_cmp
(
b
->
data
->
min_key
,
POS_MIN
))
||
(
sib
==
btree_next_sib
&&
!
bpos_cmp
(
b
->
data
->
max_key
,
SPOS_MAX
)))
{
b
->
sib_u64s
[
sib
]
=
U16_MAX
;
goto
out
;
return
0
;
}
sib_pos
=
sib
==
btree_prev_sib
...
...
@@ -1715,29 +1710,10 @@ int __bch2_foreground_maybe_merge(struct btree_trans *trans,
bch2_btree_update_done
(
as
);
out:
bch2_trans_verify_locks
(
trans
);
if
(
sib_path
)
bch2_path_put
(
trans
,
sib_path
,
true
);
/*
* Don't downgrade locks here: we're called after successful insert,
* and the caller will downgrade locks after a successful insert
* anyways (in case e.g. a split was required first)
*
* And we're also called when inserting into interior nodes in the
* split path, and downgrading to read locks in there is potentially
* confusing:
*/
return
ret
?:
ret2
;
err:
if
(
sib_path
)
bch2_path_put
(
trans
,
sib_path
,
true
);
sib_path
=
NULL
;
if
(
ret
==
-
EINTR
&&
bch2_trans_relock
(
trans
))
goto
retry
;
goto
out
;
bch2_path_put
(
trans
,
sib_path
,
true
);
bch2_trans_verify_locks
(
trans
);
return
ret
;
}
/**
...
...
fs/bcachefs/btree_update_interior.h
View file @
22b383ad
...
...
@@ -129,11 +129,7 @@ static inline int bch2_foreground_maybe_merge_sibling(struct btree_trans *trans,
{
struct
btree
*
b
;
if
(
path
->
uptodate
>=
BTREE_ITER_NEED_TRAVERSE
)
return
0
;
if
(
!
bch2_btree_node_relock
(
trans
,
path
,
level
))
return
0
;
EBUG_ON
(
!
btree_node_locked
(
path
,
level
));
b
=
path
->
l
[
level
].
b
;
if
(
b
->
sib_u64s
[
sib
]
>
trans
->
c
->
btree_foreground_merge_threshold
)
...
...
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