aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorStephen Rothwell <sfr@canb.auug.org.au>2008-05-23 01:12:23 -0400
committerPaul Mackerras <paulus@samba.org>2008-06-30 08:30:26 -0400
commit10c0ad4dd9ecc3d4141fecbe74c9f18d7f904fb7 (patch)
treeeb4a1938df580931989a94e03f29b1a51c975f36 /drivers
parent74f0609526afddd88bef40b651da24f3167b10b2 (diff)
viotape: Use unlocked_ioctl
This pushes the BKL down into the driver. Based on a patch by Alan Cox. We need to do it this way for now as the inode parameter of viotap_ioctl is used internally as a flag. We should do a further cleanup patch. Cc: Alan Cox <alan@lxorguk.ukuu.org.uk> Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au> Signed-off-by: Paul Mackerras <paulus@samba.org>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/char/viotape.c24
1 files changed, 18 insertions, 6 deletions
diff --git a/drivers/char/viotape.c b/drivers/char/viotape.c
index c39ddaff5e8f..d4db42ca71e6 100644
--- a/drivers/char/viotape.c
+++ b/drivers/char/viotape.c
@@ -46,6 +46,7 @@
46#include <linux/completion.h> 46#include <linux/completion.h>
47#include <linux/proc_fs.h> 47#include <linux/proc_fs.h>
48#include <linux/seq_file.h> 48#include <linux/seq_file.h>
49#include <linux/smp_lock.h>
49 50
50#include <asm/uaccess.h> 51#include <asm/uaccess.h>
51#include <asm/ioctls.h> 52#include <asm/ioctls.h>
@@ -677,6 +678,17 @@ free_op:
677 return ret; 678 return ret;
678} 679}
679 680
681static long viotap_unlocked_ioctl(struct file *file,
682 unsigned int cmd, unsigned long arg)
683{
684 long rc;
685
686 lock_kernel();
687 rc = viotap_ioctl(file->f_path.dentry->d_inode, file, cmd, arg);
688 unlock_kernel();
689 return rc;
690}
691
680static int viotap_open(struct inode *inode, struct file *file) 692static int viotap_open(struct inode *inode, struct file *file)
681{ 693{
682 HvLpEvent_Rc hvrc; 694 HvLpEvent_Rc hvrc;
@@ -783,12 +795,12 @@ free_op:
783} 795}
784 796
785const struct file_operations viotap_fops = { 797const struct file_operations viotap_fops = {
786 .owner = THIS_MODULE, 798 .owner = THIS_MODULE,
787 .read = viotap_read, 799 .read = viotap_read,
788 .write = viotap_write, 800 .write = viotap_write,
789 .ioctl = viotap_ioctl, 801 .unlocked_ioctl = viotap_unlocked_ioctl,
790 .open = viotap_open, 802 .open = viotap_open,
791 .release = viotap_release, 803 .release = viotap_release,
792}; 804};
793 805
794/* Handle interrupt events for tape */ 806/* Handle interrupt events for tape */