diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2010-10-22 13:49:54 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2010-10-22 13:49:54 -0400 |
commit | c37927d4359e81b85de644f8fb08878717cf5f3f (patch) | |
tree | 25dabf2d905e1410819d1bdaba0bf5f779100d3c /drivers/message | |
parent | 5704e44d283e907623e3775c1262f206a2c48cf3 (diff) | |
parent | 2a48fc0ab24241755dc93bfd4f01d68efab47f5a (diff) |
Merge branch 'trivial' of git://git.kernel.org/pub/scm/linux/kernel/git/arnd/bkl
* 'trivial' of git://git.kernel.org/pub/scm/linux/kernel/git/arnd/bkl:
block: autoconvert trivial BKL users to private mutex
drivers: autoconvert trivial BKL users to private mutex
ipmi: autoconvert trivial BKL users to private mutex
mac: autoconvert trivial BKL users to private mutex
mtd: autoconvert trivial BKL users to private mutex
scsi: autoconvert trivial BKL users to private mutex
Fix up trivial conflicts (due to addition of private mutex right next to
deletion of a version string) in drivers/char/pcmcia/cm40[04]0_cs.c
Diffstat (limited to 'drivers/message')
-rw-r--r-- | drivers/message/fusion/mptctl.c | 15 | ||||
-rw-r--r-- | drivers/message/i2o/i2o_block.c | 15 | ||||
-rw-r--r-- | drivers/message/i2o/i2o_config.c | 23 |
3 files changed, 28 insertions, 25 deletions
diff --git a/drivers/message/fusion/mptctl.c b/drivers/message/fusion/mptctl.c index d8ddfdf8be14..a3856ed90aef 100644 --- a/drivers/message/fusion/mptctl.c +++ b/drivers/message/fusion/mptctl.c | |||
@@ -54,7 +54,7 @@ | |||
54 | #include <linux/pci.h> | 54 | #include <linux/pci.h> |
55 | #include <linux/delay.h> /* for mdelay */ | 55 | #include <linux/delay.h> /* for mdelay */ |
56 | #include <linux/miscdevice.h> | 56 | #include <linux/miscdevice.h> |
57 | #include <linux/smp_lock.h> | 57 | #include <linux/mutex.h> |
58 | #include <linux/compat.h> | 58 | #include <linux/compat.h> |
59 | 59 | ||
60 | #include <asm/io.h> | 60 | #include <asm/io.h> |
@@ -83,6 +83,7 @@ MODULE_VERSION(my_VERSION); | |||
83 | 83 | ||
84 | /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ | 84 | /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ |
85 | 85 | ||
86 | static DEFINE_MUTEX(mpctl_mutex); | ||
86 | static u8 mptctl_id = MPT_MAX_PROTOCOL_DRIVERS; | 87 | static u8 mptctl_id = MPT_MAX_PROTOCOL_DRIVERS; |
87 | static u8 mptctl_taskmgmt_id = MPT_MAX_PROTOCOL_DRIVERS; | 88 | static u8 mptctl_taskmgmt_id = MPT_MAX_PROTOCOL_DRIVERS; |
88 | 89 | ||
@@ -601,12 +602,12 @@ mptctl_fasync(int fd, struct file *filep, int mode) | |||
601 | MPT_ADAPTER *ioc; | 602 | MPT_ADAPTER *ioc; |
602 | int ret; | 603 | int ret; |
603 | 604 | ||
604 | lock_kernel(); | 605 | mutex_lock(&mpctl_mutex); |
605 | list_for_each_entry(ioc, &ioc_list, list) | 606 | list_for_each_entry(ioc, &ioc_list, list) |
606 | ioc->aen_event_read_flag=0; | 607 | ioc->aen_event_read_flag=0; |
607 | 608 | ||
608 | ret = fasync_helper(fd, filep, mode, &async_queue); | 609 | ret = fasync_helper(fd, filep, mode, &async_queue); |
609 | unlock_kernel(); | 610 | mutex_unlock(&mpctl_mutex); |
610 | return ret; | 611 | return ret; |
611 | } | 612 | } |
612 | 613 | ||
@@ -698,9 +699,9 @@ static long | |||
698 | mptctl_ioctl(struct file *file, unsigned int cmd, unsigned long arg) | 699 | mptctl_ioctl(struct file *file, unsigned int cmd, unsigned long arg) |
699 | { | 700 | { |
700 | long ret; | 701 | long ret; |
701 | lock_kernel(); | 702 | mutex_lock(&mpctl_mutex); |
702 | ret = __mptctl_ioctl(file, cmd, arg); | 703 | ret = __mptctl_ioctl(file, cmd, arg); |
703 | unlock_kernel(); | 704 | mutex_unlock(&mpctl_mutex); |
704 | return ret; | 705 | return ret; |
705 | } | 706 | } |
706 | 707 | ||
@@ -2926,7 +2927,7 @@ compat_mpt_command(struct file *filp, unsigned int cmd, | |||
2926 | static long compat_mpctl_ioctl(struct file *f, unsigned int cmd, unsigned long arg) | 2927 | static long compat_mpctl_ioctl(struct file *f, unsigned int cmd, unsigned long arg) |
2927 | { | 2928 | { |
2928 | long ret; | 2929 | long ret; |
2929 | lock_kernel(); | 2930 | mutex_lock(&mpctl_mutex); |
2930 | switch (cmd) { | 2931 | switch (cmd) { |
2931 | case MPTIOCINFO: | 2932 | case MPTIOCINFO: |
2932 | case MPTIOCINFO1: | 2933 | case MPTIOCINFO1: |
@@ -2951,7 +2952,7 @@ static long compat_mpctl_ioctl(struct file *f, unsigned int cmd, unsigned long a | |||
2951 | ret = -ENOIOCTLCMD; | 2952 | ret = -ENOIOCTLCMD; |
2952 | break; | 2953 | break; |
2953 | } | 2954 | } |
2954 | unlock_kernel(); | 2955 | mutex_unlock(&mpctl_mutex); |
2955 | return ret; | 2956 | return ret; |
2956 | } | 2957 | } |
2957 | 2958 | ||
diff --git a/drivers/message/i2o/i2o_block.c b/drivers/message/i2o/i2o_block.c index f0f1e667000f..f87a9d405a5e 100644 --- a/drivers/message/i2o/i2o_block.c +++ b/drivers/message/i2o/i2o_block.c | |||
@@ -53,7 +53,7 @@ | |||
53 | #include <linux/module.h> | 53 | #include <linux/module.h> |
54 | #include <linux/slab.h> | 54 | #include <linux/slab.h> |
55 | #include <linux/i2o.h> | 55 | #include <linux/i2o.h> |
56 | #include <linux/smp_lock.h> | 56 | #include <linux/mutex.h> |
57 | 57 | ||
58 | #include <linux/mempool.h> | 58 | #include <linux/mempool.h> |
59 | 59 | ||
@@ -69,6 +69,7 @@ | |||
69 | #define OSM_VERSION "1.325" | 69 | #define OSM_VERSION "1.325" |
70 | #define OSM_DESCRIPTION "I2O Block Device OSM" | 70 | #define OSM_DESCRIPTION "I2O Block Device OSM" |
71 | 71 | ||
72 | static DEFINE_MUTEX(i2o_block_mutex); | ||
72 | static struct i2o_driver i2o_block_driver; | 73 | static struct i2o_driver i2o_block_driver; |
73 | 74 | ||
74 | /* global Block OSM request mempool */ | 75 | /* global Block OSM request mempool */ |
@@ -578,7 +579,7 @@ static int i2o_block_open(struct block_device *bdev, fmode_t mode) | |||
578 | if (!dev->i2o_dev) | 579 | if (!dev->i2o_dev) |
579 | return -ENODEV; | 580 | return -ENODEV; |
580 | 581 | ||
581 | lock_kernel(); | 582 | mutex_lock(&i2o_block_mutex); |
582 | if (dev->power > 0x1f) | 583 | if (dev->power > 0x1f) |
583 | i2o_block_device_power(dev, 0x02); | 584 | i2o_block_device_power(dev, 0x02); |
584 | 585 | ||
@@ -587,7 +588,7 @@ static int i2o_block_open(struct block_device *bdev, fmode_t mode) | |||
587 | i2o_block_device_lock(dev->i2o_dev, -1); | 588 | i2o_block_device_lock(dev->i2o_dev, -1); |
588 | 589 | ||
589 | osm_debug("Ready.\n"); | 590 | osm_debug("Ready.\n"); |
590 | unlock_kernel(); | 591 | mutex_unlock(&i2o_block_mutex); |
591 | 592 | ||
592 | return 0; | 593 | return 0; |
593 | }; | 594 | }; |
@@ -618,7 +619,7 @@ static int i2o_block_release(struct gendisk *disk, fmode_t mode) | |||
618 | if (!dev->i2o_dev) | 619 | if (!dev->i2o_dev) |
619 | return 0; | 620 | return 0; |
620 | 621 | ||
621 | lock_kernel(); | 622 | mutex_lock(&i2o_block_mutex); |
622 | i2o_block_device_flush(dev->i2o_dev); | 623 | i2o_block_device_flush(dev->i2o_dev); |
623 | 624 | ||
624 | i2o_block_device_unlock(dev->i2o_dev, -1); | 625 | i2o_block_device_unlock(dev->i2o_dev, -1); |
@@ -629,7 +630,7 @@ static int i2o_block_release(struct gendisk *disk, fmode_t mode) | |||
629 | operation = 0x24; | 630 | operation = 0x24; |
630 | 631 | ||
631 | i2o_block_device_power(dev, operation); | 632 | i2o_block_device_power(dev, operation); |
632 | unlock_kernel(); | 633 | mutex_unlock(&i2o_block_mutex); |
633 | 634 | ||
634 | return 0; | 635 | return 0; |
635 | } | 636 | } |
@@ -664,7 +665,7 @@ static int i2o_block_ioctl(struct block_device *bdev, fmode_t mode, | |||
664 | if (!capable(CAP_SYS_ADMIN)) | 665 | if (!capable(CAP_SYS_ADMIN)) |
665 | return -EPERM; | 666 | return -EPERM; |
666 | 667 | ||
667 | lock_kernel(); | 668 | mutex_lock(&i2o_block_mutex); |
668 | switch (cmd) { | 669 | switch (cmd) { |
669 | case BLKI2OGRSTRAT: | 670 | case BLKI2OGRSTRAT: |
670 | ret = put_user(dev->rcache, (int __user *)arg); | 671 | ret = put_user(dev->rcache, (int __user *)arg); |
@@ -688,7 +689,7 @@ static int i2o_block_ioctl(struct block_device *bdev, fmode_t mode, | |||
688 | ret = 0; | 689 | ret = 0; |
689 | break; | 690 | break; |
690 | } | 691 | } |
691 | unlock_kernel(); | 692 | mutex_unlock(&i2o_block_mutex); |
692 | 693 | ||
693 | return ret; | 694 | return ret; |
694 | }; | 695 | }; |
diff --git a/drivers/message/i2o/i2o_config.c b/drivers/message/i2o/i2o_config.c index 068ba0785bb4..7d3cc575c361 100644 --- a/drivers/message/i2o/i2o_config.c +++ b/drivers/message/i2o/i2o_config.c | |||
@@ -31,7 +31,7 @@ | |||
31 | */ | 31 | */ |
32 | 32 | ||
33 | #include <linux/miscdevice.h> | 33 | #include <linux/miscdevice.h> |
34 | #include <linux/smp_lock.h> | 34 | #include <linux/mutex.h> |
35 | #include <linux/compat.h> | 35 | #include <linux/compat.h> |
36 | #include <linux/slab.h> | 36 | #include <linux/slab.h> |
37 | 37 | ||
@@ -41,6 +41,7 @@ | |||
41 | 41 | ||
42 | #define SG_TABLESIZE 30 | 42 | #define SG_TABLESIZE 30 |
43 | 43 | ||
44 | static DEFINE_MUTEX(i2o_cfg_mutex); | ||
44 | static long i2o_cfg_ioctl(struct file *, unsigned int, unsigned long); | 45 | static long i2o_cfg_ioctl(struct file *, unsigned int, unsigned long); |
45 | 46 | ||
46 | static spinlock_t i2o_config_lock; | 47 | static spinlock_t i2o_config_lock; |
@@ -741,7 +742,7 @@ static long i2o_cfg_compat_ioctl(struct file *file, unsigned cmd, | |||
741 | unsigned long arg) | 742 | unsigned long arg) |
742 | { | 743 | { |
743 | int ret; | 744 | int ret; |
744 | lock_kernel(); | 745 | mutex_lock(&i2o_cfg_mutex); |
745 | switch (cmd) { | 746 | switch (cmd) { |
746 | case I2OGETIOPS: | 747 | case I2OGETIOPS: |
747 | ret = i2o_cfg_ioctl(file, cmd, arg); | 748 | ret = i2o_cfg_ioctl(file, cmd, arg); |
@@ -753,7 +754,7 @@ static long i2o_cfg_compat_ioctl(struct file *file, unsigned cmd, | |||
753 | ret = -ENOIOCTLCMD; | 754 | ret = -ENOIOCTLCMD; |
754 | break; | 755 | break; |
755 | } | 756 | } |
756 | unlock_kernel(); | 757 | mutex_unlock(&i2o_cfg_mutex); |
757 | return ret; | 758 | return ret; |
758 | } | 759 | } |
759 | 760 | ||
@@ -981,7 +982,7 @@ static long i2o_cfg_ioctl(struct file *fp, unsigned int cmd, unsigned long arg) | |||
981 | { | 982 | { |
982 | int ret; | 983 | int ret; |
983 | 984 | ||
984 | lock_kernel(); | 985 | mutex_lock(&i2o_cfg_mutex); |
985 | switch (cmd) { | 986 | switch (cmd) { |
986 | case I2OGETIOPS: | 987 | case I2OGETIOPS: |
987 | ret = i2o_cfg_getiops(arg); | 988 | ret = i2o_cfg_getiops(arg); |
@@ -1037,7 +1038,7 @@ static long i2o_cfg_ioctl(struct file *fp, unsigned int cmd, unsigned long arg) | |||
1037 | osm_debug("unknown ioctl called!\n"); | 1038 | osm_debug("unknown ioctl called!\n"); |
1038 | ret = -EINVAL; | 1039 | ret = -EINVAL; |
1039 | } | 1040 | } |
1040 | unlock_kernel(); | 1041 | mutex_unlock(&i2o_cfg_mutex); |
1041 | return ret; | 1042 | return ret; |
1042 | } | 1043 | } |
1043 | 1044 | ||
@@ -1051,7 +1052,7 @@ static int cfg_open(struct inode *inode, struct file *file) | |||
1051 | if (!tmp) | 1052 | if (!tmp) |
1052 | return -ENOMEM; | 1053 | return -ENOMEM; |
1053 | 1054 | ||
1054 | lock_kernel(); | 1055 | mutex_lock(&i2o_cfg_mutex); |
1055 | file->private_data = (void *)(i2o_cfg_info_id++); | 1056 | file->private_data = (void *)(i2o_cfg_info_id++); |
1056 | tmp->fp = file; | 1057 | tmp->fp = file; |
1057 | tmp->fasync = NULL; | 1058 | tmp->fasync = NULL; |
@@ -1065,7 +1066,7 @@ static int cfg_open(struct inode *inode, struct file *file) | |||
1065 | spin_lock_irqsave(&i2o_config_lock, flags); | 1066 | spin_lock_irqsave(&i2o_config_lock, flags); |
1066 | open_files = tmp; | 1067 | open_files = tmp; |
1067 | spin_unlock_irqrestore(&i2o_config_lock, flags); | 1068 | spin_unlock_irqrestore(&i2o_config_lock, flags); |
1068 | unlock_kernel(); | 1069 | mutex_unlock(&i2o_cfg_mutex); |
1069 | 1070 | ||
1070 | return 0; | 1071 | return 0; |
1071 | } | 1072 | } |
@@ -1076,14 +1077,14 @@ static int cfg_fasync(int fd, struct file *fp, int on) | |||
1076 | struct i2o_cfg_info *p; | 1077 | struct i2o_cfg_info *p; |
1077 | int ret = -EBADF; | 1078 | int ret = -EBADF; |
1078 | 1079 | ||
1079 | lock_kernel(); | 1080 | mutex_lock(&i2o_cfg_mutex); |
1080 | for (p = open_files; p; p = p->next) | 1081 | for (p = open_files; p; p = p->next) |
1081 | if (p->q_id == id) | 1082 | if (p->q_id == id) |
1082 | break; | 1083 | break; |
1083 | 1084 | ||
1084 | if (p) | 1085 | if (p) |
1085 | ret = fasync_helper(fd, fp, on, &p->fasync); | 1086 | ret = fasync_helper(fd, fp, on, &p->fasync); |
1086 | unlock_kernel(); | 1087 | mutex_unlock(&i2o_cfg_mutex); |
1087 | return ret; | 1088 | return ret; |
1088 | } | 1089 | } |
1089 | 1090 | ||
@@ -1093,7 +1094,7 @@ static int cfg_release(struct inode *inode, struct file *file) | |||
1093 | struct i2o_cfg_info *p, **q; | 1094 | struct i2o_cfg_info *p, **q; |
1094 | unsigned long flags; | 1095 | unsigned long flags; |
1095 | 1096 | ||
1096 | lock_kernel(); | 1097 | mutex_lock(&i2o_cfg_mutex); |
1097 | spin_lock_irqsave(&i2o_config_lock, flags); | 1098 | spin_lock_irqsave(&i2o_config_lock, flags); |
1098 | for (q = &open_files; (p = *q) != NULL; q = &p->next) { | 1099 | for (q = &open_files; (p = *q) != NULL; q = &p->next) { |
1099 | if (p->q_id == id) { | 1100 | if (p->q_id == id) { |
@@ -1103,7 +1104,7 @@ static int cfg_release(struct inode *inode, struct file *file) | |||
1103 | } | 1104 | } |
1104 | } | 1105 | } |
1105 | spin_unlock_irqrestore(&i2o_config_lock, flags); | 1106 | spin_unlock_irqrestore(&i2o_config_lock, flags); |
1106 | unlock_kernel(); | 1107 | mutex_unlock(&i2o_cfg_mutex); |
1107 | 1108 | ||
1108 | return 0; | 1109 | return 0; |
1109 | } | 1110 | } |