diff options
author | Stefan Richter <stefanr@s5r6.in-berlin.de> | 2006-10-20 15:01:58 -0400 |
---|---|---|
committer | Stefan Richter <stefanr@s5r6.in-berlin.de> | 2006-12-07 15:31:38 -0500 |
commit | 7b900c12cd689e4372afe3904a03f98253546449 (patch) | |
tree | df2d71bb71627059e065451bf2c7af734ecd15a3 /drivers/ieee1394/dv1394.c | |
parent | 75dcf5dc5a0dc4e895944368780cc2fc40008a55 (diff) |
dv1394: remove BKL contention
Purges the one remaining call to lock_kernel() from the 1394 subsystem.
Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
Diffstat (limited to 'drivers/ieee1394/dv1394.c')
-rw-r--r-- | drivers/ieee1394/dv1394.c | 14 |
1 files changed, 3 insertions, 11 deletions
diff --git a/drivers/ieee1394/dv1394.c b/drivers/ieee1394/dv1394.c index 6c72f04b2b5..d0e11c176c3 100644 --- a/drivers/ieee1394/dv1394.c +++ b/drivers/ieee1394/dv1394.c | |||
@@ -1536,27 +1536,20 @@ static ssize_t dv1394_read(struct file *file, char __user *buffer, size_t count | |||
1536 | 1536 | ||
1537 | static long dv1394_ioctl(struct file *file, unsigned int cmd, unsigned long arg) | 1537 | static long dv1394_ioctl(struct file *file, unsigned int cmd, unsigned long arg) |
1538 | { | 1538 | { |
1539 | struct video_card *video; | 1539 | struct video_card *video = file_to_video_card(file); |
1540 | unsigned long flags; | 1540 | unsigned long flags; |
1541 | int ret = -EINVAL; | 1541 | int ret = -EINVAL; |
1542 | void __user *argp = (void __user *)arg; | 1542 | void __user *argp = (void __user *)arg; |
1543 | 1543 | ||
1544 | DECLARE_WAITQUEUE(wait, current); | 1544 | DECLARE_WAITQUEUE(wait, current); |
1545 | 1545 | ||
1546 | lock_kernel(); | ||
1547 | video = file_to_video_card(file); | ||
1548 | |||
1549 | /* serialize this to prevent multi-threaded mayhem */ | 1546 | /* serialize this to prevent multi-threaded mayhem */ |
1550 | if (file->f_flags & O_NONBLOCK) { | 1547 | if (file->f_flags & O_NONBLOCK) { |
1551 | if (!mutex_trylock(&video->mtx)) { | 1548 | if (!mutex_trylock(&video->mtx)) |
1552 | unlock_kernel(); | ||
1553 | return -EAGAIN; | 1549 | return -EAGAIN; |
1554 | } | ||
1555 | } else { | 1550 | } else { |
1556 | if (mutex_lock_interruptible(&video->mtx)) { | 1551 | if (mutex_lock_interruptible(&video->mtx)) |
1557 | unlock_kernel(); | ||
1558 | return -ERESTARTSYS; | 1552 | return -ERESTARTSYS; |
1559 | } | ||
1560 | } | 1553 | } |
1561 | 1554 | ||
1562 | switch(cmd) | 1555 | switch(cmd) |
@@ -1780,7 +1773,6 @@ static long dv1394_ioctl(struct file *file, unsigned int cmd, unsigned long arg) | |||
1780 | 1773 | ||
1781 | out: | 1774 | out: |
1782 | mutex_unlock(&video->mtx); | 1775 | mutex_unlock(&video->mtx); |
1783 | unlock_kernel(); | ||
1784 | return ret; | 1776 | return ret; |
1785 | } | 1777 | } |
1786 | 1778 | ||