aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/block/paride
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/paride
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/paride')
-rw-r--r--drivers/block/paride/pcd.c11
-rw-r--r--drivers/block/paride/pd.c5
-rw-r--r--drivers/block/paride/pf.c6
3 files changed, 18 insertions, 4 deletions
diff --git a/drivers/block/paride/pcd.c b/drivers/block/paride/pcd.c
index 71acf4e5335..daba7a62a66 100644
--- a/drivers/block/paride/pcd.c
+++ b/drivers/block/paride/pcd.c
@@ -138,6 +138,7 @@ enum {D_PRT, D_PRO, D_UNI, D_MOD, D_SLV, D_DLY};
138#include <linux/cdrom.h> 138#include <linux/cdrom.h>
139#include <linux/spinlock.h> 139#include <linux/spinlock.h>
140#include <linux/blkdev.h> 140#include <linux/blkdev.h>
141#include <linux/smp_lock.h>
141#include <asm/uaccess.h> 142#include <asm/uaccess.h>
142 143
143static DEFINE_SPINLOCK(pcd_lock); 144static DEFINE_SPINLOCK(pcd_lock);
@@ -238,7 +239,13 @@ static int pcd_block_ioctl(struct block_device *bdev, fmode_t mode,
238 unsigned cmd, unsigned long arg) 239 unsigned cmd, unsigned long arg)
239{ 240{
240 struct pcd_unit *cd = bdev->bd_disk->private_data; 241 struct pcd_unit *cd = bdev->bd_disk->private_data;
241 return cdrom_ioctl(&cd->info, bdev, mode, cmd, arg); 242 int ret;
243
244 lock_kernel();
245 ret = cdrom_ioctl(&cd->info, bdev, mode, cmd, arg);
246 unlock_kernel();
247
248 return ret;
242} 249}
243 250
244static int pcd_block_media_changed(struct gendisk *disk) 251static int pcd_block_media_changed(struct gendisk *disk)
@@ -251,7 +258,7 @@ static const struct block_device_operations pcd_bdops = {
251 .owner = THIS_MODULE, 258 .owner = THIS_MODULE,
252 .open = pcd_block_open, 259 .open = pcd_block_open,
253 .release = pcd_block_release, 260 .release = pcd_block_release,
254 .locked_ioctl = pcd_block_ioctl, 261 .ioctl = pcd_block_ioctl,
255 .media_changed = pcd_block_media_changed, 262 .media_changed = pcd_block_media_changed,
256}; 263};
257 264
diff --git a/drivers/block/paride/pd.c b/drivers/block/paride/pd.c
index 4e8b9bff3ab..c4d6ed9846c 100644
--- a/drivers/block/paride/pd.c
+++ b/drivers/block/paride/pd.c
@@ -153,6 +153,7 @@ enum {D_PRT, D_PRO, D_UNI, D_MOD, D_GEO, D_SBY, D_DLY, D_SLV};
153#include <linux/blkdev.h> 153#include <linux/blkdev.h>
154#include <linux/blkpg.h> 154#include <linux/blkpg.h>
155#include <linux/kernel.h> 155#include <linux/kernel.h>
156#include <linux/smp_lock.h>
156#include <asm/uaccess.h> 157#include <asm/uaccess.h>
157#include <linux/workqueue.h> 158#include <linux/workqueue.h>
158 159
@@ -768,8 +769,10 @@ static int pd_ioctl(struct block_device *bdev, fmode_t mode,
768 769
769 switch (cmd) { 770 switch (cmd) {
770 case CDROMEJECT: 771 case CDROMEJECT:
772 lock_kernel();
771 if (disk->access == 1) 773 if (disk->access == 1)
772 pd_special_command(disk, pd_eject); 774 pd_special_command(disk, pd_eject);
775 unlock_kernel();
773 return 0; 776 return 0;
774 default: 777 default:
775 return -EINVAL; 778 return -EINVAL;
@@ -812,7 +815,7 @@ static const struct block_device_operations pd_fops = {
812 .owner = THIS_MODULE, 815 .owner = THIS_MODULE,
813 .open = pd_open, 816 .open = pd_open,
814 .release = pd_release, 817 .release = pd_release,
815 .locked_ioctl = pd_ioctl, 818 .ioctl = pd_ioctl,
816 .getgeo = pd_getgeo, 819 .getgeo = pd_getgeo,
817 .media_changed = pd_check_media, 820 .media_changed = pd_check_media,
818 .revalidate_disk= pd_revalidate 821 .revalidate_disk= pd_revalidate
diff --git a/drivers/block/paride/pf.c b/drivers/block/paride/pf.c
index c059aab3006..38b4d566b81 100644
--- a/drivers/block/paride/pf.c
+++ b/drivers/block/paride/pf.c
@@ -152,6 +152,7 @@ enum {D_PRT, D_PRO, D_UNI, D_MOD, D_SLV, D_LUN, D_DLY};
152#include <linux/spinlock.h> 152#include <linux/spinlock.h>
153#include <linux/blkdev.h> 153#include <linux/blkdev.h>
154#include <linux/blkpg.h> 154#include <linux/blkpg.h>
155#include <linux/smp_lock.h>
155#include <asm/uaccess.h> 156#include <asm/uaccess.h>
156 157
157static DEFINE_SPINLOCK(pf_spin_lock); 158static DEFINE_SPINLOCK(pf_spin_lock);
@@ -266,7 +267,7 @@ static const struct block_device_operations pf_fops = {
266 .owner = THIS_MODULE, 267 .owner = THIS_MODULE,
267 .open = pf_open, 268 .open = pf_open,
268 .release = pf_release, 269 .release = pf_release,
269 .locked_ioctl = pf_ioctl, 270 .ioctl = pf_ioctl,
270 .getgeo = pf_getgeo, 271 .getgeo = pf_getgeo,
271 .media_changed = pf_check_media, 272 .media_changed = pf_check_media,
272}; 273};
@@ -342,7 +343,10 @@ static int pf_ioctl(struct block_device *bdev, fmode_t mode, unsigned int cmd, u
342 343
343 if (pf->access != 1) 344 if (pf->access != 1)
344 return -EBUSY; 345 return -EBUSY;
346 lock_kernel();
345 pf_eject(pf); 347 pf_eject(pf);
348 unlock_kernel();
349
346 return 0; 350 return 0;
347} 351}
348 352