diff options
author | Christoph Hellwig <hch@lst.de> | 2021-10-12 12:44:50 +0200 |
---|---|---|
committer | Jens Axboe <axboe@kernel.dk> | 2021-10-18 06:17:34 -0600 |
commit | 8a709512eae7ccd5ba73e8634474caadbc9ebe76 (patch) | |
tree | e27b922a97a915f4caacdf473db858a59d0d131c /block/fops.c | |
parent | 84b8514b46b417e299746b1297d3d0899e8539f3 (diff) | |
download | lwn-8a709512eae7ccd5ba73e8634474caadbc9ebe76.tar.gz lwn-8a709512eae7ccd5ba73e8634474caadbc9ebe76.zip |
block: merge block_ioctl into blkdev_ioctl
Simplify the ioctl path and match the code structure on the compat side.
Signed-off-by: Christoph Hellwig <hch@lst.de>
Link: https://lore.kernel.org/r/20211012104450.659013-4-hch@lst.de
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'block/fops.c')
-rw-r--r-- | block/fops.c | 19 |
1 files changed, 1 insertions, 18 deletions
diff --git a/block/fops.c b/block/fops.c index 1e970c247e0e..7bb9581a146c 100644 --- a/block/fops.c +++ b/block/fops.c @@ -461,23 +461,6 @@ static int blkdev_close(struct inode *inode, struct file *filp) return 0; } -static long block_ioctl(struct file *file, unsigned cmd, unsigned long arg) -{ - struct block_device *bdev = I_BDEV(bdev_file_inode(file)); - fmode_t mode = file->f_mode; - - /* - * O_NDELAY can be altered using fcntl(.., F_SETFL, ..), so we have - * to updated it before every ioctl. - */ - if (file->f_flags & O_NDELAY) - mode |= FMODE_NDELAY; - else - mode &= ~FMODE_NDELAY; - - return blkdev_ioctl(bdev, mode, cmd, arg); -} - /* * Write data to the block device. Only intended for the block device itself * and the raw driver which basically is a fake block device. @@ -621,7 +604,7 @@ const struct file_operations def_blk_fops = { .iopoll = blkdev_iopoll, .mmap = generic_file_mmap, .fsync = blkdev_fsync, - .unlocked_ioctl = block_ioctl, + .unlocked_ioctl = blkdev_ioctl, #ifdef CONFIG_COMPAT .compat_ioctl = compat_blkdev_ioctl, #endif |