]> www.infradead.org Git - users/willy/pagecache.git/commitdiff
ptdesc: Remove ptdesc_to_virt() slab-future
authorMatthew Wilcox (Oracle) <willy@infradead.org>
Mon, 8 Sep 2025 15:13:34 +0000 (11:13 -0400)
committerMatthew Wilcox (Oracle) <willy@infradead.org>
Tue, 9 Sep 2025 18:39:07 +0000 (14:39 -0400)
This has the same effect as ptdesc_address() so convert the callers to
use that and delete the function.  Add kernel-doc for ptdesc_address().

Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
arch/arm/mm/mmu.c
arch/s390/mm/pgalloc.c
include/linux/mm.h

index edb7f56b7c9106480c459a219bf249199b75315e..8bac96e205ac4d8181e3f0a0ced0c55dafc5db9f 100644 (file)
@@ -737,7 +737,7 @@ static void *__init late_alloc(unsigned long sz)
 
        if (!ptdesc || !pagetable_pte_ctor(NULL, ptdesc))
                BUG();
-       return ptdesc_to_virt(ptdesc);
+       return ptdesc_address(ptdesc);
 }
 
 static pte_t * __init arm_pte_alloc(pmd_t *pmd, unsigned long addr,
index d2f6f1f6d2fcb9f6dff4caabf4cbc455bdbc7bcb..f56ee9aeac83e7d654880f85edc735e4a9dcc60b 100644 (file)
@@ -21,7 +21,7 @@ unsigned long *crst_table_alloc(struct mm_struct *mm)
 
        if (!ptdesc)
                return NULL;
-       table = ptdesc_to_virt(ptdesc);
+       table = ptdesc_address(ptdesc);
        __arch_set_page_dat(table, 1UL << CRST_ALLOC_ORDER);
        return table;
 }
@@ -119,7 +119,7 @@ struct ptdesc *page_table_alloc_pgste(struct mm_struct *mm)
 
        ptdesc = pagetable_alloc(GFP_KERNEL, 0);
        if (ptdesc) {
-               table = (u64 *)ptdesc_to_virt(ptdesc);
+               table = (u64 *)ptdesc_address(ptdesc);
                __arch_set_page_dat(table, 1);
                memset64(table, _PAGE_INVALID, PTRS_PER_PTE);
                memset64(table + PTRS_PER_PTE, 0, PTRS_PER_PTE);
@@ -146,7 +146,7 @@ unsigned long *page_table_alloc(struct mm_struct *mm)
                pagetable_free(ptdesc);
                return NULL;
        }
-       table = ptdesc_to_virt(ptdesc);
+       table = ptdesc_address(ptdesc);
        __arch_set_page_dat(table, 1);
        memset64((u64 *)table, _PAGE_INVALID, PTRS_PER_PTE);
        memset64((u64 *)table + PTRS_PER_PTE, 0, PTRS_PER_PTE);
index 2d0e9dedf36e7b40d306c29e2cf388eb3f776757..6514cf4ec309ce442d2f09dc2dd085da528891a5 100644 (file)
@@ -2944,11 +2944,12 @@ static inline struct ptdesc *virt_to_ptdesc(const void *x)
        return page_ptdesc(virt_to_page(x));
 }
 
-static inline void *ptdesc_to_virt(const struct ptdesc *pt)
-{
-       return page_to_virt(ptdesc_page(pt));
-}
-
+/**
+ * ptdesc_address - Virtual address of page table.
+ * @pt: Page table descriptor.
+ *
+ * Return: The first byte of the page table described by @pt.
+ */
 static inline void *ptdesc_address(const struct ptdesc *pt)
 {
        return folio_address(ptdesc_folio(pt));