aboutsummaryrefslogtreecommitdiff
path: root/arch/um/drivers/hostaudio_kern.c
diff options
context:
space:
mode:
authorArnd Bergmann <arnd@arndb.de>2010-09-11 18:38:03 +0200
committerArnd Bergmann <arnd@arndb.de>2010-10-19 11:29:42 +0200
commit9a181c58617134822ae596339dbea076ef9b5cf7 (patch)
treeb90b52c0bcb4ae3057e5ddd403230415f4cb528a /arch/um/drivers/hostaudio_kern.c
parentfa0d4c26be9f989816b30626f6c67d9e7ef867f8 (diff)
uml: kill big kernel lock
Three uml device drivers still use the big kernel lock, but all of them can be safely converted to using a per-driver mutex instead. Most likely this is not even necessary, so after further review these can and should be removed as well. The exec system call no longer requires the BKL either, so remove it from there, too. Signed-off-by: Arnd Bergmann <arnd@arndb.de> Cc: Jeff Dike <jdike@addtoit.com> Cc: user-mode-linux-devel@lists.sourceforge.net
Diffstat (limited to 'arch/um/drivers/hostaudio_kern.c')
-rw-r--r--arch/um/drivers/hostaudio_kern.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/arch/um/drivers/hostaudio_kern.c b/arch/um/drivers/hostaudio_kern.c
index 0c46e398cd8..d92ff6d6029 100644
--- a/arch/um/drivers/hostaudio_kern.c
+++ b/arch/um/drivers/hostaudio_kern.c
@@ -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"
@@ -67,6 +67,8 @@ MODULE_PARM_DESC(mixer, MIXER_HELP);
#endif
+static DEFINE_MUTEX(hostaudio_mutex);
+
/* /dev/dsp file operations */
static ssize_t hostaudio_read(struct file *file, char __user *buffer,
@@ -202,9 +204,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) {
@@ -263,9 +265,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) {