summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorKAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>2006-03-27 13:15:55 +0400
committerLinus Torvalds <torvalds@g5.osdl.org>2006-03-27 20:44:47 +0400
commita0140c1d85637ee5f4ea7c78f066e3611a6a79dc (patch)
tree7a52892e57ff7a97a3aabf920891b68ca8bf578a /include
parent0ecd702bcb924d5fb7f687e09986f688336ac896 (diff)
downloadlinux-a0140c1d85637ee5f4ea7c78f066e3611a6a79dc.tar.xz
[PATCH] remove zone_mem_map
This patch removes zone_mem_map. pfn_to_page uses pgdat, page_to_pfn uses zone. page_to_pfn can use pgdat instead of zone, which is only one user of zone_mem_map. By modifing it, we can remove zone_mem_map. Signed-off-by: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com> Cc: Dave Hansen <haveblue@us.ibm.com> Cc: Christoph Lameter <christoph@lameter.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'include')
-rw-r--r--include/asm-alpha/mmzone.h3
-rw-r--r--include/asm-generic/memory_model.h10
-rw-r--r--include/linux/mmzone.h1
3 files changed, 6 insertions, 8 deletions
diff --git a/include/asm-alpha/mmzone.h b/include/asm-alpha/mmzone.h
index c9004398f273..192d80c875b0 100644
--- a/include/asm-alpha/mmzone.h
+++ b/include/asm-alpha/mmzone.h
@@ -83,8 +83,7 @@ PLAT_NODE_DATA_LOCALNR(unsigned long p, int n)
pte_t pte; \
unsigned long pfn; \
\
- pfn = ((unsigned long)((page)-page_zone(page)->zone_mem_map)) << 32; \
- pfn += page_zone(page)->zone_start_pfn << 32; \
+ pfn = page_to_pfn(page) << 32; \
pte_val(pte) = pfn | pgprot_val(pgprot); \
\
pte; \
diff --git a/include/asm-generic/memory_model.h b/include/asm-generic/memory_model.h
index a7bb4978e808..0cfb086dd373 100644
--- a/include/asm-generic/memory_model.h
+++ b/include/asm-generic/memory_model.h
@@ -45,11 +45,11 @@ extern unsigned long page_to_pfn(struct page *page);
NODE_DATA(__nid)->node_mem_map + arch_local_page_offset(__pfn, __nid);\
})
-#define page_to_pfn(pg) \
-({ struct page *__pg = (pg); \
- struct zone *__zone = page_zone(__pg); \
- (unsigned long)(__pg - __zone->zone_mem_map) + \
- __zone->zone_start_pfn; \
+#define page_to_pfn(pg) \
+({ struct page *__pg = (pg); \
+ struct pglist_data *__pgdat = NODE_DATA(page_to_nid(__pg)); \
+ (unsigned long)(__pg - __pgdat->node_mem_map) + \
+ __pgdat->node_start_pfn; \
})
#elif defined(CONFIG_SPARSEMEM)
diff --git a/include/linux/mmzone.h b/include/linux/mmzone.h
index 0c1c0c0cce65..ace31c515a8c 100644
--- a/include/linux/mmzone.h
+++ b/include/linux/mmzone.h
@@ -225,7 +225,6 @@ struct zone {
* Discontig memory support fields.
*/
struct pglist_data *zone_pgdat;
- struct page *zone_mem_map;
/* zone_start_pfn == zone_start_paddr >> PAGE_SHIFT */
unsigned long zone_start_pfn;