提交 7b900c12 编写于 作者: S Stefan Richter

dv1394: remove BKL contention

Purges the one remaining call to lock_kernel() from the 1394 subsystem.
Signed-off-by: NStefan Richter <stefanr@s5r6.in-berlin.de>
上级 75dcf5dc
...@@ -1536,27 +1536,20 @@ static ssize_t dv1394_read(struct file *file, char __user *buffer, size_t count ...@@ -1536,27 +1536,20 @@ static ssize_t dv1394_read(struct file *file, char __user *buffer, size_t count
static long dv1394_ioctl(struct file *file, unsigned int cmd, unsigned long arg) static long dv1394_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
{ {
struct video_card *video; struct video_card *video = file_to_video_card(file);
unsigned long flags; unsigned long flags;
int ret = -EINVAL; int ret = -EINVAL;
void __user *argp = (void __user *)arg; void __user *argp = (void __user *)arg;
DECLARE_WAITQUEUE(wait, current); DECLARE_WAITQUEUE(wait, current);
lock_kernel();
video = file_to_video_card(file);
/* serialize this to prevent multi-threaded mayhem */ /* serialize this to prevent multi-threaded mayhem */
if (file->f_flags & O_NONBLOCK) { if (file->f_flags & O_NONBLOCK) {
if (!mutex_trylock(&video->mtx)) { if (!mutex_trylock(&video->mtx))
unlock_kernel();
return -EAGAIN; return -EAGAIN;
}
} else { } else {
if (mutex_lock_interruptible(&video->mtx)) { if (mutex_lock_interruptible(&video->mtx))
unlock_kernel();
return -ERESTARTSYS; return -ERESTARTSYS;
}
} }
switch(cmd) switch(cmd)
...@@ -1780,7 +1773,6 @@ static long dv1394_ioctl(struct file *file, unsigned int cmd, unsigned long arg) ...@@ -1780,7 +1773,6 @@ static long dv1394_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
out: out:
mutex_unlock(&video->mtx); mutex_unlock(&video->mtx);
unlock_kernel();
return ret; return ret;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册