We don't just want to sync out buffered writes, but also O_DIRECT ones.
Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
nfs_clear_inode(inode);
}
-static int nfs_sync_inode(struct inode *inode)
+int nfs_sync_inode(struct inode *inode)
{
nfs_inode_dio_wait(inode);
return nfs_wb_all(inode);
}
+EXPORT_SYMBOL_GPL(nfs_sync_inode);
/**
* nfs_sync_mapping - helper to flush all mmapped dirty data to disk
if (openflags & O_TRUNC) {
attr.ia_valid |= ATTR_SIZE;
attr.ia_size = 0;
- nfs_wb_all(inode);
+ nfs_sync_inode(inode);
}
inode = NFS_PROTO(dir)->open_context(dir, ctx, openflags, &attr, &opened);
* Try to write back everything synchronously (but check the
* return value!)
*/
+extern int nfs_sync_inode(struct inode *inode);
extern int nfs_wb_all(struct inode *inode);
extern int nfs_wb_page(struct inode *inode, struct page* page);
extern int nfs_wb_page_cancel(struct inode *inode, struct page* page);