All of lore.kernel.org
 help / color / mirror / Atom feed
* [f2fs-dev] [PATCH v1] f2fs: convert pagecache_read() to use folios
@ 2026-10-02 11:43 Svyatoslav Nikolenko
  2026-10-02 23:29 ` Eric Biggers via Linux-f2fs-devel
  0 siblings, 1 reply; 3+ messages in thread
From: Svyatoslav Nikolenko @ 2026-10-02 11:43 UTC (permalink / raw)
  To: jaegeuk, chao; +Cc: Svyatoslav Nikolenko, linux-kernel, linux-f2fs-devel

Replace page-based APIs with folio equivalents in pagecache_read()
to migrate fs/f2fs/verity.c away from struct page.

Signed-off-by: Svyatoslav Nikolenko <nsvatoslav515@gmail.com>
---
 fs/f2fs/verity.c | 21 ++++++++++++---------
 1 file changed, 12 insertions(+), 9 deletions(-)

diff --git a/fs/f2fs/verity.c b/fs/f2fs/verity.c
index ee838f880c4a..69bdd22ba96e 100644
--- a/fs/f2fs/verity.c
+++ b/fs/f2fs/verity.c
@@ -45,18 +45,21 @@ static int pagecache_read(struct inode *inode, void *buf, size_t count,
 			  loff_t pos)
 {
 	while (count) {
-		size_t n = min_t(size_t, count,
-				 PAGE_SIZE - offset_in_page(pos));
-		struct page *page;
+		struct folio *folio;
+		size_t n;
+
+		folio = read_mapping_folio(inode->i_mapping, pos >> PAGE_SHIFT,
+					NULL);
+
+		if (IS_ERR(folio))
+			return PTR_ERR(folio);
 
-		page = read_mapping_page(inode->i_mapping, pos >> PAGE_SHIFT,
-					 NULL);
-		if (IS_ERR(page))
-			return PTR_ERR(page);
+		n = min_t(size_t, count,
+				 folio_size(folio) - offset_in_folio(folio, pos));
 
-		memcpy_from_page(buf, page, offset_in_page(pos), n);
+		memcpy_from_folio(buf, folio, offset_in_folio(folio, pos), n);
 
-		put_page(page);
+		folio_put(folio);
 
 		buf += n;
 		pos += n;
-- 
2.47.3



_______________________________________________
Linux-f2fs-devel mailing list
Linux-f2fs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel

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

end of thread, other threads:[~2026-10-05 15:25 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-10-02 11:43 [f2fs-dev] [PATCH v1] f2fs: convert pagecache_read() to use folios Svyatoslav Nikolenko
2026-10-02 23:29 ` Eric Biggers via Linux-f2fs-devel
2026-10-05 15:25   ` Eric Biggers via Linux-f2fs-devel

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.