block: stop using bio_data() in blk_write_same_mergeable
authorChristoph Hellwig <hch@lst.de>
Mon, 19 Jun 2017 07:24:41 +0000 (09:24 +0200)
committerJens Axboe <axboe@kernel.dk>
Wed, 21 Jun 2017 01:21:48 +0000 (19:21 -0600)
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>
include/linux/blkdev.h

index 22cfba64ce8146b64de1ab0b74e8fdfd140e0154..0deed7274a7fd12b830e094601b0932fd627de35 100644 (file)
@@ -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;