Merge branch 'config' of git://git.kernel.org/pub/scm/linux/kernel/git/arnd/bkl
* 'config' of git://git.kernel.org/pub/scm/linux/kernel/git/arnd/bkl: BKL: introduce CONFIG_BKL. dabusb: remove the BKL sunrpc: remove the big kernel lock init/main.c: remove BKL notations blktrace: remove the big kernel lock rtmutex-tester: make it build without BKL dvb-core: kill the big kernel lock dvb/bt8xx: kill the big kernel lock tlclk: remove big kernel lock fix rawctl compat ioctls breakage on amd64 and itanic uml: kill big kernel lock parisc: remove big kernel lock cris: autoconvert trivial BKL users alpha: kill big kernel lock isapnp: BKL removal s390/block: kill the big kernel lock hpet: kill BKL, add compat_ioctl
This commit is contained in:
@ -42,7 +42,7 @@
|
||||
#include <linux/miscdevice.h>
|
||||
#include <linux/watchdog.h>
|
||||
#include <linux/reboot.h>
|
||||
#include <linux/smp_lock.h>
|
||||
#include <linux/mutex.h>
|
||||
#include <linux/init.h>
|
||||
#include <linux/spinlock.h>
|
||||
#include <asm/uaccess.h>
|
||||
@ -50,6 +50,7 @@
|
||||
|
||||
MODULE_LICENSE("GPL");
|
||||
|
||||
static DEFINE_MUTEX(harddog_mutex);
|
||||
static DEFINE_SPINLOCK(lock);
|
||||
static int timer_alive;
|
||||
static int harddog_in_fd = -1;
|
||||
@ -66,7 +67,7 @@ static int harddog_open(struct inode *inode, struct file *file)
|
||||
int err = -EBUSY;
|
||||
char *sock = NULL;
|
||||
|
||||
lock_kernel();
|
||||
mutex_lock(&harddog_mutex);
|
||||
spin_lock(&lock);
|
||||
if(timer_alive)
|
||||
goto err;
|
||||
@ -83,11 +84,11 @@ static int harddog_open(struct inode *inode, struct file *file)
|
||||
|
||||
timer_alive = 1;
|
||||
spin_unlock(&lock);
|
||||
unlock_kernel();
|
||||
mutex_unlock(&harddog_mutex);
|
||||
return nonseekable_open(inode, file);
|
||||
err:
|
||||
spin_unlock(&lock);
|
||||
unlock_kernel();
|
||||
mutex_unlock(&harddog_mutex);
|
||||
return err;
|
||||
}
|
||||
|
||||
@ -153,9 +154,9 @@ static long harddog_ioctl(struct file *file,
|
||||
{
|
||||
long ret;
|
||||
|
||||
lock_kernel();
|
||||
mutex_lock(&harddog_mutex);
|
||||
ret = harddog_ioctl_unlocked(file, cmd, arg);
|
||||
unlock_kernel();
|
||||
mutex_unlock(&harddog_mutex);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
@ -8,7 +8,7 @@
|
||||
#include "linux/slab.h"
|
||||
#include "linux/sound.h"
|
||||
#include "linux/soundcard.h"
|
||||
#include "linux/smp_lock.h"
|
||||
#include "linux/mutex.h"
|
||||
#include "asm/uaccess.h"
|
||||
#include "init.h"
|
||||
#include "os.h"
|
||||
@ -63,6 +63,8 @@ static int set_mixer(char *name, int *add)
|
||||
__uml_setup("mixer=", set_mixer, "mixer=<mixer device>\n" MIXER_HELP);
|
||||
#endif
|
||||
|
||||
static DEFINE_MUTEX(hostaudio_mutex);
|
||||
|
||||
/* /dev/dsp file operations */
|
||||
|
||||
static ssize_t hostaudio_read(struct file *file, char __user *buffer,
|
||||
@ -198,9 +200,9 @@ static int hostaudio_open(struct inode *inode, struct file *file)
|
||||
w = 1;
|
||||
|
||||
kparam_block_sysfs_write(dsp);
|
||||
lock_kernel();
|
||||
mutex_lock(&hostaudio_mutex);
|
||||
ret = os_open_file(dsp, of_set_rw(OPENFLAGS(), r, w), 0);
|
||||
unlock_kernel();
|
||||
mutex_unlock(&hostaudio_mutex);
|
||||
kparam_unblock_sysfs_write(dsp);
|
||||
|
||||
if (ret < 0) {
|
||||
@ -259,9 +261,9 @@ static int hostmixer_open_mixdev(struct inode *inode, struct file *file)
|
||||
w = 1;
|
||||
|
||||
kparam_block_sysfs_write(mixer);
|
||||
lock_kernel();
|
||||
mutex_lock(&hostaudio_mutex);
|
||||
ret = os_open_file(mixer, of_set_rw(OPENFLAGS(), r, w), 0);
|
||||
unlock_kernel();
|
||||
mutex_unlock(&hostaudio_mutex);
|
||||
kparam_unblock_sysfs_write(mixer);
|
||||
|
||||
if (ret < 0) {
|
||||
|
@ -33,7 +33,7 @@
|
||||
#include "linux/mm.h"
|
||||
#include "linux/slab.h"
|
||||
#include "linux/vmalloc.h"
|
||||
#include "linux/smp_lock.h"
|
||||
#include "linux/mutex.h"
|
||||
#include "linux/blkpg.h"
|
||||
#include "linux/genhd.h"
|
||||
#include "linux/spinlock.h"
|
||||
@ -100,6 +100,7 @@ static inline void ubd_set_bit(__u64 bit, unsigned char *data)
|
||||
#define DRIVER_NAME "uml-blkdev"
|
||||
|
||||
static DEFINE_MUTEX(ubd_lock);
|
||||
static DEFINE_MUTEX(ubd_mutex); /* replaces BKL, might not be needed */
|
||||
|
||||
static int ubd_open(struct block_device *bdev, fmode_t mode);
|
||||
static int ubd_release(struct gendisk *disk, fmode_t mode);
|
||||
@ -1101,7 +1102,7 @@ static int ubd_open(struct block_device *bdev, fmode_t mode)
|
||||
struct ubd *ubd_dev = disk->private_data;
|
||||
int err = 0;
|
||||
|
||||
lock_kernel();
|
||||
mutex_lock(&ubd_mutex);
|
||||
if(ubd_dev->count == 0){
|
||||
err = ubd_open_dev(ubd_dev);
|
||||
if(err){
|
||||
@ -1120,7 +1121,7 @@ static int ubd_open(struct block_device *bdev, fmode_t mode)
|
||||
err = -EROFS;
|
||||
}*/
|
||||
out:
|
||||
unlock_kernel();
|
||||
mutex_unlock(&ubd_mutex);
|
||||
return err;
|
||||
}
|
||||
|
||||
@ -1128,10 +1129,10 @@ static int ubd_release(struct gendisk *disk, fmode_t mode)
|
||||
{
|
||||
struct ubd *ubd_dev = disk->private_data;
|
||||
|
||||
lock_kernel();
|
||||
mutex_lock(&ubd_mutex);
|
||||
if(--ubd_dev->count == 0)
|
||||
ubd_close_dev(ubd_dev);
|
||||
unlock_kernel();
|
||||
mutex_unlock(&ubd_mutex);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user