]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
mm/hugetlb: use already existing interface huge_page_shift
authorWanpeng Li <liwanp@linux.vnet.ibm.com>
Thu, 27 Jun 2013 23:51:42 +0000 (09:51 +1000)
committerStephen Rothwell <sfr@canb.auug.org.au>
Fri, 28 Jun 2013 06:37:39 +0000 (16:37 +1000)
Use the already existing interface huge_page_shift instead of h->order +
PAGE_SHIFT.

Signed-off-by: Wanpeng Li <liwanp@linux.vnet.ibm.com>
Cc: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
Cc: David Rientjes <rientjes@google.com>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Reviewed-by: Michal Hocko <mhocko@suse.cz>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
arch/powerpc/mm/hugetlbpage.c
mm/hugetlb.c

index 5555778b94fcbe3e7e935310b9c5048079199f3b..834ca8eb38f202e01c5151fdb56b13197ed6acc8 100644 (file)
@@ -301,7 +301,7 @@ void add_gpage(u64 addr, u64 page_size, unsigned long number_of_pages)
 int alloc_bootmem_huge_page(struct hstate *hstate)
 {
        struct huge_bootmem_page *m;
-       int idx = shift_to_mmu_psize(hstate->order + PAGE_SHIFT);
+       int idx = shift_to_mmu_psize(huge_page_shift(hstate));
        int nr_gpages = gpage_freearray[idx].nr_gpages;
 
        if (nr_gpages == 0)
index aed085ad11a8bc3fcf3876453192f7fab4a777c2..fe095158859ec6f9f780a16333f823562efc633d 100644 (file)
@@ -319,7 +319,7 @@ unsigned long vma_kernel_pagesize(struct vm_area_struct *vma)
 
        hstate = hstate_vma(vma);
 
-       return 1UL << (hstate->order + PAGE_SHIFT);
+       return 1UL << huge_page_shift(hstate);
 }
 EXPORT_SYMBOL_GPL(vma_kernel_pagesize);