Re: [PATCH] 9p/xen: Use flexible array for data rings

Rosen Penev <[email protected]> Tue, 26 May 2026 23:38:39 -0700
Newsgroups dev.linux.lists.v9fs,org.kernel.vger.linux-kernel
Message-ID <CAKxU2N-t6mjfGPmeRq3ychV0XKULhwOvq7EVQHtjG2eQ=KDGpQ@mail.gmail.com>
On Tue, May 26, 2026 at 10:39 PM Jürgen Groß <[email protected]> wrote:
>
> On 19.05.26 03:57, Rosen Penev wrote:
> > Store the fixed set of Xen 9p data rings in the frontend private
> > allocation instead of allocating a separate rings array.
> >
> > This keeps the data ring storage tied to the frontend lifetime and
> > simplifies the allocation and cleanup paths.
> >
> > Assisted-by: Codex:GPT-5.5
> > Signed-off-by: Rosen Penev <[email protected]>
> > ---
> >   net/9p/trans_xen.c | 68 ++++++++++++++++++++--------------------------
> >   1 file changed, 30 insertions(+), 38 deletions(-)
> >
> > diff --git a/net/9p/trans_xen.c b/net/9p/trans_xen.c
> > index f9fb2db7a066..5a110d71d18c 100644
> > --- a/net/9p/trans_xen.c
> > +++ b/net/9p/trans_xen.c
> > @@ -55,7 +55,7 @@ struct xen_9pfs_front_priv {
> >       char *tag;
> >       struct p9_client *client;
> >
> > -     struct xen_9pfs_dataring *rings;
> > +     struct xen_9pfs_dataring rings[];
>
> Any reason not to use rings[XEN_9PFS_NUM_RINGS] instead of a flex array?
>
> The number of rings is a compile time constant, after all!
flexibility really. I don't know if this will ever change.
>
>
> Juergen