summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorNeil Brown <neilb@cse.unsw.edu.au>2003-05-26 07:05:15 -0700
committerLinus Torvalds <torvalds@home.transmeta.com>2003-05-26 07:05:15 -0700
commit30a92b274f0ddc0331989c00deb0485eb9123c1a (patch)
treeed3e03c828c77dff430019f91313d9b28ed37b53 /include
parent8d9387d17bfed7427a188eb103a8d78d8c9d0f5b (diff)
[PATCH] md: Improve raid0 mapping code to simplify and reduce mem usage.
To cope with a raid0 array with differing sized devices, raid0 divides an array into "strip zones". The first zone covers the start of all devices, upto an offset equal to the size of the smallest device. The second strip zone covers the remaining devices upto the size of the next smallest size, etc. In order to determing which strip zone a given address is in, the array is logically divided into slices the size of the smallest zone, and a 'hash' table is created listing the first and, if relevant, second zone in each slice. As the smallest slice can be very small (imagine an array with a 76G drive and a 75.5G drive) this hash table can be rather large. With this patch, we limit the size of the hash table to one page, at the possible cost of making several probes into the zone list before we find the correct zone. We also cope with the possibility that a zone could be larger than a 32bit sector address would allow.
Diffstat (limited to 'include')
-rw-r--r--include/linux/raid/raid0.h14
1 files changed, 5 insertions, 9 deletions
diff --git a/include/linux/raid/raid0.h b/include/linux/raid/raid0.h
index c2d5dcd52fab..470033aa1c8b 100644
--- a/include/linux/raid/raid0.h
+++ b/include/linux/raid/raid0.h
@@ -12,18 +12,14 @@ struct strip_zone
mdk_rdev_t *dev[MD_SB_DISKS]; /* Devices attached to the zone */
};
-struct raid0_hash
-{
- struct strip_zone *zone0, *zone1;
-};
-
struct raid0_private_data
{
- struct raid0_hash *hash_table; /* Dynamically allocated */
- struct strip_zone *strip_zone; /* This one too */
+ struct strip_zone **hash_table; /* Table of indexes into strip_zone */
+ struct strip_zone *strip_zone;
int nr_strip_zones;
- struct strip_zone *smallest;
- int nr_zones;
+
+ sector_t hash_spacing;
+ int preshift; /* shift this before divide by hash_spacing */
};
typedef struct raid0_private_data raid0_conf_t;