Update UML kernel/physmem.c to use rb_parent() accessor macro
[pandora-kernel.git] / arch / um / kernel / physmem.c
index f3b583a..73c741d 100644 (file)
@@ -9,6 +9,7 @@
 #include "linux/vmalloc.h"
 #include "linux/bootmem.h"
 #include "linux/module.h"
+#include "linux/pfn.h"
 #include "asm/types.h"
 #include "asm/pgtable.h"
 #include "kern_util.h"
@@ -68,7 +69,7 @@ static void insert_phys_mapping(struct phys_desc *desc)
                panic("Physical remapping for %p already present",
                      desc->virt);
 
-       rb_link_node(&desc->rb, (*n)->rb_parent, n);
+       rb_link_node(&desc->rb, rb_parent(*n), n);
        rb_insert_color(&desc->rb, &phys_mappings);
 }
 
@@ -265,7 +266,7 @@ int init_maps(unsigned long physmem, unsigned long iomem, unsigned long highmem)
        highmem_len = highmem_pages * sizeof(struct page);
 
        total_pages = phys_pages + iomem_pages + highmem_pages;
-       total_len = phys_len + iomem_pages + highmem_len;
+       total_len = phys_len + iomem_len + highmem_len;
 
        if(kmalloc_ok){
                map = kmalloc(total_len, GFP_KERNEL);
@@ -279,7 +280,7 @@ int init_maps(unsigned long physmem, unsigned long iomem, unsigned long highmem)
 
        for(i = 0; i < total_pages; i++){
                p = &map[i];
-               set_page_count(p, 0);
+               memset(p, 0, sizeof(struct page));
                SetPageReserved(p);
                INIT_LIST_HEAD(&p->lru);
        }
@@ -316,8 +317,6 @@ void map_memory(unsigned long virt, unsigned long phys, unsigned long len,
        }
 }
 
-#define PFN_UP(x) (((x) + PAGE_SIZE-1) >> PAGE_SHIFT)
-
 extern int __syscall_stub_start, __binary_start;
 
 void setup_physmem(unsigned long start, unsigned long reserve_end,