lkml.org 
[lkml]   [2002]   [Jun]   [4]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[PATCH] 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

diff -urN linux-2.5_ppc64/include/linux/bio.h linux-2.5_work/include/linux/bio.h
--- linux-2.5_ppc64/include/linux/bio.h Wed May 8 10:31:25 2002
+++ linux-2.5_work/include/linux/bio.h Tue Jun 4 16:20:41 2002
@@ -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
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
\
 
 \ /
  Last update: 2005-03-22 13:26    [W:0.042 / U:0.232 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site