Skip to content

Commit

Permalink
ceph: use generic_write_sync
Browse files Browse the repository at this point in the history
Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
  • Loading branch information
Christoph Hellwig authored and Al Viro committed May 1, 2016
1 parent e259221 commit 6aa657c
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions fs/ceph/file.c
Original file line number Diff line number Diff line change
Expand Up @@ -1382,12 +1382,11 @@ static ssize_t ceph_write_iter(struct kiocb *iocb, struct iov_iter *from)
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;
Expand Down

0 comments on commit 6aa657c

Please sign in to comment.