mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-28 10:41:38 -04:00
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 <[email protected]> Acked-by: Christoph Hellwig <[email protected]> Signed-off-by: Jens Axboe <[email protected]>
This commit is contained in:
parent
3448406244
commit
8a6cfeb6de
30 changed files with 253 additions and 85 deletions
|
|
@ -15,6 +15,7 @@
|
|||
#include <linux/blkdev.h>
|
||||
#include <linux/blkpg.h>
|
||||
#include <linux/spinlock.h>
|
||||
#include <linux/smp_lock.h>
|
||||
#include <linux/hdreg.h>
|
||||
#include <linux/init.h>
|
||||
#include <linux/mutex.h>
|
||||
|
|
@ -237,6 +238,7 @@ static int blktrans_ioctl(struct block_device *bdev, fmode_t mode,
|
|||
if (!dev)
|
||||
return ret;
|
||||
|
||||
lock_kernel();
|
||||
mutex_lock(&dev->lock);
|
||||
|
||||
if (!dev->mtd)
|
||||
|
|
@ -250,6 +252,7 @@ static int blktrans_ioctl(struct block_device *bdev, fmode_t mode,
|
|||
}
|
||||
unlock:
|
||||
mutex_unlock(&dev->lock);
|
||||
unlock_kernel();
|
||||
blktrans_dev_put(dev);
|
||||
return ret;
|
||||
}
|
||||
|
|
@ -258,7 +261,7 @@ static const struct block_device_operations mtd_blktrans_ops = {
|
|||
.owner = THIS_MODULE,
|
||||
.open = blktrans_open,
|
||||
.release = blktrans_release,
|
||||
.locked_ioctl = blktrans_ioctl,
|
||||
.ioctl = blktrans_ioctl,
|
||||
.getgeo = blktrans_getgeo,
|
||||
};
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue