Messages in this thread | | | Subject | Re: [Fwd: [patch] media video cx23888 driver: ported to new kfifo API] | From | Stefani Seibold <> | Date | Fri, 18 Dec 2009 23:09:26 +0100 |
| |
Am Freitag, den 18.12.2009, 14:00 -0800 schrieb Andrew Morton: > On Fri, 18 Dec 2009 22:57:22 +0100 > Stefani Seibold <stefani@seibold.net> wrote: > > > But kfifo_len() did not > > requiere a lock in my opinion. It is save to use without a look. > > What do you mean by this? Safe in general, or safe in this particular driver? >
Safe until you don't call kfifo_reset(). kfifo_reset() is evil, because it it the only function which breaks the single read/writer concept.
This function modifies the in and the out fifo counters. Thats why i introduced the kfifo_reset_out() function, which set the out to the value of in, which means the fifo is empty. This function can be call from the receiver of a fifo without locking.
Stefani
| |