]> www.infradead.org Git - nvme.git/commitdiff
readahead: drop index argument of page_cache_async_readahead()
authorJan Kara <jack@suse.cz>
Tue, 25 Jun 2024 10:18:55 +0000 (12:18 +0200)
committerAndrew Morton <akpm@linux-foundation.org>
Thu, 4 Jul 2024 02:30:27 +0000 (19:30 -0700)
The index argument of page_cache_async_readahead() is just folio->index so
there's no point in passing is separately.  Drop it.

Link: https://lkml.kernel.org/r/20240625101909.12234-5-jack@suse.cz
Signed-off-by: Jan Kara <jack@suse.cz>
Reviewed-by: Josef Bacik <josef@toxicpanda.com>
Tested-by: Zhang Peng <zhangpengpeng0808@gmail.com>
Cc: Matthew Wilcox (Oracle) <willy@infradead.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
fs/btrfs/relocation.c
fs/btrfs/send.c
include/linux/pagemap.h

index 8b24bb5a0aa189fe23d44a6fa54ba4df5151efac..e7e8fce70ccc02e10fb614367785cba5d5f90f3f 100644 (file)
@@ -2975,8 +2975,7 @@ static int relocate_one_folio(struct inode *inode, struct file_ra_state *ra,
 
        if (folio_test_readahead(folio))
                page_cache_async_readahead(inode->i_mapping, ra, NULL,
-                                          folio, index,
-                                          last_index + 1 - index);
+                                          folio, last_index + 1 - index);
 
        if (!folio_test_uptodate(folio)) {
                btrfs_read_folio(NULL, folio);
index 3dd4a48479a9e2e33c4a66225a307f7d51c1b1a5..dbf462e67ad0f09150128ee7baf1255a6ae69a34 100644 (file)
@@ -5307,7 +5307,7 @@ static int put_file_data(struct send_ctx *sctx, u64 offset, u32 len)
 
                if (folio_test_readahead(folio))
                        page_cache_async_readahead(mapping, &sctx->ra, NULL, folio,
-                                                  index, last_index + 1 - index);
+                                                  last_index + 1 - index);
 
                if (!folio_test_uptodate(folio)) {
                        btrfs_read_folio(NULL, folio);
index e37e16ebff7aeae2707c3d3409744ebcee61a982..eef99375dcf17d4db47063aecd529008e494c9de 100644 (file)
@@ -1293,8 +1293,7 @@ void page_cache_sync_readahead(struct address_space *mapping,
  * @mapping: address_space which holds the pagecache and I/O vectors
  * @ra: file_ra_state which holds the readahead state
  * @file: Used by the filesystem for authentication.
- * @folio: The folio at @index which triggered the readahead call.
- * @index: Index of first page to be read.
+ * @folio: The folio which triggered the readahead call.
  * @req_count: Total number of pages being read by the caller.
  *
  * page_cache_async_readahead() should be called when a page is used which
@@ -1305,9 +1304,9 @@ void page_cache_sync_readahead(struct address_space *mapping,
 static inline
 void page_cache_async_readahead(struct address_space *mapping,
                struct file_ra_state *ra, struct file *file,
-               struct folio *folio, pgoff_t index, unsigned long req_count)
+               struct folio *folio, unsigned long req_count)
 {
-       DEFINE_READAHEAD(ractl, file, ra, mapping, index);
+       DEFINE_READAHEAD(ractl, file, ra, mapping, folio->index);
        page_cache_async_ra(&ractl, folio, req_count);
 }