[CRIU] [PATCH 08/11] namespaces: remove unused code

Andrey Vagin avagin at openvz.org
Mon Sep 30 06:16:50 PDT 2013


Signed-off-by: Andrey Vagin <avagin at openvz.org>
---
 image.c              |  5 -----
 include/crtools.h    |  1 -
 include/image-desc.h | 10 ++++------
 namespaces.c         |  6 ------
 4 files changed, 4 insertions(+), 18 deletions(-)

diff --git a/image.c b/image.c
index 9eb8206..65ce4a3 100644
--- a/image.c
+++ b/image.c
@@ -180,11 +180,6 @@ struct cr_fdset *cr_task_fdset_open(int pid, int mode)
 	return cr_fdset_open(pid, _CR_FD_TASK_FROM, _CR_FD_TASK_TO, mode);
 }
 
-struct cr_fdset *cr_ns_fdset_open(int pid, int mode)
-{
-	return cr_fdset_open(pid, _CR_FD_NS_FROM, _CR_FD_NS_TO, mode);
-}
-
 struct cr_fdset *cr_glob_fdset_open(int mode)
 {
 	return cr_fdset_open(-1 /* ignored */, _CR_FD_GLOB_FROM, _CR_FD_GLOB_TO, mode);
diff --git a/include/crtools.h b/include/crtools.h
index 6bd856d..9969767 100644
--- a/include/crtools.h
+++ b/include/crtools.h
@@ -125,7 +125,6 @@ int cr_exec(int pid, char **opts);
 #define O_RSTR	(O_RDONLY)
 
 struct cr_fdset *cr_task_fdset_open(int pid, int mode);
-struct cr_fdset *cr_ns_fdset_open(int pid, int mode);
 struct cr_fdset *cr_fdset_open(int pid, int from, int to,
 			       unsigned long flags);
 struct cr_fdset *cr_glob_fdset_open(int mode);
diff --git a/include/image-desc.h b/include/image-desc.h
index 50f8266..08ff971 100644
--- a/include/image-desc.h
+++ b/include/image-desc.h
@@ -1,6 +1,7 @@
 #ifndef __CR_IMAGE_DESC_H__
 #define __CR_IMAGE_DESC_H__
 
+#include <sched.h>
 #include "asm/int.h"
 
 enum {
@@ -30,24 +31,21 @@ enum {
 	/*
 	 * NS entries
 	 */
-
-	_CR_FD_NS_FROM,
 	CR_FD_UTSNS,
 	CR_FD_MNTS,
 
-	_CR_FD_IPCNS_FROM	= CR_FD_MNTS,
+	_CR_FD_IPCNS_FROM,
 	CR_FD_IPC_VAR,
 	CR_FD_IPCNS_SHM,
 	CR_FD_IPCNS_MSG,
 	CR_FD_IPCNS_SEM,
 	_CR_FD_IPCNS_TO,
 
-	_CR_FD_NETNS_FROM	= CR_FD_IPCNS_SEM,
-	CR_FD_NETDEV		= _CR_FD_IPCNS_TO,
+	_CR_FD_NETNS_FROM,
+	CR_FD_NETDEV,
 	CR_FD_IFADDR,
 	CR_FD_ROUTE,
 	_CR_FD_NETNS_TO,
-	_CR_FD_NS_TO		= _CR_FD_NETNS_TO,
 
 	CR_FD_PSTREE,
 	CR_FD_SHMEM_PAGEMAP,
diff --git a/namespaces.c b/namespaces.c
index fefce19..a315c43 100644
--- a/namespaces.c
+++ b/namespaces.c
@@ -350,14 +350,9 @@ int dump_task_ns_ids(struct pstree_item *item)
 
 static int do_dump_namespaces(struct pid *ns_pid, unsigned int ns_flags)
 {
-	struct cr_fdset *fdset;
 	pid_t pid = ns_pid->virt;
 	int ret = 0;
 
-	fdset = cr_ns_fdset_open(ns_pid->virt, O_DUMP);
-	if (fdset == NULL)
-		return -1;
-
 	if (ns_flags & CLONE_NEWUTS) {
 		pr_info("Dump UTS namespace\n");
 		ret = dump_uts_ns(ns_pid->real, pid);
@@ -383,7 +378,6 @@ static int do_dump_namespaces(struct pid *ns_pid, unsigned int ns_flags)
 			goto err;
 	}
 err:
-	close_cr_fdset(&fdset);
 	return ret;
 
 }
-- 
1.8.3.1



More information about the CRIU mailing list