Skip to content

Commit bdc04e6

Browse files
committed
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>
1 parent db298e1 commit bdc04e6

2 files changed

Lines changed: 0 additions & 84 deletions

File tree

‎drivers/md/raid0.c‎

Lines changed: 0 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -528,33 +528,6 @@ static int raid0_make_request(mddev_t *mddev, struct bio *bio)
528528

529529
static void raid0_status(struct seq_file *seq, mddev_t *mddev)
530530
{
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
558531
seq_printf(seq, " %dk chunks", mddev->chunk_sectors / 2);
559532
return;
560533
}

‎drivers/md/raid5.c‎

Lines changed: 0 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -93,20 +93,6 @@ static inline struct bio *r5_next_bio(struct bio *bio, sector_t sector)
9393
else
9494
return NULL;
9595
}
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
11096

11197
/*
11298
* 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)
262248
pr_debug("insert_hash(), stripe %llu\n",
263249
(unsigned long long)sh->sector);
264250

265-
CHECK_DEVLOCK();
266251
hlist_add_head(&sh->hash, hp);
267252
}
268253

@@ -273,7 +258,6 @@ static struct stripe_head *get_free_stripe(raid5_conf_t *conf)
273258
struct stripe_head *sh = NULL;
274259
struct list_head *first;
275260

276-
CHECK_DEVLOCK();
277261
if (list_empty(&conf->inactive_list))
278262
goto out;
279263
first = conf->inactive_list.next;
@@ -329,7 +313,6 @@ static void init_stripe(struct stripe_head *sh, sector_t sector, int previous)
329313
BUG_ON(test_bit(STRIPE_HANDLE, &sh->state));
330314
BUG_ON(stripe_operations_active(sh));
331315

332-
CHECK_DEVLOCK();
333316
pr_debug("init_stripe called, stripe %llu\n",
334317
(unsigned long long)sh->sector);
335318

@@ -365,7 +348,6 @@ static struct stripe_head *__find_stripe(raid5_conf_t *conf, sector_t sector,
365348
struct stripe_head *sh;
366349
struct hlist_node *hn;
367350

368-
CHECK_DEVLOCK();
369351
pr_debug("__find_stripe, sector %llu\n", (unsigned long long)sector);
370352
hlist_for_each_entry(sh, hn, stripe_hash(conf, sector), hash)
371353
if (sh->sector == sector && sh->generation == generation)
@@ -4973,41 +4955,6 @@ static int stop(mddev_t *mddev)
49734955
return 0;
49744956
}
49754957

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-
50114958
static void status(struct seq_file *seq, mddev_t *mddev)
50124959
{
50134960
raid5_conf_t *conf = mddev->private;
@@ -5021,10 +4968,6 @@ static void status(struct seq_file *seq, mddev_t *mddev)
50214968
conf->disks[i].rdev &&
50224969
test_bit(In_sync, &conf->disks[i].rdev->flags) ? "U" : "_");
50234970
seq_printf (seq, "]");
5024-
#ifdef DEBUG
5025-
seq_printf (seq, "\n");
5026-
printall(seq, conf);
5027-
#endif
50284971
}
50294972

50304973
static void print_raid5_conf (raid5_conf_t *conf)

0 commit comments

Comments
 (0)