From 5b564db91e17e29fdeb75e929e46e9ac03a77c7e Mon Sep 17 00:00:00 2001 From: Andrey Vagin Date: Tue, 11 Mar 2014 19:18:00 +0400 Subject: [PATCH] namespace: move struct ns_id into namespace.h 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 Signed-off-by: Pavel Emelyanov --- 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 9fb5c0697..f14ea6de9 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 37e232caa..7c9b8febc 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;