[CRIU] [PATCH 4/5] mnt: Renames around roots yard

Pavel Emelyanov xemul at parallels.com
Mon Sep 21 04:10:57 PDT 2015


Same thing as in previous patch -- we have too many generic
clean_ and fini_ prefixes over the code. And we need more (see
next patch), so let's specify what exactly we clean or fini.

Signed-off-by: Pavel Emelyanov <xemul at parallels.com>
---
 cr-restore.c    | 4 ++--
 include/mount.h | 2 +-
 mount.c         | 6 +++---
 3 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/cr-restore.c b/cr-restore.c
index 8aa570b..d3cc50c 100644
--- a/cr-restore.c
+++ b/cr-restore.c
@@ -1537,7 +1537,7 @@ static int restore_task_with_children(void *_arg)
 	if (restore_finish_stage(CR_STATE_FORKING) < 0)
 		goto err_fini_mnt;
 
-	if (current->parent == NULL && fini_mnt_ns())
+	if (current->parent == NULL && depopulate_roots_yard())
 		goto err;
 
 	if (restore_one_task(current->pid.virt, ca->core))
@@ -1547,7 +1547,7 @@ static int restore_task_with_children(void *_arg)
 
 err_fini_mnt:
 	if (current->parent == NULL)
-		fini_mnt_ns();
+		depopulate_roots_yard();
 
 err:
 	if (current->parent == NULL)
diff --git a/include/mount.h b/include/mount.h
index 6018dd7..ca27593 100644
--- a/include/mount.h
+++ b/include/mount.h
@@ -113,7 +113,7 @@ extern bool phys_stat_dev_match(dev_t st_dev, dev_t phys_dev,
 				struct ns_id *, const char *path);
 
 extern int restore_task_mnt_ns(struct pstree_item *current);
-extern int fini_mnt_ns(void);
+extern int depopulate_roots_yard(void);
 
 extern char *rst_get_mnt_root(int mnt_id);
 extern int ext_mount_add(char *key, char *val);
diff --git a/mount.c b/mount.c
index 25ce0b6..c882fff 100644
--- a/mount.c
+++ b/mount.c
@@ -2650,7 +2650,7 @@ int restore_task_mnt_ns(struct pstree_item *current)
 /*
  * All nested mount namespaces are restore as sub-trees of the root namespace.
  */
-static int prepare_roots_yard(void)
+static int populate_roots_yard(void)
 {
 	char path[PATH_MAX];
 	struct ns_id *nsid;
@@ -2717,13 +2717,13 @@ static int populate_mnt_ns(void)
 	if (do_mount_root(pms))
 		return -1;
 
-	if (prepare_roots_yard())
+	if (populate_roots_yard())
 		return -1;
 
 	return mnt_tree_for_each(pms, do_mount_one);
 }
 
-int fini_mnt_ns(void)
+int depopulate_roots_yard(void)
 {
 	int ret = 0;
 
-- 
1.9.3




More information about the CRIU mailing list