Commit 50de8df4 authored by NeilBrown's avatar NeilBrown

md/raid0: convert some printks to pr_debug.

When md assembles a RAID0 array it prints out lots of info which
is really just for debugging, so convert that to pr_debug.
It also prints out the resulting configuration which could be
interesting, so keep that as 'printk' but tidy it up a bit.
Signed-off-by: default avatarNeilBrown <neilb@suse.de>
parent 36a4e1fe
...@@ -49,32 +49,32 @@ static int raid0_congested(void *data, int bits) ...@@ -49,32 +49,32 @@ static int raid0_congested(void *data, int bits)
*/ */
static void dump_zones(mddev_t *mddev) static void dump_zones(mddev_t *mddev)
{ {
int j, k, h; int j, k;
sector_t zone_size = 0; sector_t zone_size = 0;
sector_t zone_start = 0; sector_t zone_start = 0;
char b[BDEVNAME_SIZE]; char b[BDEVNAME_SIZE];
raid0_conf_t *conf = mddev->private; raid0_conf_t *conf = mddev->private;
int raid_disks = conf->strip_zone[0].nb_dev; int raid_disks = conf->strip_zone[0].nb_dev;
printk(KERN_INFO "******* %s configuration *********\n", printk(KERN_INFO "md: RAID0 configuration for %s - %d zone%s\n",
mdname(mddev)); mdname(mddev),
h = 0; conf->nr_strip_zones, conf->nr_strip_zones==1?"":"s");
for (j = 0; j < conf->nr_strip_zones; j++) { for (j = 0; j < conf->nr_strip_zones; j++) {
printk(KERN_INFO "zone%d=[", j); printk(KERN_INFO "md: zone%d=[", j);
for (k = 0; k < conf->strip_zone[j].nb_dev; k++) for (k = 0; k < conf->strip_zone[j].nb_dev; k++)
printk(KERN_CONT "%s/", printk(KERN_CONT "%s%s", k?"/":"",
bdevname(conf->devlist[j*raid_disks bdevname(conf->devlist[j*raid_disks
+ k]->bdev, b)); + k]->bdev, b));
printk(KERN_CONT "]\n"); printk(KERN_CONT "]\n");
zone_size = conf->strip_zone[j].zone_end - zone_start; zone_size = conf->strip_zone[j].zone_end - zone_start;
printk(KERN_INFO " zone offset=%llukb " printk(KERN_INFO " zone-offset=%10lluKB, "
"device offset=%llukb size=%llukb\n", "device-offset=%10lluKB, size=%10lluKB\n",
(unsigned long long)zone_start>>1, (unsigned long long)zone_start>>1,
(unsigned long long)conf->strip_zone[j].dev_start>>1, (unsigned long long)conf->strip_zone[j].dev_start>>1,
(unsigned long long)zone_size>>1); (unsigned long long)zone_size>>1);
zone_start = conf->strip_zone[j].zone_end; zone_start = conf->strip_zone[j].zone_end;
} }
printk(KERN_INFO "**********************************\n\n"); printk(KERN_INFO "\n");
} }
static int create_strip_zones(mddev_t *mddev, raid0_conf_t **private_conf) static int create_strip_zones(mddev_t *mddev, raid0_conf_t **private_conf)
...@@ -85,12 +85,13 @@ static int create_strip_zones(mddev_t *mddev, raid0_conf_t **private_conf) ...@@ -85,12 +85,13 @@ static int create_strip_zones(mddev_t *mddev, raid0_conf_t **private_conf)
struct strip_zone *zone; struct strip_zone *zone;
int cnt; int cnt;
char b[BDEVNAME_SIZE]; char b[BDEVNAME_SIZE];
char b2[BDEVNAME_SIZE];
raid0_conf_t *conf = kzalloc(sizeof(*conf), GFP_KERNEL); raid0_conf_t *conf = kzalloc(sizeof(*conf), GFP_KERNEL);
if (!conf) if (!conf)
return -ENOMEM; return -ENOMEM;
list_for_each_entry(rdev1, &mddev->disks, same_set) { list_for_each_entry(rdev1, &mddev->disks, same_set) {
printk(KERN_INFO "md/raid0:%s: looking at %s\n", pr_debug("md/raid0:%s: looking at %s\n",
mdname(mddev), mdname(mddev),
bdevname(rdev1->bdev, b)); bdevname(rdev1->bdev, b));
c = 0; c = 0;
...@@ -101,15 +102,15 @@ static int create_strip_zones(mddev_t *mddev, raid0_conf_t **private_conf) ...@@ -101,15 +102,15 @@ static int create_strip_zones(mddev_t *mddev, raid0_conf_t **private_conf)
rdev1->sectors = sectors * mddev->chunk_sectors; rdev1->sectors = sectors * mddev->chunk_sectors;
list_for_each_entry(rdev2, &mddev->disks, same_set) { list_for_each_entry(rdev2, &mddev->disks, same_set) {
printk(KERN_INFO "md/raid0:%s: comparing %s(%llu)", pr_debug("md/raid0:%s: comparing %s(%llu)"
" with %s(%llu)\n",
mdname(mddev), mdname(mddev),
bdevname(rdev1->bdev,b), bdevname(rdev1->bdev,b),
(unsigned long long)rdev1->sectors); (unsigned long long)rdev1->sectors,
printk(KERN_CONT " with %s(%llu)\n", bdevname(rdev2->bdev,b2),
bdevname(rdev2->bdev,b),
(unsigned long long)rdev2->sectors); (unsigned long long)rdev2->sectors);
if (rdev2 == rdev1) { if (rdev2 == rdev1) {
printk(KERN_INFO "md/raid0:%s: END\n", pr_debug("md/raid0:%s: END\n",
mdname(mddev)); mdname(mddev));
break; break;
} }
...@@ -118,23 +119,23 @@ static int create_strip_zones(mddev_t *mddev, raid0_conf_t **private_conf) ...@@ -118,23 +119,23 @@ static int create_strip_zones(mddev_t *mddev, raid0_conf_t **private_conf)
* Not unique, don't count it as a new * Not unique, don't count it as a new
* group * group
*/ */
printk(KERN_INFO "md/raid0:%s: EQUAL\n", pr_debug("md/raid0:%s: EQUAL\n",
mdname(mddev)); mdname(mddev));
c = 1; c = 1;
break; break;
} }
printk(KERN_INFO "md/raid0:%s: NOT EQUAL\n", pr_debug("md/raid0:%s: NOT EQUAL\n",
mdname(mddev)); mdname(mddev));
} }
if (!c) { if (!c) {
printk(KERN_INFO "md/raid0:%s: ==> UNIQUE\n", pr_debug("md/raid0:%s: ==> UNIQUE\n",
mdname(mddev)); mdname(mddev));
conf->nr_strip_zones++; conf->nr_strip_zones++;
printk(KERN_INFO "md/raid0:%s: %d zones\n", pr_debug("md/raid0:%s: %d zones\n",
mdname(mddev), conf->nr_strip_zones); mdname(mddev), conf->nr_strip_zones);
} }
} }
printk(KERN_INFO "md/raid0:%s: FINAL %d zones\n", pr_debug("md/raid0:%s: FINAL %d zones\n",
mdname(mddev), conf->nr_strip_zones); mdname(mddev), conf->nr_strip_zones);
err = -ENOMEM; err = -ENOMEM;
conf->strip_zone = kzalloc(sizeof(struct strip_zone)* conf->strip_zone = kzalloc(sizeof(struct strip_zone)*
...@@ -218,27 +219,28 @@ static int create_strip_zones(mddev_t *mddev, raid0_conf_t **private_conf) ...@@ -218,27 +219,28 @@ static int create_strip_zones(mddev_t *mddev, raid0_conf_t **private_conf)
zone = conf->strip_zone + i; zone = conf->strip_zone + i;
dev = conf->devlist + i * mddev->raid_disks; dev = conf->devlist + i * mddev->raid_disks;
printk(KERN_INFO "md/raid0:%s: zone %d\n", pr_debug("md/raid0:%s: zone %d\n", mdname(mddev), i);
mdname(mddev), i);
zone->dev_start = smallest->sectors; zone->dev_start = smallest->sectors;
smallest = NULL; smallest = NULL;
c = 0; c = 0;
for (j=0; j<cnt; j++) { for (j=0; j<cnt; j++) {
rdev = conf->devlist[j]; rdev = conf->devlist[j];
printk(KERN_INFO "md/raid0:%s: checking %s ...", if (rdev->sectors <= zone->dev_start) {
pr_debug("md/raid0:%s: checking %s ... nope\n",
mdname(mddev), mdname(mddev),
bdevname(rdev->bdev, b)); bdevname(rdev->bdev, b));
if (rdev->sectors <= zone->dev_start) {
printk(KERN_CONT " nope.\n");
continue; continue;
} }
printk(KERN_CONT " contained as device %d\n", c); pr_debug("md/raid0:%s: checking %s ..."
" contained as device %d\n",
mdname(mddev),
bdevname(rdev->bdev, b), c);
dev[c] = rdev; dev[c] = rdev;
c++; c++;
if (!smallest || rdev->sectors < smallest->sectors) { if (!smallest || rdev->sectors < smallest->sectors) {
smallest = rdev; smallest = rdev;
printk(KERN_INFO "md/raid0:%s: (%llu) is smallest!.\n", pr_debug("md/raid0:%s: (%llu) is smallest!.\n",
mdname(mddev), mdname(mddev),
(unsigned long long)rdev->sectors); (unsigned long long)rdev->sectors);
} }
...@@ -246,14 +248,14 @@ static int create_strip_zones(mddev_t *mddev, raid0_conf_t **private_conf) ...@@ -246,14 +248,14 @@ static int create_strip_zones(mddev_t *mddev, raid0_conf_t **private_conf)
zone->nb_dev = c; zone->nb_dev = c;
sectors = (smallest->sectors - zone->dev_start) * c; sectors = (smallest->sectors - zone->dev_start) * c;
printk(KERN_INFO "md/raid0:%s: zone->nb_dev: %d, sectors: %llu\n", pr_debug("md/raid0:%s: zone->nb_dev: %d, sectors: %llu\n",
mdname(mddev), mdname(mddev),
zone->nb_dev, (unsigned long long)sectors); zone->nb_dev, (unsigned long long)sectors);
curr_zone_end += sectors; curr_zone_end += sectors;
zone->zone_end = curr_zone_end; zone->zone_end = curr_zone_end;
printk(KERN_INFO "md/raid0:%s: current zone start: %llu\n", pr_debug("md/raid0:%s: current zone start: %llu\n",
mdname(mddev), mdname(mddev),
(unsigned long long)smallest->sectors); (unsigned long long)smallest->sectors);
} }
...@@ -275,7 +277,7 @@ static int create_strip_zones(mddev_t *mddev, raid0_conf_t **private_conf) ...@@ -275,7 +277,7 @@ static int create_strip_zones(mddev_t *mddev, raid0_conf_t **private_conf)
blk_queue_io_opt(mddev->queue, blk_queue_io_opt(mddev->queue,
(mddev->chunk_sectors << 9) * mddev->raid_disks); (mddev->chunk_sectors << 9) * mddev->raid_disks);
printk(KERN_INFO "md/raid0:%s: done.\n", mdname(mddev)); pr_debug("md/raid0:%s: done.\n", mdname(mddev));
*private_conf = conf; *private_conf = conf;
return 0; return 0;
......
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