From: Jeff Layton Date: Fri, 6 Jun 2008 05:47:00 +0000 (-0700) Subject: vm: add kzalloc_node() inline X-Git-Tag: v2.6.26-rc6~37 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=979b0fea2d9ae5d57237a368d571cbc84655fba6;p=linux-2.6 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 Cc: Christoph Lameter Cc: Pekka Enberg Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/include/linux/slab.h b/include/linux/slab.h index 805ed4b92f..c2ad350165 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 *);