Use page_to_pfn in BIO code
PATCH 1/1 Use page_to_pfn in BIO code
Hi,
While porting the DISCONTIGMEM code to ppc64 (in order to do NUMA memory allocation) I noticed the bio code uses page_to_phys. We should instead be using the recently introduced page_to_pfn code.
This now limits the direct usage of mem_map (at least on ppc64) to two spots - page_to_pfn/pfn_to_page which makes DISCONTIGMEM support quite trivial.
Anton
include/linux/bio.h +2 -2
@@ -128,8 +130,8 @@/* * 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) +#define bio_to_phys (bio) ((page_to_pfn(bio_page((bio))) << PAGE_SHIFT) + (unsigned long) bio_offset((bio))) +#define bvec_to_phys (bv) ((page_to_pfn((bv)->bv_page) << PAGE_SHIFT) + (unsigned long) (bv)->bv_offset)/* * queues that have highmem support enabled may still need to revert to