diff options
author | Christoph Hellwig <hch@lst.de> | 2016-03-02 17:35:54 +0100 |
---|---|---|
committer | Trond Myklebust <trond.myklebust@primarydata.com> | 2016-03-16 15:42:43 -0400 |
commit | 4ff79bc7098fab71e5957d48d31d2036c234e506 (patch) | |
tree | 3f7683f944bd5491fc23a563e2700c23b988c3e7 /fs/nfs/file.c | |
parent | ecf7828683997dbc8e95e7beca3ccdcab5e1bfac (diff) |
nfs: remove nfs4_file_fsync
The only difference to nfs_file_fsync is the call to pnfs_sync_inode. But
pnfs_sync_inode is just an inline that calls a pNFS layout driver method
if CONFIG_PNFS is designed, and thus can be called just fine from the core
NFS module.
Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
Diffstat (limited to 'fs/nfs/file.c')
-rw-r--r-- | fs/nfs/file.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/fs/nfs/file.c b/fs/nfs/file.c index 748bb813b8ec..cdf862188618 100644 --- a/fs/nfs/file.c +++ b/fs/nfs/file.c @@ -233,7 +233,7 @@ EXPORT_SYMBOL_GPL(nfs_file_mmap); * nfs_file_write() that a write error occurred, and hence cause it to * fall back to doing a synchronous write. */ -int +static int nfs_file_fsync_commit(struct file *file, loff_t start, loff_t end, int datasync) { struct nfs_open_context *ctx = nfs_file_open_context(file); @@ -263,9 +263,8 @@ nfs_file_fsync_commit(struct file *file, loff_t start, loff_t end, int datasync) out: return ret; } -EXPORT_SYMBOL_GPL(nfs_file_fsync_commit); -static int +int nfs_file_fsync(struct file *file, loff_t start, loff_t end, int datasync) { int ret; @@ -280,6 +279,8 @@ nfs_file_fsync(struct file *file, loff_t start, loff_t end, int datasync) break; inode_lock(inode); ret = nfs_file_fsync_commit(file, start, end, datasync); + if (!ret) + ret = pnfs_sync_inode(inode, !!datasync); inode_unlock(inode); /* * If nfs_file_fsync_commit detected a server reboot, then @@ -293,6 +294,7 @@ nfs_file_fsync(struct file *file, loff_t start, loff_t end, int datasync) trace_nfs_fsync_exit(inode, ret); return ret; } +EXPORT_SYMBOL_GPL(nfs_file_fsync); /* * Decide whether a read/modify/write cycle may be more efficient |