summaryrefslogtreecommitdiffstats
path: root/include/linux/slab.h
diff options
context:
space:
mode:
authorJeff Layton <jlayton@redhat.com>2008-06-05 22:47:00 -0700
committerLinus Torvalds <torvalds@linux-foundation.org>2008-06-06 11:29:14 -0700
commit979b0fea2d9ae5d57237a368d571cbc84655fba6 (patch)
tree7881f99767cecba11351fdfc0ec06d46a92a6e23 /include/linux/slab.h
parentef421be741a3e56cb89088a7dd4f73cc38739d1b (diff)
downloadkernel-crypto-979b0fea2d9ae5d57237a368d571cbc84655fba6.tar.gz
kernel-crypto-979b0fea2d9ae5d57237a368d571cbc84655fba6.tar.xz
kernel-crypto-979b0fea2d9ae5d57237a368d571cbc84655fba6.zip
vm: add kzalloc_node() inline
To get zeroed out memory from a particular NUMA node. To be used by sunrpc. Signed-off-by: Jeff Layton <jlayton@redhat.com> Cc: Christoph Lameter <clameter@sgi.com> Cc: Pekka Enberg <penberg@cs.helsinki.fi> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'include/linux/slab.h')
-rw-r--r--include/linux/slab.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/include/linux/slab.h b/include/linux/slab.h
index 805ed4b92f9..c2ad3501659 100644
--- a/include/linux/slab.h
+++ b/include/linux/slab.h
@@ -276,6 +276,17 @@ static inline void *kzalloc(size_t size, gfp_t flags)
return kmalloc(size, flags | __GFP_ZERO);
}
+/**
+ * kzalloc_node - allocate zeroed memory from a particular memory node.
+ * @size: how many bytes of memory are required.
+ * @flags: the type of memory to allocate (see kmalloc).
+ * @node: memory node from which to allocate
+ */
+static inline void *kzalloc_node(size_t size, gfp_t flags, int node)
+{
+ return kmalloc_node(size, flags | __GFP_ZERO, node);
+}
+
#ifdef CONFIG_SLABINFO
extern const struct seq_operations slabinfo_op;
ssize_t slabinfo_write(struct file *, const char __user *, size_t, loff_t *);