mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Svyatoslav Nikolenko <nsvatoslav515@gmail.com>
To: jaegeuk@kernel.org, chao@kernel.org
Cc: linux-f2fs-devel@lists.sourceforge.net,
	linux-kernel@vger.kernel.org,
	Svyatoslav Nikolenko <nsvatoslav515@gmail.com>
Subject: [PATCH v1] f2fs: convert pagecache_read() to use folios
Date: Fri,  2 Oct 2026 14:43:37 +0300	[thread overview]
Message-ID: <20261002114338.12073-1-nsvatoslav515@gmail.com> (raw)

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


             reply	other threads:[~2026-10-02 11:44 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-02 11:43 Svyatoslav Nikolenko [this message]
2026-10-02 23:29 ` Eric Biggers

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=20261002114338.12073-1-nsvatoslav515@gmail.com \
    --to=nsvatoslav515@gmail.com \
    --cc=chao@kernel.org \
    --cc=jaegeuk@kernel.org \
    --cc=linux-f2fs-devel@lists.sourceforge.net \
    --cc=linux-kernel@vger.kernel.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

all inboxes | Powered by JetHome®