diff options
author | Serge E. Hallyn <serue@us.ibm.com> | 2009-04-06 22:01:08 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2009-04-07 11:31:09 -0400 |
commit | 614b84cf4e4a920d2af32b8f147ea1e3b8c27ea6 (patch) | |
tree | 52478e38cd400042bd89f123c4101c95943ae492 /include | |
parent | 909e6d94795654040ed416ac69858d5d2ce66dd3 (diff) |
namespaces: mqueue ns: move mqueue_mnt into struct ipc_namespace
Move mqueue vfsmount plus a few tunables into the ipc_namespace struct.
The CONFIG_IPC_NS boolean and the ipc_namespace struct will serve both the
posix message queue namespaces and the SYSV ipc namespaces.
The sysctl code will be fixed separately in patch 3. After just this
patch, making a change to posix mqueue tunables always changes the values
in the initial ipc namespace.
Signed-off-by: Cedric Le Goater <clg@fr.ibm.com>
Signed-off-by: Serge E. Hallyn <serue@us.ibm.com>
Cc: Alexey Dobriyan <adobriyan@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/ipc_namespace.h | 39 |
1 files changed, 35 insertions, 4 deletions
diff --git a/include/linux/ipc_namespace.h b/include/linux/ipc_namespace.h index ea330f9e7100..3e6fcacebe8a 100644 --- a/include/linux/ipc_namespace.h +++ b/include/linux/ipc_namespace.h | |||
@@ -44,24 +44,55 @@ struct ipc_namespace { | |||
44 | int shm_tot; | 44 | int shm_tot; |
45 | 45 | ||
46 | struct notifier_block ipcns_nb; | 46 | struct notifier_block ipcns_nb; |
47 | |||
48 | /* The kern_mount of the mqueuefs sb. We take a ref on it */ | ||
49 | struct vfsmount *mq_mnt; | ||
50 | |||
51 | /* # queues in this ns, protected by mq_lock */ | ||
52 | unsigned int mq_queues_count; | ||
53 | |||
54 | /* next fields are set through sysctl */ | ||
55 | unsigned int mq_queues_max; /* initialized to DFLT_QUEUESMAX */ | ||
56 | unsigned int mq_msg_max; /* initialized to DFLT_MSGMAX */ | ||
57 | unsigned int mq_msgsize_max; /* initialized to DFLT_MSGSIZEMAX */ | ||
58 | |||
47 | }; | 59 | }; |
48 | 60 | ||
49 | extern struct ipc_namespace init_ipc_ns; | 61 | extern struct ipc_namespace init_ipc_ns; |
50 | extern atomic_t nr_ipc_ns; | 62 | extern atomic_t nr_ipc_ns; |
51 | 63 | ||
52 | #ifdef CONFIG_SYSVIPC | 64 | #if defined(CONFIG_POSIX_MQUEUE) || defined(CONFIG_SYSVIPC) |
53 | #define INIT_IPC_NS(ns) .ns = &init_ipc_ns, | 65 | #define INIT_IPC_NS(ns) .ns = &init_ipc_ns, |
66 | #else | ||
67 | #define INIT_IPC_NS(ns) | ||
68 | #endif | ||
54 | 69 | ||
70 | #ifdef CONFIG_SYSVIPC | ||
55 | extern int register_ipcns_notifier(struct ipc_namespace *); | 71 | extern int register_ipcns_notifier(struct ipc_namespace *); |
56 | extern int cond_register_ipcns_notifier(struct ipc_namespace *); | 72 | extern int cond_register_ipcns_notifier(struct ipc_namespace *); |
57 | extern void unregister_ipcns_notifier(struct ipc_namespace *); | 73 | extern void unregister_ipcns_notifier(struct ipc_namespace *); |
58 | extern int ipcns_notify(unsigned long); | 74 | extern int ipcns_notify(unsigned long); |
59 | |||
60 | #else /* CONFIG_SYSVIPC */ | 75 | #else /* CONFIG_SYSVIPC */ |
61 | #define INIT_IPC_NS(ns) | 76 | static inline int register_ipcns_notifier(struct ipc_namespace *ns) |
77 | { return 0; } | ||
78 | static inline int cond_register_ipcns_notifier(struct ipc_namespace *ns) | ||
79 | { return 0; } | ||
80 | static inline void unregister_ipcns_notifier(struct ipc_namespace *ns) { } | ||
81 | static inline int ipcns_notify(unsigned long l) { return 0; } | ||
62 | #endif /* CONFIG_SYSVIPC */ | 82 | #endif /* CONFIG_SYSVIPC */ |
63 | 83 | ||
64 | #if defined(CONFIG_SYSVIPC) && defined(CONFIG_IPC_NS) | 84 | #ifdef CONFIG_POSIX_MQUEUE |
85 | extern void mq_init_ns(struct ipc_namespace *ns); | ||
86 | /* default values */ | ||
87 | #define DFLT_QUEUESMAX 256 /* max number of message queues */ | ||
88 | #define DFLT_MSGMAX 10 /* max number of messages in each queue */ | ||
89 | #define HARD_MSGMAX (131072/sizeof(void *)) | ||
90 | #define DFLT_MSGSIZEMAX 8192 /* max message size */ | ||
91 | #else | ||
92 | #define mq_init_ns(ns) ((void) 0) | ||
93 | #endif | ||
94 | |||
95 | #if defined(CONFIG_IPC_NS) | ||
65 | extern void free_ipc_ns(struct kref *kref); | 96 | extern void free_ipc_ns(struct kref *kref); |
66 | extern struct ipc_namespace *copy_ipcs(unsigned long flags, | 97 | extern struct ipc_namespace *copy_ipcs(unsigned long flags, |
67 | struct ipc_namespace *ns); | 98 | struct ipc_namespace *ns); |