From: Andrew Morton <akpm@linux-foundation.org>
To: Stefani Seibold <stefani@seibold.net>
Cc: linux-kernel <linux-kernel@vger.kernel.org>,
Andi Kleen <andi@firstfloor.org>,
Greg Kroah-Hartman <gregkh@suse.de>,
Alan Cox <alan@lxorguk.ukuu.org.uk>, Theodore Tso <tytso@mit.edu>,
"Ira W. Snyder" <iws@ovro.caltech.edu>
Subject: Re: [PATCH] enhanced reimplemention of the kfifo API
Date: Thu, 4 Feb 2010 09:58:18 -0800 [thread overview]
Message-ID: <20100204095818.0d854a86.akpm@linux-foundation.org> (raw)
In-Reply-To: <1265302360.28857.18.camel@wall-e>
On Thu, 04 Feb 2010 17:52:40 +0100
Stefani Seibold <stefani@seibold.net> wrote:
> ...
> > > > > +#define kfifo_out_locked(fifo, buf, n, lock) \
> > > > > +__kfifo_check( \
> > > > > +({ \
> > > > > + unsigned long __flags; \
> > > > > + unsigned int __ret; \
> > > > > + spin_lock_irqsave(lock, __flags); \
> > > > > + __ret = kfifo_out(fifo, buf, n); \
> > > > > + spin_unlock_irqrestore(lock, __flags); \
> > > > > + __ret; \
> > > > > +}) \
> > > > > +)
> > > >
> > > > This is poorly named. Generally "foo_locked" is to be called when the
> > > > caller has already taken the lock. This identifier inverts that
> > > > convention.
> > > >
> > >
> > > This is the same name as the current kfifo API. Renaming it would break
> > > a lot of drivers. But if there is no complain and you insist i will
> > > rename it and fix the current users.
> >
> > argh, we goofed.
> >
> > yeah, it'd be nice to fix it sometime, please. Not urgent.
> >
> > A good way to fix it would be to add a new function with a new name
> > then migrate all callers over to that name then when it's done, remove
> > the old name.
> >
>
> I will do this in the next release. Would be kfifo_out_spinlocked() and
> kfifo_in_spinlocked() for the new names okay?
Good enough. It's a bit sad to needlessly expose the type of lock in
the identifier but not the end of the world.
>
> One offer to solve the egg and chicken problem: Let us include the
> functions kfifo_to_user(), kfifo_from_user(), kfifo_esize(),
> kfifo_recsize() and the dynamic record handling. If there will be no
> users in at least 9 months we remove it from the API. We talk here about
> 400 bytes of code.
>
> In the mean time me and other developer will have a change to modify the
> existing driver to the new API and/or post drivers or core kernel code
> which is using this functionality.
>
Sounds OK to me.
next prev parent reply other threads:[~2010-02-04 17:59 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-01-27 13:00 [PATCH] enhanced reimplemention of the kfifo API Stefani Seibold
2010-02-03 20:05 ` Andrew Morton
2010-02-03 20:40 ` Ira W. Snyder
2010-02-03 22:09 ` Stefani Seibold
2010-02-03 23:05 ` Andrew Morton
2010-02-04 16:52 ` Stefani Seibold
2010-02-04 17:58 ` Andrew Morton [this message]
-- strict thread matches above, loose matches on Subject: below --
2010-02-05 13:02 Stefani Seibold
2010-01-15 23:20 Stefani Seibold
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=20100204095818.0d854a86.akpm@linux-foundation.org \
--to=akpm@linux-foundation.org \
--cc=alan@lxorguk.ukuu.org.uk \
--cc=andi@firstfloor.org \
--cc=gregkh@suse.de \
--cc=iws@ovro.caltech.edu \
--cc=linux-kernel@vger.kernel.org \
--cc=stefani@seibold.net \
--cc=tytso@mit.edu \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.