Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

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

Proto:int ipc_addid(struct ipc_ids *ids, struct kern_ipc_perm *new, int limit)

Type:int

Parameter:

TypeParameterName
struct ipc_ids *ids
struct kern_ipc_perm *new
intlimit
284  _set - set a refcount's value*@r: the refcount*@n: value to which the refcount will be set
286  If limit > ipc_mni Then limit = ipc_mni
289  If in_use >= limit Then Return -ENOSPC
292  dr_preload - preload for idr_alloc()*@gfp_mask: allocation mask to use for preloading* Preallocate memory to use for the next call to idr_alloc(). This function* returns with preemption disabled. It will be enabled by idr_preload_end().
294  Process spin lock initialization( & lock)
295  _read_lock() - mark the beginning of an RCU read-side critical section* When synchronize_rcu() is invoked on one CPU while other CPUs* are within RCU read-side critical sections, then the* synchronize_rcu() is guaranteed to block until after all the other
296  spin_lock( & lock)
298  current_euid_egid( & euid, & egid)
299  cuid = uid = euid
300  gid = cgid = egid
302  deleted = false
304  idx = 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.
305  dr_preload_end - end preload section started with idr_preload()* Each idr_preload() should be matched with an invocation of this* function. See idr_preload() for details.
307  If idx >= 0 && key != IPC_PRIVATE Then
308  err = hashtable_insert_fast - insert object into hash table*@ht: hash table*@obj: pointer to hash head inside object*@params: hash table parameters* Will take the per bucket bitlock to protect against mutual mutations* on the same bucket
310  If err < 0 Then
312  idx = err
315  If idx < 0 Then
316  deleted = true
317  spin_unlock( & lock)
318  _read_unlock() - marks the end of an RCU read-side critical section.* In most situations, rcu_read_unlock() is immune from deadlock.* However, in kernels built with CONFIG_RCU_BOOST, rcu_read_unlock()
319  Return idx
322  in_use++
323  If idx > max_idx Then max_idx = idx
325  Return idx
Caller
NameDescribe
newquewque - Create a new msg queue*@ns: namespace*@params: ptr to the structure that contains the key and msgflg* Called with msg_ids.rwsem held (writer)
newarywary - Create a new semaphore set*@ns: namespace*@params: ptr to the structure that contains key, semflg and nsems* Called with sem_ids.rwsem held (as a writer)
newsegwseg - Create a new shared memory segment*@ns: namespace*@params: ptr to the structure that contains key, size and shmflg* Called with shm_ids.rwsem held as a writer.