[v3,01/17] reg_file_entry: add "mode" variable

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

Details

Message ID 20160519105712.15506.40300.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.
Mode is required for temprorary file creation, when mountpoint is not
available on restore (in case of NFS, for example).

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

Patch hide | download patch | download mbox

diff --git a/criu/files-reg.c b/criu/files-reg.c
index fd36ae9..73b2908 100644
--- a/criu/files-reg.c
+++ b/criu/files-reg.c
@@ -1165,6 +1165,9 @@  ext:
 		rfe.size = p->stat.st_size;
 	}
 
+	rfe.has_mode = true;
+	rfe.mode = p->stat.st_mode;
+
 	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 e25d589..25b1e41 100644
--- a/images/regfile.proto
+++ b/images/regfile.proto
@@ -10,4 +10,5 @@  message reg_file_entry {
 	optional sint32		mnt_id	= 7 [default = -1];
 	optional uint64		size	= 8;
 	optional bool		ext	= 9;
+	optional uint32         mode    = 10;
 }