OSDN Git Service

raid5: use bio_end_sector in r5_next_bio
authorGuoqing Jiang <guoqing.jiang@cloud.ionos.com>
Thu, 12 Sep 2019 10:10:16 +0000 (12:10 +0200)
committerSong Liu <songliubraving@fb.com>
Fri, 13 Sep 2019 20:14:43 +0000 (13:14 -0700)
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>
drivers/md/raid5.h

index 877e7d3..f90e070 100644 (file)
@@ -492,9 +492,7 @@ struct disk_info {
  */
 static inline struct bio *r5_next_bio(struct bio *bio, sector_t sector)
 {
-       int sectors = bio_sectors(bio);
-
-       if (bio->bi_iter.bi_sector + sectors < sector + STRIPE_SECTORS)
+       if (bio_end_sector(bio) < sector + STRIPE_SECTORS)
                return bio->bi_next;
        else
                return NULL;