@@ -2067,12 +2067,17 @@ static inline loff_t f2fs_readpage_limit(struct inode *inode)
20672067 return i_size_read (inode );
20682068}
20692069
2070+ static inline blk_opf_t f2fs_ra_op_flags (struct readahead_control * rac )
2071+ {
2072+ return rac ? REQ_RAHEAD : 0 ;
2073+ }
2074+
20702075static int f2fs_read_single_page (struct inode * inode , struct folio * folio ,
20712076 unsigned nr_pages ,
20722077 struct f2fs_map_blocks * map ,
20732078 struct bio * * bio_ret ,
20742079 sector_t * last_block_in_bio ,
2075- bool is_readahead )
2080+ struct readahead_control * rac )
20762081{
20772082 struct bio * bio = * bio_ret ;
20782083 const unsigned blocksize = blks_to_bytes (inode , 1 );
@@ -2148,7 +2153,7 @@ static int f2fs_read_single_page(struct inode *inode, struct folio *folio,
21482153 }
21492154 if (bio == NULL ) {
21502155 bio = f2fs_grab_read_bio (inode , block_nr , nr_pages ,
2151- is_readahead ? REQ_RAHEAD : 0 , index ,
2156+ f2fs_ra_op_flags ( rac ) , index ,
21522157 false);
21532158 if (IS_ERR (bio )) {
21542159 ret = PTR_ERR (bio );
@@ -2178,7 +2183,7 @@ static int f2fs_read_single_page(struct inode *inode, struct folio *folio,
21782183#ifdef CONFIG_F2FS_FS_COMPRESSION
21792184int f2fs_read_multi_pages (struct compress_ctx * cc , struct bio * * bio_ret ,
21802185 unsigned nr_pages , sector_t * last_block_in_bio ,
2181- bool is_readahead , bool for_write )
2186+ struct readahead_control * rac , bool for_write )
21822187{
21832188 struct dnode_of_data dn ;
21842189 struct inode * inode = cc -> inode ;
@@ -2301,7 +2306,7 @@ int f2fs_read_multi_pages(struct compress_ctx *cc, struct bio **bio_ret,
23012306
23022307 if (!bio ) {
23032308 bio = f2fs_grab_read_bio (inode , blkaddr , nr_pages ,
2304- is_readahead ? REQ_RAHEAD : 0 ,
2309+ f2fs_ra_op_flags ( rac ) ,
23052310 page -> index , for_write );
23062311 if (IS_ERR (bio )) {
23072312 ret = PTR_ERR (bio );
@@ -2399,7 +2404,7 @@ static int f2fs_mpage_readpages(struct inode *inode,
23992404 ret = f2fs_read_multi_pages (& cc , & bio ,
24002405 max_nr_pages ,
24012406 & last_block_in_bio ,
2402- rac != NULL , false);
2407+ rac , false);
24032408 f2fs_destroy_compress_ctx (& cc , false);
24042409 if (ret )
24052410 goto set_error_page ;
@@ -2449,7 +2454,7 @@ static int f2fs_mpage_readpages(struct inode *inode,
24492454 ret = f2fs_read_multi_pages (& cc , & bio ,
24502455 max_nr_pages ,
24512456 & last_block_in_bio ,
2452- rac != NULL , false);
2457+ rac , false);
24532458 f2fs_destroy_compress_ctx (& cc , false);
24542459 }
24552460 }
0 commit comments