Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 4056ca51 authored by NeilBrown's avatar NeilBrown Committed by Shaohua Li
Browse files

md/raid10: simplify print_conf a little.



'tmp' is only ever used to extract 'tmp->rdev', so just use 'rdev' directly.

Signed-off-by: default avatarNeilBrown <neilb@suse.com>
Signed-off-by: default avatarShaohua Li <shli@fb.com>
parent d683c8e0
Loading
Loading
Loading
Loading
+8 −6
Original line number Original line Diff line number Diff line
@@ -1598,7 +1598,7 @@ static void raid10_error(struct mddev *mddev, struct md_rdev *rdev)
static void print_conf(struct r10conf *conf)
static void print_conf(struct r10conf *conf)
{
{
	int i;
	int i;
	struct raid10_info *tmp;
	struct md_rdev *rdev;


	printk(KERN_DEBUG "RAID10 conf printout:\n");
	printk(KERN_DEBUG "RAID10 conf printout:\n");
	if (!conf) {
	if (!conf) {
@@ -1608,14 +1608,16 @@ static void print_conf(struct r10conf *conf)
	printk(KERN_DEBUG " --- wd:%d rd:%d\n", conf->geo.raid_disks - conf->mddev->degraded,
	printk(KERN_DEBUG " --- wd:%d rd:%d\n", conf->geo.raid_disks - conf->mddev->degraded,
		conf->geo.raid_disks);
		conf->geo.raid_disks);


	/* This is only called with ->reconfix_mutex held, so
	 * rcu protection of rdev is not needed */
	for (i = 0; i < conf->geo.raid_disks; i++) {
	for (i = 0; i < conf->geo.raid_disks; i++) {
		char b[BDEVNAME_SIZE];
		char b[BDEVNAME_SIZE];
		tmp = conf->mirrors + i;
		rdev = conf->mirrors[i].rdev;
		if (tmp->rdev)
		if (rdev)
			printk(KERN_DEBUG " disk %d, wo:%d, o:%d, dev:%s\n",
			printk(KERN_DEBUG " disk %d, wo:%d, o:%d, dev:%s\n",
				i, !test_bit(In_sync, &tmp->rdev->flags),
				i, !test_bit(In_sync, &rdev->flags),
			        !test_bit(Faulty, &tmp->rdev->flags),
			        !test_bit(Faulty, &rdev->flags),
				bdevname(tmp->rdev->bdev,b));
				bdevname(rdev->bdev,b));
	}
	}
}
}