diff options
author | Andre Noll <maan@systemlinux.org> | 2009-06-16 02:46:48 -0400 |
---|---|---|
committer | NeilBrown <neilb@suse.de> | 2009-06-16 02:46:48 -0400 |
commit | 09770e0b6ee649313611a2d6a9b44f456072dbd6 (patch) | |
tree | 5387e43652ea177341a1b2029747d827363e3a9d /drivers/md | |
parent | d27a43abd7be0ab4b2337e4587feca8c7340e5f9 (diff) |
md: raid0: Remove hash table.
The raid0 hash table has become unused due to the changes in the
previous patch. This patch removes the hash table allocation and
setup code and kills the hash_table field of struct raid0_private_data.
Signed-off-by: Andre Noll <maan@systemlinux.org>
Signed-off-by: NeilBrown <neilb@suse.de>
Diffstat (limited to 'drivers/md')
-rw-r--r-- | drivers/md/raid0.c | 12 | ||||
-rw-r--r-- | drivers/md/raid0.h | 1 |
2 files changed, 0 insertions, 13 deletions
diff --git a/drivers/md/raid0.c b/drivers/md/raid0.c index 1afdfd120bba..d4c9c5d5d7f5 100644 --- a/drivers/md/raid0.c +++ b/drivers/md/raid0.c | |||
@@ -326,22 +326,14 @@ static int raid0_run (mddev_t *mddev) | |||
326 | nb_zone = s + round; | 326 | nb_zone = s + round; |
327 | } | 327 | } |
328 | printk(KERN_INFO "raid0 : nb_zone is %d.\n", nb_zone); | 328 | printk(KERN_INFO "raid0 : nb_zone is %d.\n", nb_zone); |
329 | |||
330 | printk(KERN_INFO "raid0 : Allocating %zu bytes for hash.\n", | ||
331 | nb_zone*sizeof(struct strip_zone*)); | ||
332 | conf->hash_table = kmalloc (sizeof (struct strip_zone *)*nb_zone, GFP_KERNEL); | ||
333 | if (!conf->hash_table) | ||
334 | goto out_free_conf; | ||
335 | sectors = conf->strip_zone[cur].sectors; | 329 | sectors = conf->strip_zone[cur].sectors; |
336 | 330 | ||
337 | conf->hash_table[0] = conf->strip_zone + cur; | ||
338 | for (i=1; i< nb_zone; i++) { | 331 | for (i=1; i< nb_zone; i++) { |
339 | while (sectors <= conf->spacing) { | 332 | while (sectors <= conf->spacing) { |
340 | cur++; | 333 | cur++; |
341 | sectors += conf->strip_zone[cur].sectors; | 334 | sectors += conf->strip_zone[cur].sectors; |
342 | } | 335 | } |
343 | sectors -= conf->spacing; | 336 | sectors -= conf->spacing; |
344 | conf->hash_table[i] = conf->strip_zone + cur; | ||
345 | } | 337 | } |
346 | if (conf->sector_shift) { | 338 | if (conf->sector_shift) { |
347 | conf->spacing >>= conf->sector_shift; | 339 | conf->spacing >>= conf->sector_shift; |
@@ -384,8 +376,6 @@ static int raid0_stop (mddev_t *mddev) | |||
384 | raid0_conf_t *conf = mddev_to_conf(mddev); | 376 | raid0_conf_t *conf = mddev_to_conf(mddev); |
385 | 377 | ||
386 | blk_sync_queue(mddev->queue); /* the unplug fn references 'conf'*/ | 378 | blk_sync_queue(mddev->queue); /* the unplug fn references 'conf'*/ |
387 | kfree(conf->hash_table); | ||
388 | conf->hash_table = NULL; | ||
389 | kfree(conf->strip_zone); | 379 | kfree(conf->strip_zone); |
390 | conf->strip_zone = NULL; | 380 | conf->strip_zone = NULL; |
391 | kfree(conf); | 381 | kfree(conf); |
@@ -494,8 +484,6 @@ static void raid0_status (struct seq_file *seq, mddev_t *mddev) | |||
494 | h = 0; | 484 | h = 0; |
495 | for (j = 0; j < conf->nr_strip_zones; j++) { | 485 | for (j = 0; j < conf->nr_strip_zones; j++) { |
496 | seq_printf(seq, " z%d", j); | 486 | seq_printf(seq, " z%d", j); |
497 | if (conf->hash_table[h] == conf->strip_zone+j) | ||
498 | seq_printf(seq, "(h%d)", h++); | ||
499 | seq_printf(seq, "=["); | 487 | seq_printf(seq, "=["); |
500 | for (k = 0; k < conf->strip_zone[j].nb_dev; k++) | 488 | for (k = 0; k < conf->strip_zone[j].nb_dev; k++) |
501 | seq_printf(seq, "%s/", bdevname( | 489 | seq_printf(seq, "%s/", bdevname( |
diff --git a/drivers/md/raid0.h b/drivers/md/raid0.h index 556666fec3a5..a14630a25aa4 100644 --- a/drivers/md/raid0.h +++ b/drivers/md/raid0.h | |||
@@ -12,7 +12,6 @@ struct strip_zone | |||
12 | 12 | ||
13 | struct raid0_private_data | 13 | struct raid0_private_data |
14 | { | 14 | { |
15 | struct strip_zone **hash_table; /* Table of indexes into strip_zone */ | ||
16 | struct strip_zone *strip_zone; | 15 | struct strip_zone *strip_zone; |
17 | mdk_rdev_t **devlist; /* lists of rdevs, pointed to by strip_zone->dev */ | 16 | mdk_rdev_t **devlist; /* lists of rdevs, pointed to by strip_zone->dev */ |
18 | int nr_strip_zones; | 17 | int nr_strip_zones; |