summaryrefslogtreecommitdiff
path: root/fs/ceph/file.c
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2016-04-07 08:52:02 -0700
committerAl Viro <viro@zeniv.linux.org.uk>2016-05-01 19:58:39 -0400
commit6aa657c8526b8bbab6287f02dd91ac6d0c392d19 (patch)
tree1b261ca315793fd280ccf9c77bf6568c9ff90f2a /fs/ceph/file.c
parente259221763a40403d5bb232209998e8c45804ab8 (diff)
ceph: use generic_write_sync
Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs/ceph/file.c')
-rw-r--r--fs/ceph/file.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/fs/ceph/file.c b/fs/ceph/file.c
index a79f9269831e..4f1dc7120916 100644
--- a/fs/ceph/file.c
+++ b/fs/ceph/file.c
@@ -1382,12 +1382,11 @@ retry_snap:
ceph_cap_string(got));
ceph_put_cap_refs(ci, got);
- if (written >= 0 &&
- ((file->f_flags & O_SYNC) || IS_SYNC(file->f_mapping->host) ||
- ceph_osdmap_flag(osdc->osdmap, CEPH_OSDMAP_NEARFULL))) {
- err = vfs_fsync_range(file, pos, pos + written - 1, 1);
- if (err < 0)
- written = err;
+ if (written >= 0) {
+ if (ceph_osdmap_flag(osdc->osdmap, CEPH_OSDMAP_NEARFULL))
+ iocb->ki_flags |= IOCB_DSYNC;
+
+ written = generic_write_sync(iocb, written);
}
goto out_unlocked;