函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:__xas_nomem() - Drop locks and allocate memory if needed.*@xas: XArray operation state.*@gfp: Memory allocation flags.* Internal variant of xas_nomem().* Return: true if memory was needed, and was successfully allocated.

函数原型:static bool __xas_nomem(struct xa_state *xas, gfp_t gfp)__must_hold(xas->xa->xa_lock)

返回类型:bool

参数:

类型参数名称
struct xa_state *xas
gfp_tgfp
325  lock_type等于Coding conventions in this file:*@xa is used to refer to the entire xarray
327  如果xa_node不等于We encode errnos in the xas->xa_node. If an error has happened, we need to* drop the lock to fix it, and once we've done so the xa_state is invalid.( - ENOMEM)则
328  xas_destroy() - Free any resources allocated during the XArray operation.*@xas: XArray operation state.* This function is now internal-only.
329  返回:false
331  如果private: The rest of the data structure is not to be used directly. 按位与XA_FLAGS_ACCOUNTgfp或等于__GFP_ACCOUNT
333  如果gfpflags_allow_blocking(gfp)则
334  xas_unlock_type(xas, lock_type)
335  xa_alloc等于kmem_cache_alloc(Move the radix tree node cache here , gfp)
336  xas_lock_type(xas, lock_type)
337  否则
338  xa_alloc等于kmem_cache_alloc(Move the radix tree node cache here , gfp)
340  如果非xa_alloc则返回:false
342  XA_NODE_BUG_ON(xa_alloc, !链表为空)
343  xa_node等于XAS_RESTART
344  返回:true
调用者
名称描述
__xa_store__xa_store() - Store this entry in the XArray
__xa_cmpxchg__xa_cmpxchg() - Store this entry in the XArray
__xa_insert__xa_insert() - Store this entry in the XArray if no entry is present.*@xa: XArray.*@index: Index into array.*@entry: New entry.*@gfp: Memory allocation flags.* Inserting a NULL entry will store a reserved entry (like xa_reserve())* if no entry is present
__xa_alloc
__xa_alloc__xa_alloc() - Find somewhere to store this entry in the XArray