diff options
Diffstat (limited to 'drivers/md/raid0.c')
-rw-r--r-- | drivers/md/raid0.c | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/drivers/md/raid0.c b/drivers/md/raid0.c index 2120710172c5..fece3277c2a5 100644 --- a/drivers/md/raid0.c +++ b/drivers/md/raid0.c @@ -403,15 +403,16 @@ static int raid0_make_request (request_queue_t *q, struct bio *bio) mdk_rdev_t *tmp_dev; unsigned long chunk; sector_t block, rsect; + const int rw = bio_data_dir(bio); - if (bio_data_dir(bio)==WRITE) { - disk_stat_inc(mddev->gendisk, writes); - disk_stat_add(mddev->gendisk, write_sectors, bio_sectors(bio)); - } else { - disk_stat_inc(mddev->gendisk, reads); - disk_stat_add(mddev->gendisk, read_sectors, bio_sectors(bio)); + if (unlikely(bio_barrier(bio))) { + bio_endio(bio, bio->bi_size, -EOPNOTSUPP); + return 0; } + disk_stat_inc(mddev->gendisk, ios[rw]); + disk_stat_add(mddev->gendisk, sectors[rw], bio_sectors(bio)); + chunk_size = mddev->chunk_size >> 10; chunk_sects = mddev->chunk_size >> 9; chunksize_bits = ffz(~chunk_size); |