]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/md/linear.c
md: move md_k.h from include/linux/raid/ to drivers/md/
[linux-2.6-omap-h63xx.git] / drivers / md / linear.c
index 1e3aea9eecf18009f4ff0bc2e4c474914e1bcf74..f2488343ed4a857dbad8b9cda30bd5724a33c8d4 100644 (file)
    Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.  
 */
 
-#include <linux/raid/linear.h>
+#include <linux/blkdev.h>
+#include <linux/raid/md_u.h>
+#include <linux/seq_file.h>
+#include "md.h"
+#include "linear.h"
 
 /*
  * find which device holds a particular offset 
@@ -25,13 +29,13 @@ static inline dev_info_t *which_dev(mddev_t *mddev, sector_t sector)
 {
        dev_info_t *hash;
        linear_conf_t *conf = mddev_to_conf(mddev);
+       sector_t idx = sector >> conf->sector_shift;
 
        /*
         * sector_div(a,b) returns the remainer and sets a to a/b
         */
-       sector >>= conf->sector_shift;
-       (void)sector_div(sector, conf->spacing);
-       hash = conf->hash_table[sector];
+       (void)sector_div(idx, conf->spacing);
+       hash = conf->hash_table[idx];
 
        while (sector >= hash->num_sectors + hash->start_sector)
                hash++;