public inbox for io-uring@vger.kernel.org
 help / color / mirror / Atom feed
From: Caleb Sander Mateos <csander@purestorage.com>
To: Jens Axboe <axboe@kernel.dk>
Cc: Chris Mason <clm@fb.com>, Josef Bacik <josef@toxicpanda.com>,
	David Sterba <dsterba@suse.com>,
	 Mark Harmstone <maharmstone@fb.com>,
	linux-btrfs@vger.kernel.org, io-uring@vger.kernel.org,
	 linux-kernel@vger.kernel.org
Subject: Re: [PATCH 3/4] btrfs/ioctl: store btrfs_uring_encoded_data in io_btrfs_cmd
Date: Tue, 8 Jul 2025 14:32:24 -0400	[thread overview]
Message-ID: <CADUfDZppvPG9iZg6ED0ZUW_ms1EnNUJwwYyAJ7eCTWsJqa417w@mail.gmail.com> (raw)
In-Reply-To: <76ea020f-7f57-42d5-9f86-b21f732be603@kernel.dk>

On Tue, Jul 8, 2025 at 2:17 PM Jens Axboe <axboe@kernel.dk> wrote:
>
> On 7/2/25 1:51 PM, Caleb Sander Mateos wrote:
> > On Tue, Jul 1, 2025 at 3:06?PM Jens Axboe <axboe@kernel.dk> wrote:
> >>
> >>> @@ -4811,11 +4813,15 @@ static int btrfs_uring_encoded_read(struct io_uring_cmd *cmd, unsigned int issue
> >>>       loff_t pos;
> >>>       struct kiocb kiocb;
> >>>       struct extent_state *cached_state = NULL;
> >>>       u64 start, lockend;
> >>>       void __user *sqe_addr;
> >>> -     struct btrfs_uring_encoded_data *data = io_uring_cmd_get_async_data(cmd)->op_data;
> >>> +     struct io_btrfs_cmd *bc = io_uring_cmd_to_pdu(cmd, struct io_btrfs_cmd);
> >>> +     struct btrfs_uring_encoded_data *data = NULL;
> >>> +
> >>> +     if (cmd->flags & IORING_URING_CMD_REISSUE)
> >>> +             data = bc->data;
> >>
> >> Can this be a btrfs io_btrfs_cmd specific flag? Doesn't seem like it
> >> would need to be io_uring wide.
> >
> > Maybe. But where are you thinking it would be stored? I don't think
> > io_uring_cmd's pdu field would work because it's not initialized
> > before the first call to ->uring_cmd(). That's the whole reason I
> > needed to add a flag to tell whether this was the first call to
> > ->uring_cmd() or a subsequent one.
> > I also put the flag in the uring_cmd layer because that's where
> > op_data was defined. Even though btrfs is the only current user of
> > op_data, it seems like it was intended as a generic mechanism that
> > other ->uring_cmd() implementations might want to use. It seems like
> > the same argument would apply to this flag.
> > Thoughts?
>
> It's probably fine as-is, it was just some quick reading of it.
>
> I'd like to stage this up so we can get it done for 6.17. Can you
> respind with the other minor comments addressed? And then we can attempt
> to work this out with the btrfs side.

Sure, I can definitely incorporate the refactoring suggestion. Will
try to resend the patch series today.

Best,
Caleb

  reply	other threads:[~2025-07-08 18:32 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-06-19 19:27 [PATCH 0/4] io_uring/btrfs: remove struct io_uring_cmd_data Caleb Sander Mateos
2025-06-19 19:27 ` [PATCH 1/4] btrfs/ioctl: don't skip accounting in early ENOTTY return Caleb Sander Mateos
2025-06-19 19:27 ` [PATCH 2/4] io_uring/cmd: introduce IORING_URING_CMD_REISSUE flag Caleb Sander Mateos
2025-07-01 19:03   ` Jens Axboe
2025-07-02  6:27     ` Daniel Vacek
2025-07-02  6:44       ` Ammar Faizi
2025-07-02  7:00         ` Alan Huang
2025-07-02 13:47         ` Jens Axboe
2025-06-19 19:27 ` [PATCH 3/4] btrfs/ioctl: store btrfs_uring_encoded_data in io_btrfs_cmd Caleb Sander Mateos
2025-07-01 19:05   ` Jens Axboe
2025-07-02 19:51     ` Caleb Sander Mateos
2025-07-08 18:17       ` Jens Axboe
2025-07-08 18:32         ` Caleb Sander Mateos [this message]
2025-06-19 19:27 ` [PATCH 4/4] io_uring/cmd: remove struct io_uring_cmd_data Caleb Sander Mateos
2025-06-20 15:47 ` [PATCH 0/4] io_uring/btrfs: " David Sterba
2025-07-01 15:01   ` David Sterba

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=CADUfDZppvPG9iZg6ED0ZUW_ms1EnNUJwwYyAJ7eCTWsJqa417w@mail.gmail.com \
    --to=csander@purestorage.com \
    --cc=axboe@kernel.dk \
    --cc=clm@fb.com \
    --cc=dsterba@suse.com \
    --cc=io-uring@vger.kernel.org \
    --cc=josef@toxicpanda.com \
    --cc=linux-btrfs@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=maharmstone@fb.com \
    /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