Merge to Fedora kernel-2.6.7-1.441
[linux-2.6.git] / arch / ppc64 / mm / hash_utils.c
index 1df6d97..4e6b529 100644 (file)
@@ -251,6 +251,7 @@ int hash_page(unsigned long ea, unsigned long access, unsigned long trap)
        struct mm_struct *mm;
        pte_t *ptep;
        int ret;
+       int cpu;
        int user_region = 0;
        int local = 0;
        cpumask_t tmp;
@@ -302,7 +303,8 @@ int hash_page(unsigned long ea, unsigned long access, unsigned long trap)
        if (pgdir == NULL)
                return 1;
 
-       tmp = cpumask_of_cpu(smp_processor_id());
+       cpu = get_cpu();
+       tmp = cpumask_of_cpu(cpu);
        if (user_region && cpus_equal(mm->cpu_vm_mask, tmp))
                local = 1;
 
@@ -311,11 +313,13 @@ int hash_page(unsigned long ea, unsigned long access, unsigned long trap)
                ret = hash_huge_page(mm, access, ea, vsid, local);
        else {
                ptep = find_linux_pte(pgdir, ea);
-               if (ptep == NULL)
+               if (ptep == NULL) {
+                       put_cpu();
                        return 1;
+               }
                ret = __hash_page(ea, access, vsid, ptep, trap, local);
        }
-
+       put_cpu();
 
        return ret;
 }