• Arnd Bergmann's avatar
    compat_ioctl: simplify up block/ioctl.c · 9b81648c
    Arnd Bergmann authored
    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: default avatarBen Hutchings <ben.hutchings@codethink.co.uk>
    Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
    9b81648c
ioctl.c 19.5 KB