Re: [PATCH 4/7] vfs: add the RWF_HIPRI flag for preadv2/pwritev2

Started by Jeff Moyer on Feb 26, 2016 · 2 messages from 2 authors · Last reply Feb 27, 2016

open the first message on its own page

Message details and related content
Christoph Hellwig [off-list ref] writes:
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.
I'm not in love with the HIGHPRI name, but I don't have a better one in
mind.  So...

Acked-by: Jeff Moyer <redacted>
quoted hunk
Signed-off-by: Christoph Hellwig <redacted>
---
 fs/read_write.c         | 6 ++++--
 include/linux/fs.h      | 1 +
 include/uapi/linux/fs.h | 3 +++
 3 files changed, 8 insertions(+), 2 deletions(-)
diff --git a/fs/read_write.c b/fs/read_write.c
index 38b9afa..3b3fb22 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,
 	struct kiocb kiocb;
 	ssize_t ret;
 
-	if (flags)
+	if (flags & ~RWF_HIPRI)
 		return -EOPNOTSUPP;
 
 	init_sync_kiocb(&kiocb, filp);
+	if (flags & RWF_HIPRI)
+		kiocb.ki_flags |= IOCB_HIPRI;
 	kiocb.ki_pos = *ppos;
 
 	ret = fn(&kiocb, iter);
@@ -715,7 +717,7 @@ static ssize_t do_loop_readv_writev(struct file *filp, struct iov_iter *iter,
 {
 	ssize_t ret = 0;
 
-	if (flags)
+	if (flags & ~RWF_HIPRI)
 		return -EOPNOTSUPP;
 
 	while (iov_iter_count(iter)) {
diff --git a/include/linux/fs.h b/include/linux/fs.h
index 875277a..a1f731c 100644
--- a/include/linux/fs.h
+++ b/include/linux/fs.h
@@ -320,6 +320,7 @@ struct writeback_control;

19 more quoted lines

Message details and related content
On Fri, Feb 26, 2016 at 04:56:03PM -0500, Jeff Moyer wrote:
Christoph Hellwig [off-list ref] writes:
quoted
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.
I'm not in love with the HIGHPRI name, but I don't have a better one in
mind.  So...
I don't really like it too much either.  So if someone else has a better
suggestion: you're welcome!
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help