@@ -2067,12 +2067,17 @@ static inline loff_t f2fs_readpage_limit(struct inode *inode)
2067
2067
return i_size_read (inode );
2068
2068
}
2069
2069
2070
+ static inline blk_opf_t f2fs_ra_op_flags (struct readahead_control * rac )
2071
+ {
2072
+ return rac ? REQ_RAHEAD : 0 ;
2073
+ }
2074
+
2070
2075
static int f2fs_read_single_page (struct inode * inode , struct folio * folio ,
2071
2076
unsigned nr_pages ,
2072
2077
struct f2fs_map_blocks * map ,
2073
2078
struct bio * * bio_ret ,
2074
2079
sector_t * last_block_in_bio ,
2075
- bool is_readahead )
2080
+ struct readahead_control * rac )
2076
2081
{
2077
2082
struct bio * bio = * bio_ret ;
2078
2083
const unsigned blocksize = blks_to_bytes (inode , 1 );
@@ -2148,7 +2153,7 @@ static int f2fs_read_single_page(struct inode *inode, struct folio *folio,
2148
2153
}
2149
2154
if (bio == NULL ) {
2150
2155
bio = f2fs_grab_read_bio (inode , block_nr , nr_pages ,
2151
- is_readahead ? REQ_RAHEAD : 0 , index ,
2156
+ f2fs_ra_op_flags ( rac ) , index ,
2152
2157
false);
2153
2158
if (IS_ERR (bio )) {
2154
2159
ret = PTR_ERR (bio );
@@ -2178,7 +2183,7 @@ static int f2fs_read_single_page(struct inode *inode, struct folio *folio,
2178
2183
#ifdef CONFIG_F2FS_FS_COMPRESSION
2179
2184
int f2fs_read_multi_pages (struct compress_ctx * cc , struct bio * * bio_ret ,
2180
2185
unsigned nr_pages , sector_t * last_block_in_bio ,
2181
- bool is_readahead , bool for_write )
2186
+ struct readahead_control * rac , bool for_write )
2182
2187
{
2183
2188
struct dnode_of_data dn ;
2184
2189
struct inode * inode = cc -> inode ;
@@ -2301,7 +2306,7 @@ int f2fs_read_multi_pages(struct compress_ctx *cc, struct bio **bio_ret,
2301
2306
2302
2307
if (!bio ) {
2303
2308
bio = f2fs_grab_read_bio (inode , blkaddr , nr_pages ,
2304
- is_readahead ? REQ_RAHEAD : 0 ,
2309
+ f2fs_ra_op_flags ( rac ) ,
2305
2310
page -> index , for_write );
2306
2311
if (IS_ERR (bio )) {
2307
2312
ret = PTR_ERR (bio );
@@ -2399,7 +2404,7 @@ static int f2fs_mpage_readpages(struct inode *inode,
2399
2404
ret = f2fs_read_multi_pages (& cc , & bio ,
2400
2405
max_nr_pages ,
2401
2406
& last_block_in_bio ,
2402
- rac != NULL , false);
2407
+ rac , false);
2403
2408
f2fs_destroy_compress_ctx (& cc , false);
2404
2409
if (ret )
2405
2410
goto set_error_page ;
@@ -2449,7 +2454,7 @@ static int f2fs_mpage_readpages(struct inode *inode,
2449
2454
ret = f2fs_read_multi_pages (& cc , & bio ,
2450
2455
max_nr_pages ,
2451
2456
& last_block_in_bio ,
2452
- rac != NULL , false);
2457
+ rac , false);
2453
2458
f2fs_destroy_compress_ctx (& cc , false);
2454
2459
}
2455
2460
}
0 commit comments