Commit 1684b4e9 authored by Alexander Viro's avatar Alexander Viro Committed by Linus Torvalds

[PATCH] prepare for 32-bit dev_t: md.c cleanups

	Minor cleanups in md.c + added old_decode_dev() on ioctl argument in
there.
parent 979cd1d1
......@@ -1450,7 +1450,7 @@ static int analyze_sbs(mddev_t * mddev)
static struct kobject *md_probe(dev_t dev, int *part, void *data)
{
static DECLARE_MUTEX(disks_sem);
int unit = MINOR(dev);
int unit = *part;
mddev_t *mddev = mddev_find(unit);
struct gendisk *disk;
......@@ -1874,11 +1874,8 @@ static int autostart_array(dev_t startdev)
list_add(&start_rdev->same_set, &pending_raid_disks);
for (i = 0; i < MD_SB_DISKS; i++) {
mdp_disk_t *desc;
dev_t dev;
desc = sb->disks + i;
dev = MKDEV(desc->major, desc->minor);
mdp_disk_t *desc = sb->disks + i;
dev_t dev = MKDEV(desc->major, desc->minor);
if (!dev)
continue;
......@@ -2006,8 +2003,8 @@ static int add_new_disk(mddev_t * mddev, mdu_disk_info_t *info)
{
char b[BDEVNAME_SIZE], b2[BDEVNAME_SIZE];
mdk_rdev_t *rdev;
dev_t dev;
dev = MKDEV(info->major,info->minor);
dev_t dev = MKDEV(info->major,info->minor);
if (!mddev->raid_disks) {
int err;
/* expecting a device which has a superblock */
......@@ -2133,7 +2130,7 @@ static int hot_generate_error(mddev_t * mddev, dev_t dev)
rdev = find_rdev(mddev, dev);
if (!rdev) {
MD_BUG();
/* MD_BUG(); */ /* like hell - it's not a driver bug */
return -ENXIO;
}
......@@ -2406,7 +2403,7 @@ static int md_ioctl(struct inode *inode, struct file *file,
/* START_ARRAY doesn't need to lock the array as autostart_array
* does the locking, and it could even be a different array
*/
err = autostart_array(arg);
err = autostart_array(old_decode_dev(arg));
if (err) {
printk(KERN_WARNING "md: autostart %s failed!\n",
__bdevname(arg, b));
......@@ -2543,18 +2540,18 @@ static int md_ioctl(struct inode *inode, struct file *file,
goto done_unlock;
}
case HOT_GENERATE_ERROR:
err = hot_generate_error(mddev, arg);
err = hot_generate_error(mddev, old_decode_dev(arg));
goto done_unlock;
case HOT_REMOVE_DISK:
err = hot_remove_disk(mddev, arg);
err = hot_remove_disk(mddev, old_decode_dev(arg));
goto done_unlock;
case HOT_ADD_DISK:
err = hot_add_disk(mddev, arg);
err = hot_add_disk(mddev, old_decode_dev(arg));
goto done_unlock;
case SET_DISK_FAULTY:
err = set_disk_faulty(mddev, arg);
err = set_disk_faulty(mddev, old_decode_dev(arg));
goto done_unlock;
case RUN_ARRAY:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment