|
@@ -233,7 +233,7 @@ EXPORT_SYMBOL_GPL(nfs_file_mmap);
|
|
* nfs_file_write() that a write error occurred, and hence cause it to
|
|
* nfs_file_write() that a write error occurred, and hence cause it to
|
|
* fall back to doing a synchronous write.
|
|
* 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)
|
|
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);
|
|
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:
|
|
out:
|
|
return ret;
|
|
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)
|
|
nfs_file_fsync(struct file *file, loff_t start, loff_t end, int datasync)
|
|
{
|
|
{
|
|
int ret;
|
|
int ret;
|
|
@@ -280,6 +279,8 @@ nfs_file_fsync(struct file *file, loff_t start, loff_t end, int datasync)
|
|
break;
|
|
break;
|
|
inode_lock(inode);
|
|
inode_lock(inode);
|
|
ret = nfs_file_fsync_commit(file, start, end, datasync);
|
|
ret = nfs_file_fsync_commit(file, start, end, datasync);
|
|
|
|
+ if (!ret)
|
|
|
|
+ ret = pnfs_sync_inode(inode, !!datasync);
|
|
inode_unlock(inode);
|
|
inode_unlock(inode);
|
|
/*
|
|
/*
|
|
* If nfs_file_fsync_commit detected a server reboot, then
|
|
* 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);
|
|
trace_nfs_fsync_exit(inode, ret);
|
|
return ret;
|
|
return ret;
|
|
}
|
|
}
|
|
|
|
+EXPORT_SYMBOL_GPL(nfs_file_fsync);
|
|
|
|
|
|
/*
|
|
/*
|
|
* Decide whether a read/modify/write cycle may be more efficient
|
|
* Decide whether a read/modify/write cycle may be more efficient
|