]> err.no Git - linux-2.6/commitdiff
dv1394: remove BKL contention
authorStefan Richter <stefanr@s5r6.in-berlin.de>
Fri, 20 Oct 2006 19:01:58 +0000 (21:01 +0200)
committerStefan Richter <stefanr@s5r6.in-berlin.de>
Thu, 7 Dec 2006 20:31:38 +0000 (21:31 +0100)
Purges the one remaining call to lock_kernel() from the 1394 subsystem.

Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
drivers/ieee1394/dv1394.c

index 6c72f04b2b5db0399f5be66ecbe5653101819892..d0e11c176c3bcf8ab1c13967fa5b01a257cc3ce5 100644 (file)
@@ -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)
 {
-       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 *file, unsigned int cmd, unsigned long arg)
 
  out:
        mutex_unlock(&video->mtx);
-       unlock_kernel();
        return ret;
 }