linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Jan Kara <jack@suse.cz>
To: <linux-mm@kvack.org>
Cc: Andrew Morton <akpm@linux-foundation.org>,
	Matthew Wilcox <willy@infradead.org>,
	<linux-fsdevel@vger.kernel.org>, Jan Kara <jack@suse.cz>
Subject: [PATCH 05/10] readahead: Drop index argument of page_cache_async_readahead()
Date: Tue, 25 Jun 2024 12:18:55 +0200	[thread overview]
Message-ID: <20240625101909.12234-5-jack@suse.cz> (raw)
In-Reply-To: <20240625100859.15507-1-jack@suse.cz>

The index argument of page_cache_async_readahead() is just folio->index
so there's no point in passing is separately. Drop it.

Signed-off-by: Jan Kara <jack@suse.cz>
---
 fs/btrfs/relocation.c   | 3 +--
 fs/btrfs/send.c         | 2 +-
 include/linux/pagemap.h | 7 +++----
 3 files changed, 5 insertions(+), 7 deletions(-)

diff --git a/fs/btrfs/relocation.c b/fs/btrfs/relocation.c
index 8b24bb5a0aa1..e7e8fce70ccc 100644
--- a/fs/btrfs/relocation.c
+++ b/fs/btrfs/relocation.c
@@ -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);
diff --git a/fs/btrfs/send.c b/fs/btrfs/send.c
index 3dd4a48479a9..dbf462e67ad0 100644
--- a/fs/btrfs/send.c
+++ b/fs/btrfs/send.c
@@ -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);
diff --git a/include/linux/pagemap.h b/include/linux/pagemap.h
index ee633712bba0..7ad4decd4347 100644
--- a/include/linux/pagemap.h
+++ b/include/linux/pagemap.h
@@ -1307,8 +1307,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
@@ -1319,9 +1318,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);
 }
 
-- 
2.35.3



  parent reply	other threads:[~2024-06-25 10:19 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-06-25 10:18 [PATCH 0/10] mm: Fix various readahead quirks Jan Kara
2024-06-25 10:18 ` [PATCH 01/10] readahead: Make sure sync readahead reads needed page Jan Kara
2024-06-25 10:18 ` [PATCH 02/10] filemap: Fix page_cache_next_miss() when no hole found Jan Kara
2024-06-25 10:18 ` [PATCH 03/10] readahead: Properly shorten readahead when falling back to do_page_cache_ra() Jan Kara
2024-06-25 10:18 ` [PATCH 04/10] readahead: Drop pointless index from force_page_cache_ra() Jan Kara
2024-06-25 10:18 ` Jan Kara [this message]
2024-06-25 10:18 ` [PATCH 06/10] readahead: Drop dead code in page_cache_ra_order() Jan Kara
2024-06-25 10:18 ` [PATCH 07/10] readahead: Drop dead code in ondemand_readahead() Jan Kara
2024-06-25 10:18 ` [PATCH 08/10] readahead: Disentangle async and sync readahead Jan Kara
2024-06-25 10:18 ` [PATCH 09/10] readahead: Fold try_context_readahead() into its single caller Jan Kara
2024-06-25 10:19 ` [PATCH 10/10] readahead: Simplify gotos in page_cache_sync_ra() Jan Kara
2024-06-25 17:12 ` [PATCH 0/10] mm: Fix various readahead quirks Josef Bacik
2024-06-27  3:04 ` Zhang Peng
2024-06-27  6:10   ` zippermonkey
2024-06-27 21:13     ` Andrew Morton

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240625101909.12234-5-jack@suse.cz \
    --to=jack@suse.cz \
    --cc=akpm@linux-foundation.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=willy@infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox