aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/cdrom
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/cdrom
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/cdrom')
-rw-r--r--drivers/cdrom/gdrom.c11
-rw-r--r--drivers/cdrom/viocd.c11
2 files changed, 18 insertions, 4 deletions
diff --git a/drivers/cdrom/gdrom.c b/drivers/cdrom/gdrom.c
index 5219b57deb36..1772fd914fb9 100644
--- a/drivers/cdrom/gdrom.c
+++ b/drivers/cdrom/gdrom.c
@@ -34,6 +34,7 @@
34#include <linux/blkdev.h> 34#include <linux/blkdev.h>
35#include <linux/interrupt.h> 35#include <linux/interrupt.h>
36#include <linux/device.h> 36#include <linux/device.h>
37#include <linux/smp_lock.h>
37#include <linux/wait.h> 38#include <linux/wait.h>
38#include <linux/workqueue.h> 39#include <linux/workqueue.h>
39#include <linux/platform_device.h> 40#include <linux/platform_device.h>
@@ -509,7 +510,13 @@ static int gdrom_bdops_mediachanged(struct gendisk *disk)
509static int gdrom_bdops_ioctl(struct block_device *bdev, fmode_t mode, 510static int gdrom_bdops_ioctl(struct block_device *bdev, fmode_t mode,
510 unsigned cmd, unsigned long arg) 511 unsigned cmd, unsigned long arg)
511{ 512{
512 return cdrom_ioctl(gd.cd_info, bdev, mode, cmd, arg); 513 int ret;
514
515 lock_kernel();
516 ret = cdrom_ioctl(gd.cd_info, bdev, mode, cmd, arg);
517 unlock_kernel();
518
519 return ret;
513} 520}
514 521
515static const struct block_device_operations gdrom_bdops = { 522static const struct block_device_operations gdrom_bdops = {
@@ -517,7 +524,7 @@ static const struct block_device_operations gdrom_bdops = {
517 .open = gdrom_bdops_open, 524 .open = gdrom_bdops_open,
518 .release = gdrom_bdops_release, 525 .release = gdrom_bdops_release,
519 .media_changed = gdrom_bdops_mediachanged, 526 .media_changed = gdrom_bdops_mediachanged,
520 .locked_ioctl = gdrom_bdops_ioctl, 527 .ioctl = gdrom_bdops_ioctl,
521}; 528};
522 529
523static irqreturn_t gdrom_command_interrupt(int irq, void *dev_id) 530static irqreturn_t gdrom_command_interrupt(int irq, void *dev_id)
diff --git a/drivers/cdrom/viocd.c b/drivers/cdrom/viocd.c
index 1fa6628d150b..16dada0627ee 100644
--- a/drivers/cdrom/viocd.c
+++ b/drivers/cdrom/viocd.c
@@ -42,6 +42,7 @@
42#include <linux/module.h> 42#include <linux/module.h>
43#include <linux/completion.h> 43#include <linux/completion.h>
44#include <linux/proc_fs.h> 44#include <linux/proc_fs.h>
45#include <linux/smp_lock.h>
45#include <linux/seq_file.h> 46#include <linux/seq_file.h>
46#include <linux/scatterlist.h> 47#include <linux/scatterlist.h>
47 48
@@ -167,7 +168,13 @@ static int viocd_blk_ioctl(struct block_device *bdev, fmode_t mode,
167 unsigned cmd, unsigned long arg) 168 unsigned cmd, unsigned long arg)
168{ 169{
169 struct disk_info *di = bdev->bd_disk->private_data; 170 struct disk_info *di = bdev->bd_disk->private_data;
170 return cdrom_ioctl(&di->viocd_info, bdev, mode, cmd, arg); 171 int ret;
172
173 lock_kernel();
174 ret = cdrom_ioctl(&di->viocd_info, bdev, mode, cmd, arg);
175 unlock_kernel();
176
177 return ret;
171} 178}
172 179
173static int viocd_blk_media_changed(struct gendisk *disk) 180static int viocd_blk_media_changed(struct gendisk *disk)
@@ -180,7 +187,7 @@ static const struct block_device_operations viocd_fops = {
180 .owner = THIS_MODULE, 187 .owner = THIS_MODULE,
181 .open = viocd_blk_open, 188 .open = viocd_blk_open,
182 .release = viocd_blk_release, 189 .release = viocd_blk_release,
183 .locked_ioctl = viocd_blk_ioctl, 190 .ioctl = viocd_blk_ioctl,
184 .media_changed = viocd_blk_media_changed, 191 .media_changed = viocd_blk_media_changed,
185}; 192};
186 193