|
Gabriel Krisman Bertazi |
f3ccda |
From ecddc25d1355d0ce2b486a4991b826b6e87875a9 Mon Sep 17 00:00:00 2001
|
|
Gabriel Krisman Bertazi |
f3ccda |
From: Jens Axboe <axboe@kernel.dk>
|
|
Gabriel Krisman Bertazi |
f3ccda |
Date: Mon, 23 May 2022 16:13:56 -0600
|
|
Gabriel Krisman Bertazi |
f3ccda |
Subject: [PATCH] io_uring: make timeout prep handlers consistent with other
|
|
Gabriel Krisman Bertazi |
f3ccda |
prep handlers
|
|
Gabriel Krisman Bertazi |
f3ccda |
Git-commit: ecddc25d1355d0ce2b486a4991b826b6e87875a9
|
|
Gabriel Krisman Bertazi |
f3ccda |
Patch-mainline: v5.19-rc1
|
|
Gabriel Krisman Bertazi |
f3ccda |
References: bsc#1205205
|
|
Gabriel Krisman Bertazi |
f3ccda |
|
|
Gabriel Krisman Bertazi |
f3ccda |
All other opcodes take a {req, sqe} set for prep handling, split out
|
|
Gabriel Krisman Bertazi |
f3ccda |
a timeout prep handler so that timeout and linked timeouts can use
|
|
Gabriel Krisman Bertazi |
f3ccda |
the same one.
|
|
Gabriel Krisman Bertazi |
f3ccda |
|
|
Gabriel Krisman Bertazi |
f3ccda |
Reviewed-by: Kanchan Joshi <joshi.k@samsung.com>
|
|
Gabriel Krisman Bertazi |
f3ccda |
Signed-off-by: Jens Axboe <axboe@kernel.dk>
|
|
Gabriel Krisman Bertazi |
f3ccda |
Signed-off-by: Gabriel Krisman Bertazi <krisman@suse.de>
|
|
Gabriel Krisman Bertazi |
f3ccda |
---
|
|
Gabriel Krisman Bertazi |
f3ccda |
fs/io_uring.c | 21 +++++++++++++++++----
|
|
Gabriel Krisman Bertazi |
f3ccda |
1 file changed, 17 insertions(+), 4 deletions(-)
|
|
Gabriel Krisman Bertazi |
f3ccda |
|
|
Gabriel Krisman Bertazi |
f3ccda |
diff --git a/fs/io_uring.c b/fs/io_uring.c
|
|
Gabriel Krisman Bertazi |
f3ccda |
index 9f1c682d7caf..c3991034b26a 100644
|
|
Gabriel Krisman Bertazi |
f3ccda |
--- a/fs/io_uring.c
|
|
Gabriel Krisman Bertazi |
f3ccda |
+++ b/fs/io_uring.c
|
|
Gabriel Krisman Bertazi |
f3ccda |
@@ -7698,8 +7698,9 @@ static int io_timeout_remove(struct io_kiocb *req, unsigned int issue_flags)
|
|
Gabriel Krisman Bertazi |
f3ccda |
return 0;
|
|
Gabriel Krisman Bertazi |
f3ccda |
}
|
|
Gabriel Krisman Bertazi |
f3ccda |
|
|
Gabriel Krisman Bertazi |
f3ccda |
-static int io_timeout_prep(struct io_kiocb *req, const struct io_uring_sqe *sqe,
|
|
Gabriel Krisman Bertazi |
f3ccda |
- bool is_timeout_link)
|
|
Gabriel Krisman Bertazi |
f3ccda |
+static int __io_timeout_prep(struct io_kiocb *req,
|
|
Gabriel Krisman Bertazi |
f3ccda |
+ const struct io_uring_sqe *sqe,
|
|
Gabriel Krisman Bertazi |
f3ccda |
+ bool is_timeout_link)
|
|
Gabriel Krisman Bertazi |
f3ccda |
{
|
|
Gabriel Krisman Bertazi |
f3ccda |
struct io_timeout_data *data;
|
|
Gabriel Krisman Bertazi |
f3ccda |
unsigned flags;
|
|
Gabriel Krisman Bertazi |
f3ccda |
@@ -7754,6 +7755,18 @@ static int io_timeout_prep(struct io_kiocb *req, const struct io_uring_sqe *sqe,
|
|
Gabriel Krisman Bertazi |
f3ccda |
return 0;
|
|
Gabriel Krisman Bertazi |
f3ccda |
}
|
|
Gabriel Krisman Bertazi |
f3ccda |
|
|
Gabriel Krisman Bertazi |
f3ccda |
+static int io_timeout_prep(struct io_kiocb *req,
|
|
Gabriel Krisman Bertazi |
f3ccda |
+ const struct io_uring_sqe *sqe)
|
|
Gabriel Krisman Bertazi |
f3ccda |
+{
|
|
Gabriel Krisman Bertazi |
f3ccda |
+ return __io_timeout_prep(req, sqe, false);
|
|
Gabriel Krisman Bertazi |
f3ccda |
+}
|
|
Gabriel Krisman Bertazi |
f3ccda |
+
|
|
Gabriel Krisman Bertazi |
f3ccda |
+static int io_link_timeout_prep(struct io_kiocb *req,
|
|
Gabriel Krisman Bertazi |
f3ccda |
+ const struct io_uring_sqe *sqe)
|
|
Gabriel Krisman Bertazi |
f3ccda |
+{
|
|
Gabriel Krisman Bertazi |
f3ccda |
+ return __io_timeout_prep(req, sqe, true);
|
|
Gabriel Krisman Bertazi |
f3ccda |
+}
|
|
Gabriel Krisman Bertazi |
f3ccda |
+
|
|
Gabriel Krisman Bertazi |
f3ccda |
static int io_timeout(struct io_kiocb *req, unsigned int issue_flags)
|
|
Gabriel Krisman Bertazi |
f3ccda |
{
|
|
Gabriel Krisman Bertazi |
f3ccda |
struct io_ring_ctx *ctx = req->ctx;
|
|
Gabriel Krisman Bertazi |
f3ccda |
@@ -8039,13 +8052,13 @@ static int io_req_prep(struct io_kiocb *req, const struct io_uring_sqe *sqe)
|
|
Gabriel Krisman Bertazi |
f3ccda |
case IORING_OP_CONNECT:
|
|
Gabriel Krisman Bertazi |
f3ccda |
return io_connect_prep(req, sqe);
|
|
Gabriel Krisman Bertazi |
f3ccda |
case IORING_OP_TIMEOUT:
|
|
Gabriel Krisman Bertazi |
f3ccda |
- return io_timeout_prep(req, sqe, false);
|
|
Gabriel Krisman Bertazi |
f3ccda |
+ return io_timeout_prep(req, sqe);
|
|
Gabriel Krisman Bertazi |
f3ccda |
case IORING_OP_TIMEOUT_REMOVE:
|
|
Gabriel Krisman Bertazi |
f3ccda |
return io_timeout_remove_prep(req, sqe);
|
|
Gabriel Krisman Bertazi |
f3ccda |
case IORING_OP_ASYNC_CANCEL:
|
|
Gabriel Krisman Bertazi |
f3ccda |
return io_async_cancel_prep(req, sqe);
|
|
Gabriel Krisman Bertazi |
f3ccda |
case IORING_OP_LINK_TIMEOUT:
|
|
Gabriel Krisman Bertazi |
f3ccda |
- return io_timeout_prep(req, sqe, true);
|
|
Gabriel Krisman Bertazi |
f3ccda |
+ return io_link_timeout_prep(req, sqe);
|
|
Gabriel Krisman Bertazi |
f3ccda |
case IORING_OP_ACCEPT:
|
|
Gabriel Krisman Bertazi |
f3ccda |
return io_accept_prep(req, sqe);
|
|
Gabriel Krisman Bertazi |
f3ccda |
case IORING_OP_FALLOCATE:
|
|
Gabriel Krisman Bertazi |
f3ccda |
--
|
|
Gabriel Krisman Bertazi |
f3ccda |
2.35.3
|
|
Gabriel Krisman Bertazi |
f3ccda |
|