From: Ming Lei <ming.lei@redhat.com>
To: Caleb Sander Mateos <csander@purestorage.com>
Cc: Jens Axboe <axboe@kernel.dk>,
linux-block@vger.kernel.org,
Uday Shankar <ushankar@purestorage.com>
Subject: Re: [PATCH V2 3/5] ublk: use flexible array for ublk_queue.ios
Date: Wed, 29 Oct 2025 10:51:36 +0800 [thread overview]
Message-ID: <aQGBOLwiqKILxIAB@fedora> (raw)
In-Reply-To: <CADUfDZr-4iq752TrPjb8a9u_Wsa73dFMz_Z5_P8rmJjPUe5dGQ@mail.gmail.com>
On Tue, Oct 28, 2025 at 02:52:25PM -0700, Caleb Sander Mateos wrote:
> On Tue, Oct 28, 2025 at 1:57 AM Ming Lei <ming.lei@redhat.com> wrote:
> >
> > Convert ublk_queue to use DECLARE_FLEX_ARRAY for the ios field and
> > use struct_size() for allocation, following kernel best practices.
> >
> > Changes in this commit:
> >
> > 1. Convert ios field from "struct ublk_io ios[]" to use
> > DECLARE_FLEX_ARRAY(struct ublk_io, ios) for consistency with
> > modern kernel style.
>
> Documentation/process/deprecated.rst suggests that
> DECLARE_FLEX_ARRAY() is discouraged except in the niche cases when
> it's necessary (which don't apply here). Or am I misunderstanding
> something?
You are right, DECLARE_FLEX_ARRAY is only needed:
```
when the flexible array is either alone in a struct or is part of a union.
```
> However, struct ublk_io ios[] does seem like a good use
> case for __counted_by().
Good point!
Thanks,
Ming
next prev parent reply other threads:[~2025-10-29 2:51 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-10-28 8:56 [PATCH V2 0/5] ublk: NUMA-aware memory allocation Ming Lei
2025-10-28 8:56 ` [PATCH V2 1/5] ublk: reorder tag_set initialization before queue allocation Ming Lei
2025-10-28 8:56 ` [PATCH V2 2/5] ublk: implement NUMA-aware memory allocation Ming Lei
2025-10-28 8:56 ` [PATCH V2 3/5] ublk: use flexible array for ublk_queue.ios Ming Lei
2025-10-28 21:52 ` Caleb Sander Mateos
2025-10-29 2:51 ` Ming Lei [this message]
2025-10-28 8:56 ` [PATCH V2 4/5] selftests: ublk: set CPU affinity before thread initialization Ming Lei
2025-10-28 8:56 ` [PATCH V2 5/5] selftests: ublk: make ublk_thread thread-local variable Ming Lei
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=aQGBOLwiqKILxIAB@fedora \
--to=ming.lei@redhat.com \
--cc=axboe@kernel.dk \
--cc=csander@purestorage.com \
--cc=linux-block@vger.kernel.org \
--cc=ushankar@purestorage.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