[PATCH 2/2] f2fs: rename nr_pages_to_skip with nr_caches_to_skip

From: Chao Yu

Date: Fri Sep 11 2026 - 19:28:36 EST


From: Jaegeuk Kim <jaegeuk@xxxxxxxxxx>

The skipped count does not indicate the number of pages anymore.

Signed-off-by: Jaegeuk Kim <jaegeuk@xxxxxxxxxx>
---
fs/f2fs/checkpoint.c | 2 +-
fs/f2fs/data.c | 2 +-
fs/f2fs/node.c | 2 +-
fs/f2fs/segment.h | 10 +++++-----
4 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/fs/f2fs/checkpoint.c b/fs/f2fs/checkpoint.c
index 1ff9f241085a..a898258f6308 100644
--- a/fs/f2fs/checkpoint.c
+++ b/fs/f2fs/checkpoint.c
@@ -591,7 +591,7 @@ void f2fs_write_meta_caches(struct f2fs_sb_info *sbi)

/* collect a number of dirty meta caches and write together */
if (get_nr_caches(sbi, F2FS_DIRTY_META) <
- nr_pages_to_skip(sbi, META))
+ nr_caches_to_skip(sbi, META))
return;

/* if locked failed, cp will flush dirty caches instead */
diff --git a/fs/f2fs/data.c b/fs/f2fs/data.c
index 49fe48ae823d..fe7138797a61 100644
--- a/fs/f2fs/data.c
+++ b/fs/f2fs/data.c
@@ -3797,7 +3797,7 @@ static int __f2fs_write_data_pages(struct address_space *mapping,

if ((S_ISDIR(inode->i_mode) || IS_NOQUOTA(inode)) &&
wbc->sync_mode == WB_SYNC_NONE &&
- get_dirty_pages(inode) < nr_pages_to_skip(sbi, DATA) &&
+ get_dirty_pages(inode) < nr_caches_to_skip(sbi, DATA) &&
f2fs_available_free_memory(sbi, DIRTY_DENTS))
goto skip_write;

diff --git a/fs/f2fs/node.c b/fs/f2fs/node.c
index a185b794b7b5..1f023522474a 100644
--- a/fs/f2fs/node.c
+++ b/fs/f2fs/node.c
@@ -2270,7 +2270,7 @@ int f2fs_write_node_caches(struct f2fs_sb_info *sbi)

/* collect a number of dirty node caches and write together */
if (get_nr_caches(sbi, F2FS_DIRTY_NODES) <
- nr_pages_to_skip(sbi, NODE))
+ nr_caches_to_skip(sbi, NODE))
return -EAGAIN;

if (atomic_read(&sbi->wb_sync_req[NODE])) {
diff --git a/fs/f2fs/segment.h b/fs/f2fs/segment.h
index b77fc79907f8..526764ba31ae 100644
--- a/fs/f2fs/segment.h
+++ b/fs/f2fs/segment.h
@@ -977,13 +977,13 @@ static inline bool sec_usage_check(struct f2fs_sb_info *sbi, unsigned int secno)
}

/*
- * It is very important to gather dirty pages and write at once, so that we can
+ * It is very important to gather dirty blocks and write at once, so that we can
* submit a big bio without interfering other data writes.
- * By default, 512 pages for directory data,
- * 512 pages (2MB) * 8 for nodes, and
- * 256 pages * 8 for meta are set.
+ * By default, 512 blocks for directory data,
+ * 512 blocks (2MB) * 8 for nodes, and
+ * 256 blocks * 8 for meta are set.
*/
-static inline int nr_pages_to_skip(struct f2fs_sb_info *sbi, int type)
+static inline int nr_caches_to_skip(struct f2fs_sb_info *sbi, int type)
{
if (bdi_wb_dirty_exceeded(sbi->sb->s_bdi))
return 0;
--
2.49.0