aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--fs/nfs/inode.c3
-rw-r--r--fs/nfs/nfs4file.c2
-rw-r--r--include/linux/nfs_fs.h1
3 files changed, 4 insertions, 2 deletions
diff --git a/fs/nfs/inode.c b/fs/nfs/inode.c
index 60f907666697..f1fc0e4c1c02 100644
--- a/fs/nfs/inode.c
+++ b/fs/nfs/inode.c
@@ -133,11 +133,12 @@ void nfs_evict_inode(struct inode *inode)
133 nfs_clear_inode(inode); 133 nfs_clear_inode(inode);
134} 134}
135 135
136static int nfs_sync_inode(struct inode *inode) 136int nfs_sync_inode(struct inode *inode)
137{ 137{
138 nfs_inode_dio_wait(inode); 138 nfs_inode_dio_wait(inode);
139 return nfs_wb_all(inode); 139 return nfs_wb_all(inode);
140} 140}
141EXPORT_SYMBOL_GPL(nfs_sync_inode);
141 142
142/** 143/**
143 * nfs_sync_mapping - helper to flush all mmapped dirty data to disk 144 * nfs_sync_mapping - helper to flush all mmapped dirty data to disk
diff --git a/fs/nfs/nfs4file.c b/fs/nfs/nfs4file.c
index 0de62f7cfebf..8da5409e6f1a 100644
--- a/fs/nfs/nfs4file.c
+++ b/fs/nfs/nfs4file.c
@@ -59,7 +59,7 @@ nfs4_file_open(struct inode *inode, struct file *filp)
59 if (openflags & O_TRUNC) { 59 if (openflags & O_TRUNC) {
60 attr.ia_valid |= ATTR_SIZE; 60 attr.ia_valid |= ATTR_SIZE;
61 attr.ia_size = 0; 61 attr.ia_size = 0;
62 nfs_wb_all(inode); 62 nfs_sync_inode(inode);
63 } 63 }
64 64
65 inode = NFS_PROTO(dir)->open_context(dir, ctx, openflags, &attr, &opened); 65 inode = NFS_PROTO(dir)->open_context(dir, ctx, openflags, &attr, &opened);
diff --git a/include/linux/nfs_fs.h b/include/linux/nfs_fs.h
index b01ccf371fdc..b638eb6727c6 100644
--- a/include/linux/nfs_fs.h
+++ b/include/linux/nfs_fs.h
@@ -512,6 +512,7 @@ extern int nfs_updatepage(struct file *, struct page *, unsigned int, unsigned
512 * Try to write back everything synchronously (but check the 512 * Try to write back everything synchronously (but check the
513 * return value!) 513 * return value!)
514 */ 514 */
515extern int nfs_sync_inode(struct inode *inode);
515extern int nfs_wb_all(struct inode *inode); 516extern int nfs_wb_all(struct inode *inode);
516extern int nfs_wb_page(struct inode *inode, struct page* page); 517extern int nfs_wb_page(struct inode *inode, struct page* page);
517extern int nfs_wb_page_cancel(struct inode *inode, struct page* page); 518extern int nfs_wb_page_cancel(struct inode *inode, struct page* page);