Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:xas_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()

Proto:static void *xas_create(struct xa_state *xas, bool allow_root)

Type:void

Parameter:

TypeParameterName
struct xa_state *xas
boolallow_root
637  xa = xa
639  __rcu * slot
640  node = xa_node
642  order = xa_shift
644  If True if the node represents head-of-tree, RESTART or BOUNDS Then
645  entry = Private
646  xa_node = NULL
647  If Not entry && xa_zero_busy(xa) Then entry = XA_ZERO_ENTRY
649  shift = xas_expand adds nodes to the head of the tree until it has reached* sufficient height to be able to contain @xas->xa_index
650  If shift < 0 Then Return NULL
652  If Not shift && Not allow_root Then shift = The xarray is constructed out of a set of 'chunks' of pointers
654  entry = Private
655  slot = xa_head
656  Else if xas_error() - Return an errno stored in the xa_state.*@xas: XArray operation state.* Return: 0 if no error has been noted. A negative errno if one has. Then
657  Return NULL
658  Else if node Then
659  offset = xa_offset
661  shift = Bits remaining in each slot
662  entry = Private
663  slot = slots[offset]
664  Else
665  shift = 0
666  entry = Private
667  slot = xa_head
670  When shift > order cycle
671  shift -= The xarray is constructed out of a set of 'chunks' of pointers
672  If Not entry Then
673  node = xas_alloc(xas, shift)
674  If Not node Then Break
679  Else if Private Then
680  node = Private
681  Else
682  Break
684  entry = xas_descend(xas, node)
685  slot = slots[xa_offset]
688  Return entry
Caller
NameDescribe
xas_create_rangexas_create_range() - Ensure that stores to this range will succeed*@xas: XArray operation state.* Creates all of the slots in the range covered by @xas. Sets @xas to* create single-index entries and positions it at the beginning of the* range
xas_storexas_store() - Store this entry in the XArray
xa_store_rangexa_store_range() - Store this entry at a range of indices in the XArray