]> 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>
Wed, 19 Jun 2013 00:06:15 +0000 (10:06 +1000)
committerStephen Rothwell <sfr@canb.auug.org.au>
Wed, 19 Jun 2013 07:13:10 +0000 (17:13 +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 237c8e5f2640b79dce83c4bce7f7f66ef09fe02f..cafec930d3ff3b539baa9fe79a53d4e9690c1048 100644 (file)
@@ -357,7 +357,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 dbd3d42ae03131581744a995bb281db0c05af4d0..46cf6faf03b315ea5dfee6a2e962ca1136c25885 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);