Commit 0825b87a authored by Andre Noll's avatar Andre Noll Committed by NeilBrown

md: raid0 create_strip_zones(): Add KERN_INFO/KERN_ERR to printk's.

This patch consists only of these trivial changes.
Signed-off-by: default avatarAndre Noll <maan@systemlinux.org>
Signed-off-by: default avatarNeilBrown <neilb@suse.de>
parent 6b8796cc
...@@ -68,18 +68,18 @@ static int create_strip_zones (mddev_t *mddev) ...@@ -68,18 +68,18 @@ static int create_strip_zones (mddev_t *mddev)
conf->nr_strip_zones = 0; conf->nr_strip_zones = 0;
rdev_for_each(rdev1, tmp1, mddev) { rdev_for_each(rdev1, tmp1, mddev) {
printk("raid0: looking at %s\n", printk(KERN_INFO "raid0: looking at %s\n",
bdevname(rdev1->bdev,b)); bdevname(rdev1->bdev,b));
c = 0; c = 0;
rdev_for_each(rdev2, tmp2, mddev) { rdev_for_each(rdev2, tmp2, mddev) {
printk("raid0: comparing %s(%llu)", printk(KERN_INFO "raid0: comparing %s(%llu)",
bdevname(rdev1->bdev,b), bdevname(rdev1->bdev,b),
(unsigned long long)rdev1->size); (unsigned long long)rdev1->size);
printk(" with %s(%llu)\n", printk(KERN_INFO " with %s(%llu)\n",
bdevname(rdev2->bdev,b), bdevname(rdev2->bdev,b),
(unsigned long long)rdev2->size); (unsigned long long)rdev2->size);
if (rdev2 == rdev1) { if (rdev2 == rdev1) {
printk("raid0: END\n"); printk(KERN_INFO "raid0: END\n");
break; break;
} }
if (rdev2->size == rdev1->size) if (rdev2->size == rdev1->size)
...@@ -88,19 +88,20 @@ static int create_strip_zones (mddev_t *mddev) ...@@ -88,19 +88,20 @@ static int create_strip_zones (mddev_t *mddev)
* Not unique, don't count it as a new * Not unique, don't count it as a new
* group * group
*/ */
printk("raid0: EQUAL\n"); printk(KERN_INFO "raid0: EQUAL\n");
c = 1; c = 1;
break; break;
} }
printk("raid0: NOT EQUAL\n"); printk(KERN_INFO "raid0: NOT EQUAL\n");
} }
if (!c) { if (!c) {
printk("raid0: ==> UNIQUE\n"); printk(KERN_INFO "raid0: ==> UNIQUE\n");
conf->nr_strip_zones++; conf->nr_strip_zones++;
printk("raid0: %d zones\n", conf->nr_strip_zones); printk(KERN_INFO "raid0: %d zones\n",
conf->nr_strip_zones);
} }
} }
printk("raid0: FINAL %d zones\n", conf->nr_strip_zones); printk(KERN_INFO "raid0: FINAL %d zones\n", conf->nr_strip_zones);
conf->strip_zone = kzalloc(sizeof(struct strip_zone)* conf->strip_zone = kzalloc(sizeof(struct strip_zone)*
conf->nr_strip_zones, GFP_KERNEL); conf->nr_strip_zones, GFP_KERNEL);
...@@ -123,12 +124,13 @@ static int create_strip_zones (mddev_t *mddev) ...@@ -123,12 +124,13 @@ static int create_strip_zones (mddev_t *mddev)
int j = rdev1->raid_disk; int j = rdev1->raid_disk;
if (j < 0 || j >= mddev->raid_disks) { if (j < 0 || j >= mddev->raid_disks) {
printk("raid0: bad disk number %d - aborting!\n", j); printk(KERN_ERR "raid0: bad disk number %d - "
"aborting!\n", j);
goto abort; goto abort;
} }
if (zone->dev[j]) { if (zone->dev[j]) {
printk("raid0: multiple devices for %d - aborting!\n", printk(KERN_ERR "raid0: multiple devices for %d - "
j); "aborting!\n", j);
goto abort; goto abort;
} }
zone->dev[j] = rdev1; zone->dev[j] = rdev1;
...@@ -149,8 +151,8 @@ static int create_strip_zones (mddev_t *mddev) ...@@ -149,8 +151,8 @@ static int create_strip_zones (mddev_t *mddev)
cnt++; cnt++;
} }
if (cnt != mddev->raid_disks) { if (cnt != mddev->raid_disks) {
printk("raid0: too few disks (%d of %d) - aborting!\n", printk(KERN_ERR "raid0: too few disks (%d of %d) - "
cnt, mddev->raid_disks); "aborting!\n", cnt, mddev->raid_disks);
goto abort; goto abort;
} }
zone->nb_dev = cnt; zone->nb_dev = cnt;
...@@ -166,7 +168,7 @@ static int create_strip_zones (mddev_t *mddev) ...@@ -166,7 +168,7 @@ static int create_strip_zones (mddev_t *mddev)
zone = conf->strip_zone + i; zone = conf->strip_zone + i;
zone->dev = conf->strip_zone[i-1].dev + mddev->raid_disks; zone->dev = conf->strip_zone[i-1].dev + mddev->raid_disks;
printk("raid0: zone %d\n", i); printk(KERN_INFO "raid0: zone %d\n", i);
zone->dev_start = current_start; zone->dev_start = current_start;
smallest = NULL; smallest = NULL;
c = 0; c = 0;
...@@ -174,23 +176,25 @@ static int create_strip_zones (mddev_t *mddev) ...@@ -174,23 +176,25 @@ static int create_strip_zones (mddev_t *mddev)
for (j=0; j<cnt; j++) { for (j=0; j<cnt; j++) {
char b[BDEVNAME_SIZE]; char b[BDEVNAME_SIZE];
rdev = conf->strip_zone[0].dev[j]; rdev = conf->strip_zone[0].dev[j];
printk("raid0: checking %s ...", bdevname(rdev->bdev,b)); printk(KERN_INFO "raid0: checking %s ...",
bdevname(rdev->bdev, b));
if (rdev->size > current_start / 2) { if (rdev->size > current_start / 2) {
printk(" contained as device %d\n", c); printk(KERN_INFO " contained as device %d\n",
c);
zone->dev[c] = rdev; zone->dev[c] = rdev;
c++; c++;
if (!smallest || (rdev->size <smallest->size)) { if (!smallest || (rdev->size <smallest->size)) {
smallest = rdev; smallest = rdev;
printk(" (%llu) is smallest!.\n", printk(KERN_INFO " (%llu) is smallest!.\n",
(unsigned long long)rdev->size); (unsigned long long)rdev->size);
} }
} else } else
printk(" nope.\n"); printk(KERN_INFO " nope.\n");
} }
zone->nb_dev = c; zone->nb_dev = c;
zone->size = (smallest->size - current_start / 2) * c; zone->size = (smallest->size - current_start / 2) * c;
printk("raid0: zone->nb_dev: %d, size: %llu\n", printk(KERN_INFO "raid0: zone->nb_dev: %d, size: %llu\n",
zone->nb_dev, (unsigned long long)zone->size); zone->nb_dev, (unsigned long long)zone->size);
zone->zone_start = curr_zone_start; zone->zone_start = curr_zone_start;
...@@ -226,7 +230,7 @@ static int create_strip_zones (mddev_t *mddev) ...@@ -226,7 +230,7 @@ static int create_strip_zones (mddev_t *mddev)
mddev->queue->backing_dev_info.congested_fn = raid0_congested; mddev->queue->backing_dev_info.congested_fn = raid0_congested;
mddev->queue->backing_dev_info.congested_data = mddev; mddev->queue->backing_dev_info.congested_data = mddev;
printk("raid0: done.\n"); printk(KERN_INFO "raid0: done.\n");
return 0; return 0;
abort: abort:
return 1; return 1;
......
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