Replace direct dereferences of dirty_exceeded with the core helper
bdi_wb_dirty_exceeded(), removing f2fs dependencies on writeback
internals.

Suggested-by: Christoph Hellwig <[email protected]>
Signed-off-by: Kundan Kumar <[email protected]>
Signed-off-by: Anuj Gupta <[email protected]>
---
 fs/f2fs/node.c    | 4 ++--
 fs/f2fs/segment.h | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/fs/f2fs/node.c b/fs/f2fs/node.c
index 482a362f2625..d450b282cc55 100644
--- a/fs/f2fs/node.c
+++ b/fs/f2fs/node.c
@@ -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;
diff --git a/fs/f2fs/segment.h b/fs/f2fs/segment.h
index 07dcbcbeb7c6..d7166f1f000a 100644
--- a/fs/f2fs/segment.h
+++ b/fs/f2fs/segment.h
@@ -1000,7 +1000,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)
-- 
2.25.1



_______________________________________________
Linux-f2fs-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel

Reply via email to