[CRIU] [PATCH v2 16/30] files: Declare structures of fake masters

Kirill Tkhai ktkhai at virtuozzo.com
Wed Jun 7 14:28:35 MSK 2017


Fake masters are files, which are not owned by
a process, that is able to open them.

Signed-off-by: Kirill Tkhai <ktkhai at virtuozzo.com>
---
 criu/files.c         |    3 +++
 criu/include/files.h |    2 ++
 2 files changed, 5 insertions(+)

diff --git a/criu/files.c b/criu/files.c
index eaa41d3a6..fbf809641 100644
--- a/criu/files.c
+++ b/criu/files.c
@@ -53,6 +53,8 @@
 
 #define FDESC_HASH_SIZE	64
 static struct hlist_head file_desc_hash[FDESC_HASH_SIZE];
+/* file_desc's, which fle is not owned by a process, that is able to open them */
+static LIST_HEAD(fake_master_head);
 
 int prepare_shared_fdinfo(void)
 {
@@ -67,6 +69,7 @@ int prepare_shared_fdinfo(void)
 void file_desc_init(struct file_desc *d, u32 id, struct file_desc_ops *ops)
 {
 	INIT_LIST_HEAD(&d->fd_info_head);
+	INIT_LIST_HEAD(&d->fake_master_list);
 	INIT_HLIST_NODE(&d->hash);
 
 	d->id	= id;
diff --git a/criu/include/files.h b/criu/include/files.h
index 520abf668..fd2d20761 100644
--- a/criu/include/files.h
+++ b/criu/include/files.h
@@ -118,6 +118,8 @@ struct file_desc {
 	struct list_head	fd_info_head;	/* Chain of fdinfo_list_entry-s with same ID and type but different pids */
 	struct file_desc_ops	*ops;		/* Associated operations */
 	struct ns_id		*setns_userns;	/* Minimal user_ns to be able to restore this file */
+	struct list_head	fake_master_list;/* To chain in the list of file_desc, which don't
+						    have a fle in a task, that having permissions */
 };
 
 struct fdtype_ops {



More information about the CRIU mailing list