#define __IPC_NAMESPACE_H__
#include <linux/err.h>
+#include <linux/idr.h>
+#include <linux/rwsem.h>
+
+struct ipc_ids {
+ int in_use;
+ unsigned short seq;
+ unsigned short seq_max;
+ struct rw_semaphore rw_mutex;
+ struct idr ipcs_idr;
+};
-struct ipc_ids;
struct ipc_namespace {
struct kref kref;
- struct ipc_ids *ids[3];
+ struct ipc_ids ids[3];
int sem_ctls[4];
int used_sems;
#if defined(CONFIG_SYSVIPC) && defined(CONFIG_IPC_NS)
extern void free_ipc_ns(struct kref *kref);
extern struct ipc_namespace *copy_ipcs(unsigned long flags,
- struct ipc_namespace *ns);
+ struct ipc_namespace *ns);
+extern void free_ipcs(struct ipc_namespace *ns, struct ipc_ids *ids,
+ void (*free)(struct ipc_namespace *,
+ struct kern_ipc_perm *));
static inline struct ipc_namespace *get_ipc_ns(struct ipc_namespace *ns)
{