Revert patches 44, 45 and 47 - will be re-integrated later. [Alasdair Kergon] --- diff/drivers/md/dm-ioctl.c 2003-02-13 10:42:50.000000000 +0000 +++ source/drivers/md/dm-ioctl.c 2003-03-27 09:39:53.000000000 +0000 @@ -549,7 +549,7 @@ static int check_name(const char *name) { - if (name[0] == '/') { + if (strchr(name, '/')) { DMWARN("invalid device name"); return -EINVAL; } @@ -922,30 +922,30 @@ return dm_hash_rename(param->name, new_name); } + /*----------------------------------------------------------------- * Implementation of open/close/ioctl on the special char * device. *---------------------------------------------------------------*/ -static struct { - int cmd; - ioctl_fn fn; - -} _ioctls[] = { - {DM_VERSION_CMD, NULL}, /* version is dealt with elsewhere */ - {DM_REMOVE_ALL_CMD, remove_all}, - {DM_DEV_CREATE_CMD, create}, - {DM_DEV_REMOVE_CMD, remove}, - {DM_DEV_RELOAD_CMD, reload}, - {DM_DEV_RENAME_CMD, rename}, - {DM_DEV_SUSPEND_CMD, suspend}, - {DM_DEV_DEPS_CMD, dep}, - {DM_DEV_STATUS_CMD, info}, - {DM_TARGET_STATUS_CMD, get_status}, - {DM_TARGET_WAIT_CMD, wait_device_event}, -}; - -static inline ioctl_fn lookup_ioctl(unsigned int cmd) +static ioctl_fn lookup_ioctl(unsigned int cmd) { + static struct { + int cmd; + ioctl_fn fn; + } _ioctls[] = { + {DM_VERSION_CMD, NULL}, /* version is dealt with elsewhere */ + {DM_REMOVE_ALL_CMD, remove_all}, + {DM_DEV_CREATE_CMD, create}, + {DM_DEV_REMOVE_CMD, remove}, + {DM_DEV_RELOAD_CMD, reload}, + {DM_DEV_RENAME_CMD, rename}, + {DM_DEV_SUSPEND_CMD, suspend}, + {DM_DEV_DEPS_CMD, dep}, + {DM_DEV_STATUS_CMD, info}, + {DM_TARGET_STATUS_CMD, get_status}, + {DM_TARGET_WAIT_CMD, wait_device_event}, + }; + return (cmd >= ARRAY_SIZE(_ioctls)) ? NULL : _ioctls[cmd].fn; } @@ -1102,41 +1102,6 @@ }; /* - * Register 32 bit ioctls on 64bit systems. - */ -#if defined(CONFIG_PPC64) || defined(CONFIG_SPARC64) || defined(CONFIG_X86_64) -#include -#include - -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) @@ -1155,8 +1120,6 @@ return r; } - register_ioctl32_cmds(); - r = devfs_generate_path(_dm_misc.devfs_handle, rname + 3, sizeof rname - 3); if (r == -ENOSYS) @@ -1183,7 +1146,6 @@ return 0; failed: - unregister_ioctl32_cmds(); misc_deregister(&_dm_misc); dm_hash_exit(); return r; @@ -1191,8 +1153,6 @@ void dm_interface_exit(void) { - unregister_ioctl32_cmds(); - if (misc_deregister(&_dm_misc) < 0) DMERR("misc_deregister failed for control device"); --- diff/drivers/md/dm-linear.c 2003-02-13 10:42:28.000000000 +0000 +++ source/drivers/md/dm-linear.c 2003-03-27 09:39:53.000000000 +0000 @@ -87,7 +87,7 @@ case STATUSTYPE_TABLE: snprintf(result, maxlen, "%s " SECTOR_FORMAT, - bdevname(lc->dev->dev), lc->start); + kdevname(to_kdev_t(lc->dev->bdev->bd_dev)), lc->start); break; } return 0; --- diff/drivers/md/dm-snapshot.c 2003-02-25 14:44:11.000000000 +0000 +++ source/drivers/md/dm-snapshot.c 2003-03-27 09:39:53.000000000 +0000 @@ -961,8 +961,8 @@ * to make private copies if the output is to * make sense. */ - strncpy(cow, bdevname(snap->cow->dev), sizeof(cow)); - strncpy(org, bdevname(snap->origin->dev), sizeof(org)); + strncpy(cow, kdevname(snap->cow->dev), sizeof(cow)); + strncpy(org, kdevname(snap->origin->dev), sizeof(org)); snprintf(result, maxlen, "%s %s %c %ld", org, cow, snap->type, snap->chunk_size); break; @@ -1048,7 +1048,7 @@ break; case STATUSTYPE_TABLE: - snprintf(result, maxlen, "%s", bdevname(dev->dev)); + snprintf(result, maxlen, "%s", kdevname(dev->dev)); break; } --- diff/drivers/md/dm-stripe.c 2003-02-13 10:42:28.000000000 +0000 +++ source/drivers/md/dm-stripe.c 2003-03-27 09:39:53.000000000 +0000 @@ -221,7 +221,7 @@ offset += snprintf(result + offset, maxlen - offset, " %s " SECTOR_FORMAT, - bdevname(sc->stripe[i].dev->dev), + kdevname(to_kdev_t(sc->stripe[i].dev->bdev->bd_dev)), sc->stripe[i].physical_start); } break;