diff options
author | NeilBrown <neilb@suse.de> | 2011-10-06 23:23:17 -0400 |
---|---|---|
committer | NeilBrown <neilb@suse.de> | 2011-10-06 23:23:17 -0400 |
commit | 36a4e1fe0f454146724c174bf7c1e8e76297a212 (patch) | |
tree | 57f0de83fda98e5ae1b4f66d5e993ca27386a793 /drivers/md/md.c | |
parent | bdc04e6b15f70a8f96d8cdfe21df159a6466b49a (diff) |
md: remove PRINTK and dprintk debugging and use pr_debug
Being able to dynamically enable these make them much more useful.
Signed-off-by: NeilBrown <neilb@suse.de>
Diffstat (limited to 'drivers/md/md.c')
-rw-r--r-- | drivers/md/md.c | 28 |
1 files changed, 11 insertions, 17 deletions
diff --git a/drivers/md/md.c b/drivers/md/md.c index accae4422c06..ca4c283cf462 100644 --- a/drivers/md/md.c +++ b/drivers/md/md.c | |||
@@ -54,9 +54,6 @@ | |||
54 | #include "md.h" | 54 | #include "md.h" |
55 | #include "bitmap.h" | 55 | #include "bitmap.h" |
56 | 56 | ||
57 | #define DEBUG 0 | ||
58 | #define dprintk(x...) ((void)(DEBUG && printk(x))) | ||
59 | |||
60 | #ifndef MODULE | 57 | #ifndef MODULE |
61 | static void autostart_arrays(int part); | 58 | static void autostart_arrays(int part); |
62 | #endif | 59 | #endif |
@@ -2442,27 +2439,23 @@ repeat: | |||
2442 | sync_sbs(mddev, nospares); | 2439 | sync_sbs(mddev, nospares); |
2443 | spin_unlock_irq(&mddev->write_lock); | 2440 | spin_unlock_irq(&mddev->write_lock); |
2444 | 2441 | ||
2445 | dprintk(KERN_INFO | 2442 | pr_debug("md: updating %s RAID superblock on device (in sync %d)\n", |
2446 | "md: updating %s RAID superblock on device (in sync %d)\n", | 2443 | mdname(mddev), mddev->in_sync); |
2447 | mdname(mddev),mddev->in_sync); | ||
2448 | 2444 | ||
2449 | bitmap_update_sb(mddev->bitmap); | 2445 | bitmap_update_sb(mddev->bitmap); |
2450 | list_for_each_entry(rdev, &mddev->disks, same_set) { | 2446 | list_for_each_entry(rdev, &mddev->disks, same_set) { |
2451 | char b[BDEVNAME_SIZE]; | 2447 | char b[BDEVNAME_SIZE]; |
2452 | dprintk(KERN_INFO "md: "); | 2448 | |
2453 | if (rdev->sb_loaded != 1) | 2449 | if (rdev->sb_loaded != 1) |
2454 | continue; /* no noise on spare devices */ | 2450 | continue; /* no noise on spare devices */ |
2455 | if (test_bit(Faulty, &rdev->flags)) | ||
2456 | dprintk("(skipping faulty "); | ||
2457 | 2451 | ||
2458 | dprintk("%s ", bdevname(rdev->bdev,b)); | ||
2459 | if (!test_bit(Faulty, &rdev->flags)) { | 2452 | if (!test_bit(Faulty, &rdev->flags)) { |
2460 | md_super_write(mddev,rdev, | 2453 | md_super_write(mddev,rdev, |
2461 | rdev->sb_start, rdev->sb_size, | 2454 | rdev->sb_start, rdev->sb_size, |
2462 | rdev->sb_page); | 2455 | rdev->sb_page); |
2463 | dprintk(KERN_INFO "(write) %s's sb offset: %llu\n", | 2456 | pr_debug("md: (write) %s's sb offset: %llu\n", |
2464 | bdevname(rdev->bdev,b), | 2457 | bdevname(rdev->bdev, b), |
2465 | (unsigned long long)rdev->sb_start); | 2458 | (unsigned long long)rdev->sb_start); |
2466 | rdev->sb_events = mddev->events; | 2459 | rdev->sb_events = mddev->events; |
2467 | if (rdev->badblocks.size) { | 2460 | if (rdev->badblocks.size) { |
2468 | md_super_write(mddev, rdev, | 2461 | md_super_write(mddev, rdev, |
@@ -2473,7 +2466,8 @@ repeat: | |||
2473 | } | 2466 | } |
2474 | 2467 | ||
2475 | } else | 2468 | } else |
2476 | dprintk(")\n"); | 2469 | pr_debug("md: %s (skipping faulty)\n", |
2470 | bdevname(rdev->bdev, b)); | ||
2477 | if (mddev->level == LEVEL_MULTIPATH) | 2471 | if (mddev->level == LEVEL_MULTIPATH) |
2478 | /* only need to write one superblock... */ | 2472 | /* only need to write one superblock... */ |
2479 | break; | 2473 | break; |
@@ -6408,7 +6402,7 @@ static int md_thread(void * arg) | |||
6408 | void md_wakeup_thread(mdk_thread_t *thread) | 6402 | void md_wakeup_thread(mdk_thread_t *thread) |
6409 | { | 6403 | { |
6410 | if (thread) { | 6404 | if (thread) { |
6411 | dprintk("md: waking up MD thread %s.\n", thread->tsk->comm); | 6405 | pr_debug("md: waking up MD thread %s.\n", thread->tsk->comm); |
6412 | set_bit(THREAD_WAKEUP, &thread->flags); | 6406 | set_bit(THREAD_WAKEUP, &thread->flags); |
6413 | wake_up(&thread->wqueue); | 6407 | wake_up(&thread->wqueue); |
6414 | } | 6408 | } |
@@ -6444,7 +6438,7 @@ void md_unregister_thread(mdk_thread_t **threadp) | |||
6444 | mdk_thread_t *thread = *threadp; | 6438 | mdk_thread_t *thread = *threadp; |
6445 | if (!thread) | 6439 | if (!thread) |
6446 | return; | 6440 | return; |
6447 | dprintk("interrupting MD-thread pid %d\n", task_pid_nr(thread->tsk)); | 6441 | pr_debug("interrupting MD-thread pid %d\n", task_pid_nr(thread->tsk)); |
6448 | /* Locking ensures that mddev_unlock does not wake_up a | 6442 | /* Locking ensures that mddev_unlock does not wake_up a |
6449 | * non-existent thread | 6443 | * non-existent thread |
6450 | */ | 6444 | */ |
@@ -8112,7 +8106,7 @@ static struct notifier_block md_notifier = { | |||
8112 | 8106 | ||
8113 | static void md_geninit(void) | 8107 | static void md_geninit(void) |
8114 | { | 8108 | { |
8115 | dprintk("md: sizeof(mdp_super_t) = %d\n", (int)sizeof(mdp_super_t)); | 8109 | pr_debug("md: sizeof(mdp_super_t) = %d\n", (int)sizeof(mdp_super_t)); |
8116 | 8110 | ||
8117 | proc_create("mdstat", S_IRUGO, NULL, &md_seq_fops); | 8111 | proc_create("mdstat", S_IRUGO, NULL, &md_seq_fops); |
8118 | } | 8112 | } |