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
c7495413
Commit
c7495413
authored
Apr 25, 2024
by
Kent Overstreet
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bcachefs: uninline set_btree_iter_dontneed()
Signed-off-by:
Kent Overstreet
<
kent.overstreet@linux.dev
>
parent
0af0b963
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
20 additions
and
18 deletions
+20
-18
fs/bcachefs/alloc_background.c
fs/bcachefs/alloc_background.c
+1
-1
fs/bcachefs/alloc_foreground.c
fs/bcachefs/alloc_foreground.c
+4
-4
fs/bcachefs/btree_iter.c
fs/bcachefs/btree_iter.c
+13
-0
fs/bcachefs/btree_iter.h
fs/bcachefs/btree_iter.h
+1
-12
fs/bcachefs/btree_key_cache.c
fs/bcachefs/btree_key_cache.c
+1
-1
No files found.
fs/bcachefs/alloc_background.c
View file @
c7495413
...
...
@@ -1303,7 +1303,7 @@ static noinline_for_stack int bch2_check_discard_freespace_key(struct btree_tran
goto
delete
;
out:
fsck_err:
set_btree_iter_dontneed
(
&
alloc_iter
);
bch2_
set_btree_iter_dontneed
(
&
alloc_iter
);
bch2_trans_iter_exit
(
trans
,
&
alloc_iter
);
printbuf_exit
(
&
buf
);
return
ret
;
...
...
fs/bcachefs/alloc_foreground.c
View file @
c7495413
...
...
@@ -363,10 +363,10 @@ static struct open_bucket *try_alloc_bucket(struct btree_trans *trans, struct bc
ob
=
__try_alloc_bucket
(
c
,
ca
,
b
,
watermark
,
a
,
s
,
cl
);
if
(
!
ob
)
set_btree_iter_dontneed
(
&
iter
);
bch2_
set_btree_iter_dontneed
(
&
iter
);
err:
if
(
iter
.
path
)
set_btree_iter_dontneed
(
&
iter
);
bch2_
set_btree_iter_dontneed
(
&
iter
);
bch2_trans_iter_exit
(
trans
,
&
iter
);
printbuf_exit
(
&
buf
);
return
ob
;
...
...
@@ -433,7 +433,7 @@ bch2_bucket_alloc_early(struct btree_trans *trans,
ob
=
__try_alloc_bucket
(
trans
->
c
,
ca
,
k
.
k
->
p
.
offset
,
watermark
,
a
,
s
,
cl
);
next:
set_btree_iter_dontneed
(
&
citer
);
bch2_
set_btree_iter_dontneed
(
&
citer
);
bch2_trans_iter_exit
(
trans
,
&
citer
);
if
(
ob
)
break
;
...
...
@@ -488,7 +488,7 @@ static struct open_bucket *bch2_bucket_alloc_freelist(struct btree_trans *trans,
ob
=
try_alloc_bucket
(
trans
,
ca
,
watermark
,
alloc_cursor
,
s
,
k
,
cl
);
if
(
ob
)
{
set_btree_iter_dontneed
(
&
iter
);
bch2_
set_btree_iter_dontneed
(
&
iter
);
break
;
}
}
...
...
fs/bcachefs/btree_iter.c
View file @
c7495413
...
...
@@ -1822,6 +1822,19 @@ struct bkey_s_c bch2_btree_path_peek_slot(struct btree_path *path, struct bkey *
return
(
struct
bkey_s_c
)
{
u
,
NULL
};
}
void
bch2_set_btree_iter_dontneed
(
struct
btree_iter
*
iter
)
{
struct
btree_trans
*
trans
=
iter
->
trans
;
if
(
!
iter
->
path
||
trans
->
restarted
)
return
;
struct
btree_path
*
path
=
btree_iter_path
(
trans
,
iter
);
path
->
preserve
=
false
;
if
(
path
->
ref
==
1
)
path
->
should_be_locked
=
false
;
}
/* Btree iterators: */
int
__must_check
...
...
fs/bcachefs/btree_iter.h
View file @
c7495413
...
...
@@ -508,18 +508,7 @@ void bch2_trans_node_iter_init(struct btree_trans *, struct btree_iter *,
unsigned
,
unsigned
,
unsigned
);
void
bch2_trans_copy_iter
(
struct
btree_iter
*
,
struct
btree_iter
*
);
static
inline
void
set_btree_iter_dontneed
(
struct
btree_iter
*
iter
)
{
struct
btree_trans
*
trans
=
iter
->
trans
;
if
(
!
iter
->
path
||
trans
->
restarted
)
return
;
struct
btree_path
*
path
=
btree_iter_path
(
trans
,
iter
);
path
->
preserve
=
false
;
if
(
path
->
ref
==
1
)
path
->
should_be_locked
=
false
;
}
void
bch2_set_btree_iter_dontneed
(
struct
btree_iter
*
);
void
*
__bch2_trans_kmalloc
(
struct
btree_trans
*
,
size_t
);
...
...
fs/bcachefs/btree_key_cache.c
View file @
c7495413
...
...
@@ -456,7 +456,7 @@ static int btree_key_cache_fill(struct btree_trans *trans,
bch2_btree_node_unlock_write
(
trans
,
ck_path
,
ck_path
->
l
[
0
].
b
);
/* We're not likely to need this iterator again: */
set_btree_iter_dontneed
(
&
iter
);
bch2_
set_btree_iter_dontneed
(
&
iter
);
err:
bch2_trans_iter_exit
(
trans
,
&
iter
);
return
ret
;
...
...
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