Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:lib\genalloc.c Create Date:2022-07-28 06:57:06
Last Modify:2020-03-12 14:18:49 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:devm_gen_pool_create - managed gen_pool_create*@dev: device that provides the gen_pool*@min_alloc_order: log base 2 of number of bytes each bitmap bit represents*@nid: node selector for allocated gen_pool, %NUMA_NO_NODE for all nodes*@name: name of a

Proto:struct gen_pool *devm_gen_pool_create(struct device *dev, int min_alloc_order, int nid, const char *name)

Type:struct gen_pool

Parameter:

TypeParameterName
struct device *dev
intmin_alloc_order
intnid
const char *name
826  const char * pool_name = NULL
829  If gen_pool_get - Obtain the gen_pool (if any) for a device*@dev: device to retrieve the gen_pool from*@name: name of a gen_pool or NULL, identifies a particular gen_pool on device* Returns the gen_pool for the device if one is present, or NULL. Then Return ERR_PTR( - EINVAL)
832  If name Then
833  pool_name = kstrdup_const - conditionally duplicate an existing const string*@s: the string to duplicate*@gfp: the GFP mask used in the kmalloc() call when allocating memory* Note: Strings allocated by kstrdup_const should be freed by kfree_const.
834  If Not pool_name Then Return ERR_PTR( - ENOMEM)
838  ptr = devres_alloc(devm_gen_pool_release, size of ptr , GFP_KERNEL)
839  If Not ptr Then Go to free_pool_name
842  pool = gen_pool_create - create a new special memory pool*@min_alloc_order: log base 2 of number of bytes each bitmap bit represents*@nid: node id of the node the pool structure should be allocated on, or -1* Create a new special memory pool that can be used to
843  If Not pool Then Go to free_devres
846  ptr = pool
847  name = pool_name
848  devres_add(dev, ptr)
850  Return pool
852  free_devres :
853  devres_free(ptr)
854  free_pool_name :
855  kfree_const - conditionally free memory*@x: pointer to the memory* Function calls kfree only if @x is not in .rodata section.
857  Return ERR_PTR( - ENOMEM)