aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/ipc_namespace.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux/ipc_namespace.h')
-rw-r--r--include/linux/ipc_namespace.h43
1 files changed, 41 insertions, 2 deletions
diff --git a/include/linux/ipc_namespace.h b/include/linux/ipc_namespace.h
index 878d7ac286fa..cfb2a08b28f5 100644
--- a/include/linux/ipc_namespace.h
+++ b/include/linux/ipc_namespace.h
@@ -4,6 +4,17 @@
4#include <linux/err.h> 4#include <linux/err.h>
5#include <linux/idr.h> 5#include <linux/idr.h>
6#include <linux/rwsem.h> 6#include <linux/rwsem.h>
7#ifdef CONFIG_MEMORY_HOTPLUG
8#include <linux/notifier.h>
9#endif /* CONFIG_MEMORY_HOTPLUG */
10
11/*
12 * ipc namespace events
13 */
14#define IPCNS_MEMCHANGED 0x00000001 /* Notify lowmem size changed */
15
16#define IPCNS_CALLBACK_PRI 0
17
7 18
8struct ipc_ids { 19struct ipc_ids {
9 int in_use; 20 int in_use;
@@ -30,6 +41,10 @@ struct ipc_namespace {
30 size_t shm_ctlall; 41 size_t shm_ctlall;
31 int shm_ctlmni; 42 int shm_ctlmni;
32 int shm_tot; 43 int shm_tot;
44
45#ifdef CONFIG_MEMORY_HOTPLUG
46 struct notifier_block ipcns_nb;
47#endif
33}; 48};
34 49
35extern struct ipc_namespace init_ipc_ns; 50extern struct ipc_namespace init_ipc_ns;
@@ -37,9 +52,33 @@ extern atomic_t nr_ipc_ns;
37 52
38#ifdef CONFIG_SYSVIPC 53#ifdef CONFIG_SYSVIPC
39#define INIT_IPC_NS(ns) .ns = &init_ipc_ns, 54#define INIT_IPC_NS(ns) .ns = &init_ipc_ns,
40#else 55
56#ifdef CONFIG_MEMORY_HOTPLUG
57
58extern int register_ipcns_notifier(struct ipc_namespace *);
59extern int unregister_ipcns_notifier(struct ipc_namespace *);
60extern int ipcns_notify(unsigned long);
61
62#else /* CONFIG_MEMORY_HOTPLUG */
63
64static inline int register_ipcns_notifier(struct ipc_namespace *ipcns)
65{
66 return 0;
67}
68static inline int unregister_ipcns_notifier(struct ipc_namespace *ipcns)
69{
70 return 0;
71}
72static inline int ipcns_notify(unsigned long ev)
73{
74 return 0;
75}
76
77#endif /* CONFIG_MEMORY_HOTPLUG */
78
79#else /* CONFIG_SYSVIPC */
41#define INIT_IPC_NS(ns) 80#define INIT_IPC_NS(ns)
42#endif 81#endif /* CONFIG_SYSVIPC */
43 82
44#if defined(CONFIG_SYSVIPC) && defined(CONFIG_IPC_NS) 83#if defined(CONFIG_SYSVIPC) && defined(CONFIG_IPC_NS)
45extern void free_ipc_ns(struct kref *kref); 84extern void free_ipc_ns(struct kref *kref);