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/ide | |
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/ide')
-rw-r--r-- | drivers/ide/ide-cd.c | 14 | ||||
-rw-r--r-- | drivers/ide/ide-disk_ioctl.c | 7 | ||||
-rw-r--r-- | drivers/ide/ide-floppy_ioctl.c | 7 | ||||
-rw-r--r-- | drivers/ide/ide-gd.c | 10 | ||||
-rw-r--r-- | drivers/ide/ide-tape.c | 19 |
5 files changed, 29 insertions, 28 deletions
diff --git a/drivers/ide/ide-cd.c b/drivers/ide/ide-cd.c index 31fc76960a8f..0c73fe39a236 100644 --- a/drivers/ide/ide-cd.c +++ b/drivers/ide/ide-cd.c | |||
@@ -31,7 +31,6 @@ | |||
31 | #include <linux/delay.h> | 31 | #include <linux/delay.h> |
32 | #include <linux/timer.h> | 32 | #include <linux/timer.h> |
33 | #include <linux/seq_file.h> | 33 | #include <linux/seq_file.h> |
34 | #include <linux/smp_lock.h> | ||
35 | #include <linux/slab.h> | 34 | #include <linux/slab.h> |
36 | #include <linux/interrupt.h> | 35 | #include <linux/interrupt.h> |
37 | #include <linux/errno.h> | 36 | #include <linux/errno.h> |
@@ -52,6 +51,7 @@ | |||
52 | 51 | ||
53 | #include "ide-cd.h" | 52 | #include "ide-cd.h" |
54 | 53 | ||
54 | static DEFINE_MUTEX(ide_cd_mutex); | ||
55 | static DEFINE_MUTEX(idecd_ref_mutex); | 55 | static DEFINE_MUTEX(idecd_ref_mutex); |
56 | 56 | ||
57 | static void ide_cd_release(struct device *); | 57 | static void ide_cd_release(struct device *); |
@@ -1602,7 +1602,7 @@ static int idecd_open(struct block_device *bdev, fmode_t mode) | |||
1602 | struct cdrom_info *info; | 1602 | struct cdrom_info *info; |
1603 | int rc = -ENXIO; | 1603 | int rc = -ENXIO; |
1604 | 1604 | ||
1605 | lock_kernel(); | 1605 | mutex_lock(&ide_cd_mutex); |
1606 | info = ide_cd_get(bdev->bd_disk); | 1606 | info = ide_cd_get(bdev->bd_disk); |
1607 | if (!info) | 1607 | if (!info) |
1608 | goto out; | 1608 | goto out; |
@@ -1611,7 +1611,7 @@ static int idecd_open(struct block_device *bdev, fmode_t mode) | |||
1611 | if (rc < 0) | 1611 | if (rc < 0) |
1612 | ide_cd_put(info); | 1612 | ide_cd_put(info); |
1613 | out: | 1613 | out: |
1614 | unlock_kernel(); | 1614 | mutex_unlock(&ide_cd_mutex); |
1615 | return rc; | 1615 | return rc; |
1616 | } | 1616 | } |
1617 | 1617 | ||
@@ -1619,11 +1619,11 @@ static int idecd_release(struct gendisk *disk, fmode_t mode) | |||
1619 | { | 1619 | { |
1620 | struct cdrom_info *info = ide_drv_g(disk, cdrom_info); | 1620 | struct cdrom_info *info = ide_drv_g(disk, cdrom_info); |
1621 | 1621 | ||
1622 | lock_kernel(); | 1622 | mutex_lock(&ide_cd_mutex); |
1623 | cdrom_release(&info->devinfo, mode); | 1623 | cdrom_release(&info->devinfo, mode); |
1624 | 1624 | ||
1625 | ide_cd_put(info); | 1625 | ide_cd_put(info); |
1626 | unlock_kernel(); | 1626 | mutex_unlock(&ide_cd_mutex); |
1627 | 1627 | ||
1628 | return 0; | 1628 | return 0; |
1629 | } | 1629 | } |
@@ -1694,9 +1694,9 @@ static int idecd_ioctl(struct block_device *bdev, fmode_t mode, | |||
1694 | { | 1694 | { |
1695 | int ret; | 1695 | int ret; |
1696 | 1696 | ||
1697 | lock_kernel(); | 1697 | mutex_lock(&ide_cd_mutex); |
1698 | ret = idecd_locked_ioctl(bdev, mode, cmd, arg); | 1698 | ret = idecd_locked_ioctl(bdev, mode, cmd, arg); |
1699 | unlock_kernel(); | 1699 | mutex_unlock(&ide_cd_mutex); |
1700 | 1700 | ||
1701 | return ret; | 1701 | return ret; |
1702 | } | 1702 | } |
diff --git a/drivers/ide/ide-disk_ioctl.c b/drivers/ide/ide-disk_ioctl.c index ec94c66918f6..da36f729ff32 100644 --- a/drivers/ide/ide-disk_ioctl.c +++ b/drivers/ide/ide-disk_ioctl.c | |||
@@ -1,10 +1,11 @@ | |||
1 | #include <linux/kernel.h> | 1 | #include <linux/kernel.h> |
2 | #include <linux/ide.h> | 2 | #include <linux/ide.h> |
3 | #include <linux/hdreg.h> | 3 | #include <linux/hdreg.h> |
4 | #include <linux/smp_lock.h> | 4 | #include <linux/mutex.h> |
5 | 5 | ||
6 | #include "ide-disk.h" | 6 | #include "ide-disk.h" |
7 | 7 | ||
8 | static DEFINE_MUTEX(ide_disk_ioctl_mutex); | ||
8 | static const struct ide_ioctl_devset ide_disk_ioctl_settings[] = { | 9 | static const struct ide_ioctl_devset ide_disk_ioctl_settings[] = { |
9 | { HDIO_GET_ADDRESS, HDIO_SET_ADDRESS, &ide_devset_address }, | 10 | { HDIO_GET_ADDRESS, HDIO_SET_ADDRESS, &ide_devset_address }, |
10 | { HDIO_GET_MULTCOUNT, HDIO_SET_MULTCOUNT, &ide_devset_multcount }, | 11 | { HDIO_GET_MULTCOUNT, HDIO_SET_MULTCOUNT, &ide_devset_multcount }, |
@@ -19,13 +20,13 @@ int ide_disk_ioctl(ide_drive_t *drive, struct block_device *bdev, fmode_t mode, | |||
19 | { | 20 | { |
20 | int err; | 21 | int err; |
21 | 22 | ||
22 | lock_kernel(); | 23 | mutex_lock(&ide_disk_ioctl_mutex); |
23 | err = ide_setting_ioctl(drive, bdev, cmd, arg, ide_disk_ioctl_settings); | 24 | err = ide_setting_ioctl(drive, bdev, cmd, arg, ide_disk_ioctl_settings); |
24 | if (err != -EOPNOTSUPP) | 25 | if (err != -EOPNOTSUPP) |
25 | goto out; | 26 | goto out; |
26 | 27 | ||
27 | err = generic_ide_ioctl(drive, bdev, cmd, arg); | 28 | err = generic_ide_ioctl(drive, bdev, cmd, arg); |
28 | out: | 29 | out: |
29 | unlock_kernel(); | 30 | mutex_unlock(&ide_disk_ioctl_mutex); |
30 | return err; | 31 | return err; |
31 | } | 32 | } |
diff --git a/drivers/ide/ide-floppy_ioctl.c b/drivers/ide/ide-floppy_ioctl.c index fd3d05ab3417..d267b7affad6 100644 --- a/drivers/ide/ide-floppy_ioctl.c +++ b/drivers/ide/ide-floppy_ioctl.c | |||
@@ -5,7 +5,7 @@ | |||
5 | #include <linux/kernel.h> | 5 | #include <linux/kernel.h> |
6 | #include <linux/ide.h> | 6 | #include <linux/ide.h> |
7 | #include <linux/cdrom.h> | 7 | #include <linux/cdrom.h> |
8 | #include <linux/smp_lock.h> | 8 | #include <linux/mutex.h> |
9 | 9 | ||
10 | #include <asm/unaligned.h> | 10 | #include <asm/unaligned.h> |
11 | 11 | ||
@@ -32,6 +32,7 @@ | |||
32 | * On exit we set nformats to the number of records we've actually initialized. | 32 | * On exit we set nformats to the number of records we've actually initialized. |
33 | */ | 33 | */ |
34 | 34 | ||
35 | static DEFINE_MUTEX(ide_floppy_ioctl_mutex); | ||
35 | static int ide_floppy_get_format_capacities(ide_drive_t *drive, | 36 | static int ide_floppy_get_format_capacities(ide_drive_t *drive, |
36 | struct ide_atapi_pc *pc, | 37 | struct ide_atapi_pc *pc, |
37 | int __user *arg) | 38 | int __user *arg) |
@@ -276,7 +277,7 @@ int ide_floppy_ioctl(ide_drive_t *drive, struct block_device *bdev, | |||
276 | void __user *argp = (void __user *)arg; | 277 | void __user *argp = (void __user *)arg; |
277 | int err; | 278 | int err; |
278 | 279 | ||
279 | lock_kernel(); | 280 | mutex_lock(&ide_floppy_ioctl_mutex); |
280 | if (cmd == CDROMEJECT || cmd == CDROM_LOCKDOOR) { | 281 | if (cmd == CDROMEJECT || cmd == CDROM_LOCKDOOR) { |
281 | err = ide_floppy_lockdoor(drive, &pc, arg, cmd); | 282 | err = ide_floppy_lockdoor(drive, &pc, arg, cmd); |
282 | goto out; | 283 | goto out; |
@@ -298,6 +299,6 @@ int ide_floppy_ioctl(ide_drive_t *drive, struct block_device *bdev, | |||
298 | err = generic_ide_ioctl(drive, bdev, cmd, arg); | 299 | err = generic_ide_ioctl(drive, bdev, cmd, arg); |
299 | 300 | ||
300 | out: | 301 | out: |
301 | unlock_kernel(); | 302 | mutex_unlock(&ide_floppy_ioctl_mutex); |
302 | return err; | 303 | return err; |
303 | } | 304 | } |
diff --git a/drivers/ide/ide-gd.c b/drivers/ide/ide-gd.c index 70aeeb18833e..35c4b43585e3 100644 --- a/drivers/ide/ide-gd.c +++ b/drivers/ide/ide-gd.c | |||
@@ -1,4 +1,3 @@ | |||
1 | #include <linux/smp_lock.h> | ||
2 | #include <linux/module.h> | 1 | #include <linux/module.h> |
3 | #include <linux/types.h> | 2 | #include <linux/types.h> |
4 | #include <linux/string.h> | 3 | #include <linux/string.h> |
@@ -23,6 +22,7 @@ | |||
23 | #define IDE_GD_VERSION "1.18" | 22 | #define IDE_GD_VERSION "1.18" |
24 | 23 | ||
25 | /* module parameters */ | 24 | /* module parameters */ |
25 | static DEFINE_MUTEX(ide_gd_mutex); | ||
26 | static unsigned long debug_mask; | 26 | static unsigned long debug_mask; |
27 | module_param(debug_mask, ulong, 0644); | 27 | module_param(debug_mask, ulong, 0644); |
28 | 28 | ||
@@ -242,9 +242,9 @@ static int ide_gd_unlocked_open(struct block_device *bdev, fmode_t mode) | |||
242 | { | 242 | { |
243 | int ret; | 243 | int ret; |
244 | 244 | ||
245 | lock_kernel(); | 245 | mutex_lock(&ide_gd_mutex); |
246 | ret = ide_gd_open(bdev, mode); | 246 | ret = ide_gd_open(bdev, mode); |
247 | unlock_kernel(); | 247 | mutex_unlock(&ide_gd_mutex); |
248 | 248 | ||
249 | return ret; | 249 | return ret; |
250 | } | 250 | } |
@@ -257,7 +257,7 @@ static int ide_gd_release(struct gendisk *disk, fmode_t mode) | |||
257 | 257 | ||
258 | ide_debug_log(IDE_DBG_FUNC, "enter"); | 258 | ide_debug_log(IDE_DBG_FUNC, "enter"); |
259 | 259 | ||
260 | lock_kernel(); | 260 | mutex_lock(&ide_gd_mutex); |
261 | if (idkp->openers == 1) | 261 | if (idkp->openers == 1) |
262 | drive->disk_ops->flush(drive); | 262 | drive->disk_ops->flush(drive); |
263 | 263 | ||
@@ -269,7 +269,7 @@ static int ide_gd_release(struct gendisk *disk, fmode_t mode) | |||
269 | idkp->openers--; | 269 | idkp->openers--; |
270 | 270 | ||
271 | ide_disk_put(idkp); | 271 | ide_disk_put(idkp); |
272 | unlock_kernel(); | 272 | mutex_unlock(&ide_gd_mutex); |
273 | 273 | ||
274 | return 0; | 274 | return 0; |
275 | } | 275 | } |
diff --git a/drivers/ide/ide-tape.c b/drivers/ide/ide-tape.c index 6d622cb5ac81..65f0bcfb42ca 100644 --- a/drivers/ide/ide-tape.c +++ b/drivers/ide/ide-tape.c | |||
@@ -32,11 +32,9 @@ | |||
32 | #include <linux/errno.h> | 32 | #include <linux/errno.h> |
33 | #include <linux/genhd.h> | 33 | #include <linux/genhd.h> |
34 | #include <linux/seq_file.h> | 34 | #include <linux/seq_file.h> |
35 | #include <linux/smp_lock.h> | ||
36 | #include <linux/slab.h> | 35 | #include <linux/slab.h> |
37 | #include <linux/pci.h> | 36 | #include <linux/pci.h> |
38 | #include <linux/ide.h> | 37 | #include <linux/ide.h> |
39 | #include <linux/smp_lock.h> | ||
40 | #include <linux/completion.h> | 38 | #include <linux/completion.h> |
41 | #include <linux/bitops.h> | 39 | #include <linux/bitops.h> |
42 | #include <linux/mutex.h> | 40 | #include <linux/mutex.h> |
@@ -220,6 +218,7 @@ typedef struct ide_tape_obj { | |||
220 | char write_prot; | 218 | char write_prot; |
221 | } idetape_tape_t; | 219 | } idetape_tape_t; |
222 | 220 | ||
221 | static DEFINE_MUTEX(ide_tape_mutex); | ||
223 | static DEFINE_MUTEX(idetape_ref_mutex); | 222 | static DEFINE_MUTEX(idetape_ref_mutex); |
224 | 223 | ||
225 | static DEFINE_MUTEX(idetape_chrdev_mutex); | 224 | static DEFINE_MUTEX(idetape_chrdev_mutex); |
@@ -1426,9 +1425,9 @@ static long idetape_chrdev_ioctl(struct file *file, | |||
1426 | unsigned int cmd, unsigned long arg) | 1425 | unsigned int cmd, unsigned long arg) |
1427 | { | 1426 | { |
1428 | long ret; | 1427 | long ret; |
1429 | lock_kernel(); | 1428 | mutex_lock(&ide_tape_mutex); |
1430 | ret = do_idetape_chrdev_ioctl(file, cmd, arg); | 1429 | ret = do_idetape_chrdev_ioctl(file, cmd, arg); |
1431 | unlock_kernel(); | 1430 | mutex_unlock(&ide_tape_mutex); |
1432 | return ret; | 1431 | return ret; |
1433 | } | 1432 | } |
1434 | 1433 | ||
@@ -1909,9 +1908,9 @@ static int idetape_open(struct block_device *bdev, fmode_t mode) | |||
1909 | { | 1908 | { |
1910 | struct ide_tape_obj *tape; | 1909 | struct ide_tape_obj *tape; |
1911 | 1910 | ||
1912 | lock_kernel(); | 1911 | mutex_lock(&ide_tape_mutex); |
1913 | tape = ide_tape_get(bdev->bd_disk, false, 0); | 1912 | tape = ide_tape_get(bdev->bd_disk, false, 0); |
1914 | unlock_kernel(); | 1913 | mutex_unlock(&ide_tape_mutex); |
1915 | 1914 | ||
1916 | if (!tape) | 1915 | if (!tape) |
1917 | return -ENXIO; | 1916 | return -ENXIO; |
@@ -1923,9 +1922,9 @@ static int idetape_release(struct gendisk *disk, fmode_t mode) | |||
1923 | { | 1922 | { |
1924 | struct ide_tape_obj *tape = ide_drv_g(disk, ide_tape_obj); | 1923 | struct ide_tape_obj *tape = ide_drv_g(disk, ide_tape_obj); |
1925 | 1924 | ||
1926 | lock_kernel(); | 1925 | mutex_lock(&ide_tape_mutex); |
1927 | ide_tape_put(tape); | 1926 | ide_tape_put(tape); |
1928 | unlock_kernel(); | 1927 | mutex_unlock(&ide_tape_mutex); |
1929 | 1928 | ||
1930 | return 0; | 1929 | return 0; |
1931 | } | 1930 | } |
@@ -1937,11 +1936,11 @@ static int idetape_ioctl(struct block_device *bdev, fmode_t mode, | |||
1937 | ide_drive_t *drive = tape->drive; | 1936 | ide_drive_t *drive = tape->drive; |
1938 | int err; | 1937 | int err; |
1939 | 1938 | ||
1940 | lock_kernel(); | 1939 | mutex_lock(&ide_tape_mutex); |
1941 | err = generic_ide_ioctl(drive, bdev, cmd, arg); | 1940 | err = generic_ide_ioctl(drive, bdev, cmd, arg); |
1942 | if (err == -EINVAL) | 1941 | if (err == -EINVAL) |
1943 | err = idetape_blkdev_ioctl(drive, cmd, arg); | 1942 | err = idetape_blkdev_ioctl(drive, cmd, arg); |
1944 | unlock_kernel(); | 1943 | mutex_unlock(&ide_tape_mutex); |
1945 | 1944 | ||
1946 | return err; | 1945 | return err; |
1947 | } | 1946 | } |