aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/slab.h
diff options
context:
space:
mode:
authorMichael Opdenacker <michael.opdenacker@free-electrons.com>2013-06-25 12:16:55 -0400
committerPekka Enberg <penberg@kernel.org>2013-07-07 12:02:59 -0400
commite7efa615ccf78394338144ff0187be331240748a (patch)
tree7daaf9b4106ec8fb9e8e946a07fcc2b7cf901547 /include/linux/slab.h
parent0f8f8094d28eb53368ac09186ea6b3a324cc7d44 (diff)
slab: add kmalloc() to kernel API documentation
At the moment, kmalloc() isn't even listed in the kernel API documentation (DocBook/kernel-api.html after running "make htmldocs"). Another issue is that the documentation for kmalloc_node() refers to kcalloc()'s documentation to describe its 'flags' parameter, while kcalloc() refered to kmalloc()'s documentation, which doesn't exist! This patch is a proposed fix for this. It also removes the documentation for kmalloc() in include/linux/slob_def.h which isn't included to generate the documentation anyway. This way, kmalloc() is described in only one place. Acked-by: Christoph Lameter <cl@linux.com> Acked-by: Randy Dunlap <rdunlap@infradead.org> Signed-off-by: Michael Opdenacker <michael.opdenacker@free-electrons.com> Signed-off-by: Pekka Enberg <penberg@kernel.org>
Diffstat (limited to 'include/linux/slab.h')
-rw-r--r--include/linux/slab.h18
1 files changed, 14 insertions, 4 deletions
diff --git a/include/linux/slab.h b/include/linux/slab.h
index 9690c14eb7fb..6c5cc0ea8713 100644
--- a/include/linux/slab.h
+++ b/include/linux/slab.h
@@ -373,9 +373,8 @@ int cache_show(struct kmem_cache *s, struct seq_file *m);
373void print_slabinfo_header(struct seq_file *m); 373void print_slabinfo_header(struct seq_file *m);
374 374
375/** 375/**
376 * kmalloc_array - allocate memory for an array. 376 * kmalloc - allocate memory
377 * @n: number of elements. 377 * @size: how many bytes of memory are required.
378 * @size: element size.
379 * @flags: the type of memory to allocate. 378 * @flags: the type of memory to allocate.
380 * 379 *
381 * The @flags argument may be one of: 380 * The @flags argument may be one of:
@@ -422,6 +421,17 @@ void print_slabinfo_header(struct seq_file *m);
422 * There are other flags available as well, but these are not intended 421 * There are other flags available as well, but these are not intended
423 * for general use, and so are not documented here. For a full list of 422 * for general use, and so are not documented here. For a full list of
424 * potential flags, always refer to linux/gfp.h. 423 * potential flags, always refer to linux/gfp.h.
424 *
425 * kmalloc is the normal method of allocating memory
426 * in the kernel.
427 */
428static __always_inline void *kmalloc(size_t size, gfp_t flags);
429
430/**
431 * kmalloc_array - allocate memory for an array.
432 * @n: number of elements.
433 * @size: element size.
434 * @flags: the type of memory to allocate (see kmalloc).
425 */ 435 */
426static inline void *kmalloc_array(size_t n, size_t size, gfp_t flags) 436static inline void *kmalloc_array(size_t n, size_t size, gfp_t flags)
427{ 437{
@@ -445,7 +455,7 @@ static inline void *kcalloc(size_t n, size_t size, gfp_t flags)
445/** 455/**
446 * kmalloc_node - allocate memory from a specific node 456 * kmalloc_node - allocate memory from a specific node
447 * @size: how many bytes of memory are required. 457 * @size: how many bytes of memory are required.
448 * @flags: the type of memory to allocate (see kcalloc). 458 * @flags: the type of memory to allocate (see kmalloc).
449 * @node: node to allocate from. 459 * @node: node to allocate from.
450 * 460 *
451 * kmalloc() for non-local nodes, used to allocate from a specific node 461 * kmalloc() for non-local nodes, used to allocate from a specific node