aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNeilBrown <neilb@suse.com>2016-11-01 23:16:50 -0400
committerShaohua Li <shli@fb.com>2016-11-07 18:08:22 -0500
commit766038846e875740cf4c20dfc5d5b292ba47360a (patch)
treef5c5c1f695934a7ce87259b63a7143800debf0f8
parent7279694da4af9e99e7ed85ed8883c740efff348b (diff)
md/raid0: replace printk() with pr_*()
This makes md/raid0 much less verbose as the messages about the array geometry are now pr_debug() Signed-off-by: NeilBrown <neilb@suse.com> Signed-off-by: Shaohua Li <shli@fb.com>
-rw-r--r--drivers/md/raid0.c89
1 files changed, 44 insertions, 45 deletions
diff --git a/drivers/md/raid0.c b/drivers/md/raid0.c
index 258986a2699d..b3ba77a3c3bc 100644
--- a/drivers/md/raid0.c
+++ b/drivers/md/raid0.c
@@ -51,20 +51,21 @@ static void dump_zones(struct mddev *mddev)
51 char b[BDEVNAME_SIZE]; 51 char b[BDEVNAME_SIZE];
52 struct r0conf *conf = mddev->private; 52 struct r0conf *conf = mddev->private;
53 int raid_disks = conf->strip_zone[0].nb_dev; 53 int raid_disks = conf->strip_zone[0].nb_dev;
54 printk(KERN_INFO "md: RAID0 configuration for %s - %d zone%s\n", 54 pr_debug("md: RAID0 configuration for %s - %d zone%s\n",
55 mdname(mddev), 55 mdname(mddev),
56 conf->nr_strip_zones, conf->nr_strip_zones==1?"":"s"); 56 conf->nr_strip_zones, conf->nr_strip_zones==1?"":"s");
57 for (j = 0; j < conf->nr_strip_zones; j++) { 57 for (j = 0; j < conf->nr_strip_zones; j++) {
58 printk(KERN_INFO "md: zone%d=[", j); 58 char line[200];
59 int len = 0;
60
59 for (k = 0; k < conf->strip_zone[j].nb_dev; k++) 61 for (k = 0; k < conf->strip_zone[j].nb_dev; k++)
60 printk(KERN_CONT "%s%s", k?"/":"", 62 len += snprintf(line+len, 200-len, "%s%s", k?"/":"",
61 bdevname(conf->devlist[j*raid_disks 63 bdevname(conf->devlist[j*raid_disks
62 + k]->bdev, b)); 64 + k]->bdev, b));
63 printk(KERN_CONT "]\n"); 65 pr_debug("md: zone%d=[%s]\n", j, line);
64 66
65 zone_size = conf->strip_zone[j].zone_end - zone_start; 67 zone_size = conf->strip_zone[j].zone_end - zone_start;
66 printk(KERN_INFO " zone-offset=%10lluKB, " 68 pr_debug(" zone-offset=%10lluKB, device-offset=%10lluKB, size=%10lluKB\n",
67 "device-offset=%10lluKB, size=%10lluKB\n",
68 (unsigned long long)zone_start>>1, 69 (unsigned long long)zone_start>>1,
69 (unsigned long long)conf->strip_zone[j].dev_start>>1, 70 (unsigned long long)conf->strip_zone[j].dev_start>>1,
70 (unsigned long long)zone_size>>1); 71 (unsigned long long)zone_size>>1);
@@ -142,9 +143,9 @@ static int create_strip_zones(struct mddev *mddev, struct r0conf **private_conf)
142 * chunk size is a multiple of that sector size 143 * chunk size is a multiple of that sector size
143 */ 144 */
144 if ((mddev->chunk_sectors << 9) % blksize) { 145 if ((mddev->chunk_sectors << 9) % blksize) {
145 printk(KERN_ERR "md/raid0:%s: chunk_size of %d not multiple of block size %d\n", 146 pr_warn("md/raid0:%s: chunk_size of %d not multiple of block size %d\n",
146 mdname(mddev), 147 mdname(mddev),
147 mddev->chunk_sectors << 9, blksize); 148 mddev->chunk_sectors << 9, blksize);
148 err = -EINVAL; 149 err = -EINVAL;
149 goto abort; 150 goto abort;
150 } 151 }
@@ -186,19 +187,18 @@ static int create_strip_zones(struct mddev *mddev, struct r0conf **private_conf)
186 } 187 }
187 188
188 if (j < 0) { 189 if (j < 0) {
189 printk(KERN_ERR 190 pr_warn("md/raid0:%s: remove inactive devices before converting to RAID0\n",
190 "md/raid0:%s: remove inactive devices before converting to RAID0\n", 191 mdname(mddev));
191 mdname(mddev));
192 goto abort; 192 goto abort;
193 } 193 }
194 if (j >= mddev->raid_disks) { 194 if (j >= mddev->raid_disks) {
195 printk(KERN_ERR "md/raid0:%s: bad disk number %d - " 195 pr_warn("md/raid0:%s: bad disk number %d - aborting!\n",
196 "aborting!\n", mdname(mddev), j); 196 mdname(mddev), j);
197 goto abort; 197 goto abort;
198 } 198 }
199 if (dev[j]) { 199 if (dev[j]) {
200 printk(KERN_ERR "md/raid0:%s: multiple devices for %d - " 200 pr_warn("md/raid0:%s: multiple devices for %d - aborting!\n",
201 "aborting!\n", mdname(mddev), j); 201 mdname(mddev), j);
202 goto abort; 202 goto abort;
203 } 203 }
204 dev[j] = rdev1; 204 dev[j] = rdev1;
@@ -208,8 +208,8 @@ static int create_strip_zones(struct mddev *mddev, struct r0conf **private_conf)
208 cnt++; 208 cnt++;
209 } 209 }
210 if (cnt != mddev->raid_disks) { 210 if (cnt != mddev->raid_disks) {
211 printk(KERN_ERR "md/raid0:%s: too few disks (%d of %d) - " 211 pr_warn("md/raid0:%s: too few disks (%d of %d) - aborting!\n",
212 "aborting!\n", mdname(mddev), cnt, mddev->raid_disks); 212 mdname(mddev), cnt, mddev->raid_disks);
213 goto abort; 213 goto abort;
214 } 214 }
215 zone->nb_dev = cnt; 215 zone->nb_dev = cnt;
@@ -357,8 +357,7 @@ static int raid0_run(struct mddev *mddev)
357 int ret; 357 int ret;
358 358
359 if (mddev->chunk_sectors == 0) { 359 if (mddev->chunk_sectors == 0) {
360 printk(KERN_ERR "md/raid0:%s: chunk size must be set.\n", 360 pr_warn("md/raid0:%s: chunk size must be set.\n", mdname(mddev));
361 mdname(mddev));
362 return -EINVAL; 361 return -EINVAL;
363 } 362 }
364 if (md_check_no_bitmap(mddev)) 363 if (md_check_no_bitmap(mddev))
@@ -399,9 +398,9 @@ static int raid0_run(struct mddev *mddev)
399 /* calculate array device size */ 398 /* calculate array device size */
400 md_set_array_sectors(mddev, raid0_size(mddev, 0, 0)); 399 md_set_array_sectors(mddev, raid0_size(mddev, 0, 0));
401 400
402 printk(KERN_INFO "md/raid0:%s: md_size is %llu sectors.\n", 401 pr_debug("md/raid0:%s: md_size is %llu sectors.\n",
403 mdname(mddev), 402 mdname(mddev),
404 (unsigned long long)mddev->array_sectors); 403 (unsigned long long)mddev->array_sectors);
405 404
406 if (mddev->queue) { 405 if (mddev->queue) {
407 /* calculate the max read-ahead size. 406 /* calculate the max read-ahead size.
@@ -509,17 +508,17 @@ static void *raid0_takeover_raid45(struct mddev *mddev)
509 struct r0conf *priv_conf; 508 struct r0conf *priv_conf;
510 509
511 if (mddev->degraded != 1) { 510 if (mddev->degraded != 1) {
512 printk(KERN_ERR "md/raid0:%s: raid5 must be degraded! Degraded disks: %d\n", 511 pr_warn("md/raid0:%s: raid5 must be degraded! Degraded disks: %d\n",
513 mdname(mddev), 512 mdname(mddev),
514 mddev->degraded); 513 mddev->degraded);
515 return ERR_PTR(-EINVAL); 514 return ERR_PTR(-EINVAL);
516 } 515 }
517 516
518 rdev_for_each(rdev, mddev) { 517 rdev_for_each(rdev, mddev) {
519 /* check slot number for a disk */ 518 /* check slot number for a disk */
520 if (rdev->raid_disk == mddev->raid_disks-1) { 519 if (rdev->raid_disk == mddev->raid_disks-1) {
521 printk(KERN_ERR "md/raid0:%s: raid5 must have missing parity disk!\n", 520 pr_warn("md/raid0:%s: raid5 must have missing parity disk!\n",
522 mdname(mddev)); 521 mdname(mddev));
523 return ERR_PTR(-EINVAL); 522 return ERR_PTR(-EINVAL);
524 } 523 }
525 rdev->sectors = mddev->dev_sectors; 524 rdev->sectors = mddev->dev_sectors;
@@ -549,19 +548,19 @@ static void *raid0_takeover_raid10(struct mddev *mddev)
549 * - all mirrors must be already degraded 548 * - all mirrors must be already degraded
550 */ 549 */
551 if (mddev->layout != ((1 << 8) + 2)) { 550 if (mddev->layout != ((1 << 8) + 2)) {
552 printk(KERN_ERR "md/raid0:%s:: Raid0 cannot takeover layout: 0x%x\n", 551 pr_warn("md/raid0:%s:: Raid0 cannot takeover layout: 0x%x\n",
553 mdname(mddev), 552 mdname(mddev),
554 mddev->layout); 553 mddev->layout);
555 return ERR_PTR(-EINVAL); 554 return ERR_PTR(-EINVAL);
556 } 555 }
557 if (mddev->raid_disks & 1) { 556 if (mddev->raid_disks & 1) {
558 printk(KERN_ERR "md/raid0:%s: Raid0 cannot takeover Raid10 with odd disk number.\n", 557 pr_warn("md/raid0:%s: Raid0 cannot takeover Raid10 with odd disk number.\n",
559 mdname(mddev)); 558 mdname(mddev));
560 return ERR_PTR(-EINVAL); 559 return ERR_PTR(-EINVAL);
561 } 560 }
562 if (mddev->degraded != (mddev->raid_disks>>1)) { 561 if (mddev->degraded != (mddev->raid_disks>>1)) {
563 printk(KERN_ERR "md/raid0:%s: All mirrors must be already degraded!\n", 562 pr_warn("md/raid0:%s: All mirrors must be already degraded!\n",
564 mdname(mddev)); 563 mdname(mddev));
565 return ERR_PTR(-EINVAL); 564 return ERR_PTR(-EINVAL);
566 } 565 }
567 566
@@ -588,7 +587,7 @@ static void *raid0_takeover_raid1(struct mddev *mddev)
588 * - (N - 1) mirror drives must be already faulty 587 * - (N - 1) mirror drives must be already faulty
589 */ 588 */
590 if ((mddev->raid_disks - 1) != mddev->degraded) { 589 if ((mddev->raid_disks - 1) != mddev->degraded) {
591 printk(KERN_ERR "md/raid0:%s: (N - 1) mirrors drives must be already faulty!\n", 590 pr_err("md/raid0:%s: (N - 1) mirrors drives must be already faulty!\n",
592 mdname(mddev)); 591 mdname(mddev));
593 return ERR_PTR(-EINVAL); 592 return ERR_PTR(-EINVAL);
594 } 593 }
@@ -631,8 +630,8 @@ static void *raid0_takeover(struct mddev *mddev)
631 */ 630 */
632 631
633 if (mddev->bitmap) { 632 if (mddev->bitmap) {
634 printk(KERN_ERR "md/raid0: %s: cannot takeover array with bitmap\n", 633 pr_warn("md/raid0: %s: cannot takeover array with bitmap\n",
635 mdname(mddev)); 634 mdname(mddev));
636 return ERR_PTR(-EBUSY); 635 return ERR_PTR(-EBUSY);
637 } 636 }
638 if (mddev->level == 4) 637 if (mddev->level == 4)
@@ -642,8 +641,8 @@ static void *raid0_takeover(struct mddev *mddev)
642 if (mddev->layout == ALGORITHM_PARITY_N) 641 if (mddev->layout == ALGORITHM_PARITY_N)
643 return raid0_takeover_raid45(mddev); 642 return raid0_takeover_raid45(mddev);
644 643
645 printk(KERN_ERR "md/raid0:%s: Raid can only takeover Raid5 with layout: %d\n", 644 pr_warn("md/raid0:%s: Raid can only takeover Raid5 with layout: %d\n",
646 mdname(mddev), ALGORITHM_PARITY_N); 645 mdname(mddev), ALGORITHM_PARITY_N);
647 } 646 }
648 647
649 if (mddev->level == 10) 648 if (mddev->level == 10)
@@ -652,7 +651,7 @@ static void *raid0_takeover(struct mddev *mddev)
652 if (mddev->level == 1) 651 if (mddev->level == 1)
653 return raid0_takeover_raid1(mddev); 652 return raid0_takeover_raid1(mddev);
654 653
655 printk(KERN_ERR "Takeover from raid%i to raid0 not supported\n", 654 pr_warn("Takeover from raid%i to raid0 not supported\n",
656 mddev->level); 655 mddev->level);
657 656
658 return ERR_PTR(-EINVAL); 657 return ERR_PTR(-EINVAL);