From: Klara Modin <klarasmodin@gmail.com>
To: Caleb Sander Mateos <csander@purestorage.com>
Cc: Jens Axboe <axboe@kernel.dk>,
io-uring@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] io_uring/uring_cmd: add io_uring_cmd_tw_t type alias
Date: Sun, 7 Sep 2025 14:33:59 +0200 [thread overview]
Message-ID: <3h5wdobeinxy7bbhvw3aztcns33cea3irxg4ckwvmds56ynyi4@45fy2e3uemz2> (raw)
In-Reply-To: <20250902160657.1726828-1-csander@purestorage.com>
Hi,
On 2025-09-02 10:06:56 -0600, Caleb Sander Mateos wrote:
> Introduce a function pointer type alias io_uring_cmd_tw_t for the
> uring_cmd task work callback. This avoids repeating the signature in
> several places. Also name both arguments to the callback to clarify what
> they represent.
>
> Signed-off-by: Caleb Sander Mateos <csander@purestorage.com>
> ---
> include/linux/io_uring/cmd.h | 13 ++++++++-----
> io_uring/uring_cmd.c | 2 +-
> 2 files changed, 9 insertions(+), 6 deletions(-)
>
> diff --git a/include/linux/io_uring/cmd.h b/include/linux/io_uring/cmd.h
> index 4bd3a7339243..7211157edfe9 100644
> --- a/include/linux/io_uring/cmd.h
> +++ b/include/linux/io_uring/cmd.h
> @@ -9,15 +9,18 @@
> /* only top 8 bits of sqe->uring_cmd_flags for kernel internal use */
> #define IORING_URING_CMD_CANCELABLE (1U << 30)
> /* io_uring_cmd is being issued again */
> #define IORING_URING_CMD_REISSUE (1U << 31)
>
> +typedef void (*io_uring_cmd_tw_t)(struct io_uring_cmd *cmd,
> + unsigned issue_flags);
> +
> struct io_uring_cmd {
> struct file *file;
> const struct io_uring_sqe *sqe;
> /* callback to defer completions to task context */
> - void (*task_work_cb)(struct io_uring_cmd *cmd, unsigned);
> + io_uring_cmd_tw_t task_work_cb;
> u32 cmd_op;
> u32 flags;
> u8 pdu[32]; /* available inline for free use */
> };
>
> @@ -55,11 +58,11 @@ int io_uring_cmd_import_fixed_vec(struct io_uring_cmd *ioucmd,
> */
> void io_uring_cmd_done(struct io_uring_cmd *cmd, ssize_t ret, u64 res2,
> unsigned issue_flags);
>
> void __io_uring_cmd_do_in_task(struct io_uring_cmd *ioucmd,
> - void (*task_work_cb)(struct io_uring_cmd *, unsigned),
> + io_uring_cmd_tw_t task_work_cb,
> unsigned flags);
>
> /*
> * Note: the caller should never hard code @issue_flags and only use the
> * mask provided by the core io_uring code.
> @@ -104,11 +107,11 @@ static inline int io_uring_cmd_import_fixed_vec(struct io_uring_cmd *ioucmd,
> static inline void io_uring_cmd_done(struct io_uring_cmd *cmd, ssize_t ret,
> u64 ret2, unsigned issue_flags)
> {
> }
> static inline void __io_uring_cmd_do_in_task(struct io_uring_cmd *ioucmd,
> - void (*task_work_cb)(struct io_uring_cmd *, unsigned),
> + io_uring_tw_t task_work_cb,
There seems to have slipped in a typo for the !IO_URING stub here:
s/io_uring_tw_t/io_uring_cmd_tw_t/
> unsigned flags)
> {
> }
> static inline void io_uring_cmd_mark_cancelable(struct io_uring_cmd *cmd,
> unsigned int issue_flags)
...
Regards,
Klara Modin
next prev parent reply other threads:[~2025-09-07 12:34 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-09-02 16:06 [PATCH] io_uring/uring_cmd: add io_uring_cmd_tw_t type alias Caleb Sander Mateos
2025-09-02 17:46 ` Keith Busch
2025-09-03 1:21 ` Jens Axboe
2025-09-07 12:33 ` Klara Modin [this message]
2025-09-08 14:20 ` 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=3h5wdobeinxy7bbhvw3aztcns33cea3irxg4ckwvmds56ynyi4@45fy2e3uemz2 \
--to=klarasmodin@gmail.com \
--cc=axboe@kernel.dk \
--cc=csander@purestorage.com \
--cc=io-uring@vger.kernel.org \
--cc=linux-kernel@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox