aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/block/pktcdvd.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/block/pktcdvd.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/block/pktcdvd.c')
-rw-r--r--drivers/block/pktcdvd.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/drivers/block/pktcdvd.c b/drivers/block/pktcdvd.c
index 9f3e4454274b..40f1e31f42c4 100644
--- a/drivers/block/pktcdvd.c
+++ b/drivers/block/pktcdvd.c
@@ -57,6 +57,7 @@
57#include <linux/seq_file.h> 57#include <linux/seq_file.h>
58#include <linux/miscdevice.h> 58#include <linux/miscdevice.h>
59#include <linux/freezer.h> 59#include <linux/freezer.h>
60#include <linux/smp_lock.h>
60#include <linux/mutex.h> 61#include <linux/mutex.h>
61#include <linux/slab.h> 62#include <linux/slab.h>
62#include <scsi/scsi_cmnd.h> 63#include <scsi/scsi_cmnd.h>
@@ -2762,10 +2763,12 @@ out_mem:
2762static int pkt_ioctl(struct block_device *bdev, fmode_t mode, unsigned int cmd, unsigned long arg) 2763static int pkt_ioctl(struct block_device *bdev, fmode_t mode, unsigned int cmd, unsigned long arg)
2763{ 2764{
2764 struct pktcdvd_device *pd = bdev->bd_disk->private_data; 2765 struct pktcdvd_device *pd = bdev->bd_disk->private_data;
2766 int ret;
2765 2767
2766 VPRINTK("pkt_ioctl: cmd %x, dev %d:%d\n", cmd, 2768 VPRINTK("pkt_ioctl: cmd %x, dev %d:%d\n", cmd,
2767 MAJOR(bdev->bd_dev), MINOR(bdev->bd_dev)); 2769 MAJOR(bdev->bd_dev), MINOR(bdev->bd_dev));
2768 2770
2771 lock_kernel();
2769 switch (cmd) { 2772 switch (cmd) {
2770 case CDROMEJECT: 2773 case CDROMEJECT:
2771 /* 2774 /*
@@ -2783,14 +2786,16 @@ static int pkt_ioctl(struct block_device *bdev, fmode_t mode, unsigned int cmd,
2783 case CDROM_LAST_WRITTEN: 2786 case CDROM_LAST_WRITTEN:
2784 case CDROM_SEND_PACKET: 2787 case CDROM_SEND_PACKET:
2785 case SCSI_IOCTL_SEND_COMMAND: 2788 case SCSI_IOCTL_SEND_COMMAND:
2786 return __blkdev_driver_ioctl(pd->bdev, mode, cmd, arg); 2789 ret = __blkdev_driver_ioctl(pd->bdev, mode, cmd, arg);
2790 break;
2787 2791
2788 default: 2792 default:
2789 VPRINTK(DRIVER_NAME": Unknown ioctl for %s (%x)\n", pd->name, cmd); 2793 VPRINTK(DRIVER_NAME": Unknown ioctl for %s (%x)\n", pd->name, cmd);
2790 return -ENOTTY; 2794 ret = -ENOTTY;
2791 } 2795 }
2796 unlock_kernel();
2792 2797
2793 return 0; 2798 return ret;
2794} 2799}
2795 2800
2796static int pkt_media_changed(struct gendisk *disk) 2801static int pkt_media_changed(struct gendisk *disk)
@@ -2812,7 +2817,7 @@ static const struct block_device_operations pktcdvd_ops = {
2812 .owner = THIS_MODULE, 2817 .owner = THIS_MODULE,
2813 .open = pkt_open, 2818 .open = pkt_open,
2814 .release = pkt_close, 2819 .release = pkt_close,
2815 .locked_ioctl = pkt_ioctl, 2820 .ioctl = pkt_ioctl,
2816 .media_changed = pkt_media_changed, 2821 .media_changed = pkt_media_changed,
2817}; 2822};
2818 2823