aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/md/raid10.c
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@infradead.org>2011-09-12 06:12:01 -0400
committerJens Axboe <jaxboe@fusionio.com>2011-09-12 06:12:01 -0400
commit5a7bbad27a410350e64a2d7f5ec18fc73836c14f (patch)
tree3447cd62dbcbd77b4071e2eb7576f1d7632ef2d3 /drivers/md/raid10.c
parentc20e8de27fef9f59869c81c288ad6cf28200e00c (diff)
block: remove support for bio remapping from ->make_request
There is very little benefit in allowing to let a ->make_request instance update the bios device and sector and loop around it in __generic_make_request when we can archive the same through calling generic_make_request from the driver and letting the loop in generic_make_request handle it. Note that various drivers got the return value from ->make_request and returned non-zero values for errors. Signed-off-by: Christoph Hellwig <hch@lst.de> Acked-by: NeilBrown <neilb@suse.de> Signed-off-by: Jens Axboe <jaxboe@fusionio.com>
Diffstat (limited to 'drivers/md/raid10.c')
-rw-r--r--drivers/md/raid10.c19
1 files changed, 8 insertions, 11 deletions
diff --git a/drivers/md/raid10.c b/drivers/md/raid10.c
index 8b29cd4f01c8..04b625e1cb60 100644
--- a/drivers/md/raid10.c
+++ b/drivers/md/raid10.c
@@ -825,7 +825,7 @@ static void unfreeze_array(conf_t *conf)
825 spin_unlock_irq(&conf->resync_lock); 825 spin_unlock_irq(&conf->resync_lock);
826} 826}
827 827
828static int make_request(mddev_t *mddev, struct bio * bio) 828static void make_request(mddev_t *mddev, struct bio * bio)
829{ 829{
830 conf_t *conf = mddev->private; 830 conf_t *conf = mddev->private;
831 mirror_info_t *mirror; 831 mirror_info_t *mirror;
@@ -844,7 +844,7 @@ static int make_request(mddev_t *mddev, struct bio * bio)
844 844
845 if (unlikely(bio->bi_rw & REQ_FLUSH)) { 845 if (unlikely(bio->bi_rw & REQ_FLUSH)) {
846 md_flush_request(mddev, bio); 846 md_flush_request(mddev, bio);
847 return 0; 847 return;
848 } 848 }
849 849
850 /* If this request crosses a chunk boundary, we need to 850 /* If this request crosses a chunk boundary, we need to
@@ -876,10 +876,8 @@ static int make_request(mddev_t *mddev, struct bio * bio)
876 conf->nr_waiting++; 876 conf->nr_waiting++;
877 spin_unlock_irq(&conf->resync_lock); 877 spin_unlock_irq(&conf->resync_lock);
878 878
879 if (make_request(mddev, &bp->bio1)) 879 make_request(mddev, &bp->bio1);
880 generic_make_request(&bp->bio1); 880 make_request(mddev, &bp->bio2);
881 if (make_request(mddev, &bp->bio2))
882 generic_make_request(&bp->bio2);
883 881
884 spin_lock_irq(&conf->resync_lock); 882 spin_lock_irq(&conf->resync_lock);
885 conf->nr_waiting--; 883 conf->nr_waiting--;
@@ -887,14 +885,14 @@ static int make_request(mddev_t *mddev, struct bio * bio)
887 spin_unlock_irq(&conf->resync_lock); 885 spin_unlock_irq(&conf->resync_lock);
888 886
889 bio_pair_release(bp); 887 bio_pair_release(bp);
890 return 0; 888 return;
891 bad_map: 889 bad_map:
892 printk("md/raid10:%s: make_request bug: can't convert block across chunks" 890 printk("md/raid10:%s: make_request bug: can't convert block across chunks"
893 " or bigger than %dk %llu %d\n", mdname(mddev), chunk_sects/2, 891 " or bigger than %dk %llu %d\n", mdname(mddev), chunk_sects/2,
894 (unsigned long long)bio->bi_sector, bio->bi_size >> 10); 892 (unsigned long long)bio->bi_sector, bio->bi_size >> 10);
895 893
896 bio_io_error(bio); 894 bio_io_error(bio);
897 return 0; 895 return;
898 } 896 }
899 897
900 md_write_start(mddev, bio); 898 md_write_start(mddev, bio);
@@ -937,7 +935,7 @@ read_again:
937 slot = r10_bio->read_slot; 935 slot = r10_bio->read_slot;
938 if (disk < 0) { 936 if (disk < 0) {
939 raid_end_bio_io(r10_bio); 937 raid_end_bio_io(r10_bio);
940 return 0; 938 return;
941 } 939 }
942 mirror = conf->mirrors + disk; 940 mirror = conf->mirrors + disk;
943 941
@@ -985,7 +983,7 @@ read_again:
985 goto read_again; 983 goto read_again;
986 } else 984 } else
987 generic_make_request(read_bio); 985 generic_make_request(read_bio);
988 return 0; 986 return;
989 } 987 }
990 988
991 /* 989 /*
@@ -1157,7 +1155,6 @@ retry_write:
1157 1155
1158 if (do_sync || !mddev->bitmap || !plugged) 1156 if (do_sync || !mddev->bitmap || !plugged)
1159 md_wakeup_thread(mddev->thread); 1157 md_wakeup_thread(mddev->thread);
1160 return 0;
1161} 1158}
1162 1159
1163static void status(struct seq_file *seq, mddev_t *mddev) 1160static void status(struct seq_file *seq, mddev_t *mddev)