OSDN Git Service

compat_ioctl: block: add blkdev_compat_ptr_ioctl
authorArnd Bergmann <arnd@arndb.de>
Thu, 28 Nov 2019 14:48:10 +0000 (15:48 +0100)
committerArnd Bergmann <arnd@arndb.de>
Fri, 3 Jan 2020 08:32:59 +0000 (09:32 +0100)
commitee6a129dffe10ae30b45b5a744e7c0a056291d13
tree6a78fcfc9f06e0eff4265bedddcf42543a0923c8
parent78ed001d9e7106171e0ee761cd854137dd731302
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>
block/ioctl.c
include/linux/blkdev.h