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
b7607ce9
Commit
b7607ce9
authored
May 10, 2019
by
Kent Overstreet
Committed by
Kent Overstreet
Oct 22, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bcachefs: Kill remaining bch2_btree_iter_unlock() uses
Signed-off-by:
Kent Overstreet
<
kent.overstreet@linux.dev
>
parent
7cfac5f5
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
12 additions
and
21 deletions
+12
-21
fs/bcachefs/btree_iter.c
fs/bcachefs/btree_iter.c
+1
-11
fs/bcachefs/btree_iter.h
fs/bcachefs/btree_iter.h
+0
-2
fs/bcachefs/btree_update_interior.c
fs/bcachefs/btree_update_interior.c
+11
-8
No files found.
fs/bcachefs/btree_iter.c
View file @
b7607ce9
...
...
@@ -389,16 +389,6 @@ void __bch2_btree_iter_downgrade(struct btree_iter *iter,
bch2_btree_trans_verify_locks
(
iter
->
trans
);
}
int
bch2_btree_iter_unlock
(
struct
btree_iter
*
iter
)
{
struct
btree_iter
*
linked
;
trans_for_each_iter
(
iter
->
trans
,
linked
)
__bch2_btree_iter_unlock
(
linked
);
return
btree_iter_err
(
iter
);
}
bool
bch2_btree_trans_relock
(
struct
btree_trans
*
trans
)
{
struct
btree_iter
*
iter
;
...
...
@@ -1041,7 +1031,7 @@ static unsigned btree_iter_up_until_locked(struct btree_iter *iter,
* Returns 0 on success, -EIO on error (error reading in a btree node).
*
* On error, caller (peek_node()/peek_key()) must return NULL; the error is
* stashed in the iterator and returned from bch2_
btree_iter_unlock
().
* stashed in the iterator and returned from bch2_
trans_exit
().
*/
int
__must_check
__bch2_btree_iter_traverse
(
struct
btree_iter
*
iter
)
{
...
...
fs/bcachefs/btree_iter.h
View file @
b7607ce9
...
...
@@ -105,8 +105,6 @@ void bch2_btree_node_iter_fix(struct btree_iter *, struct btree *,
struct
btree_node_iter
*
,
struct
bkey_packed
*
,
unsigned
,
unsigned
);
int
bch2_btree_iter_unlock
(
struct
btree_iter
*
);
bool
bch2_btree_trans_relock
(
struct
btree_trans
*
);
void
bch2_btree_trans_unlock
(
struct
btree_trans
*
);
...
...
fs/bcachefs/btree_update_interior.c
View file @
b7607ce9
...
...
@@ -1551,6 +1551,7 @@ void bch2_btree_insert_node(struct btree_update *as, struct btree *b,
int
bch2_btree_split_leaf
(
struct
bch_fs
*
c
,
struct
btree_iter
*
iter
,
unsigned
flags
)
{
struct
btree_trans
*
trans
=
iter
->
trans
;
struct
btree
*
b
=
iter
->
l
[
0
].
b
;
struct
btree_update
*
as
;
struct
closure
cl
;
...
...
@@ -1561,7 +1562,7 @@ int bch2_btree_split_leaf(struct bch_fs *c, struct btree_iter *iter,
* We already have a disk reservation and open buckets pinned; this
* allocation must not block:
*/
trans_for_each_iter
(
iter
->
trans
,
linked
)
trans_for_each_iter
(
trans
,
linked
)
if
(
linked
->
btree_id
==
BTREE_ID_EXTENTS
)
flags
|=
BTREE_INSERT_USE_RESERVE
;
...
...
@@ -1573,10 +1574,10 @@ int bch2_btree_split_leaf(struct bch_fs *c, struct btree_iter *iter,
if
(
flags
&
BTREE_INSERT_NOUNLOCK
)
return
-
EINTR
;
bch2_btree_trans_unlock
(
iter
->
trans
);
bch2_btree_trans_unlock
(
trans
);
down_read
(
&
c
->
gc_lock
);
if
(
!
bch2_btree_trans_relock
(
iter
->
trans
))
if
(
!
bch2_btree_trans_relock
(
trans
))
ret
=
-
EINTR
;
}
...
...
@@ -1597,7 +1598,7 @@ int bch2_btree_split_leaf(struct bch_fs *c, struct btree_iter *iter,
ret
=
PTR_ERR
(
as
);
if
(
ret
==
-
EAGAIN
)
{
BUG_ON
(
flags
&
BTREE_INSERT_NOUNLOCK
);
bch2_btree_
iter_unlock
(
iter
);
bch2_btree_
trans_unlock
(
trans
);
ret
=
-
EINTR
;
}
goto
out
;
...
...
@@ -1624,6 +1625,7 @@ void __bch2_foreground_maybe_merge(struct bch_fs *c,
unsigned
flags
,
enum
btree_node_sibling
sib
)
{
struct
btree_trans
*
trans
=
iter
->
trans
;
struct
btree_update
*
as
;
struct
bkey_format_state
new_s
;
struct
bkey_format
new_f
;
...
...
@@ -1778,7 +1780,7 @@ void __bch2_foreground_maybe_merge(struct bch_fs *c,
if
(
flags
&
BTREE_INSERT_NOUNLOCK
)
goto
out
;
bch2_btree_
iter_unlock
(
iter
);
bch2_btree_
trans_unlock
(
trans
);
down_read
(
&
c
->
gc_lock
);
up_read
(
&
c
->
gc_lock
);
...
...
@@ -1794,7 +1796,7 @@ void __bch2_foreground_maybe_merge(struct bch_fs *c,
if
((
ret
==
-
EAGAIN
||
ret
==
-
EINTR
)
&&
!
(
flags
&
BTREE_INSERT_NOUNLOCK
))
{
bch2_btree_
iter_unlock
(
iter
);
bch2_btree_
trans_unlock
(
trans
);
closure_sync
(
&
cl
);
ret
=
bch2_btree_iter_traverse
(
iter
);
if
(
ret
)
...
...
@@ -1861,6 +1863,7 @@ static int __btree_node_rewrite(struct bch_fs *c, struct btree_iter *iter,
int
bch2_btree_node_rewrite
(
struct
bch_fs
*
c
,
struct
btree_iter
*
iter
,
__le64
seq
,
unsigned
flags
)
{
struct
btree_trans
*
trans
=
iter
->
trans
;
struct
closure
cl
;
struct
btree
*
b
;
int
ret
;
...
...
@@ -1873,7 +1876,7 @@ int bch2_btree_node_rewrite(struct bch_fs *c, struct btree_iter *iter,
if
(
!
(
flags
&
BTREE_INSERT_GC_LOCK_HELD
))
{
if
(
!
down_read_trylock
(
&
c
->
gc_lock
))
{
bch2_btree_
iter_unlock
(
iter
);
bch2_btree_
trans_unlock
(
trans
);
down_read
(
&
c
->
gc_lock
);
}
}
...
...
@@ -1892,7 +1895,7 @@ int bch2_btree_node_rewrite(struct bch_fs *c, struct btree_iter *iter,
ret
!=
-
EINTR
)
break
;
bch2_btree_
iter_unlock
(
iter
);
bch2_btree_
trans_unlock
(
trans
);
closure_sync
(
&
cl
);
}
...
...
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