[CRIU] [PATCH v3 14/16] pipes: move struct pipe_info declaration to pipes.h

Stanislav Kinsburskiy skinsbursky at virtuozzo.com
Thu Dec 10 07:17:28 PST 2015


AutoFS will need to create write pipe end file descriptor, if it was closed.
Thus, pipe_info structure have to be exported.

Signed-off-by: Stanislav Kinsburskiy <skinsbursky at virtuozzo.com>
---
 include/pipes.h |   18 ++++++++++++++++++
 pipes.c         |   17 -----------------
 2 files changed, 18 insertions(+), 17 deletions(-)

diff --git a/include/pipes.h b/include/pipes.h
index a52857a..c878616 100644
--- a/include/pipes.h
+++ b/include/pipes.h
@@ -2,6 +2,7 @@
 #define __CR_PIPES_H__
 
 #include "protobuf/pipe-data.pb-c.h"
+#include "protobuf/pipe.pb-c.h"
 
 extern struct collect_image_info pipe_cinfo;
 extern int collect_pipes(void);
@@ -36,4 +37,21 @@ struct pipe_data_rst {
 extern int collect_pipe_data(int img_type, struct pipe_data_rst **hash);
 extern int restore_pipe_data(int img_type, int pfd, u32 id, struct pipe_data_rst **hash);
 
+/*
+ * The sequence of objects which should be restored:
+ * pipe -> files struct-s -> fd-s.
+ * pipe_entry describes  pipe's file structs-s.
+ * A pipe doesn't have own properties, so it has no object.
+ */
+
+struct pipe_info {
+	PipeEntry		*pe;
+	struct list_head	pipe_list;	/* All pipe_info with the same pipe_id
+						 * This is pure circular list without head */
+	struct list_head	list;		/* list head for fdinfo_list_entry-s */
+	struct file_desc	d;
+	unsigned int		create : 1,
+				reopen : 1;
+};
+
 #endif /* __CR_PIPES_H__ */
diff --git a/pipes.c b/pipes.c
index d4f70db..091e38e 100644
--- a/pipes.c
+++ b/pipes.c
@@ -15,23 +15,6 @@
 #include "protobuf/pipe.pb-c.h"
 #include "protobuf/pipe-data.pb-c.h"
 
-/*
- * The sequence of objects which should be restored:
- * pipe -> files struct-s -> fd-s.
- * pipe_entry describes  pipe's file structs-s.
- * A pipe doesn't have own properties, so it has no object.
- */
-
-struct pipe_info {
-	PipeEntry		*pe;
-	struct list_head	pipe_list;	/* All pipe_info with the same pipe_id
-						 * This is pure circular list without head */
-	struct list_head	list;		/* list head for fdinfo_list_entry-s */
-	struct file_desc	d;
-	unsigned int		create : 1,
-				reopen : 1;
-};
-
 static LIST_HEAD(pipes);
 
 static void show_saved_pipe_fds(struct pipe_info *pi)



More information about the CRIU mailing list