[v3,03/17] regular files: protobuf "unreachable" field introduced

Submitted by Stanislav Kinsburskiy on May 19, 2016, 10:57 a.m.

Details

Message ID 20160519105725.15506.80477.stgit@skinsbursky-vz7-gold.qa.sw.ru
State Rejected
Series "NFS migration support"
Headers show

Commit Message

Stanislav Kinsburskiy May 19, 2016, 10:57 a.m.
Will be used to determine whether this file have to be created prior to  open
on restore.

Signed-off-by: Stanislav Kinsburskiy <skinsbursky@virtuozzo.com>
---
 criu/files-reg.c     |   10 ++++++++++
 images/regfile.proto |    1 +
 2 files changed, 11 insertions(+)

Patch hide | download patch | download mbox

diff --git a/criu/files-reg.c b/criu/files-reg.c
index 73b2908..e3da972 100644
--- a/criu/files-reg.c
+++ b/criu/files-reg.c
@@ -1101,6 +1101,13 @@  static bool should_check_size(int flags)
 	return true;
 }
 
+static bool path_is_unreachable(struct fd_link *link, const struct fd_parms *parms)
+{
+	if (parms->fs_type == NFS_SUPER_MAGIC)
+		return true;
+	return false;
+}
+
 int dump_one_reg_file(int lfd, u32 id, const struct fd_parms *p)
 {
 	struct fd_link _link, *link;
@@ -1168,6 +1175,9 @@  ext:
 	rfe.has_mode = true;
 	rfe.mode = p->stat.st_mode;
 
+	rfe.has_unreachable	= true;
+	rfe.unreachable		= path_is_unreachable(link, p);
+
 	rimg = img_from_set(glob_imgset, CR_FD_REG_FILES);
 	return pb_write_one(rimg, &rfe, PB_REG_FILE);
 }
diff --git a/images/regfile.proto b/images/regfile.proto
index 25b1e41..f88603e 100644
--- a/images/regfile.proto
+++ b/images/regfile.proto
@@ -11,4 +11,5 @@  message reg_file_entry {
 	optional uint64		size	= 8;
 	optional bool		ext	= 9;
 	optional uint32         mode    = 10;
+	optional bool		unreachable     = 11;
 }