[PATCH 12/13] nfs: add support in nfs to handle multiple writeback contexts

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Fetch writeback context to which an inode is affined. Use it to perform
writeback related operations.

Signed-off-by: Kundan Kumar <kundan.kumar@xxxxxxxxxxx>
Signed-off-by: Anuj Gupta <anuj20.g@xxxxxxxxxxx>
---
 fs/nfs/internal.h | 5 +++--
 fs/nfs/write.c    | 6 +++---
 2 files changed, 6 insertions(+), 5 deletions(-)

diff --git a/fs/nfs/internal.h b/fs/nfs/internal.h
index fd513bf9e875..a7cacaf484c9 100644
--- a/fs/nfs/internal.h
+++ b/fs/nfs/internal.h
@@ -838,14 +838,15 @@ static inline void nfs_folio_mark_unstable(struct folio *folio,
 {
 	if (folio && !cinfo->dreq) {
 		struct inode *inode = folio->mapping->host;
+		struct bdi_writeback_ctx *bdi_wb_ctx =
+						fetch_bdi_writeback_ctx(inode);
 		long nr = folio_nr_pages(folio);
 
 		/* This page is really still in write-back - just that the
 		 * writeback is happening on the server now.
 		 */
 		node_stat_mod_folio(folio, NR_WRITEBACK, nr);
-		wb_stat_mod(&inode_to_bdi(inode)->wb_ctx_arr[0]->wb,
-			    WB_WRITEBACK, nr);
+		wb_stat_mod(&bdi_wb_ctx->wb, WB_WRITEBACK, nr);
 		__mark_inode_dirty(inode, I_DIRTY_DATASYNC);
 	}
 }
diff --git a/fs/nfs/write.c b/fs/nfs/write.c
index ec48ec8c2db8..ca0823debce7 100644
--- a/fs/nfs/write.c
+++ b/fs/nfs/write.c
@@ -932,11 +932,11 @@ static void nfs_folio_clear_commit(struct folio *folio)
 {
 	if (folio) {
 		long nr = folio_nr_pages(folio);
-		struct inode *inode = folio->mapping->host;
+		struct bdi_writeback_ctx *bdi_wb_ctx =
+				fetch_bdi_writeback_ctx(folio->mapping->host);
 
 		node_stat_mod_folio(folio, NR_WRITEBACK, -nr);
-		wb_stat_mod(&inode_to_bdi(inode)->wb_ctx_arr[0]->wb,
-			    WB_WRITEBACK, -nr);
+		wb_stat_mod(&bdi_wb_ctx->wb, WB_WRITEBACK, -nr);
 	}
 }
 
-- 
2.25.1





[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [NTFS 3]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [NTFS 3]     [Samba]     [Device Mapper]     [CEPH Development]

  Powered by Linux