[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20240301164444.3799288-6-kernel@pankajraghav.com>
Date: Fri, 1 Mar 2024 17:44:36 +0100
From: "Pankaj Raghav (Samsung)" <kernel@...kajraghav.com>
To: linux-fsdevel@...r.kernel.org,
linux-xfs@...r.kernel.org
Cc: djwong@...nel.org,
mcgrof@...nel.org,
linux-mm@...ck.org,
hare@...e.de,
david@...morbit.com,
akpm@...ux-foundation.org,
gost.dev@...sung.com,
linux-kernel@...r.kernel.org,
chandan.babu@...cle.com,
willy@...radead.org,
Pankaj Raghav <p.raghav@...sung.com>
Subject: [PATCH v2 05/13] readahead: round up file_ra_state->ra_pages to mapping_min_nrpages
From: Luis Chamberlain <mcgrof@...nel.org>
As we will be adding multiples of mapping_min_nrpages to the page cache,
initialize file_ra_state->ra_pages with bdi->ra_pages rounded up to the
nearest mapping_min_nrpages.
Signed-off-by: Luis Chamberlain <mcgrof@...nel.org>
Signed-off-by: Pankaj Raghav <p.raghav@...sung.com>
---
mm/readahead.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/mm/readahead.c b/mm/readahead.c
index 369c70e2be42..6336c1736cc9 100644
--- a/mm/readahead.c
+++ b/mm/readahead.c
@@ -138,7 +138,8 @@
void
file_ra_state_init(struct file_ra_state *ra, struct address_space *mapping)
{
- ra->ra_pages = inode_to_bdi(mapping->host)->ra_pages;
+ ra->ra_pages = round_up(inode_to_bdi(mapping->host)->ra_pages,
+ mapping_min_folio_nrpages(mapping));
ra->prev_pos = -1;
}
EXPORT_SYMBOL_GPL(file_ra_state_init);
--
2.43.0
Powered by blists - more mailing lists