kfifo: implement missing __kfifo_skip_r()
authorAndrea Righi <arighi@develer.com>
Thu, 19 Aug 2010 21:13:27 +0000 (14:13 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Fri, 20 Aug 2010 16:34:54 +0000 (09:34 -0700)
kfifo_skip() is currently broken, due to the missing of the internal
helper function.  Add it.

Signed-off-by: Andrea Righi <arighi@develer.com>
Cc: Greg KH <greg@kroah.com>
Acked-by: Stefani Seibold <stefani@seibold.net>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
include/linux/kfifo.h
kernel/kfifo.c

index 311f8753d713dec24828856aed5a2992d6d16923..4aa95f203f3ee773a6ab4bbdbb632efaf970785e 100644 (file)
@@ -836,6 +836,8 @@ extern void __kfifo_dma_out_finish_r(struct __kfifo *fifo, size_t recsize);
 
 extern unsigned int __kfifo_len_r(struct __kfifo *fifo, size_t recsize);
 
+extern void __kfifo_skip_r(struct __kfifo *fifo, size_t recsize);
+
 extern unsigned int __kfifo_out_peek_r(struct __kfifo *fifo,
        void *buf, unsigned int len, size_t recsize);
 
index 4502604ecadf0bc9e1d0d132bc17fc6f3a0ab9d9..6b5580c57644dc1804b02fd85648e7100d5d75dd 100644 (file)
@@ -503,6 +503,15 @@ unsigned int __kfifo_out_r(struct __kfifo *fifo, void *buf,
 }
 EXPORT_SYMBOL(__kfifo_out_r);
 
+void __kfifo_skip_r(struct __kfifo *fifo, size_t recsize)
+{
+       unsigned int n;
+
+       n = __kfifo_peek_n(fifo, recsize);
+       fifo->out += n + recsize;
+}
+EXPORT_SYMBOL(__kfifo_skip_r);
+
 int __kfifo_from_user_r(struct __kfifo *fifo, const void __user *from,
        unsigned long len, unsigned int *copied, size_t recsize)
 {