[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAEogwTCH8qqjAnSpT0GDn+NuAps8dNbfcPVQ9h8kfOWNbzrD0w@mail.gmail.com>
Date: Wed, 26 Aug 2020 07:21:35 +0530
From: Allen Pais <allen.cryptic@...il.com>
To: James Bottomley <James.Bottomley@...senpartnership.com>
Cc: Allen <allen.lkml@...il.com>, Jens Axboe <axboe@...nel.dk>,
Kees Cook <keescook@...omium.org>, jdike@...toit.com,
richard@....at, anton.ivanov@...bridgegreys.com, 3chas3@...il.com,
stefanr@...6.in-berlin.de, airlied@...ux.ie,
Daniel Vetter <daniel@...ll.ch>, sre@...nel.org,
kys@...rosoft.com, deller@....de, dmitry.torokhov@...il.com,
jassisinghbrar@...il.com, shawnguo@...nel.org,
s.hauer@...gutronix.de, maximlevitsky@...il.com, oakad@...oo.com,
Ulf Hansson <ulf.hansson@...aro.org>,
mporter@...nel.crashing.org, alex.bou9@...il.com,
broonie@...nel.org, martyn@...chs.me.uk, manohar.vanga@...il.com,
mitch@...oth.com, David Miller <davem@...emloft.net>,
Jakub Kicinski <kuba@...nel.org>, linux-um@...ts.infradead.org,
linux-kernel@...r.kernel.org,
linux-atm-general@...ts.sourceforge.net, netdev@...r.kernel.org,
linux-block@...r.kernel.org, linux-arm-kernel@...ts.infradead.org,
openipmi-developer@...ts.sourceforge.net,
linux1394-devel@...ts.sourceforge.net,
intel-gfx@...ts.freedesktop.org, dri-devel@...ts.freedesktop.org,
linux-hyperv@...r.kernel.org, linux-parisc@...r.kernel.org,
linux-input@...r.kernel.org, linux-mmc@...r.kernel.org,
linux-ntb@...glegroups.com, linux-s390@...r.kernel.org,
linux-spi@...r.kernel.org, devel@...verdev.osuosl.org,
Romain Perier <romain.perier@...il.com>
Subject: Re: [PATCH] block: convert tasklets to use new tasklet_setup() API
On Thu, Aug 20, 2020 at 3:09 AM James Bottomley
<James.Bottomley@...senpartnership.com> wrote:
>
> On Wed, 2020-08-19 at 21:54 +0530, Allen wrote:
> > > [...]
> > > > > Since both threads seem to have petered out, let me suggest in
> > > > > kernel.h:
> > > > >
> > > > > #define cast_out(ptr, container, member) \
> > > > > container_of(ptr, typeof(*container), member)
> > > > >
> > > > > It does what you want, the argument order is the same as
> > > > > container_of with the only difference being you name the
> > > > > containing structure instead of having to specify its type.
> > > >
> > > > Not to incessantly bike shed on the naming, but I don't like
> > > > cast_out, it's not very descriptive. And it has connotations of
> > > > getting rid of something, which isn't really true.
> > >
> > > Um, I thought it was exactly descriptive: you're casting to the
> > > outer container. I thought about following the C++ dynamic casting
> > > style, so out_cast(), but that seemed a bit pejorative. What about
> > > outer_cast()?
> > >
> > > > FWIW, I like the from_ part of the original naming, as it has
> > > > some clues as to what is being done here. Why not just
> > > > from_container()? That should immediately tell people what it
> > > > does without having to look up the implementation, even before
> > > > this becomes a part of the accepted coding norm.
> > >
> > > I'm not opposed to container_from() but it seems a little less
> > > descriptive than outer_cast() but I don't really care. I always
> > > have to look up container_of() when I'm using it so this would just
> > > be another macro of that type ...
> > >
> >
> > So far we have a few which have been suggested as replacement
> > for from_tasklet()
> >
> > - out_cast() or outer_cast()
> > - from_member().
> > - container_from() or from_container()
> >
> > from_container() sounds fine, would trimming it a bit work? like
> > from_cont().
>
> I'm fine with container_from(). It's the same form as container_of()
> and I think we need urgent agreement to not stall everything else so
> the most innocuous name is likely to get the widest acceptance.
Kees,
Will you be sending the newly proposed API to Linus? I have V2
which uses container_from()
ready to be sent out.
Thanks.
Powered by blists - more mailing lists