summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGuoqing Jiang <guoqing.jiang@cloud.ionos.com>2019-09-12 06:10:16 -0400
committerSong Liu <songliubraving@fb.com>2019-09-13 16:14:43 -0400
commit067df25c83902e2950ef24fed713f0fa38282f34 (patch)
treeef55a627de233ea52d6deac581d9c32220936c1d
parentfeb9bf9849e2aa0dd2833285af7c25aee07df7bb (diff)
raid5: use bio_end_sector in r5_next_bio
Actually, we calculate bio's end sector here, so use the common way for the purpose. Signed-off-by: Guoqing Jiang <guoqing.jiang@cloud.ionos.com> Signed-off-by: Song Liu <songliubraving@fb.com>
-rw-r--r--drivers/md/raid5.h4
1 files changed, 1 insertions, 3 deletions
diff --git a/drivers/md/raid5.h b/drivers/md/raid5.h
index 877e7d3f4bd1..f90e0704bed9 100644
--- a/drivers/md/raid5.h
+++ b/drivers/md/raid5.h
@@ -492,9 +492,7 @@ struct disk_info {
492 */ 492 */
493static inline struct bio *r5_next_bio(struct bio *bio, sector_t sector) 493static inline struct bio *r5_next_bio(struct bio *bio, sector_t sector)
494{ 494{
495 int sectors = bio_sectors(bio); 495 if (bio_end_sector(bio) < sector + STRIPE_SECTORS)
496
497 if (bio->bi_iter.bi_sector + sectors < sector + STRIPE_SECTORS)
498 return bio->bi_next; 496 return bio->bi_next;
499 else 497 else
500 return NULL; 498 return NULL;