Lines Matching full:ipc
3 * linux/ipc/util.c
8 * Occurs in several places in the IPC code.
10 * Nov 1999 - ipc helper functions, unified SMP locking
12 * Oct 2002 - One lock per IPC id. RCU ipc_free for lock-free grow_ary().
14 * Mar 2006 - support for audit of ipc object properties
20 * General sysv ipc locking scheme:
22 * obtain the ipc object (kern_ipc_perm) by looking up the id in an idr
28 * acquire the ipc lock (kern_ipc_perm.lock) through
35 * drop the ipc lock, through ipc_unlock_object().
39 * - creating, removing and iterating the existing entries in ipc
80 * ipc_init - initialise ipc subsystem
82 * The various sysv ipc resources (semaphores, messages and shared
109 * ipc_init_ids - initialise ipc identifiers
110 * @ids: ipc identifier set
112 * Set up the sequence range to use for the ipc identifier range (limited
134 * @ids: ipc id table to iterate.
162 * ipc_findkey - find a key in an ipc identifier set
163 * @ids: ipc identifier set
166 * Returns the locked pointer to the ipc structure if found or NULL
167 * otherwise. If key is found ipc points to the owning ipc structure
186 * Insert new IPC object into idr tree, and set sequence number and id
209 * and the lockless preparations for ipc operations can start. in ipc_idr_alloc()
234 * ipc_addid - add an ipc identifier
235 * @ids: ipc identifier set
236 * @new: new ipc permission set
239 * Add an entry 'new' to the ipc ids idr. The permissions object is
300 * ipcget_new - create a new ipc object
301 * @ns: ipc namespace
302 * @ids: ipc identifier set
321 * ipc_check_perms - check security and permissions for an ipc object
322 * @ns: ipc namespace
323 * @ipcp: ipc permission set
331 * On success, the ipc id is returned.
354 * ipcget_public - get an ipc object or create a new one
355 * @ns: ipc namespace
356 * @ids: ipc identifier set
365 * On success, the ipc id is returned.
387 /* ipc object has been locked by ipc_findkey() */ in ipcget_public()
397 * ipc_check_perms returns the IPC id on in ipcget_public()
410 * ipc_kht_remove - remove an ipc from the key hashtable
411 * @ids: ipc identifier set
412 * @ipcp: ipc perm structure containing the key to remove
425 * ipc_rmid - remove an ipc identifier
426 * @ids: ipc identifier set
427 * @ipcp: ipc perm structure containing the identifier to remove
452 * ipc_set_key_private - switch the key of an existing ipc to IPC_PRIVATE
453 * @ids: ipc identifier set
454 * @ipcp: ipc perm structure containing the key to modify
480 * ipcperms - check ipc permissions
481 * @ns: ipc namespace
482 * @ipcp: ipc permission set
486 * to ipc resources. return 0 if allowed
517 * kernel_to_ipc64_perm - convert kernel ipc permissions to user
519 * @out: new style ipc permissions
536 * ipc64_perm_to_ipc_perm - convert new ipc permissions to old
537 * @in: new style ipc permissions
538 * @out: old style ipc permissions
556 * @ids: ipc identifier set
557 * @id: ipc id to look for
559 * Look for an id in the ipc ids idr and return associated ipc object.
562 * The ipc object is *not* locked on exit.
578 * @ids: ipc identifier set
579 * @id: ipc id to look for
581 * Similar to ipc_obtain_object_idr() but also checks the ipc object
585 * The ipc object is *not* locked on exit.
603 * @ids: ipc identifier set
604 * @ops: operations to be called on ipc object creation, permission checks
620 * ipc_update_perm - update the permissions of an ipc object
622 * @out: the permission of the ipc to set.
640 * ipcctl_obtain_check - retrieve an ipc object and check permissions
641 * @ns: ipc namespace
642 * @ids: the table of ids where to look for the ipc
643 * @id: the id of the ipc to retrieve
652 * - retrieves the ipc object with the given id in the given table.
654 * - returns a pointer to the ipc object or otherwise, the corresponding
690 * ipc_parse_version - ipc call version
693 * Return IPC_64 for new style IPC and IPC_OLD for old style IPC.
723 * This routine locks the ipc structure found at least at position pos.
729 struct kern_ipc_perm *ipc = NULL; in sysvipc_find_ipc() local
736 ipc = idr_find(&ids->ipcs_idr, pos); in sysvipc_find_ipc()
737 if (ipc != NULL) { in sysvipc_find_ipc()
739 ipc_lock_object(ipc); in sysvipc_find_ipc()
745 return ipc; in sysvipc_find_ipc()
752 struct kern_ipc_perm *ipc = it; in sysvipc_proc_next() local
754 /* If we had an ipc id locked before, unlock it */ in sysvipc_proc_next()
755 if (ipc && ipc != SEQ_START_TOKEN) in sysvipc_proc_next()
756 ipc_unlock(ipc); in sysvipc_proc_next()
762 * File positions: pos 0 -> header, pos n -> ipc id = n - 1.
763 * SeqFile iterator: iterator value locked ipc pointer or SEQ_TOKEN_START.
787 /* Find the (pos-1)th ipc */ in sysvipc_proc_start()
793 struct kern_ipc_perm *ipc = it; in sysvipc_proc_stop() local
799 if (ipc && ipc != SEQ_START_TOKEN) in sysvipc_proc_stop()
800 ipc_unlock(ipc); in sysvipc_proc_stop()