函数逻辑报告

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() - Allocate an ID.*@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(struct idr *idr, void *ptr, int start, int end, gfp_t gfp)

返回类型:int

参数:

类型参数名称
struct idr *idr
void *ptr
intstart
intend
gfp_tgfp
81  id等于start
84  如果WARN_ON_ONCE(start < 0)则返回:负EINVAL
87  ret等于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.
88  如果ret则返回:ret
91  返回:id
调用者
名称描述
alloc_pid分配进程句柄
irq_timings_alloc
cgroup_idr_allocIDR wrappers which synchronize using cgroup_idr_lock
perf_pmu_register
mem_cgroup_alloc
bsg_register_queue
worker_pool_assign_idworker_pool_assign_id - allocate ID and assing it to @pool*@pool: the pool pointer of interest* Returns 0 if ID in [0, WORK_OFFQ_POOL_NONE) is allocated and assigned* successfully, -errno on failure.
prealloc_memcg_shrinker
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.
blk_alloc_devtlk_alloc_devt - allocate a dev_t for a partition*@part: partition to allocate dev_t for*@devt: out parameter for resulting dev_t* Allocate a dev_t for block device
aa_alloc_secidaa_alloc_secid - allocate a new secid for a profile*@label: the label to allocate a secid for*@gfp: memory allocation flags* Returns: 0 with @label->secid initialized* <0 returns error with @label->secid set to AA_SECID_INVALID