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
108 * ipc_init_ids - initialise ipc identifiers
109 * @ids: ipc identifier set
111 * 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
213 * and the lockless preparations for ipc operations can start. in ipc_idr_alloc()
263 * ipc_addid - add an ipc identifier
264 * @ids: ipc identifier set
265 * @new: new ipc permission set
268 * Add an entry 'new' to the ipc ids idr. The permissions object is
329 * ipcget_new - create a new ipc object
330 * @ns: ipc namespace
331 * @ids: ipc identifier set
350 * ipc_check_perms - check security and permissions for an ipc object
351 * @ns: ipc namespace
352 * @ipcp: ipc permission set
360 * On success, the ipc id is returned.
383 * ipcget_public - get an ipc object or create a new one
384 * @ns: ipc namespace
385 * @ids: ipc identifier set
394 * On success, the ipc id is returned.
416 /* ipc object has been locked by ipc_findkey() */ in ipcget_public()
426 * ipc_check_perms returns the IPC id on in ipcget_public()
439 * ipc_kht_remove - remove an ipc from the key hashtable
440 * @ids: ipc identifier set
441 * @ipcp: ipc perm structure containing the key to remove
454 * ipc_rmid - remove an ipc identifier
455 * @ids: ipc identifier set
456 * @ipcp: ipc perm structure containing the identifier to remove
481 * ipc_set_key_private - switch the key of an existing ipc to IPC_PRIVATE
482 * @ids: ipc identifier set
483 * @ipcp: ipc perm structure containing the key to modify
509 * ipcperms - check ipc permissions
510 * @ns: ipc namespace
511 * @ipcp: ipc permission set
515 * to ipc resources. return 0 if allowed
546 * kernel_to_ipc64_perm - convert kernel ipc permissions to user
548 * @out: new style ipc permissions
565 * ipc64_perm_to_ipc_perm - convert new ipc permissions to old
566 * @in: new style ipc permissions
567 * @out: old style ipc permissions
585 * @ids: ipc identifier set
586 * @id: ipc id to look for
588 * Look for an id in the ipc ids idr and return associated ipc object.
591 * The ipc object is *not* locked on exit.
607 * @ids: ipc identifier set
608 * @id: ipc id to look for
610 * Similar to ipc_obtain_object_idr() but also checks the ipc object
614 * The ipc object is *not* locked on exit.
632 * @ids: ipc identifier set
633 * @ops: operations to be called on ipc object creation, permission checks
649 * ipc_update_perm - update the permissions of an ipc object
651 * @out: the permission of the ipc to set.
669 * ipcctl_obtain_check - retrieve an ipc object and check permissions
670 * @ns: ipc namespace
671 * @ids: the table of ids where to look for the ipc
672 * @id: the id of the ipc to retrieve
681 * - retrieves the ipc object with the given id in the given table.
683 * - returns a pointer to the ipc object or otherwise, the corresponding
719 * ipc_parse_version - ipc call version
722 * Return IPC_64 for new style IPC and IPC_OLD for old style IPC.
752 * This routine locks the ipc structure found at least at position pos.
757 struct kern_ipc_perm *ipc; in sysvipc_find_ipc() local
762 ipc = idr_find(&ids->ipcs_idr, id); in sysvipc_find_ipc()
763 if (ipc != NULL) in sysvipc_find_ipc()
767 ipc = NULL; in sysvipc_find_ipc()
772 ipc = idr_find(&ids->ipcs_idr, pos); in sysvipc_find_ipc()
773 if (ipc != NULL) { in sysvipc_find_ipc()
775 ipc_lock_object(ipc); in sysvipc_find_ipc()
781 return ipc; in sysvipc_find_ipc()
788 struct kern_ipc_perm *ipc = it; in sysvipc_proc_next() local
790 /* If we had an ipc id locked before, unlock it */ in sysvipc_proc_next()
791 if (ipc && ipc != SEQ_START_TOKEN) in sysvipc_proc_next()
792 ipc_unlock(ipc); in sysvipc_proc_next()
798 * File positions: pos 0 -> header, pos n -> ipc id = n - 1.
799 * SeqFile iterator: iterator value locked ipc pointer or SEQ_TOKEN_START.
823 /* Find the (pos-1)th ipc */ in sysvipc_proc_start()
829 struct kern_ipc_perm *ipc = it; in sysvipc_proc_stop() local
835 if (ipc && ipc != SEQ_START_TOKEN) in sysvipc_proc_stop()
836 ipc_unlock(ipc); in sysvipc_proc_stop()