diff options
author | Christoph Hellwig <hch@lst.de> | 2016-04-07 08:52:03 -0700 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2016-05-01 19:58:39 -0400 |
commit | e864f39569f4092c2b2bc72c773b6e486c7e3bd9 (patch) | |
tree | 4e2cadd87c25718956f26f11771ae9bf669ab380 /fs/read_write.c | |
parent | 6aa657c8526b8bbab6287f02dd91ac6d0c392d19 (diff) |
fs: add RWF_DSYNC aand RWF_SYNC
This is the per-I/O equivalent of O_DSYNC and O_SYNC, and very useful for
all kinds of file servers and storage targets.
Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs/read_write.c')
-rw-r--r-- | fs/read_write.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/fs/read_write.c b/fs/read_write.c index cf377cf9dfe3..3729d8d34797 100644 --- a/fs/read_write.c +++ b/fs/read_write.c @@ -698,12 +698,16 @@ static ssize_t do_iter_readv_writev(struct file *filp, struct iov_iter *iter, struct kiocb kiocb; ssize_t ret; - if (flags & ~RWF_HIPRI) + if (flags & ~(RWF_HIPRI | RWF_DSYNC | RWF_SYNC)) return -EOPNOTSUPP; init_sync_kiocb(&kiocb, filp); if (flags & RWF_HIPRI) kiocb.ki_flags |= IOCB_HIPRI; + if (flags & RWF_DSYNC) + kiocb.ki_flags |= IOCB_DSYNC; + if (flags & RWF_SYNC) + kiocb.ki_flags |= (IOCB_DSYNC | IOCB_SYNC); kiocb.ki_pos = *ppos; ret = fn(&kiocb, iter); |