summaryrefslogtreecommitdiff
path: root/include/linux/mm.h
diff options
context:
space:
mode:
authorStephen Rothwell <sfr@canb.auug.org.au>2017-04-20 15:55:28 +1000
committerStephen Rothwell <sfr@canb.auug.org.au>2017-04-20 15:55:28 +1000
commit742bb87ba1769b20d0cc69459ec70227388818aa (patch)
tree8eb642eed7ec67dd7d2c7e9f4b16a12111488e80 /include/linux/mm.h
parent96ea0159c4161a92a1727fb06db44257b8e74ce4 (diff)
parent7370e0f939cf6836fd02b535db16929d8844eb95 (diff)
downloadlinux-next-742bb87ba1769b20d0cc69459ec70227388818aa.tar.gz
Merge branch 'akpm/master'
Diffstat (limited to 'include/linux/mm.h')
-rw-r--r--include/linux/mm.h22
1 files changed, 22 insertions, 0 deletions
diff --git a/include/linux/mm.h b/include/linux/mm.h
index cbdbe0be3127..c82e8dbc81ea 100644
--- a/include/linux/mm.h
+++ b/include/linux/mm.h
@@ -518,6 +518,28 @@ static inline int is_vmalloc_or_module_addr(const void *x)
}
#endif
+extern void *kvmalloc_node(size_t size, gfp_t flags, int node);
+static inline void *kvmalloc(size_t size, gfp_t flags)
+{
+ return kvmalloc_node(size, flags, NUMA_NO_NODE);
+}
+static inline void *kvzalloc_node(size_t size, gfp_t flags, int node)
+{
+ return kvmalloc_node(size, flags | __GFP_ZERO, node);
+}
+static inline void *kvzalloc(size_t size, gfp_t flags)
+{
+ return kvmalloc(size, flags | __GFP_ZERO);
+}
+
+static inline void *kvmalloc_array(size_t n, size_t size, gfp_t flags)
+{
+ if (size != 0 && n > SIZE_MAX / size)
+ return NULL;
+
+ return kvmalloc(n * size, flags);
+}
+
extern void kvfree(const void *addr);
static inline atomic_t *compound_mapcount_ptr(struct page *page)