* [PATCH v1] f2fs: convert pagecache_read() to use folios
@ 2026-10-02 11:43 Svyatoslav Nikolenko
0 siblings, 0 replies; only message 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] only message in thread
only message in thread, other threads:[~2026-10-02 11:44 UTC | newest]
Thread overview: (only message) (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
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®