[patch] sound: remove BKL from sound/core/info.c

From: Ingo Molnar
Date: Sat Jan 07 2006 - 07:43:45 EST


remove the final instance of BKL use within the sound code, by converting
snd_info_entry_ioctl to an unlocked ioctl. It is obviously safe, because
the sound code already dropped the BKL in this function.

built and booted on x86.

Signed-off-by: Ingo Molnar <mingo@xxxxxxx>

----

sound/core/info.c | 33 +++++++++++----------------------
1 files changed, 11 insertions(+), 22 deletions(-)

Index: linux/sound/core/info.c
===================================================================
--- linux.orig/sound/core/info.c
+++ linux/sound/core/info.c
@@ -444,8 +444,8 @@ static unsigned int snd_info_entry_poll(
return mask;
}

-static inline int _snd_info_entry_ioctl(struct inode *inode, struct file *file,
- unsigned int cmd, unsigned long arg)
+static long snd_info_entry_ioctl(struct file *file, unsigned int cmd,
+ unsigned long arg)
{
struct snd_info_private_data *data;
struct snd_info_entry *entry;
@@ -465,17 +465,6 @@ static inline int _snd_info_entry_ioctl(
return -ENOTTY;
}

-/* FIXME: need to unlock BKL to allow preemption */
-static int snd_info_entry_ioctl(struct inode *inode, struct file *file,
- unsigned int cmd, unsigned long arg)
-{
- int err;
- unlock_kernel();
- err = _snd_info_entry_ioctl(inode, file, cmd, arg);
- lock_kernel();
- return err;
-}
-
static int snd_info_entry_mmap(struct file *file, struct vm_area_struct *vma)
{
struct inode *inode = file->f_dentry->d_inode;
@@ -499,15 +488,15 @@ static int snd_info_entry_mmap(struct fi

static struct file_operations snd_info_entry_operations =
{
- .owner = THIS_MODULE,
- .llseek = snd_info_entry_llseek,
- .read = snd_info_entry_read,
- .write = snd_info_entry_write,
- .poll = snd_info_entry_poll,
- .ioctl = snd_info_entry_ioctl,
- .mmap = snd_info_entry_mmap,
- .open = snd_info_entry_open,
- .release = snd_info_entry_release,
+ .owner = THIS_MODULE,
+ .llseek = snd_info_entry_llseek,
+ .read = snd_info_entry_read,
+ .write = snd_info_entry_write,
+ .poll = snd_info_entry_poll,
+ .unlocked_ioctl = snd_info_entry_ioctl,
+ .mmap = snd_info_entry_mmap,
+ .open = snd_info_entry_open,
+ .release = snd_info_entry_release,
};

/**
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/