Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name: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.

Proto:int idr_alloc_cyclic(struct idr *idr, void *ptr, int start, int end, gfp_t gfp)

Type:int

Parameter:

TypeParameterName
struct idr *idr
void *ptr
intstart
intend
gfp_tgfp
119  id = idr_next
120  max = If end > 0 Then end - 1 Else INT_MAX
122  If id < start Then id = 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  If err == -ENOSPC && id > start Then
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  If err Then Return err
133  idr_next = id + 1
134  Return id
Caller
NameDescribe
cgroup_init_root_id
bpf_map_alloc_id
bpf_prog_alloc_id
btf_alloc_id