linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v1] mm/filemap: increase usage of folio_next_index() helper
@ 2023-11-07  2:46 Minjie Du
  0 siblings, 0 replies; 3+ messages in thread
From: Minjie Du @ 2023-11-07  2:46 UTC (permalink / raw)
  To: Matthew Wilcox (Oracle),
	Andrew Morton, open list:PAGE CACHE, open list:MEMORY MANAGEMENT,
	open list
  Cc: opensource.kernel, Minjie Du

Simplify code pattern of 'folio->index + folio_nr_pages(folio)' by using
the existing helper folio_next_index() in filemap_get_folios_contig().

Signed-off-by: Minjie Du <duminjie@vivo.com>
---
 mm/filemap.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/mm/filemap.c b/mm/filemap.c
index 9710f43a89ac..ec8a3bbddab4 100644
--- a/mm/filemap.c
+++ b/mm/filemap.c
@@ -2173,7 +2173,7 @@ unsigned filemap_get_folios_contig(struct address_space *mapping,
 
 	if (nr) {
 		folio = fbatch->folios[nr - 1];
-		*start = folio->index + folio_nr_pages(folio);
+		*start = folio_next_index(folio);
 	}
 out:
 	rcu_read_unlock();
-- 
2.39.0



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2023-11-07  2:47 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <20230921081535.3398-1-duminjie@vivo.com>
2023-09-22  3:01 ` [PATCH v1] mm/filemap: increase usage of folio_next_index() helper Yin, Fengwei
2023-09-22  7:27 ` Matthew Wilcox
2023-11-07  2:46 Minjie Du

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox