diff options
author | Arnd Bergmann <arnd@arndb.de> | 2010-07-08 04:18:46 -0400 |
---|---|---|
committer | Jens Axboe <jaxboe@fusionio.com> | 2010-08-07 12:25:00 -0400 |
commit | 8a6cfeb6deca3a8fefd639d898b0d163c0b5d368 (patch) | |
tree | 9a633ad48c3b1ada0519ee7bade0602f940037f6 /drivers/block/swim3.c | |
parent | 34484062445fe905bf02c72f87ddda21881acda3 (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/swim3.c')
-rw-r--r-- | drivers/block/swim3.c | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/drivers/block/swim3.c b/drivers/block/swim3.c index ed6fb91123ab..f3657b2a5386 100644 --- a/drivers/block/swim3.c +++ b/drivers/block/swim3.c | |||
@@ -25,6 +25,7 @@ | |||
25 | #include <linux/ioctl.h> | 25 | #include <linux/ioctl.h> |
26 | #include <linux/blkdev.h> | 26 | #include <linux/blkdev.h> |
27 | #include <linux/interrupt.h> | 27 | #include <linux/interrupt.h> |
28 | #include <linux/smp_lock.h> | ||
28 | #include <linux/module.h> | 29 | #include <linux/module.h> |
29 | #include <linux/spinlock.h> | 30 | #include <linux/spinlock.h> |
30 | #include <asm/io.h> | 31 | #include <asm/io.h> |
@@ -839,7 +840,7 @@ static int fd_eject(struct floppy_state *fs) | |||
839 | static struct floppy_struct floppy_type = | 840 | static struct floppy_struct floppy_type = |
840 | { 2880,18,2,80,0,0x1B,0x00,0xCF,0x6C,NULL }; /* 7 1.44MB 3.5" */ | 841 | { 2880,18,2,80,0,0x1B,0x00,0xCF,0x6C,NULL }; /* 7 1.44MB 3.5" */ |
841 | 842 | ||
842 | static int floppy_ioctl(struct block_device *bdev, fmode_t mode, | 843 | static int floppy_locked_ioctl(struct block_device *bdev, fmode_t mode, |
843 | unsigned int cmd, unsigned long param) | 844 | unsigned int cmd, unsigned long param) |
844 | { | 845 | { |
845 | struct floppy_state *fs = bdev->bd_disk->private_data; | 846 | struct floppy_state *fs = bdev->bd_disk->private_data; |
@@ -867,6 +868,18 @@ static int floppy_ioctl(struct block_device *bdev, fmode_t mode, | |||
867 | return -ENOTTY; | 868 | return -ENOTTY; |
868 | } | 869 | } |
869 | 870 | ||
871 | static int floppy_ioctl(struct block_device *bdev, fmode_t mode, | ||
872 | unsigned int cmd, unsigned long param) | ||
873 | { | ||
874 | int ret; | ||
875 | |||
876 | lock_kernel(); | ||
877 | ret = floppy_locked_ioctl(bdev, mode, cmd, param); | ||
878 | unlock_kernel(); | ||
879 | |||
880 | return ret; | ||
881 | } | ||
882 | |||
870 | static int floppy_open(struct block_device *bdev, fmode_t mode) | 883 | static int floppy_open(struct block_device *bdev, fmode_t mode) |
871 | { | 884 | { |
872 | struct floppy_state *fs = bdev->bd_disk->private_data; | 885 | struct floppy_state *fs = bdev->bd_disk->private_data; |
@@ -997,7 +1010,7 @@ static int floppy_revalidate(struct gendisk *disk) | |||
997 | static const struct block_device_operations floppy_fops = { | 1010 | static const struct block_device_operations floppy_fops = { |
998 | .open = floppy_open, | 1011 | .open = floppy_open, |
999 | .release = floppy_release, | 1012 | .release = floppy_release, |
1000 | .locked_ioctl = floppy_ioctl, | 1013 | .ioctl = floppy_ioctl, |
1001 | .media_changed = floppy_check_change, | 1014 | .media_changed = floppy_check_change, |
1002 | .revalidate_disk= floppy_revalidate, | 1015 | .revalidate_disk= floppy_revalidate, |
1003 | }; | 1016 | }; |