mirror of
https://github.com/nxp-imx/linux-imx.git
synced 2025-07-08 18:35:20 +02:00
FROMGIT: f2fs: clean up set REQ_RAHEAD given rac
Let's set REQ_RAHEAD per rac by single source.
Reviewed-by: Chao Yu <chao@kernel.org>
Change-Id: I8957e8293e6509e96d33338a35260e8abeb8ffbf
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
(cherry picked from commit 6aeb084fa0
https://git.kernel.org/pub/scm/linux/kernel/git/jaegeuk/f2fs.git dev)
This commit is contained in:
parent
2f4e6b1def
commit
d14189b69e
|
@ -1100,7 +1100,7 @@ retry:
|
||||||
struct bio *bio = NULL;
|
struct bio *bio = NULL;
|
||||||
|
|
||||||
ret = f2fs_read_multi_pages(cc, &bio, cc->cluster_size,
|
ret = f2fs_read_multi_pages(cc, &bio, cc->cluster_size,
|
||||||
&last_block_in_bio, false, true);
|
&last_block_in_bio, NULL, true);
|
||||||
f2fs_put_rpages(cc);
|
f2fs_put_rpages(cc);
|
||||||
f2fs_destroy_compress_ctx(cc, true);
|
f2fs_destroy_compress_ctx(cc, true);
|
||||||
if (ret)
|
if (ret)
|
||||||
|
|
|
@ -2072,12 +2072,17 @@ static inline loff_t f2fs_readpage_limit(struct inode *inode)
|
||||||
return i_size_read(inode);
|
return i_size_read(inode);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static inline blk_opf_t f2fs_ra_op_flags(struct readahead_control *rac)
|
||||||
|
{
|
||||||
|
return rac ? REQ_RAHEAD : 0;
|
||||||
|
}
|
||||||
|
|
||||||
static int f2fs_read_single_page(struct inode *inode, struct folio *folio,
|
static int f2fs_read_single_page(struct inode *inode, struct folio *folio,
|
||||||
unsigned nr_pages,
|
unsigned nr_pages,
|
||||||
struct f2fs_map_blocks *map,
|
struct f2fs_map_blocks *map,
|
||||||
struct bio **bio_ret,
|
struct bio **bio_ret,
|
||||||
sector_t *last_block_in_bio,
|
sector_t *last_block_in_bio,
|
||||||
bool is_readahead)
|
struct readahead_control *rac)
|
||||||
{
|
{
|
||||||
struct bio *bio = *bio_ret;
|
struct bio *bio = *bio_ret;
|
||||||
const unsigned blocksize = blks_to_bytes(inode, 1);
|
const unsigned blocksize = blks_to_bytes(inode, 1);
|
||||||
|
@ -2159,7 +2164,7 @@ submit_and_realloc:
|
||||||
}
|
}
|
||||||
if (bio == NULL) {
|
if (bio == NULL) {
|
||||||
bio = f2fs_grab_read_bio(inode, block_nr, nr_pages,
|
bio = f2fs_grab_read_bio(inode, block_nr, nr_pages,
|
||||||
is_readahead ? REQ_RAHEAD : 0, index,
|
f2fs_ra_op_flags(rac), index,
|
||||||
false);
|
false);
|
||||||
if (IS_ERR(bio)) {
|
if (IS_ERR(bio)) {
|
||||||
ret = PTR_ERR(bio);
|
ret = PTR_ERR(bio);
|
||||||
|
@ -2196,7 +2201,7 @@ out:
|
||||||
#ifdef CONFIG_F2FS_FS_COMPRESSION
|
#ifdef CONFIG_F2FS_FS_COMPRESSION
|
||||||
int f2fs_read_multi_pages(struct compress_ctx *cc, struct bio **bio_ret,
|
int f2fs_read_multi_pages(struct compress_ctx *cc, struct bio **bio_ret,
|
||||||
unsigned nr_pages, sector_t *last_block_in_bio,
|
unsigned nr_pages, sector_t *last_block_in_bio,
|
||||||
bool is_readahead, bool for_write)
|
struct readahead_control *rac, bool for_write)
|
||||||
{
|
{
|
||||||
struct dnode_of_data dn;
|
struct dnode_of_data dn;
|
||||||
struct inode *inode = cc->inode;
|
struct inode *inode = cc->inode;
|
||||||
|
@ -2319,7 +2324,7 @@ submit_and_realloc:
|
||||||
|
|
||||||
if (!bio) {
|
if (!bio) {
|
||||||
bio = f2fs_grab_read_bio(inode, blkaddr, nr_pages,
|
bio = f2fs_grab_read_bio(inode, blkaddr, nr_pages,
|
||||||
is_readahead ? REQ_RAHEAD : 0,
|
f2fs_ra_op_flags(rac),
|
||||||
page->index, for_write);
|
page->index, for_write);
|
||||||
if (IS_ERR(bio)) {
|
if (IS_ERR(bio)) {
|
||||||
ret = PTR_ERR(bio);
|
ret = PTR_ERR(bio);
|
||||||
|
@ -2417,7 +2422,7 @@ static int f2fs_mpage_readpages(struct inode *inode,
|
||||||
ret = f2fs_read_multi_pages(&cc, &bio,
|
ret = f2fs_read_multi_pages(&cc, &bio,
|
||||||
max_nr_pages,
|
max_nr_pages,
|
||||||
&last_block_in_bio,
|
&last_block_in_bio,
|
||||||
rac != NULL, false);
|
rac, false);
|
||||||
f2fs_destroy_compress_ctx(&cc, false);
|
f2fs_destroy_compress_ctx(&cc, false);
|
||||||
if (ret)
|
if (ret)
|
||||||
goto set_error_page;
|
goto set_error_page;
|
||||||
|
@ -2467,7 +2472,7 @@ next_page:
|
||||||
ret = f2fs_read_multi_pages(&cc, &bio,
|
ret = f2fs_read_multi_pages(&cc, &bio,
|
||||||
max_nr_pages,
|
max_nr_pages,
|
||||||
&last_block_in_bio,
|
&last_block_in_bio,
|
||||||
rac != NULL, false);
|
rac, false);
|
||||||
f2fs_destroy_compress_ctx(&cc, false);
|
f2fs_destroy_compress_ctx(&cc, false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -4304,7 +4304,7 @@ void f2fs_update_read_extent_tree_range_compressed(struct inode *inode,
|
||||||
unsigned int llen, unsigned int c_len);
|
unsigned int llen, unsigned int c_len);
|
||||||
int f2fs_read_multi_pages(struct compress_ctx *cc, struct bio **bio_ret,
|
int f2fs_read_multi_pages(struct compress_ctx *cc, struct bio **bio_ret,
|
||||||
unsigned nr_pages, sector_t *last_block_in_bio,
|
unsigned nr_pages, sector_t *last_block_in_bio,
|
||||||
bool is_readahead, bool for_write);
|
struct readahead_control *rac, bool for_write);
|
||||||
struct decompress_io_ctx *f2fs_alloc_dic(struct compress_ctx *cc);
|
struct decompress_io_ctx *f2fs_alloc_dic(struct compress_ctx *cc);
|
||||||
void f2fs_decompress_end_io(struct decompress_io_ctx *dic, bool failed,
|
void f2fs_decompress_end_io(struct decompress_io_ctx *dic, bool failed,
|
||||||
bool in_task);
|
bool in_task);
|
||||||
|
|
Loading…
Reference in New Issue
Block a user