compat_ioctl: move tape handling into drivers
authorArnd Bergmann <arnd@arndb.de>
Fri, 7 Sep 2018 14:49:43 +0000 (16:49 +0200)
committerArnd Bergmann <arnd@arndb.de>
Wed, 23 Oct 2019 15:23:44 +0000 (17:23 +0200)
commit1207045da5a7c94344e0ea9a9e7495985eef499a
treea7f6028469b50532252bbdd7b71b0f06e293a90e
parent01b8bca81e181ccca475e1fdb92ebb00d9d9b547
compat_ioctl: move tape handling into drivers

MTIOCPOS and MTIOCGET are incompatible between 32-bit and 64-bit user
space, and traditionally have been translated in fs/compat_ioctl.c.

To get rid of that translation handler, move a corresponding
implementation into each of the four drivers implementing those commands.

The interesting part of that is now in a new linux/mtio.h header that
wraps the existing uapi/linux/mtio.h header and provides an abstraction
to let drivers handle both cases easily. Using an in_compat_syscall()
check, the caller does not have to keep track of whether this was
called through .unlocked_ioctl() or .compat_ioctl().

Acked-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Cc: "Kai Mäkisara" <Kai.Makisara@kolumbus.fi>
Cc: linux-scsi@vger.kernel.org
Cc: "James E.J. Bottomley" <jejb@linux.ibm.com>
Cc: "Martin K. Petersen" <martin.petersen@oracle.com>
Cc: "David S. Miller" <davem@davemloft.net>
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
drivers/ide/ide-tape.c
drivers/s390/char/tape_char.c
drivers/scsi/st.c
fs/compat_ioctl.c
include/linux/mtio.h [new file with mode: 0644]