[PATCH] block: add unlocked_ioctl support for block devices
This patch allows block device drivers to convert their ioctl functions to unlocked_ioctl() like character devices and other subsystems. All functions that were called with the BKL held before are still used that way, but I would not be surprised if it could be removed from the ioctl functions in drivers/block/ioctl.c themselves. As a side note, I found that compat_blkdev_ioctl() acquires the BKL as well, which looks like a bug. I have checked that every user of disk->fops->compat_ioctl() in the current git tree gets the BKL itself, so it could easily be removed from compat_blkdev_ioctl(). Signed-off-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
This commit is contained in:
committed by
Linus Torvalds
parent
0d77e5a2c2
commit
bb93e3a52f
@@ -777,8 +777,7 @@ static ssize_t blkdev_file_aio_write(struct kiocb *iocb, const char __user *buf,
|
||||
return generic_file_aio_write_nolock(iocb, &local_iov, 1, &iocb->ki_pos);
|
||||
}
|
||||
|
||||
static int block_ioctl(struct inode *inode, struct file *file, unsigned cmd,
|
||||
unsigned long arg)
|
||||
static long block_ioctl(struct file *file, unsigned cmd, unsigned long arg)
|
||||
{
|
||||
return blkdev_ioctl(file->f_mapping->host, file, cmd, arg);
|
||||
}
|
||||
@@ -803,7 +802,7 @@ struct file_operations def_blk_fops = {
|
||||
.aio_write = blkdev_file_aio_write,
|
||||
.mmap = generic_file_mmap,
|
||||
.fsync = block_fsync,
|
||||
.ioctl = block_ioctl,
|
||||
.unlocked_ioctl = block_ioctl,
|
||||
#ifdef CONFIG_COMPAT
|
||||
.compat_ioctl = compat_blkdev_ioctl,
|
||||
#endif
|
||||
|
Reference in New Issue
Block a user