From: Christoph Hellwig <[email protected]>
To: Breno Leitao <[email protected]>
Cc: [email protected], [email protected],
[email protected], [email protected], [email protected],
[email protected], [email protected],
[email protected], [email protected], [email protected],
[email protected]
Subject: Re: [PATCH v2 2/3] io_uring: Pass whole sqe to commands
Date: Mon, 24 Apr 2023 09:23:39 +0200 [thread overview]
Message-ID: <[email protected]> (raw)
In-Reply-To: <[email protected]>
On Fri, Apr 21, 2023 at 04:44:39AM -0700, Breno Leitao wrote:
> - struct ublksrv_io_cmd *ub_cmd = (struct ublksrv_io_cmd *)cmd->cmd;
> + struct ublksrv_io_cmd *ub_cmd = (struct ublksrv_io_cmd *)cmd->sqe->cmd;
As mentioned in my (late) reply to the previous series, please
add a helper like:
static inline const void *io_uring_sqe_cmd(struct io_uring_sqe *sqe)
{
return sqe->cmd;
}
and then avoid all these casts.
> int io_uring_cmd_prep_async(struct io_kiocb *req)
> {
> struct io_uring_cmd *ioucmd = io_kiocb_to_cmd(req, struct io_uring_cmd);
> + size_t size = uring_sqe_size(req->ctx);
>
> BUILD_BUG_ON(uring_cmd_pdu_size(0) != 16);
> BUILD_BUG_ON(uring_cmd_pdu_size(1) != 80);
>
> + memcpy(req->async_data, ioucmd->sqe, size);
> + ioucmd->sqe = req->async_data;
This can skip the size local variable now.
next prev parent reply other threads:[~2023-04-24 7:24 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <CGME20230421114703epcas5p37cd0ddb29674d8f3d5fe2f1fa494d1f0@epcas5p3.samsung.com>
2023-04-21 11:44 ` [PATCH v2 0/3] io_uring: Pass the whole sqe to commands Breno Leitao
2023-04-21 11:44 ` [PATCH v2 1/3] io_uring: Create a helper to return the SQE size Breno Leitao
2023-04-24 7:19 ` Christoph Hellwig
2023-04-21 11:44 ` [PATCH v2 2/3] io_uring: Pass whole sqe to commands Breno Leitao
2023-04-24 7:23 ` Christoph Hellwig [this message]
2023-04-21 11:44 ` [PATCH v2 3/3] io_uring: Remove unnecessary BUILD_BUG_ON Breno Leitao
2023-04-24 7:23 ` Christoph Hellwig
2023-04-28 17:27 ` Jens Axboe
2023-04-21 12:16 ` [PATCH v2 0/3] io_uring: Pass the whole sqe to commands Kanchan Joshi
2023-04-28 17:28 ` Jens Axboe
2023-04-30 14:39 ` Breno Leitao
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 \
[email protected] \
[email protected] \
[email protected] \
[email protected] \
[email protected] \
[email protected] \
[email protected] \
[email protected] \
[email protected] \
[email protected] \
[email protected] \
[email protected] \
[email protected] \
/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