Skip to content

Commit 0a845e0

Browse files
xzpeterakpm00
authored andcommitted
mm/treewide: replace pud_large() with pud_leaf()
pud_large() is always defined as pud_leaf(). Merge their usages. Chose pud_leaf() because pud_leaf() is a global API, while pud_large() is not. Link: https://lkml.kernel.org/r/[email protected] Signed-off-by: Peter Xu <[email protected]> Reviewed-by: Jason Gunthorpe <[email protected]> Cc: Alexander Potapenko <[email protected]> Cc: Andrey Konovalov <[email protected]> Cc: Andrey Ryabinin <[email protected]> Cc: "Aneesh Kumar K.V" <[email protected]> Cc: Borislav Petkov <[email protected]> Cc: Christophe Leroy <[email protected]> Cc: Dave Hansen <[email protected]> Cc: Dmitry Vyukov <[email protected]> Cc: Ingo Molnar <[email protected]> Cc: Kirill A. Shutemov <[email protected]> Cc: Michael Ellerman <[email protected]> Cc: Muchun Song <[email protected]> Cc: "Naveen N. Rao" <[email protected]> Cc: Nicholas Piggin <[email protected]> Cc: Thomas Gleixner <[email protected]> Cc: Vincenzo Frascino <[email protected]> Cc: Yang Shi <[email protected]> Signed-off-by: Andrew Morton <[email protected]>
1 parent 2f709f7 commit 0a845e0

File tree

20 files changed

+29
-29
lines changed

20 files changed

+29
-29
lines changed

arch/powerpc/mm/book3s64/pgtable.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ void set_pud_at(struct mm_struct *mm, unsigned long addr,
130130

131131
WARN_ON(pte_hw_valid(pud_pte(*pudp)));
132132
assert_spin_locked(pud_lockptr(mm, pudp));
133-
WARN_ON(!(pud_large(pud)));
133+
WARN_ON(!(pud_leaf(pud)));
134134
#endif
135135
trace_hugepage_set_pud(addr, pud_val(pud));
136136
return set_pte_at(mm, addr, pudp_ptep(pudp), pud_pte(pud));

arch/s390/boot/vmem.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -366,7 +366,7 @@ static void pgtable_pud_populate(p4d_t *p4d, unsigned long addr, unsigned long e
366366
}
367367
pmd = boot_crst_alloc(_SEGMENT_ENTRY_EMPTY);
368368
pud_populate(&init_mm, pud, pmd);
369-
} else if (pud_large(*pud)) {
369+
} else if (pud_leaf(*pud)) {
370370
continue;
371371
}
372372
pgtable_pmd_populate(pud, addr, next, mode);

arch/s390/include/asm/pgtable.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -730,7 +730,7 @@ static inline int pud_bad(pud_t pud)
730730
{
731731
unsigned long type = pud_val(pud) & _REGION_ENTRY_TYPE_MASK;
732732

733-
if (type > _REGION_ENTRY_TYPE_R3 || pud_large(pud))
733+
if (type > _REGION_ENTRY_TYPE_R3 || pud_leaf(pud))
734734
return 1;
735735
if (type < _REGION_ENTRY_TYPE_R3)
736736
return 0;
@@ -1400,7 +1400,7 @@ static inline unsigned long pud_deref(pud_t pud)
14001400
unsigned long origin_mask;
14011401

14021402
origin_mask = _REGION_ENTRY_ORIGIN;
1403-
if (pud_large(pud))
1403+
if (pud_leaf(pud))
14041404
origin_mask = _REGION3_ENTRY_ORIGIN_LARGE;
14051405
return (unsigned long)__va(pud_val(pud) & origin_mask);
14061406
}

arch/s390/mm/gmap.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -598,7 +598,7 @@ int __gmap_link(struct gmap *gmap, unsigned long gaddr, unsigned long vmaddr)
598598
pud = pud_offset(p4d, vmaddr);
599599
VM_BUG_ON(pud_none(*pud));
600600
/* large puds cannot yet be handled */
601-
if (pud_large(*pud))
601+
if (pud_leaf(*pud))
602602
return -EFAULT;
603603
pmd = pmd_offset(pud, vmaddr);
604604
VM_BUG_ON(pmd_none(*pmd));

arch/s390/mm/hugetlbpage.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,7 @@ pte_t *huge_pte_offset(struct mm_struct *mm,
224224
if (p4d_present(*p4dp)) {
225225
pudp = pud_offset(p4dp, addr);
226226
if (pud_present(*pudp)) {
227-
if (pud_large(*pudp))
227+
if (pud_leaf(*pudp))
228228
return (pte_t *) pudp;
229229
pmdp = pmd_offset(pudp, addr);
230230
}
@@ -240,7 +240,7 @@ int pmd_huge(pmd_t pmd)
240240

241241
int pud_huge(pud_t pud)
242242
{
243-
return pud_large(pud);
243+
return pud_leaf(pud);
244244
}
245245

246246
bool __init arch_hugetlb_valid_size(unsigned long size)

arch/s390/mm/pageattr.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -274,7 +274,7 @@ static int walk_pud_level(p4d_t *p4d, unsigned long addr, unsigned long end,
274274
if (pud_none(*pudp))
275275
return -EINVAL;
276276
next = pud_addr_end(addr, end);
277-
if (pud_large(*pudp)) {
277+
if (pud_leaf(*pudp)) {
278278
need_split = !!(flags & SET_MEMORY_4K);
279279
need_split |= !!(addr & ~PUD_MASK);
280280
need_split |= !!(addr + PUD_SIZE > next);

arch/s390/mm/pgtable.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -470,7 +470,7 @@ static int pmd_lookup(struct mm_struct *mm, unsigned long addr, pmd_t **pmdp)
470470
return -ENOENT;
471471

472472
/* Large PUDs are not supported yet. */
473-
if (pud_large(*pud))
473+
if (pud_leaf(*pud))
474474
return -EFAULT;
475475

476476
*pmdp = pmd_offset(pud, addr);

arch/s390/mm/vmem.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -329,7 +329,7 @@ static int modify_pud_table(p4d_t *p4d, unsigned long addr, unsigned long end,
329329
if (!add) {
330330
if (pud_none(*pud))
331331
continue;
332-
if (pud_large(*pud)) {
332+
if (pud_leaf(*pud)) {
333333
if (IS_ALIGNED(addr, PUD_SIZE) &&
334334
IS_ALIGNED(next, PUD_SIZE)) {
335335
pud_clear(pud);
@@ -350,7 +350,7 @@ static int modify_pud_table(p4d_t *p4d, unsigned long addr, unsigned long end,
350350
if (!pmd)
351351
goto out;
352352
pud_populate(&init_mm, pud, pmd);
353-
} else if (pud_large(*pud)) {
353+
} else if (pud_leaf(*pud)) {
354354
continue;
355355
}
356356
ret = modify_pmd_table(pud, addr, next, add, direct, altmap);
@@ -599,7 +599,7 @@ pte_t *vmem_get_alloc_pte(unsigned long addr, bool alloc)
599599
if (!pmd)
600600
goto out;
601601
pud_populate(&init_mm, pud, pmd);
602-
} else if (WARN_ON_ONCE(pud_large(*pud))) {
602+
} else if (WARN_ON_ONCE(pud_leaf(*pud))) {
603603
goto out;
604604
}
605605
pmd = pmd_offset(pud, addr);

arch/sparc/mm/init_64.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1665,7 +1665,7 @@ bool kern_addr_valid(unsigned long addr)
16651665
if (pud_none(*pud))
16661666
return false;
16671667

1668-
if (pud_large(*pud))
1668+
if (pud_leaf(*pud))
16691669
return pfn_valid(pud_pfn(*pud));
16701670

16711671
pmd = pmd_offset(pud, addr);

arch/x86/kvm/mmu/mmu.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3126,7 +3126,7 @@ static int host_pfn_mapping_level(struct kvm *kvm, gfn_t gfn,
31263126
if (pud_none(pud) || !pud_present(pud))
31273127
goto out;
31283128

3129-
if (pud_large(pud)) {
3129+
if (pud_leaf(pud)) {
31303130
level = PG_LEVEL_1G;
31313131
goto out;
31323132
}

0 commit comments

Comments
 (0)