public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
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 7/9] f2fs: convert __f2fs_write_meta_page() to use folio
Date: Tue, 13 Aug 2024 22:13:29 +0800	[thread overview]
Message-ID: <20240813141331.417067-7-chao@kernel.org> (raw)
In-Reply-To: <20240813141331.417067-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>
---
 fs/f2fs/checkpoint.c | 13 +++++++------
 1 file changed, 7 insertions(+), 6 deletions(-)

diff --git a/fs/f2fs/checkpoint.c b/fs/f2fs/checkpoint.c
index d73d4d05313e..ffaf295a198a 100644
--- a/fs/f2fs/checkpoint.c
+++ b/fs/f2fs/checkpoint.c
@@ -345,30 +345,31 @@ static int __f2fs_write_meta_page(struct page *page,
 				enum iostat_type io_type)
 {
 	struct f2fs_sb_info *sbi = F2FS_P_SB(page);
+	struct folio *folio = page_folio(page);
 
-	trace_f2fs_writepage(page_folio(page), META);
+	trace_f2fs_writepage(folio, META);
 
 	if (unlikely(f2fs_cp_error(sbi))) {
 		if (is_sbi_flag_set(sbi, SBI_IS_CLOSE)) {
-			ClearPageUptodate(page);
+			folio_clear_uptodate(folio);
 			dec_page_count(sbi, F2FS_DIRTY_META);
-			unlock_page(page);
+			folio_unlock(folio);
 			return 0;
 		}
 		goto redirty_out;
 	}
 	if (unlikely(is_sbi_flag_set(sbi, SBI_POR_DOING)))
 		goto redirty_out;
-	if (wbc->for_reclaim && page->index < GET_SUM_BLOCK(sbi, 0))
+	if (wbc->for_reclaim && folio->index < GET_SUM_BLOCK(sbi, 0))
 		goto redirty_out;
 
-	f2fs_do_write_meta_page(sbi, page_folio(page), io_type);
+	f2fs_do_write_meta_page(sbi, folio, io_type);
 	dec_page_count(sbi, F2FS_DIRTY_META);
 
 	if (wbc->for_reclaim)
 		f2fs_submit_merged_write_cond(sbi, NULL, page, 0, META);
 
-	unlock_page(page);
+	folio_unlock(folio);
 
 	if (unlikely(f2fs_cp_error(sbi)))
 		f2fs_submit_merged_write(sbi, META);
-- 
2.40.1


  parent reply	other threads:[~2024-08-13 14:13 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-08-13 14:13 [PATCH 1/9] f2fs: convert f2fs_compress_ctx_add_page() to use folio Chao Yu
2024-08-13 14:13 ` [PATCH 2/9] f2fs: convert f2fs_vm_page_mkwrite() " Chao Yu
2024-08-13 14:13 ` [PATCH 3/9] f2fs: convert f2fs_clear_page_cache_dirty_tag() " Chao Yu
2024-08-13 14:13 ` [PATCH 4/9] f2fs: convert f2fs_write_inline_data() " Chao Yu
2024-08-13 14:13 ` [PATCH 5/9] f2fs: convert f2fs_write_single_data_page() " Chao Yu
2024-08-13 14:13 ` [PATCH 6/9] f2fs: convert f2fs_do_write_meta_page() " Chao Yu
2024-08-13 14:13 ` Chao Yu [this message]
2024-08-13 14:13 ` [PATCH 8/9] f2fs: convert f2fs_read_multi_pages() " Chao Yu
2024-08-13 14:13 ` [PATCH 9/9] f2fs: convert f2fs_handle_page_eio() " Chao Yu
2024-08-13 22:24 ` [PATCH 1/9] f2fs: convert f2fs_compress_ctx_add_page() " Jaegeuk Kim
2024-08-14  0:58   ` Chao Yu
2024-08-14  3:17   ` Chao Yu
2024-08-30 20:51 ` [f2fs-dev] " 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=20240813141331.417067-7-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