compat_ioctl: block: handle cdrom compat ioctl in non-cdrom drivers
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:33:15 +0000 (09:33 +0100)
commit9452b1a3ed8792e0e8909512ea1d21aefe6cf53f
tree49255f94545d9524a75b5e243d29bb4202b94e4a
parentab8bc5417d8cf62a5fc515737b391689573e7fb3
compat_ioctl: block: handle cdrom compat ioctl in non-cdrom drivers

Various block drivers implement the CDROMMULTISESSION,
CDROM_GET_CAPABILITY, and CDROMEJECT ioctl commands, relying on the
block layer to handle compat_ioctl mode for them.

Move this into the drivers directly as a preparation for simplifying
the block layer later.

When only integer arguments or no arguments are passed, the
same handler can be used for .ioctl and .compat_ioctl, and
when only pointer arguments are passed, the newly added
blkdev_compat_ptr_ioctl can be used.

Reviewed-by: Ben Hutchings <ben.hutchings@codethink.co.uk>
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
drivers/block/floppy.c
drivers/block/paride/pd.c
drivers/block/paride/pf.c
drivers/block/sunvdc.c
drivers/block/xen-blkfront.c