diff options
author | NeilBrown <neilb@suse.de> | 2011-10-06 23:23:04 -0400 |
---|---|---|
committer | NeilBrown <neilb@suse.de> | 2011-10-06 23:23:04 -0400 |
commit | bdc04e6b15f70a8f96d8cdfe21df159a6466b49a (patch) | |
tree | 23b762d044dafe35ac2fb20214fc1eff77a41bdd /drivers | |
parent | db298e1946c074c83d97f1c959fbc0def2af2c86 (diff) |
md: remove some old DEBUGging code.
This code is not really helpful and is hard to maintain, so just
discard it.
Signed-off-by: NeilBrown <neilb@suse.de>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/md/raid0.c | 27 | ||||
-rw-r--r-- | drivers/md/raid5.c | 57 |
2 files changed, 0 insertions, 84 deletions
diff --git a/drivers/md/raid0.c b/drivers/md/raid0.c index e86bf3682e1e..20823b20bfcf 100644 --- a/drivers/md/raid0.c +++ b/drivers/md/raid0.c | |||
@@ -528,33 +528,6 @@ bad_map: | |||
528 | 528 | ||
529 | static void raid0_status(struct seq_file *seq, mddev_t *mddev) | 529 | static void raid0_status(struct seq_file *seq, mddev_t *mddev) |
530 | { | 530 | { |
531 | #undef MD_DEBUG | ||
532 | #ifdef MD_DEBUG | ||
533 | int j, k, h; | ||
534 | char b[BDEVNAME_SIZE]; | ||
535 | raid0_conf_t *conf = mddev->private; | ||
536 | int raid_disks = conf->strip_zone[0].nb_dev; | ||
537 | |||
538 | sector_t zone_size; | ||
539 | sector_t zone_start = 0; | ||
540 | h = 0; | ||
541 | |||
542 | for (j = 0; j < conf->nr_strip_zones; j++) { | ||
543 | seq_printf(seq, " z%d", j); | ||
544 | seq_printf(seq, "=["); | ||
545 | for (k = 0; k < conf->strip_zone[j].nb_dev; k++) | ||
546 | seq_printf(seq, "%s/", bdevname( | ||
547 | conf->devlist[j*raid_disks + k] | ||
548 | ->bdev, b)); | ||
549 | |||
550 | zone_size = conf->strip_zone[j].zone_end - zone_start; | ||
551 | seq_printf(seq, "] ze=%lld ds=%lld s=%lld\n", | ||
552 | (unsigned long long)zone_start>>1, | ||
553 | (unsigned long long)conf->strip_zone[j].dev_start>>1, | ||
554 | (unsigned long long)zone_size>>1); | ||
555 | zone_start = conf->strip_zone[j].zone_end; | ||
556 | } | ||
557 | #endif | ||
558 | seq_printf(seq, " %dk chunks", mddev->chunk_sectors / 2); | 531 | seq_printf(seq, " %dk chunks", mddev->chunk_sectors / 2); |
559 | return; | 532 | return; |
560 | } | 533 | } |
diff --git a/drivers/md/raid5.c b/drivers/md/raid5.c index 01163c81e740..245946e9e4c9 100644 --- a/drivers/md/raid5.c +++ b/drivers/md/raid5.c | |||
@@ -93,20 +93,6 @@ static inline struct bio *r5_next_bio(struct bio *bio, sector_t sector) | |||
93 | else | 93 | else |
94 | return NULL; | 94 | return NULL; |
95 | } | 95 | } |
96 | /* | ||
97 | * The following can be used to debug the driver | ||
98 | */ | ||
99 | #define RAID5_PARANOIA 1 | ||
100 | #if RAID5_PARANOIA && defined(CONFIG_SMP) | ||
101 | # define CHECK_DEVLOCK() assert_spin_locked(&conf->device_lock) | ||
102 | #else | ||
103 | # define CHECK_DEVLOCK() | ||
104 | #endif | ||
105 | |||
106 | #ifdef DEBUG | ||
107 | #define inline | ||
108 | #define __inline__ | ||
109 | #endif | ||
110 | 96 | ||
111 | /* | 97 | /* |
112 | * We maintain a biased count of active stripes in the bottom 16 bits of | 98 | * We maintain a biased count of active stripes in the bottom 16 bits of |
@@ -262,7 +248,6 @@ static inline void insert_hash(raid5_conf_t *conf, struct stripe_head *sh) | |||
262 | pr_debug("insert_hash(), stripe %llu\n", | 248 | pr_debug("insert_hash(), stripe %llu\n", |
263 | (unsigned long long)sh->sector); | 249 | (unsigned long long)sh->sector); |
264 | 250 | ||
265 | CHECK_DEVLOCK(); | ||
266 | hlist_add_head(&sh->hash, hp); | 251 | hlist_add_head(&sh->hash, hp); |
267 | } | 252 | } |
268 | 253 | ||
@@ -273,7 +258,6 @@ static struct stripe_head *get_free_stripe(raid5_conf_t *conf) | |||
273 | struct stripe_head *sh = NULL; | 258 | struct stripe_head *sh = NULL; |
274 | struct list_head *first; | 259 | struct list_head *first; |
275 | 260 | ||
276 | CHECK_DEVLOCK(); | ||
277 | if (list_empty(&conf->inactive_list)) | 261 | if (list_empty(&conf->inactive_list)) |
278 | goto out; | 262 | goto out; |
279 | first = conf->inactive_list.next; | 263 | first = conf->inactive_list.next; |
@@ -329,7 +313,6 @@ static void init_stripe(struct stripe_head *sh, sector_t sector, int previous) | |||
329 | BUG_ON(test_bit(STRIPE_HANDLE, &sh->state)); | 313 | BUG_ON(test_bit(STRIPE_HANDLE, &sh->state)); |
330 | BUG_ON(stripe_operations_active(sh)); | 314 | BUG_ON(stripe_operations_active(sh)); |
331 | 315 | ||
332 | CHECK_DEVLOCK(); | ||
333 | pr_debug("init_stripe called, stripe %llu\n", | 316 | pr_debug("init_stripe called, stripe %llu\n", |
334 | (unsigned long long)sh->sector); | 317 | (unsigned long long)sh->sector); |
335 | 318 | ||
@@ -365,7 +348,6 @@ static struct stripe_head *__find_stripe(raid5_conf_t *conf, sector_t sector, | |||
365 | struct stripe_head *sh; | 348 | struct stripe_head *sh; |
366 | struct hlist_node *hn; | 349 | struct hlist_node *hn; |
367 | 350 | ||
368 | CHECK_DEVLOCK(); | ||
369 | pr_debug("__find_stripe, sector %llu\n", (unsigned long long)sector); | 351 | pr_debug("__find_stripe, sector %llu\n", (unsigned long long)sector); |
370 | hlist_for_each_entry(sh, hn, stripe_hash(conf, sector), hash) | 352 | hlist_for_each_entry(sh, hn, stripe_hash(conf, sector), hash) |
371 | if (sh->sector == sector && sh->generation == generation) | 353 | if (sh->sector == sector && sh->generation == generation) |
@@ -4973,41 +4955,6 @@ static int stop(mddev_t *mddev) | |||
4973 | return 0; | 4955 | return 0; |
4974 | } | 4956 | } |
4975 | 4957 | ||
4976 | #ifdef DEBUG | ||
4977 | static void print_sh(struct seq_file *seq, struct stripe_head *sh) | ||
4978 | { | ||
4979 | int i; | ||
4980 | |||
4981 | seq_printf(seq, "sh %llu, pd_idx %d, state %ld.\n", | ||
4982 | (unsigned long long)sh->sector, sh->pd_idx, sh->state); | ||
4983 | seq_printf(seq, "sh %llu, count %d.\n", | ||
4984 | (unsigned long long)sh->sector, atomic_read(&sh->count)); | ||
4985 | seq_printf(seq, "sh %llu, ", (unsigned long long)sh->sector); | ||
4986 | for (i = 0; i < sh->disks; i++) { | ||
4987 | seq_printf(seq, "(cache%d: %p %ld) ", | ||
4988 | i, sh->dev[i].page, sh->dev[i].flags); | ||
4989 | } | ||
4990 | seq_printf(seq, "\n"); | ||
4991 | } | ||
4992 | |||
4993 | static void printall(struct seq_file *seq, raid5_conf_t *conf) | ||
4994 | { | ||
4995 | struct stripe_head *sh; | ||
4996 | struct hlist_node *hn; | ||
4997 | int i; | ||
4998 | |||
4999 | spin_lock_irq(&conf->device_lock); | ||
5000 | for (i = 0; i < NR_HASH; i++) { | ||
5001 | hlist_for_each_entry(sh, hn, &conf->stripe_hashtbl[i], hash) { | ||
5002 | if (sh->raid_conf != conf) | ||
5003 | continue; | ||
5004 | print_sh(seq, sh); | ||
5005 | } | ||
5006 | } | ||
5007 | spin_unlock_irq(&conf->device_lock); | ||
5008 | } | ||
5009 | #endif | ||
5010 | |||
5011 | static void status(struct seq_file *seq, mddev_t *mddev) | 4958 | static void status(struct seq_file *seq, mddev_t *mddev) |
5012 | { | 4959 | { |
5013 | raid5_conf_t *conf = mddev->private; | 4960 | raid5_conf_t *conf = mddev->private; |
@@ -5021,10 +4968,6 @@ static void status(struct seq_file *seq, mddev_t *mddev) | |||
5021 | conf->disks[i].rdev && | 4968 | conf->disks[i].rdev && |
5022 | test_bit(In_sync, &conf->disks[i].rdev->flags) ? "U" : "_"); | 4969 | test_bit(In_sync, &conf->disks[i].rdev->flags) ? "U" : "_"); |
5023 | seq_printf (seq, "]"); | 4970 | seq_printf (seq, "]"); |
5024 | #ifdef DEBUG | ||
5025 | seq_printf (seq, "\n"); | ||
5026 | printall(seq, conf); | ||
5027 | #endif | ||
5028 | } | 4971 | } |
5029 | 4972 | ||
5030 | static void print_raid5_conf (raid5_conf_t *conf) | 4973 | static void print_raid5_conf (raid5_conf_t *conf) |