Commit 881c3bc1 authored by Alexander Viro's avatar Alexander Viro Committed by Linus Torvalds

[PATCH] raid kdev_t cleanups - part 2

	* a bunch of callers of partition_name() are calling
bdev_partition_name(),
	* the last users of raid1 and multipath ->dev are gone; so are
the fields in question.
parent f3ddcd6b
...@@ -312,7 +312,7 @@ static void mark_disk_bad (mddev_t *mddev, int failed) ...@@ -312,7 +312,7 @@ static void mark_disk_bad (mddev_t *mddev, int failed)
mddev->sb_dirty = 1; mddev->sb_dirty = 1;
md_wakeup_thread(conf->thread); md_wakeup_thread(conf->thread);
conf->working_disks--; conf->working_disks--;
printk (DISK_FAILED, partition_name (multipath->dev), printk (DISK_FAILED, bdev_partition_name (multipath->bdev),
conf->working_disks); conf->working_disks);
} }
...@@ -405,7 +405,7 @@ static void print_multipath_conf (multipath_conf_t *conf) ...@@ -405,7 +405,7 @@ static void print_multipath_conf (multipath_conf_t *conf)
printk(" disk%d, s:%d, o:%d, n:%d rd:%d us:%d dev:%s\n", printk(" disk%d, s:%d, o:%d, n:%d rd:%d us:%d dev:%s\n",
i, tmp->spare,tmp->operational, i, tmp->spare,tmp->operational,
tmp->number,tmp->raid_disk,tmp->used_slot, tmp->number,tmp->raid_disk,tmp->used_slot,
partition_name(tmp->dev)); bdev_partition_name(tmp->bdev));
} }
} }
...@@ -594,7 +594,6 @@ static int multipath_add_disk(mddev_t *mddev, mdp_disk_t *added_desc, ...@@ -594,7 +594,6 @@ static int multipath_add_disk(mddev_t *mddev, mdp_disk_t *added_desc,
break; break;
p->number = added_desc->number; p->number = added_desc->number;
p->raid_disk = added_desc->raid_disk; p->raid_disk = added_desc->raid_disk;
p->dev = rdev->dev;
p->bdev = rdev->bdev; p->bdev = rdev->bdev;
p->operational = 0; p->operational = 0;
p->spare = 1; p->spare = 1;
...@@ -631,7 +630,6 @@ static int multipath_remove_disk(mddev_t *mddev, int number) ...@@ -631,7 +630,6 @@ static int multipath_remove_disk(mddev_t *mddev, int number)
} }
if (p->spare && i < conf->raid_disks) if (p->spare && i < conf->raid_disks)
break; break;
p->dev = NODEV;
p->bdev = NULL; p->bdev = NULL;
p->used_slot = 0; p->used_slot = 0;
conf->nr_disks--; conf->nr_disks--;
...@@ -853,7 +851,7 @@ static int multipath_run (mddev_t *mddev) ...@@ -853,7 +851,7 @@ static int multipath_run (mddev_t *mddev)
if (rdev->faulty) { if (rdev->faulty) {
/* this is a "should never happen" case and if it */ /* this is a "should never happen" case and if it */
/* ever does happen, a continue; won't help */ /* ever does happen, a continue; won't help */
printk(ERRORS, partition_name(rdev->dev)); printk(ERRORS, bdev_partition_name(rdev->bdev));
continue; continue;
} else { } else {
/* this is a "should never happen" case and if it */ /* this is a "should never happen" case and if it */
...@@ -873,7 +871,7 @@ static int multipath_run (mddev_t *mddev) ...@@ -873,7 +871,7 @@ static int multipath_run (mddev_t *mddev)
disk = conf->multipaths + disk_idx; disk = conf->multipaths + disk_idx;
if (!disk_sync(desc)) if (!disk_sync(desc))
printk(NOT_IN_SYNC, partition_name(rdev->dev)); printk(NOT_IN_SYNC, bdev_partition_name(rdev->bdev));
/* /*
* Mark all disks as spare to start with, then pick our * Mark all disks as spare to start with, then pick our
...@@ -882,7 +880,6 @@ static int multipath_run (mddev_t *mddev) ...@@ -882,7 +880,6 @@ static int multipath_run (mddev_t *mddev)
*/ */
disk->number = desc->number; disk->number = desc->number;
disk->raid_disk = desc->raid_disk; disk->raid_disk = desc->raid_disk;
disk->dev = rdev->dev;
disk->bdev = rdev->bdev; disk->bdev = rdev->bdev;
atomic_inc(&rdev->bdev->bd_count); atomic_inc(&rdev->bdev->bd_count);
disk->operational = 0; disk->operational = 0;
...@@ -892,7 +889,7 @@ static int multipath_run (mddev_t *mddev) ...@@ -892,7 +889,7 @@ static int multipath_run (mddev_t *mddev)
if (disk_active(desc)) { if (disk_active(desc)) {
if(!conf->working_disks) { if(!conf->working_disks) {
printk(OPERATIONAL, partition_name(rdev->dev), printk(OPERATIONAL, bdev_partition_name(rdev->bdev),
desc->raid_disk); desc->raid_disk);
disk->operational = 1; disk->operational = 1;
disk->spare = 0; disk->spare = 0;
...@@ -909,7 +906,7 @@ static int multipath_run (mddev_t *mddev) ...@@ -909,7 +906,7 @@ static int multipath_run (mddev_t *mddev)
if(!conf->working_disks && num_rdevs) { if(!conf->working_disks && num_rdevs) {
desc = &sb->disks[def_rdev->desc_nr]; desc = &sb->disks[def_rdev->desc_nr];
disk = conf->multipaths + desc->raid_disk; disk = conf->multipaths + desc->raid_disk;
printk(OPERATIONAL, partition_name(def_rdev->dev), printk(OPERATIONAL, bdev_partition_name(def_rdev->bdev),
disk->raid_disk); disk->raid_disk);
disk->operational = 1; disk->operational = 1;
disk->spare = 0; disk->spare = 0;
......
...@@ -589,7 +589,7 @@ static void mark_disk_bad(mddev_t *mddev, int failed) ...@@ -589,7 +589,7 @@ static void mark_disk_bad(mddev_t *mddev, int failed)
md_wakeup_thread(conf->thread); md_wakeup_thread(conf->thread);
if (!mirror->write_only) if (!mirror->write_only)
conf->working_disks--; conf->working_disks--;
printk(DISK_FAILED, partition_name(mirror->dev), conf->working_disks); printk(DISK_FAILED, bdev_partition_name(mirror->bdev), conf->working_disks);
} }
static int error(mddev_t *mddev, struct block_device *bdev) static int error(mddev_t *mddev, struct block_device *bdev)
...@@ -640,7 +640,7 @@ static void print_conf(conf_t *conf) ...@@ -640,7 +640,7 @@ static void print_conf(conf_t *conf)
printk(" disk %d, s:%d, o:%d, n:%d rd:%d us:%d dev:%s\n", printk(" disk %d, s:%d, o:%d, n:%d rd:%d us:%d dev:%s\n",
i, tmp->spare, tmp->operational, i, tmp->spare, tmp->operational,
tmp->number, tmp->raid_disk, tmp->used_slot, tmp->number, tmp->raid_disk, tmp->used_slot,
partition_name(tmp->dev)); bdev_partition_name(tmp->bdev));
} }
} }
...@@ -848,7 +848,6 @@ static int raid1_add_disk(mddev_t *mddev, mdp_disk_t *added_desc, ...@@ -848,7 +848,6 @@ static int raid1_add_disk(mddev_t *mddev, mdp_disk_t *added_desc,
break; break;
p->number = added_desc->number; p->number = added_desc->number;
p->raid_disk = added_desc->raid_disk; p->raid_disk = added_desc->raid_disk;
p->dev = rdev->dev;
/* it will be held open by rdev */ /* it will be held open by rdev */
p->bdev = rdev->bdev; p->bdev = rdev->bdev;
p->operational = 0; p->operational = 0;
...@@ -886,7 +885,6 @@ static int raid1_remove_disk(mddev_t *mddev, int number) ...@@ -886,7 +885,6 @@ static int raid1_remove_disk(mddev_t *mddev, int number)
} }
if (p->spare && (i < conf->raid_disks)) if (p->spare && (i < conf->raid_disks))
break; break;
p->dev = NODEV;
p->bdev = NULL; p->bdev = NULL;
p->used_slot = 0; p->used_slot = 0;
conf->nr_disks--; conf->nr_disks--;
...@@ -1284,7 +1282,7 @@ static int run(mddev_t *mddev) ...@@ -1284,7 +1282,7 @@ static int run(mddev_t *mddev)
ITERATE_RDEV(mddev, rdev, tmp) { ITERATE_RDEV(mddev, rdev, tmp) {
if (rdev->faulty) { if (rdev->faulty) {
printk(ERRORS, partition_name(rdev->dev)); printk(ERRORS, bdev_partition_name(rdev->bdev));
} else { } else {
if (!rdev->sb) { if (!rdev->sb) {
MD_BUG(); MD_BUG();
...@@ -1302,7 +1300,6 @@ static int run(mddev_t *mddev) ...@@ -1302,7 +1300,6 @@ static int run(mddev_t *mddev)
if (disk_faulty(descriptor)) { if (disk_faulty(descriptor)) {
disk->number = descriptor->number; disk->number = descriptor->number;
disk->raid_disk = disk_idx; disk->raid_disk = disk_idx;
disk->dev = rdev->dev;
disk->bdev = rdev->bdev; disk->bdev = rdev->bdev;
atomic_inc(&rdev->bdev->bd_count); atomic_inc(&rdev->bdev->bd_count);
disk->operational = 0; disk->operational = 0;
...@@ -1315,27 +1312,26 @@ static int run(mddev_t *mddev) ...@@ -1315,27 +1312,26 @@ static int run(mddev_t *mddev)
if (disk_active(descriptor)) { if (disk_active(descriptor)) {
if (!disk_sync(descriptor)) { if (!disk_sync(descriptor)) {
printk(NOT_IN_SYNC, printk(NOT_IN_SYNC,
partition_name(rdev->dev)); bdev_partition_name(rdev->bdev));
continue; continue;
} }
if ((descriptor->number > MD_SB_DISKS) || if ((descriptor->number > MD_SB_DISKS) ||
(disk_idx > sb->raid_disks)) { (disk_idx > sb->raid_disks)) {
printk(INCONSISTENT, printk(INCONSISTENT,
partition_name(rdev->dev)); bdev_partition_name(rdev->bdev));
continue; continue;
} }
if (disk->operational) { if (disk->operational) {
printk(ALREADY_RUNNING, printk(ALREADY_RUNNING,
partition_name(rdev->dev), bdev_partition_name(rdev->bdev),
disk_idx); disk_idx);
continue; continue;
} }
printk(OPERATIONAL, partition_name(rdev->dev), printk(OPERATIONAL, bdev_partition_name(rdev->bdev),
disk_idx); disk_idx);
disk->number = descriptor->number; disk->number = descriptor->number;
disk->raid_disk = disk_idx; disk->raid_disk = disk_idx;
disk->dev = rdev->dev;
disk->bdev = rdev->bdev; disk->bdev = rdev->bdev;
atomic_inc(&rdev->bdev->bd_count); atomic_inc(&rdev->bdev->bd_count);
disk->operational = 1; disk->operational = 1;
...@@ -1348,10 +1344,9 @@ static int run(mddev_t *mddev) ...@@ -1348,10 +1344,9 @@ static int run(mddev_t *mddev)
/* /*
* Must be a spare disk .. * Must be a spare disk ..
*/ */
printk(SPARE, partition_name(rdev->dev)); printk(SPARE, bdev_partition_name(rdev->bdev));
disk->number = descriptor->number; disk->number = descriptor->number;
disk->raid_disk = disk_idx; disk->raid_disk = disk_idx;
disk->dev = rdev->dev;
disk->bdev = rdev->bdev; disk->bdev = rdev->bdev;
atomic_inc(&rdev->bdev->bd_count); atomic_inc(&rdev->bdev->bd_count);
disk->operational = 0; disk->operational = 0;
...@@ -1385,7 +1380,6 @@ static int run(mddev_t *mddev) ...@@ -1385,7 +1380,6 @@ static int run(mddev_t *mddev)
!disk->used_slot) { !disk->used_slot) {
disk->number = descriptor->number; disk->number = descriptor->number;
disk->raid_disk = disk_idx; disk->raid_disk = disk_idx;
disk->dev = NODEV;
disk->bdev = NULL; disk->bdev = NULL;
disk->operational = 0; disk->operational = 0;
disk->write_only = 0; disk->write_only = 0;
......
...@@ -441,7 +441,6 @@ static void raid5_build_block (struct stripe_head *sh, int i) ...@@ -441,7 +441,6 @@ static void raid5_build_block (struct stripe_head *sh, int i)
static int error(mddev_t *mddev, struct block_device *bdev) static int error(mddev_t *mddev, struct block_device *bdev)
{ {
kdev_t dev = to_kdev_t(bdev->bd_dev);
raid5_conf_t *conf = (raid5_conf_t *) mddev->private; raid5_conf_t *conf = (raid5_conf_t *) mddev->private;
mdp_super_t *sb = mddev->sb; mdp_super_t *sb = mddev->sb;
struct disk_info *disk; struct disk_info *disk;
...@@ -467,7 +466,7 @@ static int error(mddev_t *mddev, struct block_device *bdev) ...@@ -467,7 +466,7 @@ static int error(mddev_t *mddev, struct block_device *bdev)
printk (KERN_ALERT printk (KERN_ALERT
"raid5: Disk failure on %s, disabling device." "raid5: Disk failure on %s, disabling device."
" Operation continuing on %d devices\n", " Operation continuing on %d devices\n",
partition_name (dev), conf->working_disks); bdev_partition_name(bdev), conf->working_disks);
} }
return 0; return 0;
} }
...@@ -479,7 +478,7 @@ static int error(mddev_t *mddev, struct block_device *bdev) ...@@ -479,7 +478,7 @@ static int error(mddev_t *mddev, struct block_device *bdev)
if (disk->bdev == bdev) { if (disk->bdev == bdev) {
printk (KERN_ALERT printk (KERN_ALERT
"raid5: Disk failure on spare %s\n", "raid5: Disk failure on spare %s\n",
partition_name (dev)); bdev_partition_name (bdev));
if (!conf->spare->operational) { if (!conf->spare->operational) {
/* probably a SET_DISK_FAULTY ioctl */ /* probably a SET_DISK_FAULTY ioctl */
return -EIO; return -EIO;
...@@ -1429,7 +1428,7 @@ static int run (mddev_t *mddev) ...@@ -1429,7 +1428,7 @@ static int run (mddev_t *mddev)
disk = conf->disks + raid_disk; disk = conf->disks + raid_disk;
if (disk_faulty(desc)) { if (disk_faulty(desc)) {
printk(KERN_ERR "raid5: disabled device %s (errors detected)\n", partition_name(rdev->dev)); printk(KERN_ERR "raid5: disabled device %s (errors detected)\n", bdev_partition_name(rdev->bdev));
if (!rdev->faulty) { if (!rdev->faulty) {
MD_BUG(); MD_BUG();
goto abort; goto abort;
...@@ -1446,19 +1445,19 @@ static int run (mddev_t *mddev) ...@@ -1446,19 +1445,19 @@ static int run (mddev_t *mddev)
} }
if (disk_active(desc)) { if (disk_active(desc)) {
if (!disk_sync(desc)) { if (!disk_sync(desc)) {
printk(KERN_ERR "raid5: disabled device %s (not in sync)\n", partition_name(rdev->dev)); printk(KERN_ERR "raid5: disabled device %s (not in sync)\n", bdev_partition_name(rdev->bdev));
MD_BUG(); MD_BUG();
goto abort; goto abort;
} }
if (raid_disk > sb->raid_disks) { if (raid_disk > sb->raid_disks) {
printk(KERN_ERR "raid5: disabled device %s (inconsistent descriptor)\n", partition_name(rdev->dev)); printk(KERN_ERR "raid5: disabled device %s (inconsistent descriptor)\n", bdev_partition_name(rdev->bdev));
continue; continue;
} }
if (disk->operational) { if (disk->operational) {
printk(KERN_ERR "raid5: disabled device %s (device %d already operational)\n", partition_name(rdev->dev), raid_disk); printk(KERN_ERR "raid5: disabled device %s (device %d already operational)\n", bdev_partition_name(rdev->bdev), raid_disk);
continue; continue;
} }
printk(KERN_INFO "raid5: device %s operational as raid disk %d\n", partition_name(rdev->dev), raid_disk); printk(KERN_INFO "raid5: device %s operational as raid disk %d\n", bdev_partition_name(rdev->bdev), raid_disk);
disk->number = desc->number; disk->number = desc->number;
disk->raid_disk = raid_disk; disk->raid_disk = raid_disk;
...@@ -1471,7 +1470,7 @@ static int run (mddev_t *mddev) ...@@ -1471,7 +1470,7 @@ static int run (mddev_t *mddev)
/* /*
* Must be a spare disk .. * Must be a spare disk ..
*/ */
printk(KERN_INFO "raid5: spare disk %s\n", partition_name(rdev->dev)); printk(KERN_INFO "raid5: spare disk %s\n", bdev_partition_name(rdev->bdev));
disk->number = desc->number; disk->number = desc->number;
disk->raid_disk = raid_disk; disk->raid_disk = raid_disk;
disk->bdev = rdev->bdev; disk->bdev = rdev->bdev;
...@@ -1688,9 +1687,7 @@ static void print_raid5_conf (raid5_conf_t *conf) ...@@ -1688,9 +1687,7 @@ static void print_raid5_conf (raid5_conf_t *conf)
printk(" disk %d, s:%d, o:%d, n:%d rd:%d us:%d dev:%s\n", printk(" disk %d, s:%d, o:%d, n:%d rd:%d us:%d dev:%s\n",
i, tmp->spare,tmp->operational, i, tmp->spare,tmp->operational,
tmp->number,tmp->raid_disk,tmp->used_slot, tmp->number,tmp->raid_disk,tmp->used_slot,
partition_name(tmp->bdev ? bdev_partition_name(tmp->bdev));
to_kdev_t(tmp->bdev->bd_dev):
NODEV));
} }
} }
......
...@@ -66,7 +66,7 @@ extern struct hd_struct md_hd_struct[MAX_MD_DEVS]; ...@@ -66,7 +66,7 @@ extern struct hd_struct md_hd_struct[MAX_MD_DEVS];
extern char * partition_name (kdev_t dev); extern char * partition_name (kdev_t dev);
extern inline char * bdev_partition_name (struct block_device *bdev) extern inline char * bdev_partition_name (struct block_device *bdev)
{ {
return partition_name(to_kdev_t(bdev->bd_dev)); return partition_name(bdev ? to_kdev_t(bdev->bd_dev) : NODEV);
} }
extern int register_md_personality (int p_num, mdk_personality_t *p); extern int register_md_personality (int p_num, mdk_personality_t *p);
extern int unregister_md_personality (int p_num); extern int unregister_md_personality (int p_num);
......
...@@ -6,7 +6,6 @@ ...@@ -6,7 +6,6 @@
struct multipath_info { struct multipath_info {
int number; int number;
int raid_disk; int raid_disk;
kdev_t dev;
struct block_device *bdev; struct block_device *bdev;
/* /*
......
...@@ -8,7 +8,6 @@ typedef struct mirror_info mirror_info_t; ...@@ -8,7 +8,6 @@ typedef struct mirror_info mirror_info_t;
struct mirror_info { struct mirror_info {
int number; int number;
int raid_disk; int raid_disk;
kdev_t dev;
struct block_device *bdev; struct block_device *bdev;
sector_t head_position; sector_t head_position;
atomic_t nr_pending; atomic_t nr_pending;
......
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