Skip to content

Commit

Permalink
raid5: use bio_end_sector in r5_next_bio
Browse files Browse the repository at this point in the history
Actually, we calculate bio's end sector here, so use the common
way for the purpose.

Signed-off-by: Guoqing Jiang <[email protected]>
Signed-off-by: Song Liu <[email protected]>
  • Loading branch information
Guoqing Jiang authored and liu-song-6 committed Sep 13, 2019
1 parent feb9bf9 commit 067df25
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions drivers/md/raid5.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 067df25

Please sign in to comment.