Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 127723
b: refs/heads/master
c: 6b8796c
h: refs/heads/master
i:
  127721: e04cb07
  127719: 5b51249
v: v3
  • Loading branch information
Andre Noll authored and NeilBrown committed Jan 8, 2009
1 parent 3f1b21c commit 7b9edc7
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 15 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 6199d3db0fc34f8ada895879d04a353a6ae632bc
refs/heads/master: 6b8796cc3decb43c7c67a13a0699b6a21b754c78
27 changes: 13 additions & 14 deletions trunk/drivers/md/raid0.c
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ static int raid0_congested(void *data, int bits)
static int create_strip_zones (mddev_t *mddev)
{
int i, c, j;
sector_t current_offset, curr_zone_offset;
sector_t current_start, curr_zone_start;
sector_t min_spacing;
raid0_conf_t *conf = mddev_to_conf(mddev);
mdk_rdev_t *smallest, *rdev1, *rdev2, *rdev;
Expand Down Expand Up @@ -157,8 +157,8 @@ static int create_strip_zones (mddev_t *mddev)
zone->size = smallest->size * cnt;
zone->zone_start = 0;

current_offset = smallest->size;
curr_zone_offset = zone->size;
current_start = smallest->size * 2;
curr_zone_start = zone->size * 2;

/* now do the other zones */
for (i = 1; i < conf->nr_strip_zones; i++)
Expand All @@ -167,16 +167,15 @@ static int create_strip_zones (mddev_t *mddev)
zone->dev = conf->strip_zone[i-1].dev + mddev->raid_disks;

printk("raid0: zone %d\n", i);
zone->dev_start = current_offset * 2;
zone->dev_start = current_start;
smallest = NULL;
c = 0;

for (j=0; j<cnt; j++) {
char b[BDEVNAME_SIZE];
rdev = conf->strip_zone[0].dev[j];
printk("raid0: checking %s ...", bdevname(rdev->bdev,b));
if (rdev->size > current_offset)
{
if (rdev->size > current_start / 2) {
printk(" contained as device %d\n", c);
zone->dev[c] = rdev;
c++;
Expand All @@ -190,16 +189,16 @@ static int create_strip_zones (mddev_t *mddev)
}

zone->nb_dev = c;
zone->size = (smallest->size - current_offset) * c;
zone->size = (smallest->size - current_start / 2) * c;
printk("raid0: zone->nb_dev: %d, size: %llu\n",
zone->nb_dev, (unsigned long long)zone->size);

zone->zone_start = curr_zone_offset * 2;
curr_zone_offset += zone->size;
zone->zone_start = curr_zone_start;
curr_zone_start += zone->size * 2;

current_offset = smallest->size;
printk("raid0: current zone offset: %llu\n",
(unsigned long long)current_offset);
current_start = smallest->size * 2;
printk(KERN_INFO "raid0: current zone start: %llu\n",
(unsigned long long)current_start);
}

/* Now find appropriate hash spacing.
Expand All @@ -210,8 +209,8 @@ static int create_strip_zones (mddev_t *mddev)
* strip though as it's size has no bearing on the efficacy of the hash
* table.
*/
conf->hash_spacing = curr_zone_offset;
min_spacing = curr_zone_offset;
conf->hash_spacing = curr_zone_start / 2;
min_spacing = curr_zone_start / 2;
sector_div(min_spacing, PAGE_SIZE/sizeof(struct strip_zone*));
for (i=0; i < conf->nr_strip_zones-1; i++) {
sector_t sz = 0;
Expand Down

0 comments on commit 7b9edc7

Please sign in to comment.