lkml.org 
[lkml]   [2009]   [Aug]   [17]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 2/7] kfifo: move out spinlock
On Mon, 17 Aug 2009 07:48:20 +0100 Alan Cox <alan@lxorguk.ukuu.org.uk> wrote:

> > kfifo has no business assuming that the caller wants to use
> > spin_lock() locking.
> >
> > If we want to add wrapper helpers around kfifo to reduce code
> > duplication in callers, and if one of those wrapper helpers provides
> > spinlock-based locking then fine.
>
> Those wrappers happen to be called kfifo_get and kfifo_put

Those names are wrong.

They're wrong because they are the spinlock-specific variant. What are
we going to call the mutex_lock-specific variant?

> > But the happens-to-use-spin_lock functions shouldn't be called
> > kfifo_get(), because that steals namespace from the unlocked functions,
> > and makes the naming for the happens-to-use-mutex_lock functions look
> > weird.
>
> All over the kernel unlocked function versions have a leading _ name.
> It's the kernel convention.

tisn't. radix-tree, rbrtee, idr, list_head, prio_tree, flex_array -
none of them use that convention.

> The other thing I must say I dislike about these patches is the
> gratuitious 'let's rename all the functions' approach it takes. The kfifo
> API is documented, used and random API of the year type changes mess
> stuff up and cause unneeded churn.

It fixes naming mistakes. Long-term it is the correct thing to do.
Best to do it now before we get more callers.



\
 
 \ /
  Last update: 2009-08-17 09:41    [W:0.122 / U:0.196 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site