[PATCH 01/12] staging: autoconvert trivial BKL users to private mutex

Martyn Welch martyn.welch at ge.com
Tue Jul 13 08:27:51 UTC 2010


Arnd Bergmann wrote:

<snip>


> diff --git a/drivers/staging/vme/devices/vme_user.c b/drivers/staging/vme/devices/vme_user.c
> index bc16fc0..73a67a8 100644
> --- a/drivers/staging/vme/devices/vme_user.c
> +++ b/drivers/staging/vme/devices/vme_user.c
> @@ -31,7 +31,7 @@
>  #include <linux/slab.h>
>  #include <linux/spinlock.h>
>  #include <linux/syscalls.h>
> -#include <linux/smp_lock.h>
> +#include <linux/mutex.h>
>  #include <linux/types.h>
>  
>  #include <asm/io.h>
> @@ -40,6 +40,7 @@
>  #include "../vme.h"
>  #include "vme_user.h"
>  
> +static DEFINE_MUTEX(vme_user_mutex);
>  static char driver_name[] = "vme_user";
>  
>  static int bus[USER_BUS_MAX];
> @@ -560,9 +561,9 @@ vme_user_unlocked_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
>  {
>  	int ret;
>  
> -	lock_kernel();
> +	mutex_lock(&vme_user_mutex);
>  	ret = vme_user_ioctl(file->f_path.dentry->d_inode, file, cmd, arg);
> -	unlock_kernel();
> +	mutex_unlock(&vme_user_mutex);
>   

Wha!, where'd that come from!!??

Ah, OK - "Staging: push down BKL into ioctl functions", missed that,
looks fine.
<http://git.kernel.org/gitweb.cgi?p=linux/kernel/git/sfr/linux-next.git;a=commitdiff;h=b1f2ac07636aadee5cb077fc7e830908b00fcaae>

Martyn
<http://git.kernel.org/gitweb.cgi?p=linux/kernel/git/sfr/linux-next.git;a=commitdiff;h=b1f2ac07636aadee5cb077fc7e830908b00fcaae>


>  
>  	return ret;
>  }
>   


-- 
Martyn Welch (Principal Software Engineer)   |   Registered in England and
GE Intelligent Platforms                     |   Wales (3828642) at 100
T +44(0)127322748                            |   Barbirolli Square, Manchester,
E martyn.welch at ge.com                        |   M2 3AB  VAT:GB 927559189




More information about the devel mailing list