diff options
author | Stefani Seibold <stefani@seibold.net> | 2009-12-21 17:37:27 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2009-12-22 17:17:56 -0500 |
commit | c1e13f25674ed564948ecb7dfe5f83e578892896 (patch) | |
tree | 24fac07b3e2b66dff01c3127b34077de1de4c101 /net | |
parent | 45465487897a1c6d508b14b904dc5777f7ec7e04 (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.c | 6 |
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, ...) | |||
67 | len += vscnprintf(tbuf+len, sizeof(tbuf)-len, fmt, args); | 67 | len += vscnprintf(tbuf+len, sizeof(tbuf)-len, fmt, args); |
68 | va_end(args); | 68 | va_end(args); |
69 | 69 | ||
70 | kfifo_put(&dccpw.fifo, tbuf, len); | 70 | kfifo_put_locked(&dccpw.fifo, tbuf, len, &dccpw.lock); |
71 | wake_up(&dccpw.wait); | 71 | wake_up(&dccpw.wait); |
72 | } | 72 | } |
73 | 73 | ||
@@ -135,7 +135,7 @@ static ssize_t dccpprobe_read(struct file *file, char __user *buf, | |||
135 | if (error) | 135 | if (error) |
136 | goto out_free; | 136 | goto out_free; |
137 | 137 | ||
138 | cnt = kfifo_get(&dccpw.fifo, tbuf, len); | 138 | cnt = kfifo_get_locked(&dccpw.fifo, tbuf, len, &dccpw.lock); |
139 | error = copy_to_user(buf, tbuf, cnt) ? -EFAULT : 0; | 139 | error = copy_to_user(buf, tbuf, cnt) ? -EFAULT : 0; |
140 | 140 | ||
141 | out_free: | 141 | out_free: |
@@ -156,7 +156,7 @@ static __init int dccpprobe_init(void) | |||
156 | 156 | ||
157 | init_waitqueue_head(&dccpw.wait); | 157 | init_waitqueue_head(&dccpw.wait); |
158 | spin_lock_init(&dccpw.lock); | 158 | spin_lock_init(&dccpw.lock); |
159 | if (kfifo_alloc(&dccpw.fifo, bufsize, GFP_KERNEL, &dccpw.lock)) | 159 | if (kfifo_alloc(&dccpw.fifo, bufsize, GFP_KERNEL)) |
160 | return ret; | 160 | return ret; |
161 | if (!proc_net_fops_create(&init_net, procname, S_IRUSR, &dccpprobe_fops)) | 161 | if (!proc_net_fops_create(&init_net, procname, S_IRUSR, &dccpprobe_fops)) |
162 | goto err0; | 162 | goto err0; |