lkml.org 
[lkml]   [2024]   [Apr]   [11]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH 058/437] fs: add IOCB_VECTORED flags
Date
This allows a user of ->read_iter() or ->write_iter() to tell if this
request originally came as a readv/writev, or if it was a normal
read/write operation.

Signed-off-by: Jens Axboe <axboe@kernel.dk>
---
fs/read_write.c | 1 +
include/linux/fs.h | 2 ++
2 files changed, 3 insertions(+)

diff --git a/fs/read_write.c b/fs/read_write.c
index 1d035293607b..efddd395d436 100644
--- a/fs/read_write.c
+++ b/fs/read_write.c
@@ -733,6 +733,7 @@ static ssize_t do_iter_readv_writev(struct file *filp, struct iov_iter *iter,
ret = kiocb_set_rw_flags(&kiocb, flags);
if (ret)
return ret;
+ kiocb.ki_flags |= IOCB_VECTORED;
kiocb.ki_pos = (ppos ? *ppos : 0);

if (type == READ)
diff --git a/include/linux/fs.h b/include/linux/fs.h
index 483c70d3941e..69e4dfac2853 100644
--- a/include/linux/fs.h
+++ b/include/linux/fs.h
@@ -346,6 +346,8 @@ struct readahead_control;
#define IOCB_DIO_CALLER_COMP (1 << 22)
/* kiocb is a read or write operation submitted by fs/aio.c. */
#define IOCB_AIO_RW (1 << 23)
+/* came from readv/writev */
+#define IOCB_VECTORED (1 << 24)

/* for use in trace events */
#define TRACE_IOCB_STRINGS \
--
2.43.0

\
 
 \ /
  Last update: 2024-05-27 16:36    [W:1.675 / U:0.364 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site