summaryrefslogtreecommitdiff
path: root/net
diff options
context:
space:
mode:
authorStefani Seibold <stefani@seibold.net>2009-12-21 14:37:27 -0800
committerLinus Torvalds <torvalds@linux-foundation.org>2009-12-22 14:17:56 -0800
commitc1e13f25674ed564948ecb7dfe5f83e578892896 (patch)
tree24fac07b3e2b66dff01c3127b34077de1de4c101 /net
parent45465487897a1c6d508b14b904dc5777f7ec7e04 (diff)
kfifo: move out spinlock
Move the pointer to the spinlock out of struct kfifo. Most users in tree do not actually use a spinlock, so the few exceptions now have to call kfifo_{get,put}_locked, which takes an extra argument to a spinlock. Signed-off-by: Stefani Seibold <stefani@seibold.net> Acked-by: Greg Kroah-Hartman <gregkh@suse.de> Acked-by: Mauro Carvalho Chehab <mchehab@redhat.com> Acked-by: Andi Kleen <ak@linux.intel.com> Acked-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'net')
-rw-r--r--net/dccp/probe.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/net/dccp/probe.c b/net/dccp/probe.c
index 6230ceb0823e..c6b50351aa78 100644
--- a/net/dccp/probe.c
+++ b/net/dccp/probe.c
@@ -67,7 +67,7 @@ static void printl(const char *fmt, ...)
len += vscnprintf(tbuf+len, sizeof(tbuf)-len, fmt, args);
va_end(args);
- kfifo_put(&dccpw.fifo, tbuf, len);
+ kfifo_put_locked(&dccpw.fifo, tbuf, len, &dccpw.lock);
wake_up(&dccpw.wait);
}
@@ -135,7 +135,7 @@ static ssize_t dccpprobe_read(struct file *file, char __user *buf,
if (error)
goto out_free;
- cnt = kfifo_get(&dccpw.fifo, tbuf, len);
+ cnt = kfifo_get_locked(&dccpw.fifo, tbuf, len, &dccpw.lock);
error = copy_to_user(buf, tbuf, cnt) ? -EFAULT : 0;
out_free:
@@ -156,7 +156,7 @@ static __init int dccpprobe_init(void)
init_waitqueue_head(&dccpw.wait);
spin_lock_init(&dccpw.lock);
- if (kfifo_alloc(&dccpw.fifo, bufsize, GFP_KERNEL, &dccpw.lock))
+ if (kfifo_alloc(&dccpw.fifo, bufsize, GFP_KERNEL))
return ret;
if (!proc_net_fops_create(&init_net, procname, S_IRUSR, &dccpprobe_fops))
goto err0;