public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* should new kfifo implementation really be exporting that much?
@ 2010-03-14 13:32 Robert P. J. Day
  2010-03-14 14:57 ` Robert P. J. Day
  0 siblings, 1 reply; 6+ messages in thread
From: Robert P. J. Day @ 2010-03-14 13:32 UTC (permalink / raw)
  To: Linux Kernel Mailing List


  just curious about how much is being exported from kfifo.c:

$ grep EXPORT_SYMBOL kernel/kfifo.c
EXPORT_SYMBOL(kfifo_init);
EXPORT_SYMBOL(kfifo_alloc);
EXPORT_SYMBOL(kfifo_free);
EXPORT_SYMBOL(kfifo_skip);
EXPORT_SYMBOL(__kfifo_in_n);
EXPORT_SYMBOL(kfifo_in);
EXPORT_SYMBOL(__kfifo_in_generic);
EXPORT_SYMBOL(__kfifo_out_n);
EXPORT_SYMBOL(kfifo_out);
EXPORT_SYMBOL(kfifo_out_peek);
EXPORT_SYMBOL(__kfifo_out_generic);
EXPORT_SYMBOL(__kfifo_from_user_n);
EXPORT_SYMBOL(kfifo_from_user);
EXPORT_SYMBOL(__kfifo_from_user_generic);
EXPORT_SYMBOL(__kfifo_to_user_n);
EXPORT_SYMBOL(kfifo_to_user);
EXPORT_SYMBOL(__kfifo_to_user_generic);
EXPORT_SYMBOL(__kfifo_peek_generic);
EXPORT_SYMBOL(__kfifo_skip_generic);
$

  there's a lot there that looks like it should be static, no?  or is
all of that *meant* to be part of the public kfifo API?

rday
--

========================================================================
Robert P. J. Day                               Waterloo, Ontario, CANADA

            Linux Consulting, Training and Kernel Pedantry.

Web page:                                          http://crashcourse.ca
Twitter:                                       http://twitter.com/rpjday
========================================================================

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: should new kfifo implementation really be exporting that much?
  2010-03-14 13:32 should new kfifo implementation really be exporting that much? Robert P. J. Day
@ 2010-03-14 14:57 ` Robert P. J. Day
  2010-03-14 16:37   ` Tilman Schmidt
  0 siblings, 1 reply; 6+ messages in thread
From: Robert P. J. Day @ 2010-03-14 14:57 UTC (permalink / raw)
  To: Linux Kernel Mailing List

On Sun, 14 Mar 2010, Robert P. J. Day wrote:

>
>   just curious about how much is being exported from kfifo.c:
>
> $ grep EXPORT_SYMBOL kernel/kfifo.c
> EXPORT_SYMBOL(kfifo_init);
> EXPORT_SYMBOL(kfifo_alloc);
> EXPORT_SYMBOL(kfifo_free);
> EXPORT_SYMBOL(kfifo_skip);
> EXPORT_SYMBOL(__kfifo_in_n);
> EXPORT_SYMBOL(kfifo_in);
> EXPORT_SYMBOL(__kfifo_in_generic);
> EXPORT_SYMBOL(__kfifo_out_n);
> EXPORT_SYMBOL(kfifo_out);
> EXPORT_SYMBOL(kfifo_out_peek);
> EXPORT_SYMBOL(__kfifo_out_generic);
> EXPORT_SYMBOL(__kfifo_from_user_n);
> EXPORT_SYMBOL(kfifo_from_user);
> EXPORT_SYMBOL(__kfifo_from_user_generic);
> EXPORT_SYMBOL(__kfifo_to_user_n);
> EXPORT_SYMBOL(kfifo_to_user);
> EXPORT_SYMBOL(__kfifo_to_user_generic);
> EXPORT_SYMBOL(__kfifo_peek_generic);
> EXPORT_SYMBOL(__kfifo_skip_generic);
> $
>
>   there's a lot there that looks like it should be static, no?  or is
> all of that *meant* to be part of the public kfifo API?

  as a short followup, kfifo.h strongly implies that a lot of the
above shouldn't be exported:

...
/*
 * __kfifo_in_... internal functions for put date into the fifo
 * do not call it directly, use kfifo_in_rec() instead
 */
...
/*
 * __kfifo_out_... internal functions for get date from the fifo
 * do not call it directly, use kfifo_out_rec() instead
 */
...
/*
 * __kfifo_from_user_... internal functions for transfer from user space into
 * the fifo. do not call it directly, use kfifo_from_user_rec() instead
 */
...
/*
 * __kfifo_to_user_... internal functions for transfer fifo data into user space
 * do not call it directly, use kfifo_to_user_rec() instead
 */
...
/*
 * __kfifo_peek_... internal functions for peek into the next fifo record
 * do not call it directly, use kfifo_peek_rec() instead
 */
...
/*
 * __kfifo_skip_... internal functions for skip the next fifo record
 * do not call it directly, use kfifo_skip_rec() instead
 */
...

  anyway, you get the idea.  it would seem that a lot of those EXPORTs
should be removed, no?

rday
--


========================================================================
Robert P. J. Day                               Waterloo, Ontario, CANADA

            Linux Consulting, Training and Kernel Pedantry.

Web page:                                          http://crashcourse.ca
Twitter:                                       http://twitter.com/rpjday
========================================================================

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: should new kfifo implementation really be exporting that much?
  2010-03-14 14:57 ` Robert P. J. Day
@ 2010-03-14 16:37   ` Tilman Schmidt
  2010-03-14 16:49     ` Robert P. J. Day
  0 siblings, 1 reply; 6+ messages in thread
From: Tilman Schmidt @ 2010-03-14 16:37 UTC (permalink / raw)
  To: Robert P. J. Day; +Cc: Linux Kernel Mailing List

Am 14.03.2010 15:57 schrieb Robert P. J. Day:
>   as a short followup, kfifo.h strongly implies that a lot of the
> above shouldn't be exported:
> 
> ...
> /*
>  * __kfifo_in_... internal functions for put date into the fifo
>  * do not call it directly, use kfifo_in_rec() instead
>  */
> ...
> 
>   anyway, you get the idea.  it would seem that a lot of those EXPORTs
> should be removed, no?

If you look at kfifo_in_rec(), it's a static inline void function
defined in kfifo.h and which calls __kfifo_in_generic() or
__kfifo_in_rec(). I don't think you'll be able to make that work
without exporting those functions.

HTH
T.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: should new kfifo implementation really be exporting that much?
  2010-03-14 16:37   ` Tilman Schmidt
@ 2010-03-14 16:49     ` Robert P. J. Day
  2010-03-21  9:32       ` Jon Masters
  0 siblings, 1 reply; 6+ messages in thread
From: Robert P. J. Day @ 2010-03-14 16:49 UTC (permalink / raw)
  To: Tilman Schmidt; +Cc: Linux Kernel Mailing List

On Sun, 14 Mar 2010, Tilman Schmidt wrote:

> Am 14.03.2010 15:57 schrieb Robert P. J. Day:
> >   as a short followup, kfifo.h strongly implies that a lot of the
> > above shouldn't be exported:
> >
> > ...
> > /*
> >  * __kfifo_in_... internal functions for put date into the fifo
> >  * do not call it directly, use kfifo_in_rec() instead
> >  */
> > ...
> >
> >   anyway, you get the idea.  it would seem that a lot of those EXPORTs
> > should be removed, no?
>
> If you look at kfifo_in_rec(), it's a static inline void function
> defined in kfifo.h and which calls __kfifo_in_generic() or
> __kfifo_in_rec(). I don't think you'll be able to make that work
> without exporting those functions.

  huh.  i believe you're correct.  i'll take a closer look but i still
get this feeling that there's something ... messy about that API.
case in point:  kfifo_in_rec() is *not* being exported, but a routine
that it invokes -- __kfifo_in_generic() -- *is* being exported.
doesn't that just seem a bit backwards?

  anyway, off to the gym to bike and see which duke team shows up for
georgia tech.

rday
--


========================================================================
Robert P. J. Day                               Waterloo, Ontario, CANADA

            Linux Consulting, Training and Kernel Pedantry.

Web page:                                          http://crashcourse.ca
Twitter:                                       http://twitter.com/rpjday
========================================================================

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: should new kfifo implementation really be exporting that much?
  2010-03-14 16:49     ` Robert P. J. Day
@ 2010-03-21  9:32       ` Jon Masters
  2010-03-22 14:32         ` Robert P. J. Day
  0 siblings, 1 reply; 6+ messages in thread
From: Jon Masters @ 2010-03-21  9:32 UTC (permalink / raw)
  To: Robert P. J. Day; +Cc: Tilman Schmidt, Linux Kernel Mailing List

On Sun, Mar 14, 2010 at 12:49:08PM -0400, Robert P. J. Day wrote:
> On Sun, 14 Mar 2010, Tilman Schmidt wrote:
> 
> > Am 14.03.2010 15:57 schrieb Robert P. J. Day:
> > >   as a short followup, kfifo.h strongly implies that a lot of the
> > > above shouldn't be exported:
> > >
> > > ...
> > > /*
> > >  * __kfifo_in_... internal functions for put date into the fifo
> > >  * do not call it directly, use kfifo_in_rec() instead
> > >  */
> > > ...
> > >
> > >   anyway, you get the idea.  it would seem that a lot of those EXPORTs
> > > should be removed, no?
> >
> > If you look at kfifo_in_rec(), it's a static inline void function
> > defined in kfifo.h and which calls __kfifo_in_generic() or
> > __kfifo_in_rec(). I don't think you'll be able to make that work
> > without exporting those functions.
> 
>   huh.  i believe you're correct.  i'll take a closer look but i still
> get this feeling that there's something ... messy about that API.
> case in point:  kfifo_in_rec() is *not* being exported, but a routine
> that it invokes -- __kfifo_in_generic() -- *is* being exported.
> doesn't that just seem a bit backwards?

I believe it would be a good idea to have an export type explicitly
covering symbols that are exported solely for the use of inlines,
just for tidying up these situations. EXPORT_SYMBOL_INTERNAL?

Jon.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: should new kfifo implementation really be exporting that much?
  2010-03-21  9:32       ` Jon Masters
@ 2010-03-22 14:32         ` Robert P. J. Day
  0 siblings, 0 replies; 6+ messages in thread
From: Robert P. J. Day @ 2010-03-22 14:32 UTC (permalink / raw)
  To: Jon Masters; +Cc: Tilman Schmidt, Linux Kernel Mailing List

On Sun, 21 Mar 2010, Jon Masters wrote:

> On Sun, Mar 14, 2010 at 12:49:08PM -0400, Robert P. J. Day wrote:
> > On Sun, 14 Mar 2010, Tilman Schmidt wrote:
> >
> > > Am 14.03.2010 15:57 schrieb Robert P. J. Day:
> > > >   as a short followup, kfifo.h strongly implies that a lot of the
> > > > above shouldn't be exported:
> > > >
> > > > ...
> > > > /*
> > > >  * __kfifo_in_... internal functions for put date into the fifo
> > > >  * do not call it directly, use kfifo_in_rec() instead
> > > >  */
> > > > ...
> > > >
> > > >   anyway, you get the idea.  it would seem that a lot of those EXPORTs
> > > > should be removed, no?
> > >
> > > If you look at kfifo_in_rec(), it's a static inline void
> > > function defined in kfifo.h and which calls __kfifo_in_generic()
> > > or __kfifo_in_rec(). I don't think you'll be able to make that
> > > work without exporting those functions.
> >
> >   huh.  i believe you're correct.  i'll take a closer look but i
> > still get this feeling that there's something ... messy about that
> > API. case in point:  kfifo_in_rec() is *not* being exported, but a
> > routine that it invokes -- __kfifo_in_generic() -- *is* being
> > exported. doesn't that just seem a bit backwards?
>
> I believe it would be a good idea to have an export type explicitly
> covering symbols that are exported solely for the use of inlines,
> just for tidying up these situations. EXPORT_SYMBOL_INTERNAL?

  i wasn't suggesting anything as drastic as inventing a new export
level :-), i just wanted to verify that the current situation as to
what's currently exported related to kfifo just seemed a bit odd and
inconsistent.  but a new export level might support the removal of a
considerable amount from the fully-exported namespace.

rday
--

========================================================================
Robert P. J. Day                               Waterloo, Ontario, CANADA

            Linux Consulting, Training and Kernel Pedantry.

Web page:                                          http://crashcourse.ca
Twitter:                                       http://twitter.com/rpjday
========================================================================

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2010-03-22 14:34 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-03-14 13:32 should new kfifo implementation really be exporting that much? Robert P. J. Day
2010-03-14 14:57 ` Robert P. J. Day
2010-03-14 16:37   ` Tilman Schmidt
2010-03-14 16:49     ` Robert P. J. Day
2010-03-21  9:32       ` Jon Masters
2010-03-22 14:32         ` Robert P. J. Day

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox