diff options
Diffstat (limited to 'drivers/md/multipath.c')
-rw-r--r-- | drivers/md/multipath.c | 13 |
1 files changed, 2 insertions, 11 deletions
diff --git a/drivers/md/multipath.c b/drivers/md/multipath.c index 789bf535d29c..410fb60699ac 100644 --- a/drivers/md/multipath.c +++ b/drivers/md/multipath.c | |||
@@ -85,7 +85,7 @@ static void multipath_end_bh_io (struct multipath_bh *mp_bh, int err) | |||
85 | static void multipath_end_request(struct bio *bio, int error) | 85 | static void multipath_end_request(struct bio *bio, int error) |
86 | { | 86 | { |
87 | int uptodate = test_bit(BIO_UPTODATE, &bio->bi_flags); | 87 | int uptodate = test_bit(BIO_UPTODATE, &bio->bi_flags); |
88 | struct multipath_bh * mp_bh = (struct multipath_bh *)(bio->bi_private); | 88 | struct multipath_bh *mp_bh = bio->bi_private; |
89 | multipath_conf_t *conf = mp_bh->mddev->private; | 89 | multipath_conf_t *conf = mp_bh->mddev->private; |
90 | mdk_rdev_t *rdev = conf->multipaths[mp_bh->path].rdev; | 90 | mdk_rdev_t *rdev = conf->multipaths[mp_bh->path].rdev; |
91 | 91 | ||
@@ -136,14 +136,11 @@ static void multipath_unplug(struct request_queue *q) | |||
136 | } | 136 | } |
137 | 137 | ||
138 | 138 | ||
139 | static int multipath_make_request (struct request_queue *q, struct bio * bio) | 139 | static int multipath_make_request(mddev_t *mddev, struct bio * bio) |
140 | { | 140 | { |
141 | mddev_t *mddev = q->queuedata; | ||
142 | multipath_conf_t *conf = mddev->private; | 141 | multipath_conf_t *conf = mddev->private; |
143 | struct multipath_bh * mp_bh; | 142 | struct multipath_bh * mp_bh; |
144 | struct multipath_info *multipath; | 143 | struct multipath_info *multipath; |
145 | const int rw = bio_data_dir(bio); | ||
146 | int cpu; | ||
147 | 144 | ||
148 | if (unlikely(bio_rw_flagged(bio, BIO_RW_BARRIER))) { | 145 | if (unlikely(bio_rw_flagged(bio, BIO_RW_BARRIER))) { |
149 | md_barrier_request(mddev, bio); | 146 | md_barrier_request(mddev, bio); |
@@ -155,12 +152,6 @@ static int multipath_make_request (struct request_queue *q, struct bio * bio) | |||
155 | mp_bh->master_bio = bio; | 152 | mp_bh->master_bio = bio; |
156 | mp_bh->mddev = mddev; | 153 | mp_bh->mddev = mddev; |
157 | 154 | ||
158 | cpu = part_stat_lock(); | ||
159 | part_stat_inc(cpu, &mddev->gendisk->part0, ios[rw]); | ||
160 | part_stat_add(cpu, &mddev->gendisk->part0, sectors[rw], | ||
161 | bio_sectors(bio)); | ||
162 | part_stat_unlock(); | ||
163 | |||
164 | mp_bh->path = multipath_map(conf); | 155 | mp_bh->path = multipath_map(conf); |
165 | if (mp_bh->path < 0) { | 156 | if (mp_bh->path < 0) { |
166 | bio_endio(bio, -EIO); | 157 | bio_endio(bio, -EIO); |