diff options
Diffstat (limited to 'drivers/block/floppy.c')
-rw-r--r-- | drivers/block/floppy.c | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/drivers/block/floppy.c b/drivers/block/floppy.c index 82c30f9f81ca..40419b066aa9 100644 --- a/drivers/block/floppy.c +++ b/drivers/block/floppy.c | |||
@@ -178,6 +178,7 @@ static int print_unex = 1; | |||
178 | #include <linux/slab.h> | 178 | #include <linux/slab.h> |
179 | #include <linux/mm.h> | 179 | #include <linux/mm.h> |
180 | #include <linux/bio.h> | 180 | #include <linux/bio.h> |
181 | #include <linux/smp_lock.h> | ||
181 | #include <linux/string.h> | 182 | #include <linux/string.h> |
182 | #include <linux/jiffies.h> | 183 | #include <linux/jiffies.h> |
183 | #include <linux/fcntl.h> | 184 | #include <linux/fcntl.h> |
@@ -3371,7 +3372,7 @@ static int fd_getgeo(struct block_device *bdev, struct hd_geometry *geo) | |||
3371 | return 0; | 3372 | return 0; |
3372 | } | 3373 | } |
3373 | 3374 | ||
3374 | static int fd_ioctl(struct block_device *bdev, fmode_t mode, unsigned int cmd, | 3375 | static int fd_locked_ioctl(struct block_device *bdev, fmode_t mode, unsigned int cmd, |
3375 | unsigned long param) | 3376 | unsigned long param) |
3376 | { | 3377 | { |
3377 | int drive = (long)bdev->bd_disk->private_data; | 3378 | int drive = (long)bdev->bd_disk->private_data; |
@@ -3547,6 +3548,18 @@ static int fd_ioctl(struct block_device *bdev, fmode_t mode, unsigned int cmd, | |||
3547 | return 0; | 3548 | return 0; |
3548 | } | 3549 | } |
3549 | 3550 | ||
3551 | static int fd_ioctl(struct block_device *bdev, fmode_t mode, | ||
3552 | unsigned int cmd, unsigned long param) | ||
3553 | { | ||
3554 | int ret; | ||
3555 | |||
3556 | lock_kernel(); | ||
3557 | ret = fd_locked_ioctl(bdev, mode, cmd, param); | ||
3558 | unlock_kernel(); | ||
3559 | |||
3560 | return ret; | ||
3561 | } | ||
3562 | |||
3550 | static void __init config_types(void) | 3563 | static void __init config_types(void) |
3551 | { | 3564 | { |
3552 | bool has_drive = false; | 3565 | bool has_drive = false; |
@@ -3848,7 +3861,7 @@ static const struct block_device_operations floppy_fops = { | |||
3848 | .owner = THIS_MODULE, | 3861 | .owner = THIS_MODULE, |
3849 | .open = floppy_open, | 3862 | .open = floppy_open, |
3850 | .release = floppy_release, | 3863 | .release = floppy_release, |
3851 | .locked_ioctl = fd_ioctl, | 3864 | .ioctl = fd_ioctl, |
3852 | .getgeo = fd_getgeo, | 3865 | .getgeo = fd_getgeo, |
3853 | .media_changed = check_floppy_change, | 3866 | .media_changed = check_floppy_change, |
3854 | .revalidate_disk = floppy_revalidate, | 3867 | .revalidate_disk = floppy_revalidate, |