• Neil Brown's avatar
    [PATCH] md: Improve raid0 mapping code to simplify and reduce mem usage. · 30a92b27
    Neil Brown authored
    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.
    30a92b27
raid0.c 11.1 KB