Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:ipc\util.c Create Date:2022-07-28 16:39:35
Last Modify:2022-05-23 18:05:07 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

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

Proto:static inline int ipc_idr_alloc(struct ipc_ids *ids, struct kern_ipc_perm *new)

Type:int

Parameter:

TypeParameterName
struct ipc_ids *ids
struct kern_ipc_perm *new
203  next_id = -1
222  If next_id < 0 Then
225  max_idx = max - return maximum of two values of the same or compatible types*@x: first value*@y: second value(in_use * 3 / 2, ipc_min_cycle)
226  max_idx = min - return minimum of two values of the same or compatible types*@x: first value*@y: second value(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  If idx >= 0 Then
238  If idx <= last_idx Then
239  seq++
240  If seq >= ipcid_seq_max() Then seq = 0
243  last_idx = idx
245  seq = seq
252  Else
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  If idx >= 0 Then id = (seq << ipcmni_seq_shift()) + idx
259  Return idx
Caller
NameDescribe
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