diff options
Diffstat (limited to 'drivers/char/viotape.c')
-rw-r--r-- | drivers/char/viotape.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/drivers/char/viotape.c b/drivers/char/viotape.c index 42f7fa442ff8..6f954a808b65 100644 --- a/drivers/char/viotape.c +++ b/drivers/char/viotape.c | |||
@@ -46,7 +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 | #include <linux/mutex.h> |
50 | #include <linux/slab.h> | 50 | #include <linux/slab.h> |
51 | 51 | ||
52 | #include <asm/uaccess.h> | 52 | #include <asm/uaccess.h> |
@@ -64,6 +64,7 @@ | |||
64 | #define VIOTAPE_KERN_WARN KERN_WARNING "viotape: " | 64 | #define VIOTAPE_KERN_WARN KERN_WARNING "viotape: " |
65 | #define VIOTAPE_KERN_INFO KERN_INFO "viotape: " | 65 | #define VIOTAPE_KERN_INFO KERN_INFO "viotape: " |
66 | 66 | ||
67 | static DEFINE_MUTEX(proc_viotape_mutex); | ||
67 | static int viotape_numdev; | 68 | static int viotape_numdev; |
68 | 69 | ||
69 | /* | 70 | /* |
@@ -684,9 +685,9 @@ static long viotap_unlocked_ioctl(struct file *file, | |||
684 | { | 685 | { |
685 | long rc; | 686 | long rc; |
686 | 687 | ||
687 | lock_kernel(); | 688 | mutex_lock(&proc_viotape_mutex); |
688 | rc = viotap_ioctl(file->f_path.dentry->d_inode, file, cmd, arg); | 689 | rc = viotap_ioctl(file->f_path.dentry->d_inode, file, cmd, arg); |
689 | unlock_kernel(); | 690 | mutex_unlock(&proc_viotape_mutex); |
690 | return rc; | 691 | return rc; |
691 | } | 692 | } |
692 | 693 | ||
@@ -700,7 +701,7 @@ static int viotap_open(struct inode *inode, struct file *file) | |||
700 | if (op == NULL) | 701 | if (op == NULL) |
701 | return -ENOMEM; | 702 | return -ENOMEM; |
702 | 703 | ||
703 | lock_kernel(); | 704 | mutex_lock(&proc_viotape_mutex); |
704 | get_dev_info(file->f_path.dentry->d_inode, &devi); | 705 | get_dev_info(file->f_path.dentry->d_inode, &devi); |
705 | 706 | ||
706 | /* Note: We currently only support one mode! */ | 707 | /* Note: We currently only support one mode! */ |
@@ -731,7 +732,7 @@ static int viotap_open(struct inode *inode, struct file *file) | |||
731 | 732 | ||
732 | free_op: | 733 | free_op: |
733 | free_op_struct(op); | 734 | free_op_struct(op); |
734 | unlock_kernel(); | 735 | mutex_unlock(&proc_viotape_mutex); |
735 | return ret; | 736 | return ret; |
736 | } | 737 | } |
737 | 738 | ||