From: Chao Yu <chao@kernel.org>
To: jaegeuk@kernel.org
Cc: linux-kernel@vger.kernel.org,
Matthew Wilcox <willy@infradead.org>,
linux-f2fs-devel@lists.sourceforge.net
Subject: [f2fs-dev] [PATCH v3 1/9] f2fs: convert f2fs_submit_page_read() to use folio
Date: Tue, 20 Aug 2024 22:54:59 +0800 [thread overview]
Message-ID: <20240820145507.1372905-1-chao@kernel.org> (raw)
Convert to use folio, so that we can get rid of 'page->index' to
prepare for removal of 'index' field in structure page [1].
[1] https://lore.kernel.org/all/Zp8fgUSIBGQ1TN0D@casper.infradead.org/
Cc: Matthew Wilcox <willy@infradead.org>
Signed-off-by: Chao Yu <chao@kernel.org>
---
fs/f2fs/data.c | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/fs/f2fs/data.c b/fs/f2fs/data.c
index 4f4e76c33611..0655fddfc4ba 100644
--- a/fs/f2fs/data.c
+++ b/fs/f2fs/data.c
@@ -1086,7 +1086,7 @@ static struct bio *f2fs_grab_read_bio(struct inode *inode, block_t blkaddr,
}
/* This can handle encryption stuffs */
-static int f2fs_submit_page_read(struct inode *inode, struct page *page,
+static int f2fs_submit_page_read(struct inode *inode, struct folio *folio,
block_t blkaddr, blk_opf_t op_flags,
bool for_write)
{
@@ -1094,14 +1094,14 @@ static int f2fs_submit_page_read(struct inode *inode, struct page *page,
struct bio *bio;
bio = f2fs_grab_read_bio(inode, blkaddr, 1, op_flags,
- page->index, for_write);
+ folio->index, for_write);
if (IS_ERR(bio))
return PTR_ERR(bio);
/* wait for GCed page writeback via META_MAPPING */
f2fs_wait_on_block_writeback(inode, blkaddr);
- if (bio_add_page(bio, page, PAGE_SIZE, 0) < PAGE_SIZE) {
+ if (!bio_add_folio(bio, folio, PAGE_SIZE, 0)) {
iostat_update_and_unbind_ctx(bio);
if (bio->bi_private)
mempool_free(bio->bi_private, bio_post_read_ctx_pool);
@@ -1269,7 +1269,7 @@ struct page *f2fs_get_read_data_page(struct inode *inode, pgoff_t index,
return page;
}
- err = f2fs_submit_page_read(inode, page, dn.data_blkaddr,
+ err = f2fs_submit_page_read(inode, page_folio(page), dn.data_blkaddr,
op_flags, for_write);
if (err)
goto put_err;
@@ -3668,8 +3668,8 @@ static int f2fs_write_begin(struct file *file, struct address_space *mapping,
goto fail;
}
err = f2fs_submit_page_read(use_cow ?
- F2FS_I(inode)->cow_inode : inode, page,
- blkaddr, 0, true);
+ F2FS_I(inode)->cow_inode : inode,
+ page_folio(page), blkaddr, 0, true);
if (err)
goto fail;
--
2.40.1
_______________________________________________
Linux-f2fs-devel mailing list
Linux-f2fs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel
next reply other threads:[~2024-08-20 14:55 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-08-20 14:54 Chao Yu [this message]
2024-08-20 14:55 ` [f2fs-dev] [PATCH v3 2/9] f2fs: convert f2fs_write_begin() to use folio Chao Yu
2024-08-20 14:55 ` [f2fs-dev] [PATCH v3 3/9] f2fs: convert f2fs_write_end() " Chao Yu
2024-08-20 14:55 ` [f2fs-dev] [PATCH v3 4/9] f2fs: convert f2fs_set_compressed_page() " Chao Yu
2024-08-20 14:55 ` [f2fs-dev] [PATCH v3 5/9] f2fs: convert f2fs_do_write_data_page() " Chao Yu
2024-08-20 14:55 ` [f2fs-dev] [PATCH v3 6/9] f2fs: convert f2fs_write_data_page() " Chao Yu
2024-08-20 14:55 ` [f2fs-dev] [PATCH v3 7/9] f2fs: convert __write_node_page() " Chao Yu
2024-08-20 14:55 ` [f2fs-dev] [PATCH v3 8/9] f2fs: convert read_node_page() " Chao Yu
2024-08-20 14:55 ` [f2fs-dev] [PATCH v3 9/9] f2fs: get rid of page->index Chao Yu
2024-08-21 11:01 ` [f2fs-dev] [PATCH v3 1/9] f2fs: convert f2fs_submit_page_read() to use folio Li Zetao via Linux-f2fs-devel
2024-08-30 20:51 ` patchwork-bot+f2fs--- via Linux-f2fs-devel
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=20240820145507.1372905-1-chao@kernel.org \
--to=chao@kernel.org \
--cc=jaegeuk@kernel.org \
--cc=linux-f2fs-devel@lists.sourceforge.net \
--cc=linux-kernel@vger.kernel.org \
--cc=willy@infradead.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;
as well as URLs for NNTP newsgroup(s).