Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

powerpc/mm: make gup_hugepte() static

gup_huge_pd() is the only user of gup_hugepte() and it is
located in the same file. This patch moves gup_huge_pd()
after gup_hugepte() and makes gup_hugepte() static.

Signed-off-by: Christophe Leroy <christophe.leroy@c-s.fr>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>

authored by

Christophe Leroy and committed by
Michael Ellerman
0001e5aa b7dcf96c

+19 -22
-3
arch/powerpc/include/asm/pgtable.h
··· 89 89 */ 90 90 extern void update_mmu_cache(struct vm_area_struct *, unsigned long, pte_t *); 91 91 92 - extern int gup_hugepte(pte_t *ptep, unsigned long sz, unsigned long addr, 93 - unsigned long end, int write, 94 - struct page **pages, int *nr); 95 92 #ifndef CONFIG_TRANSPARENT_HUGEPAGE 96 93 #define pmd_large(pmd) 0 97 94 #endif
+19 -19
arch/powerpc/mm/hugetlbpage.c
··· 539 539 return (__boundary - 1 < end - 1) ? __boundary : end; 540 540 } 541 541 542 - int gup_huge_pd(hugepd_t hugepd, unsigned long addr, unsigned pdshift, 543 - unsigned long end, int write, struct page **pages, int *nr) 544 - { 545 - pte_t *ptep; 546 - unsigned long sz = 1UL << hugepd_shift(hugepd); 547 - unsigned long next; 548 - 549 - ptep = hugepte_offset(hugepd, addr, pdshift); 550 - do { 551 - next = hugepte_addr_end(addr, end, sz); 552 - if (!gup_hugepte(ptep, sz, addr, end, write, pages, nr)) 553 - return 0; 554 - } while (ptep++, addr = next, addr != end); 555 - 556 - return 1; 557 - } 558 - 559 542 #ifdef CONFIG_PPC_MM_SLICES 560 543 unsigned long hugetlb_get_unmapped_area(struct file *file, unsigned long addr, 561 544 unsigned long len, unsigned long pgoff, ··· 734 751 } 735 752 } 736 753 737 - int gup_hugepte(pte_t *ptep, unsigned long sz, unsigned long addr, 738 - unsigned long end, int write, struct page **pages, int *nr) 754 + static int gup_hugepte(pte_t *ptep, unsigned long sz, unsigned long addr, 755 + unsigned long end, int write, struct page **pages, int *nr) 739 756 { 740 757 unsigned long pte_end; 741 758 struct page *head, *page; ··· 778 795 put_page(head); 779 796 return 0; 780 797 } 798 + 799 + return 1; 800 + } 801 + 802 + int gup_huge_pd(hugepd_t hugepd, unsigned long addr, unsigned int pdshift, 803 + unsigned long end, int write, struct page **pages, int *nr) 804 + { 805 + pte_t *ptep; 806 + unsigned long sz = 1UL << hugepd_shift(hugepd); 807 + unsigned long next; 808 + 809 + ptep = hugepte_offset(hugepd, addr, pdshift); 810 + do { 811 + next = hugepte_addr_end(addr, end, sz); 812 + if (!gup_hugepte(ptep, sz, addr, end, write, pages, nr)) 813 + return 0; 814 + } while (ptep++, addr = next, addr != end); 781 815 782 816 return 1; 783 817 }