lkml.org 
[lkml]   [2006]   [Oct]   [20]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[PATCH] 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>
---
Index: linux/drivers/ieee1394/dv1394.c
===================================================================
--- linux.orig/drivers/ieee1394/dv1394.c 2006-10-20 20:54:33.000000000 +0200
+++ linux/drivers/ieee1394/dv1394.c 2006-10-20 20:55:03.000000000 +0200
@@ -1536,27 +1536,20 @@ static ssize_t dv1394_read(struct file *

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;
int ret = -EINVAL;
void __user *argp = (void __user *)arg;

DECLARE_WAITQUEUE(wait, current);

- lock_kernel();
- video = file_to_video_card(file);
-
/* serialize this to prevent multi-threaded mayhem */
if (file->f_flags & O_NONBLOCK) {
- if (!mutex_trylock(&video->mtx)) {
- unlock_kernel();
+ if (!mutex_trylock(&video->mtx))
return -EAGAIN;
- }
} else {
- if (mutex_lock_interruptible(&video->mtx)) {
- unlock_kernel();
+ if (mutex_lock_interruptible(&video->mtx))
return -ERESTARTSYS;
- }
}

switch(cmd)
@@ -1780,7 +1773,6 @@ static long dv1394_ioctl(struct file *fi

out:
mutex_unlock(&video->mtx);
- unlock_kernel();
return ret;
}


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2006-10-20 21:05    [W:0.145 / U:0.804 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site