aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ide/ide-cd.c
diff options
context:
space:
mode:
authorArnd Bergmann <arnd@arndb.de>2010-07-08 04:18:46 -0400
committerJens Axboe <jaxboe@fusionio.com>2010-08-07 12:25:00 -0400
commit8a6cfeb6deca3a8fefd639d898b0d163c0b5d368 (patch)
tree9a633ad48c3b1ada0519ee7bade0602f940037f6 /drivers/ide/ide-cd.c
parent34484062445fe905bf02c72f87ddda21881acda3 (diff)
block: push down BKL into .locked_ioctl
As a preparation for the removal of the big kernel lock in the block layer, this removes the BKL from the common ioctl handling code, moving it into every single driver still using it. Signed-off-by: Arnd Bergmann <arnd@arndb.de> Acked-by: Christoph Hellwig <hch@infradead.org> Signed-off-by: Jens Axboe <jaxboe@fusionio.com>
Diffstat (limited to 'drivers/ide/ide-cd.c')
-rw-r--r--drivers/ide/ide-cd.c18
1 files changed, 16 insertions, 2 deletions
diff --git a/drivers/ide/ide-cd.c b/drivers/ide/ide-cd.c
index ef7e3a9bee51..bf9f61a5c2f8 100644
--- a/drivers/ide/ide-cd.c
+++ b/drivers/ide/ide-cd.c
@@ -31,6 +31,7 @@
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>
34#include <linux/slab.h> 35#include <linux/slab.h>
35#include <linux/interrupt.h> 36#include <linux/interrupt.h>
36#include <linux/errno.h> 37#include <linux/errno.h>
@@ -1654,7 +1655,7 @@ static int idecd_get_spindown(struct cdrom_device_info *cdi, unsigned long arg)
1654 return 0; 1655 return 0;
1655} 1656}
1656 1657
1657static int idecd_ioctl(struct block_device *bdev, fmode_t mode, 1658static int idecd_locked_ioctl(struct block_device *bdev, fmode_t mode,
1658 unsigned int cmd, unsigned long arg) 1659 unsigned int cmd, unsigned long arg)
1659{ 1660{
1660 struct cdrom_info *info = ide_drv_g(bdev->bd_disk, cdrom_info); 1661 struct cdrom_info *info = ide_drv_g(bdev->bd_disk, cdrom_info);
@@ -1676,6 +1677,19 @@ static int idecd_ioctl(struct block_device *bdev, fmode_t mode,
1676 return err; 1677 return err;
1677} 1678}
1678 1679
1680static int idecd_ioctl(struct block_device *bdev, fmode_t mode,
1681 unsigned int cmd, unsigned long arg)
1682{
1683 int ret;
1684
1685 lock_kernel();
1686 ret = idecd_locked_ioctl(bdev, mode, cmd, arg);
1687 unlock_kernel();
1688
1689 return ret;
1690}
1691
1692
1679static int idecd_media_changed(struct gendisk *disk) 1693static int idecd_media_changed(struct gendisk *disk)
1680{ 1694{
1681 struct cdrom_info *info = ide_drv_g(disk, cdrom_info); 1695 struct cdrom_info *info = ide_drv_g(disk, cdrom_info);
@@ -1696,7 +1710,7 @@ static const struct block_device_operations idecd_ops = {
1696 .owner = THIS_MODULE, 1710 .owner = THIS_MODULE,
1697 .open = idecd_open, 1711 .open = idecd_open,
1698 .release = idecd_release, 1712 .release = idecd_release,
1699 .locked_ioctl = idecd_ioctl, 1713 .ioctl = idecd_ioctl,
1700 .media_changed = idecd_media_changed, 1714 .media_changed = idecd_media_changed,
1701 .revalidate_disk = idecd_revalidate_disk 1715 .revalidate_disk = idecd_revalidate_disk
1702}; 1716};