diff options
Diffstat (limited to 'drivers/char/viotape.c')
-rw-r--r-- | drivers/char/viotape.c | 26 |
1 files changed, 20 insertions, 6 deletions
diff --git a/drivers/char/viotape.c b/drivers/char/viotape.c index c39ddaff5e8f..e5da98d8f9cd 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 | ||
681 | static 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 | |||
680 | static int viotap_open(struct inode *inode, struct file *file) | 692 | static int viotap_open(struct inode *inode, struct file *file) |
681 | { | 693 | { |
682 | HvLpEvent_Rc hvrc; | 694 | HvLpEvent_Rc hvrc; |
@@ -687,6 +699,7 @@ static int viotap_open(struct inode *inode, struct file *file) | |||
687 | if (op == NULL) | 699 | if (op == NULL) |
688 | return -ENOMEM; | 700 | return -ENOMEM; |
689 | 701 | ||
702 | lock_kernel(); | ||
690 | get_dev_info(file->f_path.dentry->d_inode, &devi); | 703 | get_dev_info(file->f_path.dentry->d_inode, &devi); |
691 | 704 | ||
692 | /* Note: We currently only support one mode! */ | 705 | /* Note: We currently only support one mode! */ |
@@ -717,6 +730,7 @@ static int viotap_open(struct inode *inode, struct file *file) | |||
717 | 730 | ||
718 | free_op: | 731 | free_op: |
719 | free_op_struct(op); | 732 | free_op_struct(op); |
733 | unlock_kernel(); | ||
720 | return ret; | 734 | return ret; |
721 | } | 735 | } |
722 | 736 | ||
@@ -783,12 +797,12 @@ free_op: | |||
783 | } | 797 | } |
784 | 798 | ||
785 | const struct file_operations viotap_fops = { | 799 | const struct file_operations viotap_fops = { |
786 | .owner = THIS_MODULE, | 800 | .owner = THIS_MODULE, |
787 | .read = viotap_read, | 801 | .read = viotap_read, |
788 | .write = viotap_write, | 802 | .write = viotap_write, |
789 | .ioctl = viotap_ioctl, | 803 | .unlocked_ioctl = viotap_unlocked_ioctl, |
790 | .open = viotap_open, | 804 | .open = viotap_open, |
791 | .release = viotap_release, | 805 | .release = viotap_release, |
792 | }; | 806 | }; |
793 | 807 | ||
794 | /* Handle interrupt events for tape */ | 808 | /* Handle interrupt events for tape */ |