diff options
author | Arnd Bergmann <arnd@arndb.de> | 2019-11-28 17:48:10 +0300 |
---|---|---|
committer | Arnd Bergmann <arnd@arndb.de> | 2020-01-03 11:32:59 +0300 |
commit | ee6a129dffe10ae30b45b5a744e7c0a056291d13 (patch) | |
tree | 6a78fcfc9f06e0eff4265bedddcf42543a0923c8 /include/linux/blkdev.h | |
parent | 78ed001d9e7106171e0ee761cd854137dd731302 (diff) | |
download | linux-ee6a129dffe10ae30b45b5a744e7c0a056291d13.tar.xz |
compat_ioctl: block: add blkdev_compat_ptr_ioctl
A lot of block drivers need only a trivial .compat_ioctl callback.
Add a helper function that can be set as the callback pointer
to only convert the argument using the compat_ptr() conversion
and otherwise assume all input and output data is compatible,
or handled using in_compat_syscall() checks.
This mirrors the compat_ptr_ioctl() helper function used in
character devices.
Reviewed-by: Ben Hutchings <ben.hutchings@codethink.co.uk>
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Diffstat (limited to 'include/linux/blkdev.h')
-rw-r--r-- | include/linux/blkdev.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h index 47eb22a3b7f9..3e0408618da7 100644 --- a/include/linux/blkdev.h +++ b/include/linux/blkdev.h @@ -1711,6 +1711,13 @@ struct block_device_operations { const struct pr_ops *pr_ops; }; +#ifdef CONFIG_COMPAT +extern int blkdev_compat_ptr_ioctl(struct block_device *, fmode_t, + unsigned int, unsigned long); +#else +#define blkdev_compat_ptr_ioctl NULL +#endif + extern int __blkdev_driver_ioctl(struct block_device *, fmode_t, unsigned int, unsigned long); extern int bdev_read_page(struct block_device *, sector_t, struct page *); |