[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20240813141331.417067-3-chao@kernel.org>
Date: Tue, 13 Aug 2024 22:13:25 +0800
From: Chao Yu <chao@...nel.org>
To: jaegeuk@...nel.org
Cc: linux-f2fs-devel@...ts.sourceforge.net,
linux-kernel@...r.kernel.org,
Chao Yu <chao@...nel.org>,
Matthew Wilcox <willy@...radead.org>
Subject: [PATCH 3/9] f2fs: convert f2fs_clear_page_cache_dirty_tag() to use folio
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@...radead.org>
Signed-off-by: Chao Yu <chao@...nel.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 --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);
}
--
2.40.1
Powered by blists - more mailing lists