[CRIU] [PATCH 3/7] don't include crtools.h in pstree.h

Andrey Vagin avagin at openvz.org
Wed Nov 6 02:34:29 PST 2013


Signed-off-by: Andrey Vagin <avagin at openvz.org>
---
 eventpoll.c        |  1 +
 include/crtools.h  | 32 --------------------------------
 include/pstree.h   |  4 ++--
 include/rst_info.h | 39 +++++++++++++++++++++++++++++++++++++++
 4 files changed, 42 insertions(+), 34 deletions(-)
 create mode 100644 include/rst_info.h

diff --git a/eventpoll.c b/eventpoll.c
index 3766909..fa5003a 100644
--- a/eventpoll.c
+++ b/eventpoll.c
@@ -15,6 +15,7 @@
 #include "compiler.h"
 #include "asm/types.h"
 #include "fdset.h"
+#include "rst_info.h"
 #include "eventpoll.h"
 #include "proc_parse.h"
 #include "crtools.h"
diff --git a/include/crtools.h b/include/crtools.h
index 9d0aebf..e14828c 100644
--- a/include/crtools.h
+++ b/include/crtools.h
@@ -81,38 +81,6 @@ int cr_exec(int pid, char **opts);
 #define O_SHOW	(O_RDONLY)
 #define O_RSTR	(O_RDONLY)
 
-struct fdt {
-	int			nr;		/* How many tasks share this fd table */
-	pid_t			pid;		/* Who should restore this fd table */
-	/*
-	 * The fd table is ready for restoing, if fdt_lock is equal to nr
-	 * The fdt table was restrored, if fdt_lock is equal to nr + 1
-	 */
-	futex_t			fdt_lock;
-};
-
-struct rst_info {
-	struct list_head	fds;
-	struct list_head	eventpoll;
-	struct list_head	tty_slaves;
-
-	void			*premmapped_addr;
-	unsigned long		premmapped_len;
-	unsigned long		clone_flags;
-
-	void			*munmap_restorer;
-
-	int			nr_zombies;
-
-	int service_fd_id;
-	struct fdt		*fdt;
-
-	union {
-		struct pstree_item	*pgrp_leader;
-		futex_t			pgrp_set;
-	};
-};
-
 /*
  * When we have to restore a shared resource, we mush select which
  * task should do it, and make other(s) wait for it. In order to
diff --git a/include/pstree.h b/include/pstree.h
index 698e582..3da92c5 100644
--- a/include/pstree.h
+++ b/include/pstree.h
@@ -3,7 +3,8 @@
 
 #include "list.h"
 #include "pid.h"
-#include "crtools.h"
+#include "image.h"
+#include "rst_info.h"
 #include "protobuf/core.pb-c.h"
 
 /*
@@ -11,7 +12,6 @@
  * all orphaned children in the system.
  */
 #define INIT_PID	(1)
-
 struct pstree_item {
 	struct pstree_item	*parent;
 	struct list_head	children;	/* list of my children */
diff --git a/include/rst_info.h b/include/rst_info.h
new file mode 100644
index 0000000..38d7737
--- /dev/null
+++ b/include/rst_info.h
@@ -0,0 +1,39 @@
+#ifndef __CR_RST_INFO_H__
+#define __CR_RST_INFO_H__
+
+#include "lock.h"
+#include "list.h"
+
+struct fdt {
+	int			nr;		/* How many tasks share this fd table */
+	pid_t			pid;		/* Who should restore this fd table */
+	/*
+	 * The fd table is ready for restoing, if fdt_lock is equal to nr
+	 * The fdt table was restrored, if fdt_lock is equal to nr + 1
+	 */
+	futex_t			fdt_lock;
+};
+
+struct rst_info {
+	struct list_head	fds;
+	struct list_head	eventpoll;
+	struct list_head	tty_slaves;
+
+	void			*premmapped_addr;
+	unsigned long		premmapped_len;
+	unsigned long		clone_flags;
+
+	void			*munmap_restorer;
+
+	int			nr_zombies;
+
+	int service_fd_id;
+	struct fdt		*fdt;
+
+	union {
+		struct pstree_item	*pgrp_leader;
+		futex_t			pgrp_set;
+	};
+};
+
+#endif
-- 
1.8.3.1



More information about the CRIU mailing list