Move the ioctl32 registration from dm-ioctl.c to the appropriate arch-specific ioctl32.c files. --- linux-2.4.20a/drivers/md/dm-ioctl.c 2003/02/27 22:14:09 +++ linux-2.4.20b/drivers/md/dm-ioctl.c 2003/02/28 20:13:14 @@ -1115,41 +1115,6 @@ }; /* - * Register 32 bit ioctls on 64bit systems. - */ -#if defined(CONFIG_PPC64) || defined(CONFIG_SPARC64) || defined(CONFIG_X86_64) -#include <linux/smp_lock.h> -#include <asm/ioctl32.h> - -static inline void register_ioctl32_cmds(void) -{ - int i; - - lock_kernel(); - for (i = 0; i < ARRAY_SIZE(_ioctls); i++) { - register_ioctl32_conversion(_IOWR(DM_IOCTL, _ioctls[i].cmd, - struct dm_ioctl), NULL); - } - unlock_kernel(); -} - -static inline void unregister_ioctl32_cmds(void) -{ - int i; - - lock_kernel(); - for (i = 0; i < ARRAY_SIZE(_ioctls); i++) { - unregister_ioctl32_conversion(_IOWR(DM_IOCTL, _ioctls[i].cmd, - struct dm_ioctl)); - } - unlock_kernel(); -} -#else -static inline void register_ioctl32_cmds(void) {} -static inline void unregister_ioctl32_cmds(void) {} -#endif - -/* * Create misc character device and link to DM_DIR/control. */ int __init dm_interface_init(void) @@ -1168,8 +1133,6 @@ return r; } - register_ioctl32_cmds(); - r = devfs_generate_path(_dm_misc.devfs_handle, rname + 3, sizeof rname - 3); if (r == -ENOSYS) @@ -1196,7 +1159,6 @@ return 0; failed: - unregister_ioctl32_cmds(); misc_deregister(&_dm_misc); dm_hash_exit(); return r; @@ -1204,8 +1166,6 @@ void dm_interface_exit(void) { - unregister_ioctl32_cmds(); - if (misc_deregister(&_dm_misc) < 0) DMERR("misc_deregister failed for control device"); --- linux-2.4.20a/arch/parisc/kernel/ioctl32.c 2003/02/28 20:00:36 +++ linux-2.4.20b/arch/parisc/kernel/ioctl32.c 2003/02/28 20:01:44 @@ -55,6 +55,7 @@ #define max max */ #include <linux/lvm.h> #endif /* LVM */ +#include <linux/dm-ioctl.h> #include <scsi/scsi.h> /* Ugly hack. */ @@ -3415,6 +3416,18 @@ COMPATIBLE_IOCTL(LV_BMAP) COMPATIBLE_IOCTL(LV_SNAPSHOT_USE_RATE) #endif /* LVM */ +/* Device-Mapper */ +COMPATIBLE_IOCTL(DM_VERSION) +COMPATIBLE_IOCTL(DM_REMOVE_ALL) +COMPATIBLE_IOCTL(DM_DEV_CREATE) +COMPATIBLE_IOCTL(DM_DEV_REMOVE) +COMPATIBLE_IOCTL(DM_DEV_RELOAD) +COMPATIBLE_IOCTL(DM_DEV_SUSPEND) +COMPATIBLE_IOCTL(DM_DEV_RENAME) +COMPATIBLE_IOCTL(DM_DEV_DEPS) +COMPATIBLE_IOCTL(DM_DEV_STATUS) +COMPATIBLE_IOCTL(DM_TARGET_STATUS) +COMPATIBLE_IOCTL(DM_TARGET_WAIT) #if defined(CONFIG_DRM) || defined(CONFIG_DRM_MODULE) COMPATIBLE_IOCTL(DRM_IOCTL_GET_MAGIC) COMPATIBLE_IOCTL(DRM_IOCTL_IRQ_BUSID) --- linux-2.4.20a/arch/ppc64/kernel/ioctl32.c 2003/02/28 20:02:36 +++ linux-2.4.20b/arch/ppc64/kernel/ioctl32.c 2003/02/28 20:08:08 @@ -66,6 +66,7 @@ #if defined(CONFIG_BLK_DEV_LVM) || defined(CONFIG_BLK_DEV_LVM_MODULE) #include <linux/lvm.h> #endif /* LVM */ +#include <linux/dm-ioctl.h> #include <scsi/scsi.h> /* Ugly hack. */ @@ -4280,6 +4281,18 @@ COMPATIBLE_IOCTL(LV_BMAP), COMPATIBLE_IOCTL(LV_SNAPSHOT_USE_RATE), #endif /* LVM */ +/* Device-Mapper */ +COMPATIBLE_IOCTL(DM_VERSION) +COMPATIBLE_IOCTL(DM_REMOVE_ALL) +COMPATIBLE_IOCTL(DM_DEV_CREATE) +COMPATIBLE_IOCTL(DM_DEV_REMOVE) +COMPATIBLE_IOCTL(DM_DEV_RELOAD) +COMPATIBLE_IOCTL(DM_DEV_SUSPEND) +COMPATIBLE_IOCTL(DM_DEV_RENAME) +COMPATIBLE_IOCTL(DM_DEV_DEPS) +COMPATIBLE_IOCTL(DM_DEV_STATUS) +COMPATIBLE_IOCTL(DM_TARGET_STATUS) +COMPATIBLE_IOCTL(DM_TARGET_WAIT) #if defined(CONFIG_DRM) || defined(CONFIG_DRM_MODULE) COMPATIBLE_IOCTL(DRM_IOCTL_GET_MAGIC), COMPATIBLE_IOCTL(DRM_IOCTL_IRQ_BUSID), --- linux-2.4.20a/arch/sparc64/kernel/ioctl32.c 2003/02/28 20:08:38 +++ linux-2.4.20b/arch/sparc64/kernel/ioctl32.c 2003/02/28 20:09:56 @@ -55,6 +55,7 @@ #if defined(CONFIG_BLK_DEV_LVM) || defined(CONFIG_BLK_DEV_LVM_MODULE) #include <linux/lvm.h> #endif /* LVM */ +#include <linux/dm-ioctl.h> #include <scsi/scsi.h> /* Ugly hack. */ @@ -4930,6 +4931,18 @@ COMPATIBLE_IOCTL(LV_BMAP) COMPATIBLE_IOCTL(LV_SNAPSHOT_USE_RATE) #endif /* LVM */ +/* Device-Mapper */ +COMPATIBLE_IOCTL(DM_VERSION) +COMPATIBLE_IOCTL(DM_REMOVE_ALL) +COMPATIBLE_IOCTL(DM_DEV_CREATE) +COMPATIBLE_IOCTL(DM_DEV_REMOVE) +COMPATIBLE_IOCTL(DM_DEV_RELOAD) +COMPATIBLE_IOCTL(DM_DEV_SUSPEND) +COMPATIBLE_IOCTL(DM_DEV_RENAME) +COMPATIBLE_IOCTL(DM_DEV_DEPS) +COMPATIBLE_IOCTL(DM_DEV_STATUS) +COMPATIBLE_IOCTL(DM_TARGET_STATUS) +COMPATIBLE_IOCTL(DM_TARGET_WAIT) #if defined(CONFIG_DRM_NEW) || defined(CONFIG_DRM_NEW_MODULE) COMPATIBLE_IOCTL(DRM_IOCTL_GET_MAGIC) COMPATIBLE_IOCTL(DRM_IOCTL_IRQ_BUSID) --- linux-2.4.20a/arch/x86_64/ia32/ia32_ioctl.c 2003/02/28 20:10:35 +++ linux-2.4.20b/arch/x86_64/ia32/ia32_ioctl.c 2003/02/28 20:11:46 @@ -62,6 +62,7 @@ #define max max #include <linux/lvm.h> #endif /* LVM */ +#include <linux/dm-ioctl.h> #include <scsi/scsi.h> /* Ugly hack. */ @@ -3776,6 +3777,18 @@ COMPATIBLE_IOCTL(LV_BMAP) COMPATIBLE_IOCTL(LV_SNAPSHOT_USE_RATE) #endif /* LVM */ +/* Device-Mapper */ +COMPATIBLE_IOCTL(DM_VERSION) +COMPATIBLE_IOCTL(DM_REMOVE_ALL) +COMPATIBLE_IOCTL(DM_DEV_CREATE) +COMPATIBLE_IOCTL(DM_DEV_REMOVE) +COMPATIBLE_IOCTL(DM_DEV_RELOAD) +COMPATIBLE_IOCTL(DM_DEV_SUSPEND) +COMPATIBLE_IOCTL(DM_DEV_RENAME) +COMPATIBLE_IOCTL(DM_DEV_DEPS) +COMPATIBLE_IOCTL(DM_DEV_STATUS) +COMPATIBLE_IOCTL(DM_TARGET_STATUS) +COMPATIBLE_IOCTL(DM_TARGET_WAIT) #if defined(CONFIG_DRM) || defined(CONFIG_DRM_MODULE) COMPATIBLE_IOCTL(DRM_IOCTL_GET_MAGIC) COMPATIBLE_IOCTL(DRM_IOCTL_IRQ_BUSID)