函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:ipc\util.c Create Date:2022-07-27 18:14:54
Last Modify:2022-05-23 18:05:07 Copyright©Brick
首页 函数Tree
注解内核,赢得工具下载SCCTEnglish

函数名称:Insert 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.

函数原型:static inline int ipc_idr_alloc(struct ipc_ids *ids, struct kern_ipc_perm *new)

返回类型:int

参数:

类型参数名称
struct ipc_ids *ids
struct kern_ipc_perm *new
203  next_id等于负1
222  如果next_id小于0则
225  max_idx等于两数取大(in_use * 3 / 2, ipc_min_cycle)
226  max_idx等于两数取小(max_idx, ipc_mni)
229  idx等于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.
232  如果idx大于等于0则
238  如果idx小于等于last_idx
239  seq自加
240  如果seq大于等于ipcid_seq_max()则seq等于0
243  last_idx等于idx
245  seq等于seq
252  否则
253  seq等于ipcid_to_seqx(next_id)
254  idx等于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.
257  如果idx大于等于0则id等于seq左移ipcmni_seq_shift()位的值加idx
259  返回:idx
调用者
名称描述
ipc_addidpc_addid - add an ipc identifier*@ids: ipc identifier set*@new: new ipc permission set*@limit: limit for the number of used ids* Add an entry 'new' to the ipc ids idr