summaryrefslogtreecommitdiffstats
path: root/fs/read_write.c
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2016-03-03 10:04:01 -0500
committerAl Viro <viro@zeniv.linux.org.uk>2016-03-04 12:20:10 -0500
commit97be7ebe53915af504fb491fb99f064c7cf3cb09 (patch)
treebf2995e974c538c38d5db5c4fbf9486cce478d81 /fs/read_write.c
parent4babf2c5efb79be778d45ebe95d9c9b3c880c83b (diff)
vfs: add the RWF_HIPRI flag for preadv2/pwritev2
This adds a flag that tells the file system that this is a high priority request for which it's worth to poll the hardware. The flag is purely advisory and can be ignored if not supported. Signed-off-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Stephen Bates <stephen.bates@pmcs.com> Tested-by: Stephen Bates <stephen.bates@pmcs.com> Acked-by: Jeff Moyer <jmoyer@redhat.com> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs/read_write.c')
-rw-r--r--fs/read_write.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/fs/read_write.c b/fs/read_write.c
index e9c9e2a667ce..07c53db04ec1 100644
--- a/fs/read_write.c
+++ b/fs/read_write.c
@@ -697,10 +697,12 @@ static ssize_t do_iter_readv_writev(struct file *filp, struct iov_iter *iter,
697 struct kiocb kiocb; 697 struct kiocb kiocb;
698 ssize_t ret; 698 ssize_t ret;
699 699
700 if (flags) 700 if (flags & ~RWF_HIPRI)
701 return -EOPNOTSUPP; 701 return -EOPNOTSUPP;
702 702
703 init_sync_kiocb(&kiocb, filp); 703 init_sync_kiocb(&kiocb, filp);
704 if (flags & RWF_HIPRI)
705 kiocb.ki_flags |= IOCB_HIPRI;
704 kiocb.ki_pos = *ppos; 706 kiocb.ki_pos = *ppos;
705 707
706 ret = fn(&kiocb, iter); 708 ret = fn(&kiocb, iter);
@@ -715,7 +717,7 @@ static ssize_t do_loop_readv_writev(struct file *filp, struct iov_iter *iter,
715{ 717{
716 ssize_t ret = 0; 718 ssize_t ret = 0;
717 719
718 if (flags) 720 if (flags & ~RWF_HIPRI)
719 return -EOPNOTSUPP; 721 return -EOPNOTSUPP;
720 722
721 while (iov_iter_count(iter)) { 723 while (iov_iter_count(iter)) {