on_each_cpu(): kill unused 'retry' parameter
[deliverable/linux.git] / arch / sparc64 / mm / hugetlbpage.c
index 074620d413d4733db87aca5f0ce6f09be09a080e..ebefd2a14375b25104030cf04d649dc9b7da72fd 100644 (file)
@@ -4,14 +4,12 @@
  * Copyright (C) 2002, 2003, 2006 David S. Miller (davem@davemloft.net)
  */
 
-#include <linux/config.h>
 #include <linux/init.h>
 #include <linux/module.h>
 #include <linux/fs.h>
 #include <linux/mm.h>
 #include <linux/hugetlb.h>
 #include <linux/pagemap.h>
-#include <linux/smp_lock.h>
 #include <linux/slab.h>
 #include <linux/sysctl.h>
 
@@ -176,6 +174,12 @@ hugetlb_get_unmapped_area(struct file *file, unsigned long addr,
        if (len > task_size)
                return -ENOMEM;
 
+       if (flags & MAP_FIXED) {
+               if (prepare_hugepage_range(addr, len))
+                       return -EINVAL;
+               return addr;
+       }
+
        if (addr) {
                addr = ALIGN(addr, HPAGE_SIZE);
                vma = find_vma(mm, addr);
@@ -198,6 +202,13 @@ pte_t *huge_pte_alloc(struct mm_struct *mm, unsigned long addr)
        pmd_t *pmd;
        pte_t *pte = NULL;
 
+       /* We must align the address, because our caller will run
+        * set_huge_pte_at() on whatever we return, which writes out
+        * all of the sub-ptes for the hugepage range.  So we have
+        * to give it the first such sub-pte.
+        */
+       addr &= HPAGE_MASK;
+
        pgd = pgd_offset(mm, addr);
        pud = pud_alloc(mm, pgd, addr);
        if (pud) {
@@ -229,6 +240,11 @@ pte_t *huge_pte_offset(struct mm_struct *mm, unsigned long addr)
        return pte;
 }
 
+int huge_pmd_unshare(struct mm_struct *mm, unsigned long *addr, pte_t *ptep)
+{
+       return 0;
+}
+
 void set_huge_pte_at(struct mm_struct *mm, unsigned long addr,
                     pte_t *ptep, pte_t entry)
 {
@@ -237,6 +253,7 @@ void set_huge_pte_at(struct mm_struct *mm, unsigned long addr,
        if (!pte_present(*ptep) && pte_present(entry))
                mm->context.huge_pte_count++;
 
+       addr &= HPAGE_MASK;
        for (i = 0; i < (1 << HUGETLB_PAGE_ORDER); i++) {
                set_pte_at(mm, addr, ptep, entry);
                ptep++;
@@ -255,6 +272,8 @@ pte_t huge_ptep_get_and_clear(struct mm_struct *mm, unsigned long addr,
        if (pte_present(entry))
                mm->context.huge_pte_count--;
 
+       addr &= HPAGE_MASK;
+
        for (i = 0; i < (1 << HUGETLB_PAGE_ORDER); i++) {
                pte_clear(mm, addr, ptep);
                addr += PAGE_SIZE;
@@ -325,7 +344,7 @@ void hugetlb_prefault_arch_hook(struct mm_struct *mm)
                         * also executing in this address space.
                         */
                        mm->context.sparc64_ctx_val = ctx;
-                       on_each_cpu(context_reload, mm, 0, 0);
+                       on_each_cpu(context_reload, mm, 0);
                }
                spin_unlock(&ctx_alloc_lock);
        }
This page took 0.02598 seconds and 5 git commands to generate.