]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/md/raid0.c
[PATCH] md: add information about superblock version to /proc/mdstat
[linux-2.6-omap-h63xx.git] / drivers / md / raid0.c
index e11dd14d0b43f4700f7a9779a0ed6d7676461aa4..f6757259ce7fe3f8ced8b05553f2cf52c25e6dbb 100644 (file)
@@ -314,16 +314,16 @@ static int raid0_run (mddev_t *mddev)
                sector_t space = conf->hash_spacing;
                int round;
                conf->preshift = 0;
-               if (sizeof(sector_t) > sizeof(unsigned long)) {
+               if (sizeof(sector_t) > sizeof(u32)) {
                        /*shift down space and s so that sector_div will work */
-                       while (space > (sector_t) (~(unsigned long)0)) {
+                       while (space > (sector_t) (~(u32)0)) {
                                s >>= 1;
                                space >>= 1;
                                s += 1; /* force round-up */
                                conf->preshift++;
                        }
                }
-               round = sector_div(s, (unsigned long)space) ? 1 : 0;
+               round = sector_div(s, (u32)space) ? 1 : 0;
                nb_zone = s + round;
        }
        printk("raid0 : nb_zone is %d.\n", nb_zone);
@@ -404,6 +404,11 @@ static int raid0_make_request (request_queue_t *q, struct bio *bio)
        unsigned long chunk;
        sector_t block, rsect;
 
+       if (unlikely(bio_barrier(bio))) {
+               bio_endio(bio, bio->bi_size, -EOPNOTSUPP);
+               return 0;
+       }
+
        if (bio_data_dir(bio)==WRITE) {
                disk_stat_inc(mddev->gendisk, writes);
                disk_stat_add(mddev->gendisk, write_sectors, bio_sectors(bio));
@@ -443,7 +448,7 @@ static int raid0_make_request (request_queue_t *q, struct bio *bio)
                volatile
 #endif
                sector_t x = block >> conf->preshift;
-               sector_div(x, (unsigned long)conf->hash_spacing);
+               sector_div(x, (u32)conf->hash_spacing);
                zone = conf->hash_table[x];
        }