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;
36 extern atomic_t nr_ipc_ns;
39 #define INIT_IPC_NS(ns) .ns = &init_ipc_ns,
41 #define INIT_IPC_NS(ns)
44 #if defined(CONFIG_SYSVIPC) && defined(CONFIG_IPC_NS)
45 extern void free_ipc_ns(struct kref *kref);
46 extern struct ipc_namespace *copy_ipcs(unsigned long flags,
47 struct ipc_namespace *ns);
48 extern void free_ipcs(struct ipc_namespace *ns, struct ipc_ids *ids,
49 void (*free)(struct ipc_namespace *,
50 struct kern_ipc_perm *));
52 static inline struct ipc_namespace *get_ipc_ns(struct ipc_namespace *ns)
59 static inline void put_ipc_ns(struct ipc_namespace *ns)
61 kref_put(&ns->kref, free_ipc_ns);
64 static inline struct ipc_namespace *copy_ipcs(unsigned long flags,
65 struct ipc_namespace *ns)
67 if (flags & CLONE_NEWIPC)
68 return ERR_PTR(-EINVAL);
73 static inline struct ipc_namespace *get_ipc_ns(struct ipc_namespace *ns)
78 static inline void put_ipc_ns(struct ipc_namespace *ns)