From: Christoph Hellwig Date: Thu, 7 Apr 2016 15:52:02 +0000 (-0700) Subject: ceph: use generic_write_sync X-Git-Tag: v4.7-rc1~158^2~2 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=6aa657c8526b8bbab6287f02dd91ac6d0c392d19;p=karo-tx-linux.git ceph: use generic_write_sync Signed-off-by: Christoph Hellwig Signed-off-by: Al Viro --- 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;