@@ -2499,7 +2499,6 @@ static int filemap_get_pages(struct kiocb *iocb, size_t count,
2499
2499
{
2500
2500
struct file * filp = iocb -> ki_filp ;
2501
2501
struct address_space * mapping = filp -> f_mapping ;
2502
- struct file_ra_state * ra = & filp -> f_ra ;
2503
2502
pgoff_t index = iocb -> ki_pos >> PAGE_SHIFT ;
2504
2503
pgoff_t last_index ;
2505
2504
struct folio * folio ;
@@ -2514,12 +2513,13 @@ static int filemap_get_pages(struct kiocb *iocb, size_t count,
2514
2513
2515
2514
filemap_get_read_batch (mapping , index , last_index - 1 , fbatch );
2516
2515
if (!folio_batch_count (fbatch )) {
2516
+ DEFINE_READAHEAD (ractl , filp , & filp -> f_ra , mapping , index );
2517
+
2517
2518
if (iocb -> ki_flags & IOCB_NOIO )
2518
2519
return - EAGAIN ;
2519
2520
if (iocb -> ki_flags & IOCB_NOWAIT )
2520
2521
flags = memalloc_noio_save ();
2521
- page_cache_sync_readahead (mapping , ra , filp , index ,
2522
- last_index - index );
2522
+ page_cache_sync_ra (& ractl , last_index - index );
2523
2523
if (iocb -> ki_flags & IOCB_NOWAIT )
2524
2524
memalloc_noio_restore (flags );
2525
2525
filemap_get_read_batch (mapping , index , last_index - 1 , fbatch );
0 commit comments