[CRIU] [PATCH 03/13] namespace: move struct ns_id into namespace.h

Andrey Vagin avagin at openvz.org
Tue Mar 11 08:18:19 PDT 2014


It's going to be used for restoring namespaces. For example we need to
enumirate the ns_ids list for restoring mount namespaces.

Signed-off-by: Andrey Vagin <avagin at openvz.org>
---
 include/namespaces.h |  9 +++++++++
 namespaces.c         | 10 +---------
 2 files changed, 10 insertions(+), 9 deletions(-)

diff --git a/include/namespaces.h b/include/namespaces.h
index 9fb5c06..f14ea6d 100644
--- a/include/namespaces.h
+++ b/include/namespaces.h
@@ -9,6 +9,15 @@ struct ns_desc {
 	size_t		len;
 };
 
+struct ns_id {
+	unsigned int kid;
+	unsigned int id;
+	pid_t pid;
+	struct ns_desc *nd;
+	struct ns_id *next;
+};
+extern struct ns_id *ns_ids;
+
 #define NS_DESC_ENTRY(_cflag, _str)			\
 	{						\
 		.cflag		= _cflag,		\
diff --git a/namespaces.c b/namespaces.c
index 37e232c..7c9b8fe 100644
--- a/namespaces.c
+++ b/namespaces.c
@@ -113,15 +113,7 @@ int restore_ns(int rst, struct ns_desc *nd)
 	return ret;
 }
 
-struct ns_id {
-	unsigned int kid;
-	unsigned int id;
-	pid_t pid;
-	struct ns_desc *nd;
-	struct ns_id *next;
-};
-
-static struct ns_id *ns_ids;
+struct ns_id *ns_ids = NULL;
 static unsigned int ns_next_id = 1;
 unsigned long current_ns_mask = 0;
 
-- 
1.8.5.3



More information about the CRIU mailing list