diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/ipc_namespace.h | 43 | ||||
-rw-r--r-- | include/linux/memory.h | 1 |
2 files changed, 42 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 | ||
8 | struct ipc_ids { | 19 | struct 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 | ||
35 | extern struct ipc_namespace init_ipc_ns; | 50 | extern 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 | |||
58 | extern int register_ipcns_notifier(struct ipc_namespace *); | ||
59 | extern int unregister_ipcns_notifier(struct ipc_namespace *); | ||
60 | extern int ipcns_notify(unsigned long); | ||
61 | |||
62 | #else /* CONFIG_MEMORY_HOTPLUG */ | ||
63 | |||
64 | static inline int register_ipcns_notifier(struct ipc_namespace *ipcns) | ||
65 | { | ||
66 | return 0; | ||
67 | } | ||
68 | static inline int unregister_ipcns_notifier(struct ipc_namespace *ipcns) | ||
69 | { | ||
70 | return 0; | ||
71 | } | ||
72 | static 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) |
45 | extern void free_ipc_ns(struct kref *kref); | 84 | extern void free_ipc_ns(struct kref *kref); |
diff --git a/include/linux/memory.h b/include/linux/memory.h index 39628dfe4a4c..2f5f8a5ef2a0 100644 --- a/include/linux/memory.h +++ b/include/linux/memory.h | |||
@@ -58,6 +58,7 @@ struct mem_section; | |||
58 | * order in the callback chain) | 58 | * order in the callback chain) |
59 | */ | 59 | */ |
60 | #define SLAB_CALLBACK_PRI 1 | 60 | #define SLAB_CALLBACK_PRI 1 |
61 | #define IPC_CALLBACK_PRI 10 | ||
61 | 62 | ||
62 | #ifndef CONFIG_MEMORY_HOTPLUG_SPARSE | 63 | #ifndef CONFIG_MEMORY_HOTPLUG_SPARSE |
63 | static inline int memory_dev_init(void) | 64 | static inline int memory_dev_init(void) |