struct dev_pagemap *pgmap);
extern void sparse_remove_section(unsigned long pfn, unsigned long nr_pages,
struct vmem_altmap *altmap);
-extern struct page *sparse_decode_mem_map(unsigned long coded_mem_map,
- unsigned long pnum);
extern struct zone *zone_for_pfn_range(enum mmop online_type,
int nid, struct memory_group *group, unsigned long start_pfn,
unsigned long nr_pages);
return coded_mem_map;
}
-#ifdef CONFIG_MEMORY_HOTPLUG
-/*
- * Decode mem_map from the coded memmap
- */
-struct page *sparse_decode_mem_map(unsigned long coded_mem_map, unsigned long pnum)
-{
- /* mask off the extra low bits of information */
- coded_mem_map &= SECTION_MAP_MASK;
- return ((struct page *)coded_mem_map) + section_nr_to_pfn(pnum);
-}
-#endif /* CONFIG_MEMORY_HOTPLUG */
-
static void __meminit sparse_init_one_section(struct mem_section *ms,
unsigned long pnum, struct page *mem_map,
struct mem_section_usage *usage, unsigned long flags)
empty = is_subsection_map_empty(ms);
if (empty) {
- unsigned long section_nr = pfn_to_section_nr(pfn);
-
/*
* Mark the section invalid so that valid_section()
* return false. This prevents code from dereferencing
kfree_rcu(ms->usage, rcu);
WRITE_ONCE(ms->usage, NULL);
}
- memmap = sparse_decode_mem_map(ms->section_mem_map, section_nr);
+ memmap = pfn_to_page(SECTION_ALIGN_DOWN(pfn));
}
/*