From: Michal Hocko <[email protected]>

Both functions will use altmap rather than kmalloc for sparsemem-vmemmap
so rename them to alloc_section_memmap/free_section_memmap which better
reflect the functionality.

Signed-off-by: Michal Hocko <[email protected]>
Signed-off-by: Oscar Salvador <[email protected]>
---
 mm/sparse.c | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/mm/sparse.c b/mm/sparse.c
index 29cbaa0e46c3..719853ef2e55 100644
--- a/mm/sparse.c
+++ b/mm/sparse.c
@@ -589,13 +589,13 @@ static void free_vmemmap_range(unsigned long limit, 
unsigned long start, unsigne
        }
 }
 
-static inline struct page *kmalloc_section_memmap(unsigned long pnum, int nid,
+static inline struct page *alloc_section_memmap(unsigned long pnum, int nid,
                struct vmem_altmap *altmap)
 {
        /* This will make the necessary allocations eventually. */
        return sparse_mem_map_populate(pnum, nid, altmap);
 }
-static void __kfree_section_memmap(struct page *memmap,
+static void free_section_memmap(struct page *memmap,
                struct vmem_altmap *altmap)
 {
        unsigned long start = (unsigned long)memmap;
@@ -646,13 +646,13 @@ static struct page *__kmalloc_section_memmap(void)
        return ret;
 }
 
-static inline struct page *kmalloc_section_memmap(unsigned long pnum, int nid,
+static inline struct page *alloc_section_memmap(unsigned long pnum, int nid,
                struct vmem_altmap *altmap)
 {
        return __kmalloc_section_memmap();
 }
 
-static void __kfree_section_memmap(struct page *memmap,
+static void free_section_memmap(struct page *memmap,
                struct vmem_altmap *altmap)
 {
        if (is_vmalloc_addr(memmap))
@@ -718,12 +718,12 @@ int __meminit sparse_add_one_section(struct pglist_data 
*pgdat,
        if (ret < 0 && ret != -EEXIST)
                return ret;
        ret = 0;
-       memmap = kmalloc_section_memmap(section_nr, pgdat->node_id, altmap);
+       memmap = alloc_section_memmap(section_nr, pgdat->node_id, altmap);
        if (!memmap)
                return -ENOMEM;
        usemap = __kmalloc_section_usemap();
        if (!usemap) {
-               __kfree_section_memmap(memmap, altmap);
+               free_section_memmap(memmap, altmap);
                return -ENOMEM;
        }
 
@@ -756,7 +756,7 @@ int __meminit sparse_add_one_section(struct pglist_data 
*pgdat,
        pgdat_resize_unlock(pgdat, &flags);
        if (ret < 0) {
                kfree(usemap);
-               __kfree_section_memmap(memmap, altmap);
+               free_section_memmap(memmap, altmap);
        }
        return ret;
 }
@@ -798,7 +798,7 @@ static void free_section_usemap(struct page *memmap, 
unsigned long *usemap,
        if (PageSlab(usemap_page) || PageCompound(usemap_page)) {
                kfree(usemap);
                if (memmap)
-                       __kfree_section_memmap(memmap, altmap);
+                       free_section_memmap(memmap, altmap);
                return;
        }
 
-- 
2.13.6

Reply via email to