Skip to content

Commit

Permalink
UBIFS: remove manual O_SYNC handling
Browse files Browse the repository at this point in the history
generic_file_aio_write already calls into ->fsync to handle O_SYNC/O_DSYNC.
Remove the duplicate call to ubifs_sync_wbufs_by_inode which is already
covered by ubifs_fsync.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
  • Loading branch information
Christoph Hellwig authored and Artem Bityutskiy committed Nov 24, 2009
1 parent 9722324 commit 774888b
Showing 1 changed file with 1 addition and 12 deletions.
13 changes: 1 addition & 12 deletions fs/ubifs/file.c
Original file line number Diff line number Diff line change
Expand Up @@ -1389,25 +1389,14 @@ static ssize_t ubifs_aio_write(struct kiocb *iocb, const struct iovec *iov,
unsigned long nr_segs, loff_t pos)
{
int err;
ssize_t ret;
struct inode *inode = iocb->ki_filp->f_mapping->host;
struct ubifs_info *c = inode->i_sb->s_fs_info;

err = update_mctime(c, inode);
if (err)
return err;

ret = generic_file_aio_write(iocb, iov, nr_segs, pos);
if (ret < 0)
return ret;

if (ret > 0 && (IS_SYNC(inode) || iocb->ki_filp->f_flags & O_SYNC)) {
err = ubifs_sync_wbufs_by_inode(c, inode);
if (err)
return err;
}

return ret;
return generic_file_aio_write(iocb, iov, nr_segs, pos);
}

static int ubifs_set_page_dirty(struct page *page)
Expand Down

0 comments on commit 774888b

Please sign in to comment.