summaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorGoldwyn Rodrigues <rgoldwyn@suse.com>2017-06-20 14:05:40 +0200
committerJens Axboe <axboe@kernel.dk>2017-06-20 15:12:03 +0200
commitfdd2f5b7de2afaa931e5f7bad7bcda35d1f1b479 (patch)
tree2774b3a9c34b3529c8efef0842b4fbd71583c2fc /fs
parentnvme: host: unquiesce queue in nvme_kill_queues() (diff)
downloadlinux-fdd2f5b7de2afaa931e5f7bad7bcda35d1f1b479.tar.xz
linux-fdd2f5b7de2afaa931e5f7bad7bcda35d1f1b479.zip
fs: Separate out kiocb flags setup based on RWF_* flags
Also added RWF_SUPPORTED to encompass all flags. Reviewed-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Jan Kara <jack@suse.cz> Signed-off-by: Goldwyn Rodrigues <rgoldwyn@suse.com> Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'fs')
-rw-r--r--fs/read_write.c12
1 files changed, 3 insertions, 9 deletions
diff --git a/fs/read_write.c b/fs/read_write.c
index 47c1d4484df9..53c816c61122 100644
--- a/fs/read_write.c
+++ b/fs/read_write.c
@@ -678,16 +678,10 @@ static ssize_t do_iter_readv_writev(struct file *filp, struct iov_iter *iter,
struct kiocb kiocb;
ssize_t ret;
- 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);
+ ret = kiocb_set_rw_flags(&kiocb, flags);
+ if (ret)
+ return ret;
kiocb.ki_pos = *ppos;
if (type == READ)