Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 104284
b: refs/heads/master
c: d6e2215
h: refs/heads/master
v: v3
  • Loading branch information
Andre Noll authored and NeilBrown committed Jul 21, 2008
1 parent 2b819cd commit c4c9997
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 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: f233ea5c9e0d8b95e4283bf6a3436b88f6fd3586
refs/heads/master: d6e2215052810678bc9782fd980b52706fc71f50
16 changes: 8 additions & 8 deletions trunk/drivers/md/linear.c
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ static linear_conf_t *linear_conf(mddev_t *mddev, int raid_disks)
return NULL;

cnt = 0;
conf->array_size = 0;
conf->array_sectors = 0;

rdev_for_each(rdev, tmp, mddev) {
int j = rdev->raid_disk;
Expand All @@ -144,7 +144,7 @@ static linear_conf_t *linear_conf(mddev_t *mddev, int raid_disks)
blk_queue_max_sectors(mddev->queue, PAGE_SIZE>>9);

disk->size = rdev->size;
conf->array_size += rdev->size;
conf->array_sectors += rdev->size * 2;

cnt++;
}
Expand All @@ -153,7 +153,7 @@ static linear_conf_t *linear_conf(mddev_t *mddev, int raid_disks)
goto out;
}

min_spacing = conf->array_size;
min_spacing = conf->array_sectors / 2;
sector_div(min_spacing, PAGE_SIZE/sizeof(struct dev_info *));

/* min_spacing is the minimum spacing that will fit the hash
Expand All @@ -162,7 +162,7 @@ static linear_conf_t *linear_conf(mddev_t *mddev, int raid_disks)
* that is larger than min_spacing as use the size of that as
* the actual spacing
*/
conf->hash_spacing = conf->array_size;
conf->hash_spacing = conf->array_sectors / 2;
for (i=0; i < cnt-1 ; i++) {
sector_t sz = 0;
int j;
Expand Down Expand Up @@ -192,7 +192,7 @@ static linear_conf_t *linear_conf(mddev_t *mddev, int raid_disks)
unsigned round;
unsigned long base;

sz = conf->array_size >> conf->preshift;
sz = conf->array_sectors >> (conf->preshift + 1);
sz += 1; /* force round-up */
base = conf->hash_spacing >> conf->preshift;
round = sector_div(sz, base);
Expand All @@ -219,7 +219,7 @@ static linear_conf_t *linear_conf(mddev_t *mddev, int raid_disks)
curr_offset = 0;
i = 0;
for (curr_offset = 0;
curr_offset < conf->array_size;
curr_offset < conf->array_sectors / 2;
curr_offset += conf->hash_spacing) {

while (i < raid_disks-1 &&
Expand Down Expand Up @@ -256,7 +256,7 @@ static int linear_run (mddev_t *mddev)
if (!conf)
return 1;
mddev->private = conf;
mddev->array_sectors = conf->array_size * 2;
mddev->array_sectors = conf->array_sectors;

blk_queue_merge_bvec(mddev->queue, linear_mergeable_bvec);
mddev->queue->unplug_fn = linear_unplug;
Expand Down Expand Up @@ -290,7 +290,7 @@ static int linear_add(mddev_t *mddev, mdk_rdev_t *rdev)
newconf->prev = mddev_to_conf(mddev);
mddev->private = newconf;
mddev->raid_disks++;
mddev->array_sectors = newconf->array_size * 2;
mddev->array_sectors = newconf->array_sectors;
set_capacity(mddev->gendisk, mddev->array_sectors);
return 0;
}
Expand Down
2 changes: 1 addition & 1 deletion trunk/include/linux/raid/linear.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ struct linear_private_data
struct linear_private_data *prev; /* earlier version */
dev_info_t **hash_table;
sector_t hash_spacing;
sector_t array_size;
sector_t array_sectors;
int preshift; /* shift before dividing by hash_spacing */
dev_info_t disks[0];
};
Expand Down

0 comments on commit c4c9997

Please sign in to comment.