Commit f1c4069e authored by Joonsoo Kim's avatar Joonsoo Kim Committed by Linus Torvalds

mm, vmalloc: export vmap_area_list, instead of vmlist

Although our intention is to unexport internal structure entirely, but
there is one exception for kexec.  kexec dumps address of vmlist and
makedumpfile uses this information.

We are about to remove vmlist, then another way to retrieve information
of vmalloc layer is needed for makedumpfile.  For this purpose, we
export vmap_area_list, instead of vmlist.
Signed-off-by: default avatarJoonsoo Kim <js1304@gmail.com>
Signed-off-by: default avatarJoonsoo Kim <iamjoonsoo.kim@lge.com>
Cc: Eric Biederman <ebiederm@xmission.com>
Cc: Dave Anderson <anderson@redhat.com>
Cc: Vivek Goyal <vgoyal@redhat.com>
Cc: Atsushi Kumagai <kumagai-atsushi@mxc.nes.nec.co.jp>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: "H. Peter Anvin" <hpa@zytor.com>
Cc: Chris Metcalf <cmetcalf@tilera.com>
Cc: Guan Xuetao <gxt@mprc.pku.edu.cn>
Cc: Ingo Molnar <mingo@kernel.org>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent d4033afd
...@@ -130,8 +130,7 @@ extern long vwrite(char *buf, char *addr, unsigned long count); ...@@ -130,8 +130,7 @@ extern long vwrite(char *buf, char *addr, unsigned long count);
/* /*
* Internals. Dont't use.. * Internals. Dont't use..
*/ */
extern rwlock_t vmlist_lock; extern struct list_head vmap_area_list;
extern struct vm_struct *vmlist;
extern __init void vm_area_add_early(struct vm_struct *vm); extern __init void vm_area_add_early(struct vm_struct *vm);
extern __init void vm_area_register_early(struct vm_struct *vm, size_t align); extern __init void vm_area_register_early(struct vm_struct *vm, size_t align);
......
...@@ -1577,7 +1577,7 @@ static int __init crash_save_vmcoreinfo_init(void) ...@@ -1577,7 +1577,7 @@ static int __init crash_save_vmcoreinfo_init(void)
VMCOREINFO_SYMBOL(swapper_pg_dir); VMCOREINFO_SYMBOL(swapper_pg_dir);
#endif #endif
VMCOREINFO_SYMBOL(_stext); VMCOREINFO_SYMBOL(_stext);
VMCOREINFO_SYMBOL(vmlist); VMCOREINFO_SYMBOL(vmap_area_list);
#ifndef CONFIG_NEED_MULTIPLE_NODES #ifndef CONFIG_NEED_MULTIPLE_NODES
VMCOREINFO_SYMBOL(mem_map); VMCOREINFO_SYMBOL(mem_map);
......
...@@ -228,8 +228,7 @@ int follow_pfn(struct vm_area_struct *vma, unsigned long address, ...@@ -228,8 +228,7 @@ int follow_pfn(struct vm_area_struct *vma, unsigned long address,
} }
EXPORT_SYMBOL(follow_pfn); EXPORT_SYMBOL(follow_pfn);
DEFINE_RWLOCK(vmlist_lock); LIST_HEAD(vmap_area_list);
struct vm_struct *vmlist;
void vfree(const void *addr) void vfree(const void *addr)
{ {
......
...@@ -261,7 +261,8 @@ struct vmap_area { ...@@ -261,7 +261,8 @@ struct vmap_area {
}; };
static DEFINE_SPINLOCK(vmap_area_lock); static DEFINE_SPINLOCK(vmap_area_lock);
static LIST_HEAD(vmap_area_list); /* Export for kexec only */
LIST_HEAD(vmap_area_list);
static struct rb_root vmap_area_root = RB_ROOT; static struct rb_root vmap_area_root = RB_ROOT;
/* The vmap cache globals are protected by vmap_area_lock */ /* The vmap cache globals are protected by vmap_area_lock */
...@@ -272,6 +273,10 @@ static unsigned long cached_align; ...@@ -272,6 +273,10 @@ static unsigned long cached_align;
static unsigned long vmap_area_pcpu_hole; static unsigned long vmap_area_pcpu_hole;
/*** Old vmalloc interfaces ***/
static DEFINE_RWLOCK(vmlist_lock);
static struct vm_struct *vmlist;
static struct vmap_area *__find_vmap_area(unsigned long addr) static struct vmap_area *__find_vmap_area(unsigned long addr)
{ {
struct rb_node *n = vmap_area_root.rb_node; struct rb_node *n = vmap_area_root.rb_node;
...@@ -1283,10 +1288,6 @@ int map_vm_area(struct vm_struct *area, pgprot_t prot, struct page ***pages) ...@@ -1283,10 +1288,6 @@ int map_vm_area(struct vm_struct *area, pgprot_t prot, struct page ***pages)
} }
EXPORT_SYMBOL_GPL(map_vm_area); EXPORT_SYMBOL_GPL(map_vm_area);
/*** Old vmalloc interfaces ***/
DEFINE_RWLOCK(vmlist_lock);
struct vm_struct *vmlist;
static void setup_vmalloc_vm(struct vm_struct *vm, struct vmap_area *va, static void setup_vmalloc_vm(struct vm_struct *vm, struct vmap_area *va,
unsigned long flags, const void *caller) unsigned long flags, const void *caller)
{ {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment