]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
f2fs: stop using writeback internals for dirty_exceeded checks
authorKundan Kumar <kundan.kumar@samsung.com>
Fri, 13 Feb 2026 05:46:32 +0000 (11:16 +0530)
committerChristian Brauner <brauner@kernel.org>
Tue, 17 Feb 2026 12:25:14 +0000 (13:25 +0100)
Replace direct dereferences of dirty_exceeded with the core helper
bdi_wb_dirty_exceeded(), removing f2fs dependencies on writeback
internals.

Reviewed-by: Jeff Layton <jlayton@kernel.org>
Reviewed-by: Andreas Gruenbacher <agruenba@redhat.com>
Suggested-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Kundan Kumar <kundan.kumar@samsung.com>
Signed-off-by: Anuj Gupta <anuj20.g@samsung.com>
Link: https://patch.msgid.link/20260213054634.79785-3-kundan.kumar@samsung.com
Signed-off-by: Christian Brauner <brauner@kernel.org>
fs/f2fs/node.c
fs/f2fs/segment.h

index 74992fd9c9b660eeb8dcca569b657acc3041470a..2030e943ab9b3d5e2deb20efe9a44cf5093a61fb 100644 (file)
@@ -78,7 +78,7 @@ bool f2fs_available_free_memory(struct f2fs_sb_info *sbi, int type)
                if (excess_cached_nats(sbi))
                        res = false;
        } else if (type == DIRTY_DENTS) {
-               if (sbi->sb->s_bdi->wb.dirty_exceeded)
+               if (bdi_wb_dirty_exceeded(sbi->sb->s_bdi))
                        return false;
                mem_size = get_pages(sbi, F2FS_DIRTY_DENTS);
                res = mem_size < ((avail_ram * nm_i->ram_thresh / 100) >> 1);
@@ -119,7 +119,7 @@ bool f2fs_available_free_memory(struct f2fs_sb_info *sbi, int type)
                res = false;
 #endif
        } else {
-               if (!sbi->sb->s_bdi->wb.dirty_exceeded)
+               if (!bdi_wb_dirty_exceeded(sbi->sb->s_bdi))
                        return true;
        }
        return res;
index 068845660b0fac5d2f87670fc281dc42639ef13a..08735a165433cc355bf629d3a223722a09bee89c 100644 (file)
@@ -992,7 +992,7 @@ static inline bool sec_usage_check(struct f2fs_sb_info *sbi, unsigned int secno)
  */
 static inline int nr_pages_to_skip(struct f2fs_sb_info *sbi, int type)
 {
-       if (sbi->sb->s_bdi->wb.dirty_exceeded)
+       if (bdi_wb_dirty_exceeded(sbi->sb->s_bdi))
                return 0;
 
        if (type == DATA)