Skip to content

Commit

Permalink
mm/hugetlb: reduce arch dependent code about hugetlb_prefault_arch_hook
Browse files Browse the repository at this point in the history
Currently we have many duplicates in definitions of
hugetlb_prefault_arch_hook.  In all architectures this function is empty.

Signed-off-by: Zhang Zhen <zhenzhang.zhang@huawei.com>
Acked-by: David Rientjes <rientjes@google.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
  • Loading branch information
Zhang Zhen authored and Linus Torvalds committed Jun 25, 2015
1 parent 83d3f0e commit a67a31f
Show file tree
Hide file tree
Showing 12 changed files with 0 additions and 41 deletions.
4 changes: 0 additions & 4 deletions arch/arm/include/asm/hugetlb.h
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,6 @@ static inline int prepare_hugepage_range(struct file *file,
return 0;
}

static inline void hugetlb_prefault_arch_hook(struct mm_struct *mm)
{
}

static inline int huge_pte_none(pte_t pte)
{
return pte_none(pte);
Expand Down
4 changes: 0 additions & 4 deletions arch/arm64/include/asm/hugetlb.h
Original file line number Diff line number Diff line change
Expand Up @@ -86,10 +86,6 @@ static inline int prepare_hugepage_range(struct file *file,
return 0;
}

static inline void hugetlb_prefault_arch_hook(struct mm_struct *mm)
{
}

static inline int huge_pte_none(pte_t pte)
{
return pte_none(pte);
Expand Down
4 changes: 0 additions & 4 deletions arch/ia64/include/asm/hugetlb.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,6 @@ static inline int is_hugepage_only_range(struct mm_struct *mm,
REGION_NUMBER((addr)+(len)-1) == RGN_HPAGE);
}

static inline void hugetlb_prefault_arch_hook(struct mm_struct *mm)
{
}

static inline void set_huge_pte_at(struct mm_struct *mm, unsigned long addr,
pte_t *ptep, pte_t pte)
{
Expand Down
4 changes: 0 additions & 4 deletions arch/metag/include/asm/hugetlb.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,6 @@ static inline int is_hugepage_only_range(struct mm_struct *mm,
int prepare_hugepage_range(struct file *file, unsigned long addr,
unsigned long len);

static inline void hugetlb_prefault_arch_hook(struct mm_struct *mm)
{
}

static inline void hugetlb_free_pgd_range(struct mmu_gather *tlb,
unsigned long addr, unsigned long end,
unsigned long floor,
Expand Down
4 changes: 0 additions & 4 deletions arch/mips/include/asm/hugetlb.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,6 @@ static inline int prepare_hugepage_range(struct file *file,
return 0;
}

static inline void hugetlb_prefault_arch_hook(struct mm_struct *mm)
{
}

static inline void hugetlb_free_pgd_range(struct mmu_gather *tlb,
unsigned long addr,
unsigned long end,
Expand Down
5 changes: 0 additions & 5 deletions arch/powerpc/include/asm/hugetlb.h
Original file line number Diff line number Diff line change
Expand Up @@ -112,11 +112,6 @@ static inline int prepare_hugepage_range(struct file *file,
return 0;
}

static inline void hugetlb_prefault_arch_hook(struct mm_struct *mm)
{
}


static inline void set_huge_pte_at(struct mm_struct *mm, unsigned long addr,
pte_t *ptep, pte_t pte)
{
Expand Down
1 change: 0 additions & 1 deletion arch/s390/include/asm/hugetlb.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ static inline int prepare_hugepage_range(struct file *file,
return 0;
}

#define hugetlb_prefault_arch_hook(mm) do { } while (0)
#define arch_clear_hugepage_flags(page) do { } while (0)

int arch_prepare_hugepage(struct page *page);
Expand Down
3 changes: 0 additions & 3 deletions arch/sh/include/asm/hugetlb.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,6 @@ static inline int prepare_hugepage_range(struct file *file,
return 0;
}

static inline void hugetlb_prefault_arch_hook(struct mm_struct *mm) {
}

static inline void hugetlb_free_pgd_range(struct mmu_gather *tlb,
unsigned long addr, unsigned long end,
unsigned long floor,
Expand Down
4 changes: 0 additions & 4 deletions arch/sparc/include/asm/hugetlb.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,6 @@ void set_huge_pte_at(struct mm_struct *mm, unsigned long addr,
pte_t huge_ptep_get_and_clear(struct mm_struct *mm, unsigned long addr,
pte_t *ptep);

static inline void hugetlb_prefault_arch_hook(struct mm_struct *mm)
{
}

static inline int is_hugepage_only_range(struct mm_struct *mm,
unsigned long addr,
unsigned long len) {
Expand Down
4 changes: 0 additions & 4 deletions arch/tile/include/asm/hugetlb.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,6 @@ static inline int prepare_hugepage_range(struct file *file,
return 0;
}

static inline void hugetlb_prefault_arch_hook(struct mm_struct *mm)
{
}

static inline void hugetlb_free_pgd_range(struct mmu_gather *tlb,
unsigned long addr, unsigned long end,
unsigned long floor,
Expand Down
3 changes: 0 additions & 3 deletions arch/x86/include/asm/hugetlb.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,6 @@ static inline int prepare_hugepage_range(struct file *file,
return 0;
}

static inline void hugetlb_prefault_arch_hook(struct mm_struct *mm) {
}

static inline void hugetlb_free_pgd_range(struct mmu_gather *tlb,
unsigned long addr, unsigned long end,
unsigned long floor,
Expand Down
1 change: 0 additions & 1 deletion fs/hugetlbfs/inode.c
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,6 @@ static int hugetlbfs_file_mmap(struct file *file, struct vm_area_struct *vma)
goto out;

ret = 0;
hugetlb_prefault_arch_hook(vma->vm_mm);
if (vma->vm_flags & VM_WRITE && inode->i_size < len)
inode->i_size = len;
out:
Expand Down

0 comments on commit a67a31f

Please sign in to comment.