Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:xas_alloc

Proto:static void *xas_alloc(struct xa_state *xas, unsigned int shift)

Type:void

Parameter:

TypeParameterName
struct xa_state *xas
unsigned intshift
357  parent = xa_node
358  node = xa_alloc
360  If xas_invalid() - Is the xas in a retry or error state?*@xas: XArray operation state.* Return: %true if the xas cannot be used for operations. Then Return NULL
363  If node Then
364  xa_alloc = NULL
365  Else
366  gfp = GFP_NOWAIT | DOC: Action modifiers* Action modifiers* ~~~~~~~~~~~~~~~~* %__GFP_NOWARN suppresses allocation failure reports.* %__GFP_COMP address compound page metadata.* %__GFP_ZERO returns a zeroed page on success.
368  If private: The rest of the data structure is not to be used directly. & XA_FLAGS_ACCOUNT Then gfp |= __GFP_ACCOUNT
371  node = kmem_cache_alloc(Move the radix tree node cache here , gfp)
372  If Not node Then
374  Return NULL
378  If parent Then
379  Slot offset in parent = xa_offset
380  Total entry count ++
381  XA_NODE_BUG_ON(node, Total entry count > XA_CHUNK_SIZE)
382  xas_update(xas, parent)
384  XA_NODE_BUG_ON(node, shift > BITS_PER_LONG)
385  XA_NODE_BUG_ON(node, !list_empty - tests whether a list is empty*@head: the list to test.)
386  Bits remaining in each slot = shift
387  Total entry count = 0
388  Value entry count = 0
389  RCU_INIT_POINTER() - initialize an RCU protected pointer*@p: The pointer to be initialized.*@v: The value to initialized the pointer to.* Initialize an RCU-protected pointer in special cases where readers(NULL at top of tree , xa_node)
390  The array we belong to = xa
392  Return node
Caller
NameDescribe
xas_expandxas_expand adds nodes to the head of the tree until it has reached* sufficient height to be able to contain @xas->xa_index
xas_createxas_create() - Create a slot to store an entry in.*@xas: XArray operation state.*@allow_root: %true if we can store the entry in the root directly* Most users will not need to call this function directly, as it is called* by xas_store()