From: Jens Axboe <axboe@kernel.dk>
To: io-uring@vger.kernel.org
Cc: Jens Axboe <axboe@kernel.dk>
Subject: [PATCH 3/4] io_uring: rename io_cancel_data->user_data to just 'data'
Date: Thu, 14 Apr 2022 14:24:18 -0600 [thread overview]
Message-ID: <20220414202419.201614-4-axboe@kernel.dk> (raw)
In-Reply-To: <20220414202419.201614-1-axboe@kernel.dk>
In preparation for putting other data in there than just the user_data,
rename it to a data.
Signed-off-by: Jens Axboe <axboe@kernel.dk>
---
fs/io_uring.c | 16 ++++++++--------
1 file changed, 8 insertions(+), 8 deletions(-)
diff --git a/fs/io_uring.c b/fs/io_uring.c
index c3955b9709c6..0ef8401b6552 100644
--- a/fs/io_uring.c
+++ b/fs/io_uring.c
@@ -6318,13 +6318,13 @@ static bool io_poll_disarm(struct io_kiocb *req)
struct io_cancel_data {
struct io_ring_ctx *ctx;
- u64 user_data;
+ u64 data;
};
static int io_poll_cancel(struct io_ring_ctx *ctx, struct io_cancel_data *cd)
__must_hold(&ctx->completion_lock)
{
- struct io_kiocb *req = io_poll_find(ctx, cd->user_data, false);
+ struct io_kiocb *req = io_poll_find(ctx, cd->data, false);
if (!req)
return -ENOENT;
@@ -6762,7 +6762,7 @@ static bool io_cancel_cb(struct io_wq_work *work, void *data)
struct io_kiocb *req = container_of(work, struct io_kiocb, work);
struct io_cancel_data *cd = data;
- return req->ctx == cd->ctx && req->cqe.user_data == cd->user_data;
+ return req->ctx == cd->ctx && req->cqe.user_data == cd->data;
}
static int io_async_cancel_one(struct io_uring_task *tctx,
@@ -6812,7 +6812,7 @@ static int io_try_cancel_userdata(struct io_kiocb *req,
goto out;
spin_lock_irq(&ctx->timeout_lock);
- ret = io_timeout_cancel(ctx, cd->user_data);
+ ret = io_timeout_cancel(ctx, cd->data);
spin_unlock_irq(&ctx->timeout_lock);
out:
spin_unlock(&ctx->completion_lock);
@@ -6838,8 +6838,8 @@ static int io_async_cancel(struct io_kiocb *req, unsigned int issue_flags)
{
struct io_ring_ctx *ctx = req->ctx;
struct io_cancel_data cd = {
- .ctx = ctx,
- .user_data = req->cancel.addr,
+ .ctx = ctx,
+ .data = req->cancel.addr,
};
struct io_tctx_node *node;
int ret;
@@ -7460,8 +7460,8 @@ static void io_req_task_link_timeout(struct io_kiocb *req, bool *locked)
if (prev) {
if (!(req->task->flags & PF_EXITING)) {
struct io_cancel_data cd = {
- .ctx = req->ctx,
- .user_data = prev->cqe.user_data,
+ .ctx = req->ctx,
+ .data = prev->cqe.user_data,
};
ret = io_try_cancel_userdata(req, &cd);
--
2.35.1
next prev parent reply other threads:[~2022-04-14 20:24 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-04-14 20:24 [PATCHSET next 0/4] Allow cancelation based on fd Jens Axboe
2022-04-14 20:24 ` [PATCH 1/4] io_uring: remove dead 'poll_only' argument to io_poll_cancel() Jens Axboe
2022-04-14 20:24 ` [PATCH 2/4] io_uring: pass in struct io_cancel_data consistently Jens Axboe
2022-04-14 20:24 ` Jens Axboe [this message]
2022-04-14 20:24 ` [PATCH 4/4] io_uring: allow IORING_OP_ASYNC_CANCEL with 'fd' key Jens Axboe
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20220414202419.201614-4-axboe@kernel.dk \
--to=axboe@kernel.dk \
--cc=io-uring@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.