Re: [PATCH] new kqueue API v.08

From: Willy Tarreau
Date: Sun Dec 20 2009 - 00:22:58 EST


On Sun, Dec 20, 2009 at 12:25:15AM +0100, Stefani Seibold wrote:
> Am Samstag, den 19.12.2009, 12:36 +0100 schrieb Andi Kleen:
> > I like the basic idea of a type safe FIFO.
> >
> > > #define DYNAMIC
> > > #ifdef DYNAMIC
> > > static DECLARE_KFIFO_PTR(test[1], int);
> > > #else
> > > static DECLARE_KFIFO(test[1], int, FIFO_SIZE);
> >
> > The [1] looks weird. Is that really needed and what does it mean?
> > The callers below don't seem to use it like an array.
>
> I am a lazy girl. This is only for convenient, because i don't want to
> write always kfifo_....(&test...). Using an array of [1] provide the
> pointer automaticly. Of course you can also write
>
> static DECLARE_KFIFO(test, int, FIFO_SIZE);
>
> and then call the kfifo macros with the address of the variable.

So you want test[0] then, not test[1]. Or I'm missing something.

Also, the subject of your mail was a bit misleading, it was talking
about "kqueue" (which is the equivalent of epoll on BSD systems),
while everywhere in the code we see kfifo. I think you simply changed
the name recently for kfifo in fact.

Willy

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/