[PATCH 4/4] nfs: stop using writeback internals for WB_WRITEBACK accounting

From: Kundan Kumar

Date: Wed Feb 11 2026 - 02:06:51 EST


Convert NFS WB_WRITEBACK accounting to bdi-scoped writeback helper,
eliminating direct access to writeback.

Suggested-by: Christoph Hellwig <hch@xxxxxx>
Signed-off-by: Kundan Kumar <kundan.kumar@xxxxxxxxxxx>
Signed-off-by: Anuj Gupta <anuj20.g@xxxxxxxxxxx>
---
fs/nfs/internal.h | 2 +-
fs/nfs/write.c | 4 ++--
2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/fs/nfs/internal.h b/fs/nfs/internal.h
index 2e596244799f..a738c357b153 100644
--- a/fs/nfs/internal.h
+++ b/fs/nfs/internal.h
@@ -866,7 +866,7 @@ static inline void nfs_folio_mark_unstable(struct folio *folio,
* writeback is happening on the server now.
*/
node_stat_mod_folio(folio, NR_WRITEBACK, nr);
- wb_stat_mod(&inode_to_bdi(inode)->wb, WB_WRITEBACK, nr);
+ bdi_wb_stat_mod(inode_to_bdi(inode), WB_WRITEBACK, nr);
__mark_inode_dirty(inode, I_DIRTY_DATASYNC);
}
}
diff --git a/fs/nfs/write.c b/fs/nfs/write.c
index bf412455e8ed..c56b15b5380f 100644
--- a/fs/nfs/write.c
+++ b/fs/nfs/write.c
@@ -872,8 +872,8 @@ static void nfs_folio_clear_commit(struct folio *folio)
long nr = folio_nr_pages(folio);

node_stat_mod_folio(folio, NR_WRITEBACK, -nr);
- wb_stat_mod(&inode_to_bdi(folio->mapping->host)->wb,
- WB_WRITEBACK, -nr);
+ bdi_wb_stat_mod(inode_to_bdi(folio->mapping->host),
+ WB_WRITEBACK, -nr);
}
}

--
2.25.1