Greg Kroah-Hartman | b244131 | 2017-11-01 15:07:57 +0100 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0 */ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 2 | #ifndef _LINUX_IPC_H |
3 | #define _LINUX_IPC_H | ||||
4 | |||||
Robert P. J. Day | 0a3021f | 2007-07-15 23:39:57 -0700 | [diff] [blame] | 5 | #include <linux/spinlock.h> |
Eric W. Biederman | 1efdb69 | 2012-02-07 16:54:11 -0800 | [diff] [blame] | 6 | #include <linux/uidgid.h> |
Guillaume Knispel | 0cfb6ae | 2017-09-08 16:17:55 -0700 | [diff] [blame] | 7 | #include <linux/rhashtable.h> |
David Howells | 607ca46 | 2012-10-13 10:46:48 +0100 | [diff] [blame] | 8 | #include <uapi/linux/ipc.h> |
Elena Reshetova | 9405c03 | 2017-09-08 16:17:45 -0700 | [diff] [blame] | 9 | #include <linux/refcount.h> |
Cedric Le Goater | b119f13 | 2006-10-04 02:15:19 -0700 | [diff] [blame] | 10 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 11 | #define IPCMNI 32768 /* <= MAX_INT limit for ipc arrays (including sysctl changes) */ |
12 | |||||
13 | /* used by in-kernel data structures */ | ||||
Davidlohr Bueso | 60f3e00 | 2017-05-08 15:57:06 -0700 | [diff] [blame] | 14 | struct kern_ipc_perm { |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 15 | spinlock_t lock; |
Rafael Aquini | 72a8ff2 | 2014-01-27 17:07:02 -0800 | [diff] [blame] | 16 | bool deleted; |
Nadia Derbey | 7ca7e56 | 2007-10-18 23:40:48 -0700 | [diff] [blame] | 17 | int id; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 18 | key_t key; |
Eric W. Biederman | 1efdb69 | 2012-02-07 16:54:11 -0800 | [diff] [blame] | 19 | kuid_t uid; |
20 | kgid_t gid; | ||||
21 | kuid_t cuid; | ||||
22 | kgid_t cgid; | ||||
Davidlohr Bueso | 60f3e00 | 2017-05-08 15:57:06 -0700 | [diff] [blame] | 23 | umode_t mode; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 24 | unsigned long seq; |
25 | void *security; | ||||
Manfred Spraul | dba4cdd | 2017-07-12 14:34:41 -0700 | [diff] [blame] | 26 | |
Guillaume Knispel | 0cfb6ae | 2017-09-08 16:17:55 -0700 | [diff] [blame] | 27 | struct rhash_head khtnode; |
28 | |||||
Manfred Spraul | dba4cdd | 2017-07-12 14:34:41 -0700 | [diff] [blame] | 29 | struct rcu_head rcu; |
Elena Reshetova | 9405c03 | 2017-09-08 16:17:45 -0700 | [diff] [blame] | 30 | refcount_t refcount; |
Kees Cook | 3859a27 | 2016-10-28 01:22:25 -0700 | [diff] [blame] | 31 | } ____cacheline_aligned_in_smp __randomize_layout; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 32 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 33 | #endif /* _LINUX_IPC_H */ |