ceph: use generic_write_sync
authorChristoph Hellwig <hch@lst.de>
Thu, 7 Apr 2016 15:52:02 +0000 (08:52 -0700)
committerAl Viro <viro@zeniv.linux.org.uk>
Sun, 1 May 2016 23:58:39 +0000 (19:58 -0400)
Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
fs/ceph/file.c

index a79f9269831e383ba03bbe5fe01f0e8f8bbec942..4f1dc7120916be699939ce03d46374bde72f6cca 100644 (file)
@@ -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;
This page took 0.039633 seconds and 5 git commands to generate.