aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/block/amiflop.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/amiflop.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/amiflop.c')
-rw-r--r--drivers/block/amiflop.c17
1 files changed, 15 insertions, 2 deletions
diff --git a/drivers/block/amiflop.c b/drivers/block/amiflop.c
index 832798aa14f6..0fa26359304c 100644
--- a/drivers/block/amiflop.c
+++ b/drivers/block/amiflop.c
@@ -60,6 +60,7 @@
60#include <linux/hdreg.h> 60#include <linux/hdreg.h>
61#include <linux/delay.h> 61#include <linux/delay.h>
62#include <linux/init.h> 62#include <linux/init.h>
63#include <linux/smp_lock.h>
63#include <linux/amifdreg.h> 64#include <linux/amifdreg.h>
64#include <linux/amifd.h> 65#include <linux/amifd.h>
65#include <linux/buffer_head.h> 66#include <linux/buffer_head.h>
@@ -1423,7 +1424,7 @@ static int fd_getgeo(struct block_device *bdev, struct hd_geometry *geo)
1423 return 0; 1424 return 0;
1424} 1425}
1425 1426
1426static int fd_ioctl(struct block_device *bdev, fmode_t mode, 1427static int fd_locked_ioctl(struct block_device *bdev, fmode_t mode,
1427 unsigned int cmd, unsigned long param) 1428 unsigned int cmd, unsigned long param)
1428{ 1429{
1429 struct amiga_floppy_struct *p = bdev->bd_disk->private_data; 1430 struct amiga_floppy_struct *p = bdev->bd_disk->private_data;
@@ -1500,6 +1501,18 @@ static int fd_ioctl(struct block_device *bdev, fmode_t mode,
1500 return 0; 1501 return 0;
1501} 1502}
1502 1503
1504static int fd_ioctl(struct block_device *bdev, fmode_t mode,
1505 unsigned int cmd, unsigned long param)
1506{
1507 int ret;
1508
1509 lock_kernel();
1510 ret = fd_locked_ioctl(bdev, mode, cmd, param);
1511 unlock_kernel();
1512
1513 return ret;
1514}
1515
1503static void fd_probe(int dev) 1516static void fd_probe(int dev)
1504{ 1517{
1505 unsigned long code; 1518 unsigned long code;
@@ -1638,7 +1651,7 @@ static const struct block_device_operations floppy_fops = {
1638 .owner = THIS_MODULE, 1651 .owner = THIS_MODULE,
1639 .open = floppy_open, 1652 .open = floppy_open,
1640 .release = floppy_release, 1653 .release = floppy_release,
1641 .locked_ioctl = fd_ioctl, 1654 .ioctl = fd_ioctl,
1642 .getgeo = fd_getgeo, 1655 .getgeo = fd_getgeo,
1643 .media_changed = amiga_floppy_change, 1656 .media_changed = amiga_floppy_change,
1644}; 1657};