nick kvfree() from apparmor

too many places open-code it

Signed-off-by: Al Viro <[email protected]>
This commit is contained in:
Al Viro 2014-05-06 14:02:53 -04:00
commit 39f1f78d53
4 changed files with 12 additions and 15 deletions

View file

@ -10,6 +10,7 @@
#include <linux/swapops.h>
#include <linux/mman.h>
#include <linux/hugetlb.h>
#include <linux/vmalloc.h>
#include <asm/uaccess.h>
@ -387,6 +388,15 @@ unsigned long vm_mmap(struct file *file, unsigned long addr,
}
EXPORT_SYMBOL(vm_mmap);
void kvfree(const void *addr)
{
if (is_vmalloc_addr(addr))
vfree(addr);
else
kfree(addr);
}
EXPORT_SYMBOL(kvfree);
struct address_space *page_mapping(struct page *page)
{
struct address_space *mapping = page->mapping;