From: Christoph Hellwig <hch@lst.de>
Date: Mon, 19 Jun 2017 07:24:41 +0000 (+0200)
Subject: block: stop using bio_data() in blk_write_same_mergeable
X-Git-Tag: v4.13-rc1~70^2~20
X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=efbeccdb59d666b9c77d505af01097cc0a9d102b;p=linux.git
block: stop using bio_data() in blk_write_same_mergeable
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>
---
diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h
index 22cfba64ce81..0deed7274a7f 100644
--- a/include/linux/blkdev.h
+++ b/include/linux/blkdev.h
@@ -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;