aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/md/raid10.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/md/raid10.c')
-rw-r--r--drivers/md/raid10.c31
1 files changed, 8 insertions, 23 deletions
diff --git a/drivers/md/raid10.c b/drivers/md/raid10.c
index 4e53792aa520..25a96c42bdb0 100644
--- a/drivers/md/raid10.c
+++ b/drivers/md/raid10.c
@@ -227,7 +227,7 @@ static void raid_end_bio_io(r10bio_t *r10_bio)
227{ 227{
228 struct bio *bio = r10_bio->master_bio; 228 struct bio *bio = r10_bio->master_bio;
229 229
230 bio_endio(bio, bio->bi_size, 230 bio_endio(bio,
231 test_bit(R10BIO_Uptodate, &r10_bio->state) ? 0 : -EIO); 231 test_bit(R10BIO_Uptodate, &r10_bio->state) ? 0 : -EIO);
232 free_r10bio(r10_bio); 232 free_r10bio(r10_bio);
233} 233}
@@ -243,15 +243,13 @@ static inline void update_head_pos(int slot, r10bio_t *r10_bio)
243 r10_bio->devs[slot].addr + (r10_bio->sectors); 243 r10_bio->devs[slot].addr + (r10_bio->sectors);
244} 244}
245 245
246static int raid10_end_read_request(struct bio *bio, unsigned int bytes_done, int error) 246static void raid10_end_read_request(struct bio *bio, int error)
247{ 247{
248 int uptodate = test_bit(BIO_UPTODATE, &bio->bi_flags); 248 int uptodate = test_bit(BIO_UPTODATE, &bio->bi_flags);
249 r10bio_t * r10_bio = (r10bio_t *)(bio->bi_private); 249 r10bio_t * r10_bio = (r10bio_t *)(bio->bi_private);
250 int slot, dev; 250 int slot, dev;
251 conf_t *conf = mddev_to_conf(r10_bio->mddev); 251 conf_t *conf = mddev_to_conf(r10_bio->mddev);
252 252
253 if (bio->bi_size)
254 return 1;
255 253
256 slot = r10_bio->read_slot; 254 slot = r10_bio->read_slot;
257 dev = r10_bio->devs[slot].devnum; 255 dev = r10_bio->devs[slot].devnum;
@@ -284,19 +282,15 @@ static int raid10_end_read_request(struct bio *bio, unsigned int bytes_done, int
284 } 282 }
285 283
286 rdev_dec_pending(conf->mirrors[dev].rdev, conf->mddev); 284 rdev_dec_pending(conf->mirrors[dev].rdev, conf->mddev);
287 return 0;
288} 285}
289 286
290static int raid10_end_write_request(struct bio *bio, unsigned int bytes_done, int error) 287static void raid10_end_write_request(struct bio *bio, int error)
291{ 288{
292 int uptodate = test_bit(BIO_UPTODATE, &bio->bi_flags); 289 int uptodate = test_bit(BIO_UPTODATE, &bio->bi_flags);
293 r10bio_t * r10_bio = (r10bio_t *)(bio->bi_private); 290 r10bio_t * r10_bio = (r10bio_t *)(bio->bi_private);
294 int slot, dev; 291 int slot, dev;
295 conf_t *conf = mddev_to_conf(r10_bio->mddev); 292 conf_t *conf = mddev_to_conf(r10_bio->mddev);
296 293
297 if (bio->bi_size)
298 return 1;
299
300 for (slot = 0; slot < conf->copies; slot++) 294 for (slot = 0; slot < conf->copies; slot++)
301 if (r10_bio->devs[slot].bio == bio) 295 if (r10_bio->devs[slot].bio == bio)
302 break; 296 break;
@@ -339,7 +333,6 @@ static int raid10_end_write_request(struct bio *bio, unsigned int bytes_done, in
339 } 333 }
340 334
341 rdev_dec_pending(conf->mirrors[dev].rdev, conf->mddev); 335 rdev_dec_pending(conf->mirrors[dev].rdev, conf->mddev);
342 return 0;
343} 336}
344 337
345 338
@@ -787,7 +780,7 @@ static int make_request(struct request_queue *q, struct bio * bio)
787 unsigned long flags; 780 unsigned long flags;
788 781
789 if (unlikely(bio_barrier(bio))) { 782 if (unlikely(bio_barrier(bio))) {
790 bio_endio(bio, bio->bi_size, -EOPNOTSUPP); 783 bio_endio(bio, -EOPNOTSUPP);
791 return 0; 784 return 0;
792 } 785 }
793 786
@@ -819,7 +812,7 @@ static int make_request(struct request_queue *q, struct bio * bio)
819 " or bigger than %dk %llu %d\n", chunk_sects/2, 812 " or bigger than %dk %llu %d\n", chunk_sects/2,
820 (unsigned long long)bio->bi_sector, bio->bi_size >> 10); 813 (unsigned long long)bio->bi_sector, bio->bi_size >> 10);
821 814
822 bio_io_error(bio, bio->bi_size); 815 bio_io_error(bio);
823 return 0; 816 return 0;
824 } 817 }
825 818
@@ -1155,15 +1148,12 @@ abort:
1155} 1148}
1156 1149
1157 1150
1158static int end_sync_read(struct bio *bio, unsigned int bytes_done, int error) 1151static void end_sync_read(struct bio *bio, int error)
1159{ 1152{
1160 r10bio_t * r10_bio = (r10bio_t *)(bio->bi_private); 1153 r10bio_t * r10_bio = (r10bio_t *)(bio->bi_private);
1161 conf_t *conf = mddev_to_conf(r10_bio->mddev); 1154 conf_t *conf = mddev_to_conf(r10_bio->mddev);
1162 int i,d; 1155 int i,d;
1163 1156
1164 if (bio->bi_size)
1165 return 1;
1166
1167 for (i=0; i<conf->copies; i++) 1157 for (i=0; i<conf->copies; i++)
1168 if (r10_bio->devs[i].bio == bio) 1158 if (r10_bio->devs[i].bio == bio)
1169 break; 1159 break;
@@ -1192,10 +1182,9 @@ static int end_sync_read(struct bio *bio, unsigned int bytes_done, int error)
1192 reschedule_retry(r10_bio); 1182 reschedule_retry(r10_bio);
1193 } 1183 }
1194 rdev_dec_pending(conf->mirrors[d].rdev, conf->mddev); 1184 rdev_dec_pending(conf->mirrors[d].rdev, conf->mddev);
1195 return 0;
1196} 1185}
1197 1186
1198static int end_sync_write(struct bio *bio, unsigned int bytes_done, int error) 1187static void end_sync_write(struct bio *bio, int error)
1199{ 1188{
1200 int uptodate = test_bit(BIO_UPTODATE, &bio->bi_flags); 1189 int uptodate = test_bit(BIO_UPTODATE, &bio->bi_flags);
1201 r10bio_t * r10_bio = (r10bio_t *)(bio->bi_private); 1190 r10bio_t * r10_bio = (r10bio_t *)(bio->bi_private);
@@ -1203,9 +1192,6 @@ static int end_sync_write(struct bio *bio, unsigned int bytes_done, int error)
1203 conf_t *conf = mddev_to_conf(mddev); 1192 conf_t *conf = mddev_to_conf(mddev);
1204 int i,d; 1193 int i,d;
1205 1194
1206 if (bio->bi_size)
1207 return 1;
1208
1209 for (i = 0; i < conf->copies; i++) 1195 for (i = 0; i < conf->copies; i++)
1210 if (r10_bio->devs[i].bio == bio) 1196 if (r10_bio->devs[i].bio == bio)
1211 break; 1197 break;
@@ -1228,7 +1214,6 @@ static int end_sync_write(struct bio *bio, unsigned int bytes_done, int error)
1228 } 1214 }
1229 } 1215 }
1230 rdev_dec_pending(conf->mirrors[d].rdev, mddev); 1216 rdev_dec_pending(conf->mirrors[d].rdev, mddev);
1231 return 0;
1232} 1217}
1233 1218
1234/* 1219/*
@@ -1374,7 +1359,7 @@ static void recovery_request_write(mddev_t *mddev, r10bio_t *r10_bio)
1374 if (test_bit(R10BIO_Uptodate, &r10_bio->state)) 1359 if (test_bit(R10BIO_Uptodate, &r10_bio->state))
1375 generic_make_request(wbio); 1360 generic_make_request(wbio);
1376 else 1361 else
1377 bio_endio(wbio, wbio->bi_size, -EIO); 1362 bio_endio(wbio, -EIO);
1378} 1363}
1379 1364
1380 1365