two small cleanups
Stop relying on bio_page and a page_address in the Write Same code and remove an unused macro.
PATCH 1/2 block: remove the unused bio_to_phys macro
--- include/linux/bio.h | 1 - 1 file changed, 1 deletion(-)
include/linux/bio.h +0 -1
@@ -118,7 +118,6 @@ static inline void *bio_data(struct bio *bio)/* * will die */ -#define bio_to_phys (bio) (page_to_phys(bio_page((bio))) + (unsigned long) bio_offset((bio)))#define bvec_to_phys (bv) (page_to_phys((bv)->bv_page) + (unsigned long) (bv)->bv_offset)/*
Signature · 1 line
2.11.0
PATCH 2/2 block: stop using bio_data() in blk_write_same_mergeable
In reply to Christoph HellwigWhile 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.
--- include/linux/blkdev.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
include/linux/blkdev.h +2 -1
@@ -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;
Signature · 1 line
2.11.0
Re: [PATCH 1/2] block: remove the unused bio_to_phys macro
In reply to Christoph HellwigChristoph,
Quoted 1 line
Signed-off-by Christoph Hellwig <[email protected]>
That's fine.
Signature · 1 line
Martin K. Petersen Oracle Linux Engineering
Re: [PATCH 2/2] block: stop using bio_data() in blk_write_same_mergeable
In reply to Christoph HellwigChristoph,
Quoted 2 lines
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.
Also fine.
Signature · 1 line
Martin K. Petersen Oracle Linux Engineering
Quoted 2 lines · Christoph Hellwig
Stop relying on
bio_pageand apage_addressin the Write Same code and remove an unused macro.
Applied, thanks.
Signature · 1 line
Jens Axboe