]> git.baikalelectronics.ru Git - kernel.git/commit
compat_ioctl: simplify up block/ioctl.c
authorArnd Bergmann <arnd@arndb.de>
Fri, 29 Nov 2019 10:48:31 +0000 (11:48 +0100)
committerArnd Bergmann <arnd@arndb.de>
Fri, 3 Jan 2020 08:42:52 +0000 (09:42 +0100)
commit60f512b3f05bbbd21cc6d04a7e8223d6181ea87b
tree2a971e392be7ea804073fe035c969bc5f519f2d7
parent0084d8972f1a052ac7c2a7029ea92382a71d4dc4
compat_ioctl: simplify up block/ioctl.c

Having separate implementations of blkdev_ioctl() often leads to these
getting out of sync, despite the comment at the top.

Since most of the ioctl commands are compatible, and we try very hard
not to add any new incompatible ones, move all the common bits into a
shared function and leave only the ones that are historically different
in separate functions for native/compat mode.

To deal with the compat_ptr() conversion, pass both the integer
argument and the pointer argument into the new blkdev_common_ioctl()
and make sure to always use the correct one of these.

blkdev_ioctl() is now only kept as a separate exported interfact
for drivers/char/raw.c, which lacks a compat_ioctl variant.
We should probably either move raw.c to staging if there are no
more users, or export blkdev_compat_ioctl() as well.

Reviewed-by: Ben Hutchings <ben.hutchings@codethink.co.uk>
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
block/ioctl.c