diff options
Diffstat (limited to 'drivers/block/paride')
-rw-r--r-- | drivers/block/paride/pcd.c | 11 | ||||
-rw-r--r-- | drivers/block/paride/pd.c | 5 | ||||
-rw-r--r-- | drivers/block/paride/pf.c | 6 |
3 files changed, 18 insertions, 4 deletions
diff --git a/drivers/block/paride/pcd.c b/drivers/block/paride/pcd.c index 71acf4e53356..daba7a62a663 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 | ||
143 | static DEFINE_SPINLOCK(pcd_lock); | 144 | static 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 | ||
244 | static int pcd_block_media_changed(struct gendisk *disk) | 251 | static 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 4e8b9bff3abe..c4d6ed9846ca 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 c059aab3006b..38b4d566b816 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 | ||
157 | static DEFINE_SPINLOCK(pf_spin_lock); | 158 | static 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 | ||