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/brd.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/brd.c')
-rw-r--r-- | drivers/block/brd.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/block/brd.c b/drivers/block/brd.c index 1d2c18620f9a..1c7f63792ff8 100644 --- a/drivers/block/brd.c +++ b/drivers/block/brd.c | |||
@@ -15,6 +15,7 @@ | |||
15 | #include <linux/blkdev.h> | 15 | #include <linux/blkdev.h> |
16 | #include <linux/bio.h> | 16 | #include <linux/bio.h> |
17 | #include <linux/highmem.h> | 17 | #include <linux/highmem.h> |
18 | #include <linux/smp_lock.h> | ||
18 | #include <linux/radix-tree.h> | 19 | #include <linux/radix-tree.h> |
19 | #include <linux/buffer_head.h> /* invalidate_bh_lrus() */ | 20 | #include <linux/buffer_head.h> /* invalidate_bh_lrus() */ |
20 | #include <linux/slab.h> | 21 | #include <linux/slab.h> |
@@ -401,6 +402,7 @@ static int brd_ioctl(struct block_device *bdev, fmode_t mode, | |||
401 | * ram device BLKFLSBUF has special semantics, we want to actually | 402 | * ram device BLKFLSBUF has special semantics, we want to actually |
402 | * release and destroy the ramdisk data. | 403 | * release and destroy the ramdisk data. |
403 | */ | 404 | */ |
405 | lock_kernel(); | ||
404 | mutex_lock(&bdev->bd_mutex); | 406 | mutex_lock(&bdev->bd_mutex); |
405 | error = -EBUSY; | 407 | error = -EBUSY; |
406 | if (bdev->bd_openers <= 1) { | 408 | if (bdev->bd_openers <= 1) { |
@@ -417,13 +419,14 @@ static int brd_ioctl(struct block_device *bdev, fmode_t mode, | |||
417 | error = 0; | 419 | error = 0; |
418 | } | 420 | } |
419 | mutex_unlock(&bdev->bd_mutex); | 421 | mutex_unlock(&bdev->bd_mutex); |
422 | unlock_kernel(); | ||
420 | 423 | ||
421 | return error; | 424 | return error; |
422 | } | 425 | } |
423 | 426 | ||
424 | static const struct block_device_operations brd_fops = { | 427 | static const struct block_device_operations brd_fops = { |
425 | .owner = THIS_MODULE, | 428 | .owner = THIS_MODULE, |
426 | .locked_ioctl = brd_ioctl, | 429 | .ioctl = brd_ioctl, |
427 | #ifdef CONFIG_BLK_DEV_XIP | 430 | #ifdef CONFIG_BLK_DEV_XIP |
428 | .direct_access = brd_direct_access, | 431 | .direct_access = brd_direct_access, |
429 | #endif | 432 | #endif |