Skip to content

Commit

Permalink
block: stop using bio_data() in blk_write_same_mergeable
Browse files Browse the repository at this point in the history
While the Write Same page currently always is in low-level it is just
as easy and safer to just compare the page and offset directly.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
  • Loading branch information
Christoph Hellwig authored and Jens Axboe committed Jun 21, 2017
1 parent 80ab6af commit efbeccd
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion include/linux/blkdev.h
Original file line number Diff line number Diff line change
@@ -815,7 +815,8 @@ static inline bool rq_mergeable(struct request *rq)

static inline bool blk_write_same_mergeable(struct bio *a, struct bio *b)
{
if (bio_data(a) == bio_data(b))
if (bio_page(a) == bio_page(b) &&
bio_offset(a) == bio_offset(b))
return true;

return false;

0 comments on commit efbeccd

Please sign in to comment.