Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:dr_alloc_u32() - Allocate an ID.*@idr: IDR handle.*@ptr: Pointer to be associated with the new ID.*@nextid: Pointer to an ID.*@max: The maximum ID to allocate (inclusive).*@gfp: Memory allocation flags.

Proto:int idr_alloc_u32(struct idr *idr, void *ptr, u32 *nextid, unsigned long max, gfp_t gfp)

Type:int

Parameter:

TypeParameterName
struct idr *idr
void *ptr
u32 *nextid
unsigned longmax
gfp_tgfp
37  __rcu * slot
38  base = idr_base
39  id = nextid
41  If WARN_ON_ONCE(!(private: The rest of the data structure is not to be used directly. & The IDR tag is stored in the low bits of xa_flags )) Then private: The rest of the data structure is not to be used directly. |= Set the IDR flag and the IDR_FREE tag
44  id = If id < base Then 0 Else id - base
45  adix_tree_iter_init - initialize radix tree iterator*@iter: pointer to iterator state*@start: iteration starting index* Returns: NULL
46  slot = idr_get_free( & idr_rt, & iter, gfp, max - base)
47  If IS_ERR(slot) Then Return PTR_ERR(slot)
50  nextid = index + base
52  adix_tree_iter_replace - replace item in a slot*@root: radix tree root*@slot: pointer to slot*@item: new item to store in the slot.* For use with radix_tree_for_each_slot().* Caller must hold tree write locked.
53  adix_tree_iter_tag_clear - clear a tag on the current iterator entry*@root: radix tree root*@iter: iterator state*@tag: tag to clear
55  Return 0