mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-29 11:11:45 -04:00
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 <[email protected]>
Acked-by: Greg Kroah-Hartman <[email protected]>
Acked-by: Mauro Carvalho Chehab <[email protected]>
Acked-by: Andi Kleen <[email protected]>
Acked-by: Arnd Bergmann <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
This commit is contained in:
parent
4546548789
commit
c1e13f2567
16 changed files with 131 additions and 130 deletions
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Reference in a new issue