aboutsummaryrefslogtreecommitdiffstats
path: root/arch/um/drivers/hostaudio_kern.c
diff options
context:
space:
mode:
authorArnd Bergmann <arnd@arndb.de>2010-09-11 12:38:03 -0400
committerArnd Bergmann <arnd@arndb.de>2010-10-19 05:29:42 -0400
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 0c46e398cd8f..d92ff6d60297 100644
--- a/arch/um/drivers/hostaudio_kern.c
+++ b/arch/um/drivers/hostaudio_kern.c
@@ -8,7 +8,7 @@
8#include "linux/slab.h" 8#include "linux/slab.h"
9#include "linux/sound.h" 9#include "linux/sound.h"
10#include "linux/soundcard.h" 10#include "linux/soundcard.h"
11#include "linux/smp_lock.h" 11#include "linux/mutex.h"
12#include "asm/uaccess.h" 12#include "asm/uaccess.h"
13#include "init.h" 13#include "init.h"
14#include "os.h" 14#include "os.h"
@@ -67,6 +67,8 @@ MODULE_PARM_DESC(mixer, MIXER_HELP);
67 67
68#endif 68#endif
69 69
70static DEFINE_MUTEX(hostaudio_mutex);
71
70/* /dev/dsp file operations */ 72/* /dev/dsp file operations */
71 73
72static ssize_t hostaudio_read(struct file *file, char __user *buffer, 74static ssize_t hostaudio_read(struct file *file, char __user *buffer,
@@ -202,9 +204,9 @@ static int hostaudio_open(struct inode *inode, struct file *file)
202 w = 1; 204 w = 1;
203 205
204 kparam_block_sysfs_write(dsp); 206 kparam_block_sysfs_write(dsp);
205 lock_kernel(); 207 mutex_lock(&hostaudio_mutex);
206 ret = os_open_file(dsp, of_set_rw(OPENFLAGS(), r, w), 0); 208 ret = os_open_file(dsp, of_set_rw(OPENFLAGS(), r, w), 0);
207 unlock_kernel(); 209 mutex_unlock(&hostaudio_mutex);
208 kparam_unblock_sysfs_write(dsp); 210 kparam_unblock_sysfs_write(dsp);
209 211
210 if (ret < 0) { 212 if (ret < 0) {
@@ -263,9 +265,9 @@ static int hostmixer_open_mixdev(struct inode *inode, struct file *file)
263 w = 1; 265 w = 1;
264 266
265 kparam_block_sysfs_write(mixer); 267 kparam_block_sysfs_write(mixer);
266 lock_kernel(); 268 mutex_lock(&hostaudio_mutex);
267 ret = os_open_file(mixer, of_set_rw(OPENFLAGS(), r, w), 0); 269 ret = os_open_file(mixer, of_set_rw(OPENFLAGS(), r, w), 0);
268 unlock_kernel(); 270 mutex_unlock(&hostaudio_mutex);
269 kparam_unblock_sysfs_write(mixer); 271 kparam_unblock_sysfs_write(mixer);
270 272
271 if (ret < 0) { 273 if (ret < 0) {