NFS: Create custom NFS v4 write_inode() function
This gives pnfs a chance to do a layout commit inside the v4 code.
Signed-off-by: Bryan Schumaker <bjschuma@netapp.com>
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
diff --git a/fs/nfs/write.c b/fs/nfs/write.c
index c11fb00..f312860 100644
--- a/fs/nfs/write.c
+++ b/fs/nfs/write.c
@@ -1671,9 +1671,14 @@
int nfs_write_inode(struct inode *inode, struct writeback_control *wbc)
{
- int ret;
+ return nfs_commit_unstable_pages(inode, wbc);
+}
- ret = nfs_commit_unstable_pages(inode, wbc);
+#ifdef CONFIG_NFS_V4
+int nfs4_write_inode(struct inode *inode, struct writeback_control *wbc)
+{
+ int ret = nfs_write_inode(inode, wbc);
+
if (ret >= 0 && test_bit(NFS_INO_LAYOUTCOMMIT, &NFS_I(inode)->flags)) {
int status;
bool sync = true;
@@ -1687,6 +1692,7 @@
}
return ret;
}
+#endif
/*
* flush the inode to disk.