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

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


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

* Re: [PATCH v1] f2fs: convert pagecache_read() to use folios
  2026-10-02 11:43 [PATCH v1] f2fs: convert pagecache_read() to use folios Svyatoslav Nikolenko
@ 2026-10-02 23:29 ` Eric Biggers
  0 siblings, 0 replies; 2+ messages in thread
From: Eric Biggers @ 2026-10-02 23:29 UTC (permalink / raw)
  To: Svyatoslav Nikolenko; +Cc: jaegeuk, chao, linux-kernel, linux-f2fs-devel

On Fri, Oct 02, 2026 at 02:43:37PM +0300, Svyatoslav Nikolenko wrote:
> 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>

This will conflict with
https://lore.kernel.org/fsverity/20261002223705.2175542-5-aalbersh@kernel.org

I'm checking if that one will go into 7.4.  If so, this one won't be
needed.

- Eric

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

end of thread, other threads:[~2026-10-02 23:29 UTC | newest]

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

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

all inboxes | Powered by JetHome®