aboutsummaryrefslogtreecommitdiffstats
path: root/fs/nfs/write.c
diff options
context:
space:
mode:
authorTrond Myklebust <trond.myklebust@primarydata.com>2015-03-25 14:14:42 -0400
committerTrond Myklebust <trond.myklebust@primarydata.com>2015-03-27 12:39:38 -0400
commit5bb89b4702e22981445ae01af733a57d1cae2018 (patch)
tree4c00a7c47fa2dab958f43a395e71067fe6ee6538 /fs/nfs/write.c
parent7140171ea9be4143736c35acf6f31b6feb195ca0 (diff)
NFSv4.1/pnfs: Separate out metadata and data consistency for pNFS
The LAYOUTCOMMIT operation means different things to different layout types. For blocks and objects, it is both a data and metadata consistency operation. For files and flexfiles, it is only a metadata consistency operation. This patch separates out the 2 cases, allowing the files/flexfiles layout drivers to optimise away the data consistency calls to layoutcommit. Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
Diffstat (limited to 'fs/nfs/write.c')
-rw-r--r--fs/nfs/write.c13
1 files changed, 6 insertions, 7 deletions
diff --git a/fs/nfs/write.c b/fs/nfs/write.c
index 849ed784d6ac..7f933a39f385 100644
--- a/fs/nfs/write.c
+++ b/fs/nfs/write.c
@@ -1840,17 +1840,16 @@ EXPORT_SYMBOL_GPL(nfs_write_inode);
1840 */ 1840 */
1841int nfs_wb_all(struct inode *inode) 1841int nfs_wb_all(struct inode *inode)
1842{ 1842{
1843 struct writeback_control wbc = {
1844 .sync_mode = WB_SYNC_ALL,
1845 .nr_to_write = LONG_MAX,
1846 .range_start = 0,
1847 .range_end = LLONG_MAX,
1848 };
1849 int ret; 1843 int ret;
1850 1844
1851 trace_nfs_writeback_inode_enter(inode); 1845 trace_nfs_writeback_inode_enter(inode);
1852 1846
1853 ret = sync_inode(inode, &wbc); 1847 ret = filemap_write_and_wait(inode->i_mapping);
1848 if (!ret) {
1849 ret = nfs_commit_inode(inode, FLUSH_SYNC);
1850 if (!ret)
1851 pnfs_sync_inode(inode, true);
1852 }
1854 1853
1855 trace_nfs_writeback_inode_exit(inode, ret); 1854 trace_nfs_writeback_inode_exit(inode, ret);
1856 return ret; 1855 return ret;