From: Cedric Le Goater <clg@fr.ibm.com>
To: Kirill Korotaev <dev@openvz.org>
Cc: Andrew Morton <akpm@osdl.org>,
devel@openvz.org, xemul@openvz.org,
Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
ebiederm@xmission.com, herbert@13thfloor.at, saw@sw.ru,
serue@us.ibm.com, sfrench@us.ibm.com, sam@vilain.net,
haveblue@us.ibm.com
Subject: Re: [PATCH 1/6] IPC namespace core
Date: Fri, 09 Jun 2006 17:20:15 +0200 [thread overview]
Message-ID: <448991AF.2060503@fr.ibm.com> (raw)
In-Reply-To: <44898D52.4080506@openvz.org>
[-- Attachment #1: Type: text/plain, Size: 1599 bytes --]
Kirill Korotaev wrote:
> This patch implements core IPC namespace changes:
> - ipc_namespace structure
> - new config option CONFIG_IPC_NS
> - adds CLONE_NEWIPC flag
> - unshare support
>
> Signed-Off-By: Pavel Emelianov <xemul@openvz.org>
> Signed-Off-By: Kirill Korotaev <dev@openvz.org>
>
>
> ------------------------------------------------------------------------
>
> --- ./include/linux/init_task.h.ipcns 2006-06-06 14:47:58.000000000 +0400
> +++ ./include/linux/init_task.h 2006-06-08 14:28:23.000000000 +0400
> @@ -73,6 +73,7 @@ extern struct nsproxy init_nsproxy;
> .count = ATOMIC_INIT(1), \
> .nslock = SPIN_LOCK_UNLOCKED, \
> .uts_ns = &init_uts_ns, \
> + .ipc_ns = &init_ipc_ns, \
> .namespace = NULL, \
> }
>
> --- ./include/linux/ipc.h.ipcns 2006-04-21 11:59:36.000000000 +0400
> +++ ./include/linux/ipc.h 2006-06-08 15:43:43.000000000 +0400
> @@ -2,6 +2,7 @@
> #define _LINUX_IPC_H
>
> #include <linux/types.h>
> +#include <linux/kref.h>
>
> #define IPC_PRIVATE ((__kernel_key_t) 0)
>
> @@ -68,6 +69,41 @@ struct kern_ipc_perm
> void *security;
> };
>
> +struct ipc_ids;
> +struct ipc_namespace {
> + struct kref kref;
> + struct ipc_ids *ids[3];
> +
> + int sem_ctls[4];
> + int used_sems;
> +
> + int msg_ctlmax;
> + int msg_ctlmnb;
> + int msg_ctlmni;
> +
> + size_t shm_ctlmax;
> + size_t shm_ctlall;
> + int shm_ctlmni;
> + int shm_tot;
> +};
you could probably simplify your patch by moving struct ipc_ids to ipc.h
and not allocating ids.
see patch bellow. I've been working all week on this patchset :)
C.
[-- Attachment #2: namespaces-sysvipc-move-struct-ipc-ids.patch --]
[-- Type: text/x-patch, Size: 1685 bytes --]
From: Cedric Le Goater <clg@fr.ibm.com>
Subject: namespaces sysvipc : move struct ipc_ids to ipc.h
Signed-off-by: Cedric Le Goater <clg@fr.ibm.com>
---
include/linux/ipc.h | 17 +++++++++++++++++
ipc/util.h | 15 ---------------
2 files changed, 17 insertions(+), 15 deletions(-)
Index: 2.6.17-rc5-mm3/include/linux/ipc.h
===================================================================
--- 2.6.17-rc5-mm3.orig/include/linux/ipc.h
+++ 2.6.17-rc5-mm3/include/linux/ipc.h
@@ -51,6 +51,8 @@ struct ipc_perm
#ifdef __KERNEL__
+#include <linux/mutex.h>
+
#define IPCMNI 32768 /* <= MAX_INT limit for ipc arrays (including sysctl changes) */
/* used by in-kernel data structures */
@@ -68,6 +70,21 @@ struct kern_ipc_perm
void *security;
};
+struct ipc_id_ary {
+ int size;
+ struct kern_ipc_perm *p[0];
+};
+
+struct ipc_ids {
+ int in_use;
+ int max_id;
+ unsigned short seq;
+ unsigned short seq_max;
+ struct mutex mutex;
+ struct ipc_id_ary nullentry;
+ struct ipc_id_ary* entries;
+};
+
#endif /* __KERNEL__ */
#endif /* _LINUX_IPC_H */
Index: 2.6.17-rc5-mm3/ipc/util.h
===================================================================
--- 2.6.17-rc5-mm3.orig/ipc/util.h
+++ 2.6.17-rc5-mm3/ipc/util.h
@@ -15,21 +15,6 @@ void sem_init (void);
void msg_init (void);
void shm_init (void);
-struct ipc_id_ary {
- int size;
- struct kern_ipc_perm *p[0];
-};
-
-struct ipc_ids {
- int in_use;
- int max_id;
- unsigned short seq;
- unsigned short seq_max;
- struct mutex mutex;
- struct ipc_id_ary nullentry;
- struct ipc_id_ary* entries;
-};
-
struct seq_file;
void __init ipc_init_ids(struct ipc_ids* ids, int size);
#ifdef CONFIG_PROC_FS
next prev parent reply other threads:[~2006-06-09 15:20 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-06-09 14:55 [PATCH] IPC namespace Kirill Korotaev
2006-06-09 15:01 ` [PATCH 1/6] IPC namespace core Kirill Korotaev
2006-06-09 15:20 ` Cedric Le Goater [this message]
2006-06-09 15:26 ` James Morris
2006-06-09 18:38 ` Andrew Morton
2006-06-10 0:44 ` Eric W. Biederman
2006-06-10 3:22 ` Andrew Morton
2006-06-09 15:05 ` [PATCH 2/6] IPC namespace - utils Kirill Korotaev
2006-06-12 17:08 ` Cedric Le Goater
2006-06-12 18:01 ` Eric W. Biederman
2006-06-12 21:05 ` Cedric Le Goater
2006-06-12 21:49 ` Eric W. Biederman
2006-06-13 21:17 ` Cedric Le Goater
2006-06-14 11:14 ` Kirill Korotaev
2006-06-09 15:07 ` [PATCH 3/6] IPC namespace - msg Kirill Korotaev
2006-06-09 15:08 ` [PATCH 4/6] IPC namespace - sem Kirill Korotaev
2006-06-09 15:09 ` [PATCH 5/6] IPC namespace - shm Kirill Korotaev
2006-06-09 15:11 ` [PATCH 6/6] IPC namespace - sysctls Kirill Korotaev
2006-06-12 17:19 ` [PATCH] IPC namespace Dave Hansen
2006-06-13 2:44 ` Eric W. Biederman
2006-06-13 16:41 ` Kirill Korotaev
2006-06-13 17:01 ` Eric W. Biederman
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=448991AF.2060503@fr.ibm.com \
--to=clg@fr.ibm.com \
--cc=akpm@osdl.org \
--cc=dev@openvz.org \
--cc=devel@openvz.org \
--cc=ebiederm@xmission.com \
--cc=haveblue@us.ibm.com \
--cc=herbert@13thfloor.at \
--cc=linux-kernel@vger.kernel.org \
--cc=sam@vilain.net \
--cc=saw@sw.ru \
--cc=serue@us.ibm.com \
--cc=sfrench@us.ibm.com \
--cc=xemul@openvz.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox