[PATCH] numa node ids are int, page_to_nid and zone_to_nid should return int
[linux-2.6.git] / include / asm-ia64 / pgalloc.h
index e86a8c3..393e04c 100644 (file)
@@ -13,7 +13,6 @@
  * Copyright (C) 2000, Goutham Rao <goutham.rao@intel.com>
  */
 
-#include <linux/config.h>
 
 #include <linux/compiler.h>
 #include <linux/mm.h>
@@ -29,7 +28,7 @@ DECLARE_PER_CPU(long, __pgtable_quicklist_size);
 
 static inline long pgtable_quicklist_total_size(void)
 {
-       long ql_size;
+       long ql_size = 0;
        int cpuid;
 
        for_each_online_cpu(cpuid) {
@@ -49,19 +48,19 @@ static inline void *pgtable_quicklist_alloc(void)
                pgtable_quicklist = (unsigned long *)(*ret);
                ret[0] = 0;
                --pgtable_quicklist_size;
+               preempt_enable();
        } else {
+               preempt_enable();
                ret = (unsigned long *)__get_free_page(GFP_KERNEL | __GFP_ZERO);
        }
 
-       preempt_enable();
-
        return ret;
 }
 
 static inline void pgtable_quicklist_free(void *pgtable_entry)
 {
 #ifdef CONFIG_NUMA
-       unsigned long nid = page_to_nid(virt_to_page(pgtable_entry));
+       int nid = page_to_nid(virt_to_page(pgtable_entry));
 
        if (unlikely(nid != numa_node_id())) {
                free_page((unsigned long)pgtable_entry);
@@ -86,6 +85,25 @@ static inline void pgd_free(pgd_t * pgd)
        pgtable_quicklist_free(pgd);
 }
 
+#ifdef CONFIG_PGTABLE_4
+static inline void
+pgd_populate(struct mm_struct *mm, pgd_t * pgd_entry, pud_t * pud)
+{
+       pgd_val(*pgd_entry) = __pa(pud);
+}
+
+static inline pud_t *pud_alloc_one(struct mm_struct *mm, unsigned long addr)
+{
+       return pgtable_quicklist_alloc();
+}
+
+static inline void pud_free(pud_t * pud)
+{
+       pgtable_quicklist_free(pud);
+}
+#define __pud_free_tlb(tlb, pud)       pud_free(pud)
+#endif /* CONFIG_PGTABLE_4 */
+
 static inline void
 pud_populate(struct mm_struct *mm, pud_t * pud_entry, pmd_t * pmd)
 {