Commit ed81745a authored by Andrii Nakryiko's avatar Andrii Nakryiko Committed by Alexei Starovoitov

mm: Implement no-MMU variant of vmalloc_user_node_flags

To fix build with !CONFIG_MMU, implement it for no-MMU configurations as well.

Fixes: fc970227 ("bpf: Add mmap() support for BPF_MAP_TYPE_ARRAY")
Reported-by: default avatarkbuild test robot <lkp@intel.com>
Signed-off-by: default avatarAndrii Nakryiko <andriin@fb.com>
Signed-off-by: default avatarAlexei Starovoitov <ast@kernel.org>
Acked-by: default avatarJohannes Weiner <hannes@cmpxchg.org>
Acked-by: default avatarJohn Fastabend <john.fastabend@gmail.com>
Link: https://lore.kernel.org/bpf/20191123220835.1237773-1-andriin@fb.com
parent c431047c
...@@ -155,11 +155,11 @@ void *__vmalloc_node_flags(unsigned long size, int node, gfp_t flags) ...@@ -155,11 +155,11 @@ void *__vmalloc_node_flags(unsigned long size, int node, gfp_t flags)
return __vmalloc(size, flags, PAGE_KERNEL); return __vmalloc(size, flags, PAGE_KERNEL);
} }
void *vmalloc_user(unsigned long size) static void *__vmalloc_user_flags(unsigned long size, gfp_t flags)
{ {
void *ret; void *ret;
ret = __vmalloc(size, GFP_KERNEL | __GFP_ZERO, PAGE_KERNEL); ret = __vmalloc(size, flags, PAGE_KERNEL);
if (ret) { if (ret) {
struct vm_area_struct *vma; struct vm_area_struct *vma;
...@@ -172,8 +172,19 @@ void *vmalloc_user(unsigned long size) ...@@ -172,8 +172,19 @@ void *vmalloc_user(unsigned long size)
return ret; return ret;
} }
void *vmalloc_user(unsigned long size)
{
return __vmalloc_user_flags(size, GFP_KERNEL | __GFP_ZERO);
}
EXPORT_SYMBOL(vmalloc_user); EXPORT_SYMBOL(vmalloc_user);
void *vmalloc_user_node_flags(unsigned long size, int node, gfp_t flags)
{
return __vmalloc_user_flags(size, flags | __GFP_ZERO);
}
EXPORT_SYMBOL(vmalloc_user_node_flags);
struct page *vmalloc_to_page(const void *addr) struct page *vmalloc_to_page(const void *addr)
{ {
return virt_to_page(addr); return virt_to_page(addr);
......
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