linux-raid.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Andre Noll <maan@systemlinux.org>
To: neilb@suse.de
Cc: raziebe@gmail.com, linux-raid@vger.kernel.org,
	Andre Noll <maan@systemlinux.org>
Subject: [PATCH] md: raid0: Remove hash table.
Date: Thu, 14 May 2009 12:43:49 +0200	[thread overview]
Message-ID: <1242297833-13908-3-git-send-email-maan@systemlinux.org> (raw)
In-Reply-To: <1242297833-13908-1-git-send-email-maan@systemlinux.org>

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>
---
 drivers/md/raid0.c |   12 ------------
 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 9fd3c3c..6bae90c 100644
--- a/drivers/md/raid0.c
+++ b/drivers/md/raid0.c
@@ -330,22 +330,14 @@ static int raid0_run (mddev_t *mddev)
 		nb_zone = s + round;
 	}
 	printk(KERN_INFO "raid0 : nb_zone is %d.\n", nb_zone);
-
-	printk(KERN_INFO "raid0 : Allocating %zu bytes for hash.\n",
-				nb_zone*sizeof(struct strip_zone*));
-	conf->hash_table = kmalloc (sizeof (struct strip_zone *)*nb_zone, GFP_KERNEL);
-	if (!conf->hash_table)
-		goto out_free_conf;
 	sectors = conf->strip_zone[cur].sectors;
 
-	conf->hash_table[0] = conf->strip_zone + cur;
 	for (i=1; i< nb_zone; i++) {
 		while (sectors <= conf->spacing) {
 			cur++;
 			sectors += conf->strip_zone[cur].sectors;
 		}
 		sectors -= conf->spacing;
-		conf->hash_table[i] = conf->strip_zone + cur;
 	}
 	if (conf->sector_shift) {
 		conf->spacing >>= conf->sector_shift;
@@ -388,8 +380,6 @@ static int raid0_stop (mddev_t *mddev)
 	raid0_conf_t *conf = mddev_to_conf(mddev);
 
 	blk_sync_queue(mddev->queue); /* the unplug fn references 'conf'*/
-	kfree(conf->hash_table);
-	conf->hash_table = NULL;
 	kfree(conf->strip_zone);
 	conf->strip_zone = NULL;
 	kfree(conf);
@@ -502,8 +492,6 @@ static void raid0_status (struct seq_file *seq, mddev_t *mddev)
 	h = 0;
 	for (j = 0; j < conf->nr_strip_zones; j++) {
 		seq_printf(seq, "      z%d", j);
-		if (conf->hash_table[h] == conf->strip_zone+j)
-			seq_printf(seq, "(h%d)", h++);
 		seq_printf(seq, "=[");
 		for (k = 0; k < conf->strip_zone[j].nb_dev; k++)
 			seq_printf(seq, "%s/", bdevname(
diff --git a/drivers/md/raid0.h b/drivers/md/raid0.h
index 824b12e..aac3613 100644
--- a/drivers/md/raid0.h
+++ b/drivers/md/raid0.h
@@ -12,7 +12,6 @@ struct strip_zone
 
 struct raid0_private_data
 {
-	struct strip_zone **hash_table; /* Table of indexes into strip_zone */
 	struct strip_zone *strip_zone;
 	mdk_rdev_t **devlist; /* lists of rdevs, pointed to by strip_zone->dev */
 	int nr_strip_zones;
-- 
1.5.4.3


  parent reply	other threads:[~2009-05-14 10:43 UTC|newest]

Thread overview: 39+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-05-14 10:43 [PATCH 0/6] md: Remove the hash tables from raid0 Andre Noll
2009-05-14 10:43 ` [PATCH] md: raid0: Replace hash table lookup by looping over all strip_zones Andre Noll
2009-05-14 11:15   ` SandeepKsinha
2009-05-14 11:15   ` NeilBrown
2009-05-14 12:10     ` Andre Noll
2009-05-14 12:25       ` NeilBrown
2009-05-14 12:54         ` Sujit Karataparambil
2009-05-14 15:00           ` SandeepKsinha
2009-05-14 15:58         ` PATCH md [001:002]: raid0: fix chunk size to 4K*n granularity raz ben yehuda
2009-05-14 14:07           ` Andre Noll
2009-05-14 22:35           ` Neil Brown
2009-05-18 22:58             ` raz ben yehuda
2009-05-14 16:00         ` Subject: PATCH[002:002] md: raid0: dump raid configuration raz ben yehuda
2009-05-14 17:12         ` Subject: [PATCH] mdadm: raid0: support chunks of 4K*n for raid0 raz ben yehuda
2009-05-15  3:59           ` Sujit Karataparambil
2009-05-15  6:01             ` Raz
2009-05-15  6:45               ` Sujit Karataparambil
2009-05-15  8:39                 ` NeilBrown
2009-05-15 15:45                   ` Raz
2009-05-14 12:22     ` [PATCH] md: raid0: Replace hash table lookup by looping over all strip_zones Neil Brown
2009-05-14 15:51       ` raz ben yehuda
2009-05-14 20:38         ` NeilBrown
2009-05-15 13:18           ` Andre Noll
2009-05-15 17:30         ` Andre Noll
2009-05-15 21:19           ` Raz
2009-05-18  8:21             ` Andre Noll
2009-05-14 12:01   ` SandeepKsinha
2009-05-14 12:15     ` SandeepKsinha
2009-05-14 14:13   ` raz ben yehuda
2009-05-14 10:43 ` Andre Noll [this message]
2009-05-14 10:43 ` [PATCH] md: raid0: Remove hash spacing and sector shift Andre Noll
2009-05-14 10:43 ` [PATCH] md: raid0: Make raid0_run() return a proper error code Andre Noll
2009-05-14 11:21   ` NeilBrown
2009-05-14 11:42     ` Andre Noll
2009-05-14 10:43 ` [PATCH] md: raid0: Kfree() strip_zone and devlist in create_strip_zones() Andre Noll
2009-05-14 10:43 ` [PATCH] md: raid0: Simplify raid0_run() Andre Noll
2009-05-14 11:43   ` SandeepKsinha
2009-05-14 12:06     ` NeilBrown
2009-05-14 14:03   ` raz ben yehuda

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1242297833-13908-3-git-send-email-maan@systemlinux.org \
    --to=maan@systemlinux.org \
    --cc=linux-raid@vger.kernel.org \
    --cc=neilb@suse.de \
    --cc=raziebe@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).