[CRIU] [PATCH v5 10/15] pipes: export collect_one_pipe_ops() helper

Stanislav Kinsburskiy skinsbursky at virtuozzo.com
Wed Jan 27 04:04:37 PST 2016


This helper is used by autofs restore to add temporary pipe structures.

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

diff --git a/include/pipes.h b/include/pipes.h
index c878616..6605572 100644
--- a/include/pipes.h
+++ b/include/pipes.h
@@ -54,4 +54,7 @@ struct pipe_info {
 				reopen : 1;
 };
 
+extern int collect_one_pipe_ops(void *o, ProtobufCMessage *base,
+				struct file_desc_ops *ops);
+
 #endif /* __CR_PIPES_H__ */
diff --git a/pipes.c b/pipes.c
index 1f4cc1a..de0af6a 100644
--- a/pipes.c
+++ b/pipes.c
@@ -371,7 +371,7 @@ static struct file_desc_ops pipe_desc_ops = {
 	.name		= pipe_d_name,
 };
 
-static int collect_one_pipe(void *o, ProtobufCMessage *base)
+int collect_one_pipe_ops(void *o, ProtobufCMessage *base, struct file_desc_ops *ops)
 {
 	struct pipe_info *pi = o, *tmp;
 
@@ -382,7 +382,7 @@ static int collect_one_pipe(void *o, ProtobufCMessage *base)
 	pr_info("Collected pipe entry ID %#x PIPE ID %#x\n",
 			pi->pe->id, pi->pe->pipe_id);
 
-	if (file_desc_add(&pi->d, pi->pe->id, &pipe_desc_ops))
+	if (file_desc_add(&pi->d, pi->pe->id, ops))
 		return -1;
 
 	INIT_LIST_HEAD(&pi->pipe_list);
@@ -400,6 +400,11 @@ static int collect_one_pipe(void *o, ProtobufCMessage *base)
 	return 0;
 }
 
+static int collect_one_pipe(void *o, ProtobufCMessage *base)
+{
+	return collect_one_pipe_ops(o, base, &pipe_desc_ops);
+}
+
 struct collect_image_info pipe_cinfo = {
 	.fd_type = CR_FD_PIPES,
 	.pb_type = PB_PIPE,



More information about the CRIU mailing list