linux-f2fs-devel.lists.sourceforge.net archive mirror
 help / color / mirror / Atom feed
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 9/9] f2fs: convert f2fs_handle_page_eio() to use folio
Date: Tue, 13 Aug 2024 22:13:31 +0800	[thread overview]
Message-ID: <20240813141331.417067-9-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 | 2 +-
 fs/f2fs/f2fs.h       | 6 ++++--
 fs/f2fs/node.c       | 2 +-
 3 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/fs/f2fs/checkpoint.c b/fs/f2fs/checkpoint.c
index ffaf295a198a..7f76460b721f 100644
--- a/fs/f2fs/checkpoint.c
+++ b/fs/f2fs/checkpoint.c
@@ -99,7 +99,7 @@ static struct page *__get_meta_page(struct f2fs_sb_info *sbi, pgoff_t index,
 	}
 
 	if (unlikely(!PageUptodate(page))) {
-		f2fs_handle_page_eio(sbi, page->index, META);
+		f2fs_handle_page_eio(sbi, page_folio(page), META);
 		f2fs_put_page(page, 1);
 		return ERR_PTR(-EIO);
 	}
diff --git a/fs/f2fs/f2fs.h b/fs/f2fs/f2fs.h
index c29ed8b6eea6..28b6246e07f9 100644
--- a/fs/f2fs/f2fs.h
+++ b/fs/f2fs/f2fs.h
@@ -4666,9 +4666,11 @@ static inline void f2fs_io_schedule_timeout(long timeout)
 	io_schedule_timeout(timeout);
 }
 
-static inline void f2fs_handle_page_eio(struct f2fs_sb_info *sbi, pgoff_t ofs,
-					enum page_type type)
+static inline void f2fs_handle_page_eio(struct f2fs_sb_info *sbi,
+				struct folio *folio, enum page_type type)
 {
+	pgoff_t ofs = folio->index;
+
 	if (unlikely(f2fs_cp_error(sbi)))
 		return;
 
diff --git a/fs/f2fs/node.c b/fs/f2fs/node.c
index 2b764c86aacc..7beaa3690e03 100644
--- a/fs/f2fs/node.c
+++ b/fs/f2fs/node.c
@@ -1492,7 +1492,7 @@ static struct page *__get_node_page(struct f2fs_sb_info *sbi, pgoff_t nid,
 out_put_err:
 	/* ENOENT comes from read_node_page which is not an error. */
 	if (err != -ENOENT)
-		f2fs_handle_page_eio(sbi, page->index, NODE);
+		f2fs_handle_page_eio(sbi, page_folio(page), NODE);
 	f2fs_put_page(page, 1);
 	return ERR_PTR(err);
 }
-- 
2.40.1



_______________________________________________
Linux-f2fs-devel mailing list
Linux-f2fs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel

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

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