[CRIU] [PATCH] criu: clean up headers

Andrey Vagin avagin at gmail.com
Thu Feb 25 22:32:58 PST 2016


From: Andrey Vagin <avagin at openvz.org>

Signed-off-by: Andrey Vagin <avagin at openvz.org>
---
 criu/cgroup.c             | 1 +
 criu/include/cgroup.h     | 3 +--
 criu/include/proc_parse.h | 7 ++++---
 criu/include/pstree.h     | 2 +-
 criu/parasite-syscall.c   | 1 -
 criu/proc_parse.c         | 2 ++
 criu/sysfs_parse.c        | 1 +
 7 files changed, 10 insertions(+), 7 deletions(-)

diff --git a/criu/cgroup.c b/criu/cgroup.c
index fbe91d3..81c4944 100644
--- a/criu/cgroup.c
+++ b/criu/cgroup.c
@@ -19,6 +19,7 @@
 #include "namespaces.h"
 #include "seize.h"
 #include "syscall-types.h"
+#include "parasite.h"
 #include "protobuf.h"
 #include "images/core.pb-c.h"
 #include "images/cgroup.pb-c.h"
diff --git a/criu/include/cgroup.h b/criu/include/cgroup.h
index c162bb2..fd7ffd8 100644
--- a/criu/include/cgroup.h
+++ b/criu/include/cgroup.h
@@ -3,11 +3,10 @@
 
 #include "asm/int.h"
 
-#include "parasite.h"
-
 #include "images/core.pb-c.h"
 
 struct pstree_item;
+struct parasite_dump_cgroup_args;
 extern u32 root_cg_set;
 int dump_task_cgroup(struct pstree_item *, u32 *, struct parasite_dump_cgroup_args *args);
 int dump_cgroups(void);
diff --git a/criu/include/proc_parse.h b/criu/include/proc_parse.h
index ae8e713..5de5c86 100644
--- a/criu/include/proc_parse.h
+++ b/criu/include/proc_parse.h
@@ -5,8 +5,6 @@
 #include "asm/types.h"
 #include "image.h"
 #include "list.h"
-#include "cgroup.h"
-#include "mount.h"
 
 #include "images/eventfd.pb-c.h"
 #include "images/eventpoll.pb-c.h"
@@ -106,6 +104,7 @@ struct proc_status_creds {
 bool proc_status_creds_dumpable(struct proc_status_creds *parent,
 				struct proc_status_creds *child);
 
+struct mount_info;
 typedef int (*mount_fn_t)(struct mount_info *mi, const char *src, const
 			  char *fstype, unsigned long mountflags);
 
@@ -123,6 +122,7 @@ struct vm_area_list;
 #define INVALID_UID ((uid_t)-1)
 
 extern bool add_skip_mount(const char *mountpoint);
+struct ns_id;
 extern struct mount_info *parse_mountinfo(pid_t pid, struct ns_id *nsid, bool for_dump);
 extern int parse_pid_stat(pid_t pid, struct proc_pid_stat *s);
 extern unsigned int parse_pid_loginuid(pid_t pid, int *err, bool ignore_noent);
@@ -201,7 +201,8 @@ struct cg_ctl {
 /*
  * Returns the list of cg_ctl-s sorted by name
  */
-
+struct list_head;
+struct parasite_dump_cgroup_args;
 extern int parse_task_cgroup(int pid, struct parasite_dump_cgroup_args *args, struct list_head *l, unsigned int *n);
 extern void put_ctls(struct list_head *);
 
diff --git a/criu/include/pstree.h b/criu/include/pstree.h
index 1a0899a..4bf6db7 100644
--- a/criu/include/pstree.h
+++ b/criu/include/pstree.h
@@ -4,7 +4,6 @@
 #include "list.h"
 #include "pid.h"
 #include "image.h"
-#include "rst_info.h"
 #include "images/core.pb-c.h"
 
 /*
@@ -30,6 +29,7 @@ struct pstree_item {
 	TaskKobjIdsEntry	*ids;
 };
 
+struct rst_info;
 /* See alloc_pstree_item() for details */
 static inline struct rst_info *rsti(struct pstree_item *i)
 {
diff --git a/criu/parasite-syscall.c b/criu/parasite-syscall.c
index 2b13da2..bcdadcb 100644
--- a/criu/parasite-syscall.c
+++ b/criu/parasite-syscall.c
@@ -24,7 +24,6 @@
 #include "config.h"
 #include "pstree.h"
 #include "posix-timer.h"
-#include "net.h"
 #include "mem.h"
 #include "vma.h"
 #include "proc_parse.h"
diff --git a/criu/proc_parse.c b/criu/proc_parse.c
index e900b6e..8bb5271 100644
--- a/criu/proc_parse.c
+++ b/criu/proc_parse.c
@@ -25,12 +25,14 @@
 #include "vma.h"
 #include "bfd.h"
 #include "proc_parse.h"
+#include "parasite.h"
 #include "cr_options.h"
 #include "sysfs_parse.h"
 #include "seccomp.h"
 #include "string.h"
 #include "namespaces.h"
 #include "files-reg.h"
+#include "cgroup.h"
 
 #include "protobuf.h"
 #include "images/fdinfo.pb-c.h"
diff --git a/criu/sysfs_parse.c b/criu/sysfs_parse.c
index 6497d53..a947db6 100644
--- a/criu/sysfs_parse.c
+++ b/criu/sysfs_parse.c
@@ -16,6 +16,7 @@
 #include "util.h"
 #include "sysfs_parse.h"
 #include "namespaces.h"
+#include "mount.h"
 
 /*
  * Currently, there are two kernel problems dealing with AUFS
-- 
2.5.0



More information about the CRIU mailing list