函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:lib\xarray.c Create Date:2022-07-27 07:10:37
Last Modify:2020-03-12 14:18:49 Copyright©Brick
首页 函数Tree
注解内核,赢得工具下载SCCTEnglish

函数名称:xas_alloc

函数原型:static void *xas_alloc(struct xa_state *xas, unsigned int shift)

返回类型:void

参数:

类型参数名称
struct xa_state *xas
unsigned intshift
357  parent等于xa_node
358  node等于xa_alloc
360  如果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.则返回:NULL
363  如果node
364  xa_alloc = NULL
365  否则
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  如果private: The rest of the data structure is not to be used directly. 按位与XA_FLAGS_ACCOUNTgfp或等于__GFP_ACCOUNT
371  node等于kmem_cache_alloc(Move the radix tree node cache here , gfp)
372  如果非node
374  返回:NULL
378  如果parent
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, !链表为空)
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  返回:node
调用者
名称描述
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()