1 #ifndef __IPC_NAMESPACE_H__
2 #define __IPC_NAMESPACE_H__
6 #include <linux/rwsem.h>
11 unsigned short seq_max
;
12 struct rw_semaphore rw_mutex
;
16 struct ipc_namespace
{
18 struct ipc_ids ids
[3];
35 extern struct ipc_namespace init_ipc_ns
;
38 #define INIT_IPC_NS(ns) .ns = &init_ipc_ns,
40 #define INIT_IPC_NS(ns)
43 #if defined(CONFIG_SYSVIPC) && defined(CONFIG_IPC_NS)
44 extern void free_ipc_ns(struct kref
*kref
);
45 extern struct ipc_namespace
*copy_ipcs(unsigned long flags
,
46 struct ipc_namespace
*ns
);
48 static inline struct ipc_namespace
*get_ipc_ns(struct ipc_namespace
*ns
)
55 static inline void put_ipc_ns(struct ipc_namespace
*ns
)
57 kref_put(&ns
->kref
, free_ipc_ns
);
60 static inline struct ipc_namespace
*copy_ipcs(unsigned long flags
,
61 struct ipc_namespace
*ns
)
63 if (flags
& CLONE_NEWIPC
)
64 return ERR_PTR(-EINVAL
);
69 static inline struct ipc_namespace
*get_ipc_ns(struct ipc_namespace
*ns
)
74 static inline void put_ipc_ns(struct ipc_namespace
*ns
)