mm: remove free_unmap_vmap_area_addr()
Just inline it into the only caller. Change-Id: I5691805a6cec3e9e160b653551a99c6c998ff087 Link: http://lkml.kernel.org/r/1479474236-4139-3-git-send-email-hch@lst.de Signed-off-by: Christoph Hellwig <hch@lst.de> Tested-by: Jisheng Zhang <jszhang@marvell.com> Cc: Andrey Ryabinin <aryabinin@virtuozzo.com> Cc: Joel Fernandes <joelaf@google.com> Cc: Chris Wilson <chris@chris-wilson.co.uk> Cc: John Dias <joaodias@google.com> Cc: Thomas Gleixner <tglx@linutronix.de> Cc: "H. Peter Anvin" <hpa@zytor.com> Cc: Ingo Molnar <mingo@elte.hu> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> Git-commit: 9c3acf6043ac437ae0a45de4657ee700c3dc8850 Git-repo: git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git Signed-off-by: Vinayak Menon <vinmenon@codeaurora.org>
This commit is contained in:
parent
b4734e5498
commit
a0f320ed87
1 changed files with 8 additions and 13 deletions
21
mm/vmalloc.c
21
mm/vmalloc.c
|
@ -757,16 +757,6 @@ static struct vmap_area *find_vmap_area(unsigned long addr)
|
|||
return va;
|
||||
}
|
||||
|
||||
static void free_unmap_vmap_area_addr(unsigned long addr)
|
||||
{
|
||||
struct vmap_area *va;
|
||||
|
||||
va = find_vmap_area(addr);
|
||||
BUG_ON(!va);
|
||||
free_unmap_vmap_area(va);
|
||||
}
|
||||
|
||||
|
||||
/*** Per cpu kva allocator ***/
|
||||
|
||||
/*
|
||||
|
@ -1124,6 +1114,7 @@ void vm_unmap_ram(const void *mem, unsigned int count)
|
|||
{
|
||||
unsigned long size = count << PAGE_SHIFT;
|
||||
unsigned long addr = (unsigned long)mem;
|
||||
struct vmap_area *va;
|
||||
|
||||
BUG_ON(!addr);
|
||||
BUG_ON(addr < VMALLOC_START);
|
||||
|
@ -1133,10 +1124,14 @@ void vm_unmap_ram(const void *mem, unsigned int count)
|
|||
debug_check_no_locks_freed(mem, size);
|
||||
vmap_debug_free_range(addr, addr+size);
|
||||
|
||||
if (likely(count <= VMAP_MAX_ALLOC))
|
||||
if (likely(count <= VMAP_MAX_ALLOC)) {
|
||||
vb_free(mem, size);
|
||||
else
|
||||
free_unmap_vmap_area_addr(addr);
|
||||
return;
|
||||
}
|
||||
|
||||
va = find_vmap_area(addr);
|
||||
BUG_ON(!va);
|
||||
free_unmap_vmap_area(va);
|
||||
}
|
||||
EXPORT_SYMBOL(vm_unmap_ram);
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue