block: remove BKL from BLKROSET and BLKFLSBUF
authorArnd Bergmann <arnd@arndb.de>
Wed, 7 Jul 2010 14:51:27 +0000 (16:51 +0200)
committerJens Axboe <jaxboe@fusionio.com>
Sat, 7 Aug 2010 16:26:08 +0000 (18:26 +0200)
We only call the functions set_device_ro(),
invalidate_bdev(), sync_filesystem() and sync_blockdev()
while holding the BKL in these commands. All
of these are also done in other code paths without
the BKL, which leads me to the conclusion that
the BKL is not needed here either.

The reason we hold it here is that it was originally
pushed down into the ioctl function from vfs_ioctl.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Jens Axboe <jaxboe@fusionio.com>
block/ioctl.c

index 9d91e830b32095fd34b96b71275109ca2e7fd6c9..60f477c91eef0e76296bb4e53834333f714aca03 100644 (file)
@@ -197,10 +197,8 @@ int blkdev_ioctl(struct block_device *bdev, fmode_t mode, unsigned cmd,
                if (ret != -EINVAL && ret != -ENOTTY)
                        return ret;
 
-               lock_kernel();
                fsync_bdev(bdev);
                invalidate_bdev(bdev);
-               unlock_kernel();
                return 0;
 
        case BLKROSET:
@@ -212,9 +210,7 @@ int blkdev_ioctl(struct block_device *bdev, fmode_t mode, unsigned cmd,
                        return -EACCES;
                if (get_user(n, (int __user *)(arg)))
                        return -EFAULT;
-               lock_kernel();
                set_device_ro(bdev, n);
-               unlock_kernel();
                return 0;
 
        case BLKDISCARD: {