diff mbox series

[f2fs-dev,3/9] f2fs: convert f2fs_clear_page_cache_dirty_tag() to use folio

Message ID 20240813141331.417067-3-chao@kernel.org (mailing list archive)
State Accepted
Commit 71aa6bbfc2476a11c5cafbc10a2dc1ddb70f0944
Headers show
Series [f2fs-dev,1/9] f2fs: convert f2fs_compress_ctx_add_page() to use folio | expand

Commit Message

Chao Yu Aug. 13, 2024, 2:13 p.m. UTC
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   | 3 +--
 fs/f2fs/dir.c    | 2 +-
 fs/f2fs/f2fs.h   | 2 +-
 fs/f2fs/inline.c | 2 +-
 fs/f2fs/node.c   | 2 +-
 5 files changed, 5 insertions(+), 6 deletions(-)
diff mbox series

Patch

diff --git a/fs/f2fs/data.c b/fs/f2fs/data.c
index 100b6526717f..0df5a0c66ede 100644
--- a/fs/f2fs/data.c
+++ b/fs/f2fs/data.c
@@ -4117,9 +4117,8 @@  const struct address_space_operations f2fs_dblock_aops = {
 	.swap_deactivate = f2fs_swap_deactivate,
 };
 
-void f2fs_clear_page_cache_dirty_tag(struct page *page)
+void f2fs_clear_page_cache_dirty_tag(struct folio *folio)
 {
-	struct folio *folio = page_folio(page);
 	struct address_space *mapping = folio->mapping;
 	unsigned long flags;
 
diff --git a/fs/f2fs/dir.c b/fs/f2fs/dir.c
index 14900ca8a9ff..5fcc952107e9 100644
--- a/fs/f2fs/dir.c
+++ b/fs/f2fs/dir.c
@@ -868,7 +868,7 @@  void f2fs_delete_entry(struct f2fs_dir_entry *dentry, struct page *page,
 
 	if (bit_pos == NR_DENTRY_IN_BLOCK &&
 		!f2fs_truncate_hole(dir, page->index, page->index + 1)) {
-		f2fs_clear_page_cache_dirty_tag(page);
+		f2fs_clear_page_cache_dirty_tag(page_folio(page));
 		clear_page_dirty_for_io(page);
 		ClearPageUptodate(page);
 		clear_page_private_all(page);
diff --git a/fs/f2fs/f2fs.h b/fs/f2fs/f2fs.h
index df436dd3aac1..a4b90215a51f 100644
--- a/fs/f2fs/f2fs.h
+++ b/fs/f2fs/f2fs.h
@@ -3890,7 +3890,7 @@  void f2fs_write_failed(struct inode *inode, loff_t to);
 void f2fs_invalidate_folio(struct folio *folio, size_t offset, size_t length);
 bool f2fs_release_folio(struct folio *folio, gfp_t wait);
 bool f2fs_overwrite_io(struct inode *inode, loff_t pos, size_t len);
-void f2fs_clear_page_cache_dirty_tag(struct page *page);
+void f2fs_clear_page_cache_dirty_tag(struct folio *folio);
 int f2fs_init_post_read_processing(void);
 void f2fs_destroy_post_read_processing(void);
 int f2fs_init_post_read_wq(struct f2fs_sb_info *sbi);
diff --git a/fs/f2fs/inline.c b/fs/f2fs/inline.c
index d76a3bed7093..98d122164cd1 100644
--- a/fs/f2fs/inline.c
+++ b/fs/f2fs/inline.c
@@ -281,7 +281,7 @@  int f2fs_write_inline_data(struct inode *inode, struct page *page)
 			 page, 0, MAX_INLINE_DATA(inode));
 	set_page_dirty(ipage);
 
-	f2fs_clear_page_cache_dirty_tag(page);
+	f2fs_clear_page_cache_dirty_tag(page_folio(page));
 
 	set_inode_flag(inode, FI_APPEND_WRITE);
 	set_inode_flag(inode, FI_DATA_EXIST);
diff --git a/fs/f2fs/node.c b/fs/f2fs/node.c
index 9e7a6e21f30c..20518c12f5b7 100644
--- a/fs/f2fs/node.c
+++ b/fs/f2fs/node.c
@@ -123,7 +123,7 @@  bool f2fs_available_free_memory(struct f2fs_sb_info *sbi, int type)
 static void clear_node_page_dirty(struct page *page)
 {
 	if (PageDirty(page)) {
-		f2fs_clear_page_cache_dirty_tag(page);
+		f2fs_clear_page_cache_dirty_tag(page_folio(page));
 		clear_page_dirty_for_io(page);
 		dec_page_count(F2FS_P_SB(page), F2FS_DIRTY_NODES);
 	}