[PATCH] md: support md/linear array with components greater than 2 terabytes.

linear currently uses division by the size of the smallest componenet device
to find which device a request goes to.  If that smallest device is larger
than 2 terabytes, then the division will not work on some systems.

So we introduce a pre-shift, and take care not to make the hash table too
large, much like the code in raid0.

Also get rid of conf->nr_zones, which is not needed.

Signed-off-by: Neil Brown <neilb@cse.unsw.edu.au>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
This commit is contained in:
NeilBrown 2005-09-09 16:23:47 -07:00 committed by Linus Torvalds
parent 4b6d287f62
commit 15945fee6f
2 changed files with 69 additions and 32 deletions

View file

@ -14,8 +14,8 @@ typedef struct dev_info dev_info_t;
struct linear_private_data
{
dev_info_t **hash_table;
dev_info_t *smallest;
int nr_zones;
sector_t hash_spacing;
int preshift; /* shift before dividing by hash_spacing */
dev_info_t disks[0];
};