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
4753bdeb
Commit
4753bdeb
authored
Dec 20, 2023
by
Kent Overstreet
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bcachefs: Kill GFP_NOFAIL usage in readahead path
Signed-off-by:
Kent Overstreet
<
kent.overstreet@linux.dev
>
parent
806ebf2a
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
17 deletions
+14
-17
fs/bcachefs/fs-io-buffered.c
fs/bcachefs/fs-io-buffered.c
+14
-17
No files found.
fs/bcachefs/fs-io-buffered.c
View file @
4753bdeb
...
@@ -52,23 +52,20 @@ struct readpages_iter {
...
@@ -52,23 +52,20 @@ struct readpages_iter {
static
int
readpages_iter_init
(
struct
readpages_iter
*
iter
,
static
int
readpages_iter_init
(
struct
readpages_iter
*
iter
,
struct
readahead_control
*
ractl
)
struct
readahead_control
*
ractl
)
{
{
memset
(
iter
,
0
,
sizeof
(
*
iter
))
;
struct
folio
*
folio
;
iter
->
mapping
=
ractl
->
mapping
;
*
iter
=
(
struct
readpages_iter
)
{
ractl
->
mapping
}
;
int
ret
=
bch2_filemap_get_contig_folios_d
(
iter
->
mapping
,
while
((
folio
=
__readahead_folio
(
ractl
)))
{
ractl
->
_index
<<
PAGE_SHIFT
,
if
(
!
bch2_folio_create
(
folio
,
GFP_KERNEL
)
||
(
ractl
->
_index
+
ractl
->
_nr_pages
)
<<
PAGE_SHIFT
,
darray_push
(
&
iter
->
folios
,
folio
))
{
0
,
mapping_gfp_mask
(
iter
->
mapping
),
bch2_folio_release
(
folio
);
&
iter
->
folios
);
ractl
->
_nr_pages
+=
folio_nr_pages
(
folio
);
if
(
ret
)
ractl
->
_index
-=
folio_nr_pages
(
folio
);
return
ret
;
return
iter
->
folios
.
nr
?
0
:
-
ENOMEM
;
}
darray_for_each
(
iter
->
folios
,
fi
)
{
folio_put
(
folio
);
ractl
->
_nr_pages
-=
1U
<<
folio_order
(
*
fi
);
__bch2_folio_create
(
*
fi
,
__GFP_NOFAIL
|
GFP_KERNEL
);
folio_put
(
*
fi
);
folio_put
(
*
fi
);
}
}
return
0
;
return
0
;
...
@@ -270,12 +267,12 @@ void bch2_readahead(struct readahead_control *ractl)
...
@@ -270,12 +267,12 @@ void bch2_readahead(struct readahead_control *ractl)
struct
btree_trans
*
trans
=
bch2_trans_get
(
c
);
struct
btree_trans
*
trans
=
bch2_trans_get
(
c
);
struct
folio
*
folio
;
struct
folio
*
folio
;
struct
readpages_iter
readpages_iter
;
struct
readpages_iter
readpages_iter
;
int
ret
;
bch2_inode_opts_get
(
&
opts
,
c
,
&
inode
->
ei_inode
);
bch2_inode_opts_get
(
&
opts
,
c
,
&
inode
->
ei_inode
);
ret
=
readpages_iter_init
(
&
readpages_iter
,
ractl
);
int
ret
=
readpages_iter_init
(
&
readpages_iter
,
ractl
);
BUG_ON
(
ret
);
if
(
ret
)
return
;
bch2_pagecache_add_get
(
inode
);
bch2_pagecache_add_get
(
inode
);
...
...
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