summaryrefslogtreecommitdiff
path: root/io_uring/io_uring.h
diff options
context:
space:
mode:
authorJens Axboe <axboe@kernel.dk>2022-05-24 21:19:47 -0600
committerJens Axboe <axboe@kernel.dk>2022-07-24 18:39:11 -0600
commit531113bbd5bfc93e8de45440752af11c751e4aaf (patch)
treea4643adc406a76ed1f27d30d3fab96c785620e4e /io_uring/io_uring.h
parent11aeb71406ddd0ef526ad1df48b54aae628aad3b (diff)
io_uring: split out splice related operations
This splits out splice and tee support. Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'io_uring/io_uring.h')
-rw-r--r--io_uring/io_uring.h19
1 files changed, 19 insertions, 0 deletions
diff --git a/io_uring/io_uring.h b/io_uring/io_uring.h
index 73943dbe884e..02c00122b97a 100644
--- a/io_uring/io_uring.h
+++ b/io_uring/io_uring.h
@@ -9,10 +9,29 @@ enum {
IOU_ISSUE_SKIP_COMPLETE = -EIOCBQUEUED,
};
+static inline void req_set_fail(struct io_kiocb *req)
+{
+ req->flags |= REQ_F_FAIL;
+ if (req->flags & REQ_F_CQE_SKIP) {
+ req->flags &= ~REQ_F_CQE_SKIP;
+ req->flags |= REQ_F_SKIP_LINK_CQES;
+ }
+}
+
static inline void io_req_set_res(struct io_kiocb *req, s32 res, u32 cflags)
{
req->cqe.res = res;
req->cqe.flags = cflags;
}
+static inline void io_put_file(struct file *file)
+{
+ if (file)
+ fput(file);
+}
+
+struct file *io_file_get_normal(struct io_kiocb *req, int fd);
+struct file *io_file_get_fixed(struct io_kiocb *req, int fd,
+ unsigned issue_flags);
+
#endif