diff options
Diffstat (limited to 'drivers/md/linear.c')
-rw-r--r-- | drivers/md/linear.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/md/linear.c b/drivers/md/linear.c index 1e3aea9eecf1..09658b218474 100644 --- a/drivers/md/linear.c +++ b/drivers/md/linear.c | |||
@@ -25,13 +25,13 @@ static inline dev_info_t *which_dev(mddev_t *mddev, sector_t sector) | |||
25 | { | 25 | { |
26 | dev_info_t *hash; | 26 | dev_info_t *hash; |
27 | linear_conf_t *conf = mddev_to_conf(mddev); | 27 | linear_conf_t *conf = mddev_to_conf(mddev); |
28 | sector_t idx = sector >> conf->sector_shift; | ||
28 | 29 | ||
29 | /* | 30 | /* |
30 | * sector_div(a,b) returns the remainer and sets a to a/b | 31 | * sector_div(a,b) returns the remainer and sets a to a/b |
31 | */ | 32 | */ |
32 | sector >>= conf->sector_shift; | 33 | (void)sector_div(idx, conf->spacing); |
33 | (void)sector_div(sector, conf->spacing); | 34 | hash = conf->hash_table[idx]; |
34 | hash = conf->hash_table[sector]; | ||
35 | 35 | ||
36 | while (sector >= hash->num_sectors + hash->start_sector) | 36 | while (sector >= hash->num_sectors + hash->start_sector) |
37 | hash++; | 37 | hash++; |