sound: push BKL into open functions
This moves the lock_kernel() call from soundcore_open to the individual OSS device drivers, where we can deal with it one driver at a time if needed, or just kill off the drivers. All core components in ALSA already provide adequate locking in their open()-functions and do not require the big kernel lock, so there is no need to add the BKL there. Signed-off-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Takashi Iwai <tiwai@suse.de>
This commit is contained in:
@@ -756,12 +756,15 @@ static int dev_open(struct inode *inode, struct file *file)
|
||||
int minor = iminor(inode);
|
||||
int err = 0;
|
||||
|
||||
lock_kernel();
|
||||
if (minor == dev.dsp_minor) {
|
||||
if ((file->f_mode & FMODE_WRITE &&
|
||||
test_bit(F_AUDIO_WRITE_INUSE, &dev.flags)) ||
|
||||
(file->f_mode & FMODE_READ &&
|
||||
test_bit(F_AUDIO_READ_INUSE, &dev.flags)))
|
||||
return -EBUSY;
|
||||
test_bit(F_AUDIO_READ_INUSE, &dev.flags))) {
|
||||
err = -EBUSY;
|
||||
goto out;
|
||||
}
|
||||
|
||||
if ((err = dsp_open(file)) >= 0) {
|
||||
dev.nresets = 0;
|
||||
@@ -782,7 +785,8 @@ static int dev_open(struct inode *inode, struct file *file)
|
||||
/* nothing */
|
||||
} else
|
||||
err = -EINVAL;
|
||||
|
||||
out:
|
||||
unlock_kernel();
|
||||
return err;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user