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/xd.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/xd.c')
-rw-r--r-- | drivers/block/xd.c | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/drivers/block/xd.c b/drivers/block/xd.c index b16a3a926cf2..d5a3cd750561 100644 --- a/drivers/block/xd.c +++ b/drivers/block/xd.c | |||
@@ -46,6 +46,7 @@ | |||
46 | #include <linux/init.h> | 46 | #include <linux/init.h> |
47 | #include <linux/wait.h> | 47 | #include <linux/wait.h> |
48 | #include <linux/blkdev.h> | 48 | #include <linux/blkdev.h> |
49 | #include <linux/smp_lock.h> | ||
49 | #include <linux/blkpg.h> | 50 | #include <linux/blkpg.h> |
50 | #include <linux/delay.h> | 51 | #include <linux/delay.h> |
51 | #include <linux/io.h> | 52 | #include <linux/io.h> |
@@ -133,7 +134,7 @@ static int xd_getgeo(struct block_device *bdev, struct hd_geometry *geo); | |||
133 | 134 | ||
134 | static const struct block_device_operations xd_fops = { | 135 | static const struct block_device_operations xd_fops = { |
135 | .owner = THIS_MODULE, | 136 | .owner = THIS_MODULE, |
136 | .locked_ioctl = xd_ioctl, | 137 | .ioctl = xd_ioctl, |
137 | .getgeo = xd_getgeo, | 138 | .getgeo = xd_getgeo, |
138 | }; | 139 | }; |
139 | static DECLARE_WAIT_QUEUE_HEAD(xd_wait_int); | 140 | static DECLARE_WAIT_QUEUE_HEAD(xd_wait_int); |
@@ -347,7 +348,7 @@ static int xd_getgeo(struct block_device *bdev, struct hd_geometry *geo) | |||
347 | } | 348 | } |
348 | 349 | ||
349 | /* xd_ioctl: handle device ioctl's */ | 350 | /* xd_ioctl: handle device ioctl's */ |
350 | static int xd_ioctl(struct block_device *bdev, fmode_t mode, u_int cmd, u_long arg) | 351 | static int xd_locked_ioctl(struct block_device *bdev, fmode_t mode, u_int cmd, u_long arg) |
351 | { | 352 | { |
352 | switch (cmd) { | 353 | switch (cmd) { |
353 | case HDIO_SET_DMA: | 354 | case HDIO_SET_DMA: |
@@ -375,6 +376,18 @@ static int xd_ioctl(struct block_device *bdev, fmode_t mode, u_int cmd, u_long a | |||
375 | } | 376 | } |
376 | } | 377 | } |
377 | 378 | ||
379 | static int xd_ioctl(struct block_device *bdev, fmode_t mode, | ||
380 | unsigned int cmd, unsigned long param) | ||
381 | { | ||
382 | int ret; | ||
383 | |||
384 | lock_kernel(); | ||
385 | ret = xd_locked_ioctl(bdev, mode, cmd, param); | ||
386 | unlock_kernel(); | ||
387 | |||
388 | return ret; | ||
389 | } | ||
390 | |||
378 | /* xd_readwrite: handle a read/write request */ | 391 | /* xd_readwrite: handle a read/write request */ |
379 | static int xd_readwrite (u_char operation,XD_INFO *p,char *buffer,u_int block,u_int count) | 392 | static int xd_readwrite (u_char operation,XD_INFO *p,char *buffer,u_int block,u_int count) |
380 | { | 393 | { |