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 v2 2/8] f2fs: convert f2fs_write_end() to use folio
Date: Tue, 20 Aug 2024 11:46:48 +0800 [thread overview]
Message-ID: <20240820034654.698236-2-chao@kernel.org> (raw)
In-Reply-To: <20240820034654.698236-1-chao@kernel.org>
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>
---
v2:
- fix compile error.
fs/f2fs/data.c | 13 +++++++------
1 file changed, 7 insertions(+), 6 deletions(-)
diff --git a/fs/f2fs/data.c b/fs/f2fs/data.c
index 85ac05c3655a..e114d738b6b4 100644
--- a/fs/f2fs/data.c
+++ b/fs/f2fs/data.c
@@ -3698,7 +3698,8 @@ static int f2fs_write_end(struct file *file,
loff_t pos, unsigned len, unsigned copied,
struct page *page, void *fsdata)
{
- struct inode *inode = page->mapping->host;
+ struct folio *folio = page_folio(page);
+ struct inode *inode = folio->mapping->host;
trace_f2fs_write_end(inode, pos, len, copied);
@@ -3707,17 +3708,17 @@ static int f2fs_write_end(struct file *file,
* should be PAGE_SIZE. Otherwise, we treat it with zero copied and
* let generic_perform_write() try to copy data again through copied=0.
*/
- if (!PageUptodate(page)) {
+ if (!folio_test_uptodate(folio)) {
if (unlikely(copied != len))
copied = 0;
else
- SetPageUptodate(page);
+ folio_mark_uptodate(folio);
}
#ifdef CONFIG_F2FS_FS_COMPRESSION
/* overwrite compressed file */
if (f2fs_compressed_file(inode) && fsdata) {
- f2fs_compress_write_end(inode, fsdata, page->index, copied);
+ f2fs_compress_write_end(inode, fsdata, folio->index, copied);
f2fs_update_time(F2FS_I_SB(inode), REQ_TIME);
if (pos + copied > i_size_read(inode) &&
@@ -3730,10 +3731,10 @@ static int f2fs_write_end(struct file *file,
if (!copied)
goto unlock_out;
- set_page_dirty(page);
+ folio_mark_dirty(folio);
if (f2fs_is_atomic_file(inode))
- set_page_private_atomic(page);
+ set_page_private_atomic(folio_page(folio, 0));
if (pos + copied > i_size_read(inode) &&
!f2fs_verity_in_progress(inode)) {
--
2.40.1
_______________________________________________
Linux-f2fs-devel mailing list
Linux-f2fs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel
WARNING: multiple messages have this Message-ID (diff)
From: Chao Yu <chao@kernel.org>
To: jaegeuk@kernel.org
Cc: linux-f2fs-devel@lists.sourceforge.net,
linux-kernel@vger.kernel.org, Chao Yu <chao@kernel.org>,
Matthew Wilcox <willy@infradead.org>
Subject: [PATCH v2 2/8] f2fs: convert f2fs_write_end() to use folio
Date: Tue, 20 Aug 2024 11:46:48 +0800 [thread overview]
Message-ID: <20240820034654.698236-2-chao@kernel.org> (raw)
In-Reply-To: <20240820034654.698236-1-chao@kernel.org>
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>
---
v2:
- fix compile error.
fs/f2fs/data.c | 13 +++++++------
1 file changed, 7 insertions(+), 6 deletions(-)
diff --git a/fs/f2fs/data.c b/fs/f2fs/data.c
index 85ac05c3655a..e114d738b6b4 100644
--- a/fs/f2fs/data.c
+++ b/fs/f2fs/data.c
@@ -3698,7 +3698,8 @@ static int f2fs_write_end(struct file *file,
loff_t pos, unsigned len, unsigned copied,
struct page *page, void *fsdata)
{
- struct inode *inode = page->mapping->host;
+ struct folio *folio = page_folio(page);
+ struct inode *inode = folio->mapping->host;
trace_f2fs_write_end(inode, pos, len, copied);
@@ -3707,17 +3708,17 @@ static int f2fs_write_end(struct file *file,
* should be PAGE_SIZE. Otherwise, we treat it with zero copied and
* let generic_perform_write() try to copy data again through copied=0.
*/
- if (!PageUptodate(page)) {
+ if (!folio_test_uptodate(folio)) {
if (unlikely(copied != len))
copied = 0;
else
- SetPageUptodate(page);
+ folio_mark_uptodate(folio);
}
#ifdef CONFIG_F2FS_FS_COMPRESSION
/* overwrite compressed file */
if (f2fs_compressed_file(inode) && fsdata) {
- f2fs_compress_write_end(inode, fsdata, page->index, copied);
+ f2fs_compress_write_end(inode, fsdata, folio->index, copied);
f2fs_update_time(F2FS_I_SB(inode), REQ_TIME);
if (pos + copied > i_size_read(inode) &&
@@ -3730,10 +3731,10 @@ static int f2fs_write_end(struct file *file,
if (!copied)
goto unlock_out;
- set_page_dirty(page);
+ folio_mark_dirty(folio);
if (f2fs_is_atomic_file(inode))
- set_page_private_atomic(page);
+ set_page_private_atomic(folio_page(folio, 0));
if (pos + copied > i_size_read(inode) &&
!f2fs_verity_in_progress(inode)) {
--
2.40.1
next prev parent reply other threads:[~2024-08-20 3:47 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-08-20 3:46 [f2fs-dev] [PATCH v2 1/8] f2fs: convert f2fs_write_begin() to use folio Chao Yu
2024-08-20 3:46 ` Chao Yu
2024-08-20 3:46 ` Chao Yu [this message]
2024-08-20 3:46 ` [PATCH v2 2/8] f2fs: convert f2fs_write_end() " Chao Yu
2024-08-20 3:46 ` [f2fs-dev] [PATCH v2 3/8] f2fs: convert f2fs_set_compressed_page() " Chao Yu
2024-08-20 3:46 ` Chao Yu
2024-08-20 3:46 ` [f2fs-dev] [PATCH v2 4/8] f2fs: convert f2fs_do_write_data_page() " Chao Yu
2024-08-20 3:46 ` Chao Yu
2024-08-20 3:46 ` [f2fs-dev] [PATCH v2 5/8] f2fs: convert f2fs_write_data_page() " Chao Yu
2024-08-20 3:46 ` Chao Yu
2024-08-20 3:46 ` [f2fs-dev] [PATCH v2 6/8] f2fs: convert __write_node_page() " Chao Yu
2024-08-20 3:46 ` Chao Yu
2024-08-20 3:46 ` [f2fs-dev] [PATCH v2 7/8] f2fs: convert read_node_page() " Chao Yu
2024-08-20 3:46 ` Chao Yu
2024-08-20 3:46 ` [f2fs-dev] [PATCH v2 8/8] f2fs: get rid of page->index Chao Yu
2024-08-20 3:46 ` Chao Yu
2024-08-20 4:38 ` [f2fs-dev] [PATCH v2 1/8] f2fs: convert f2fs_write_begin() to use folio Li Zetao via Linux-f2fs-devel
2024-08-20 4:38 ` Li Zetao
2024-08-20 6:58 ` [f2fs-dev] " Chao Yu
2024-08-20 6:58 ` Chao Yu
2024-08-21 7:31 ` [f2fs-dev] " Chao Yu via Linux-f2fs-devel
2024-08-21 7:31 ` Chao Yu
2024-08-30 20:51 ` patchwork-bot+f2fs--- via Linux-f2fs-devel
2024-08-30 20:51 ` patchwork-bot+f2fs
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=20240820034654.698236-2-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 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.