函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:dr_alloc_cyclic() - Allocate an ID cyclically.*@idr: IDR handle.*@ptr: Pointer to be associated with the new ID.*@start: The minimum ID (inclusive).*@end: The maximum ID (exclusive).*@gfp: Memory allocation flags.

函数原型:int idr_alloc_cyclic(struct idr *idr, void *ptr, int start, int end, gfp_t gfp)

返回类型:int

参数:

类型参数名称
struct idr *idr
void *ptr
intstart
intend
gfp_tgfp
119  id等于idr_next
120  max等于如果end大于0则end减1否则INT_MAX
122  如果id小于startid等于start
125  err等于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.
126  如果err恒等于负ENOSPCid大于start
127  id等于start
128  err等于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.
130  如果err则返回:err
133  idr_next等于id加1
134  返回:id
调用者
名称描述
cgroup_init_root_id
bpf_map_alloc_id
bpf_prog_alloc_id
btf_alloc_id
alloc_pid分配进程句柄
ipc_idr_allocInsert new IPC object into idr tree, and set sequence number and id* in the correct order.* Especially:* - the sequence number must be set before inserting the object into the idr,* because the sequence number is accessed without a lock.
inotify_add_to_idr