[CRIU] [PATCH v2 3/5] introduce __fsname_is_auto(name, force_auto)

Oleg Nesterov oleg at redhat.com
Thu Apr 9 10:46:32 PDT 2015


Simple preparation to simplify the review of the next patch. Turn
find_fstype_by_name(name) into __find_fstype_by_name(name, force_auto)
and reimplement find_fstype_by_name() as a trivial wrapper on top.

This allows "restore" to specify that this particular fsname was treated
as FSTYPE__AUTO by "dump".

Signed-off-by: Oleg Nesterov <oleg at redhat.com>
---
 mount.c |    9 +++++++--
 1 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/mount.c b/mount.c
index ddb162f..59ccf6d 100644
--- a/mount.c
+++ b/mount.c
@@ -1122,7 +1122,7 @@ static bool fsname_is_auto(const char *name)
 	return false;
 }
 
-struct fstype *find_fstype_by_name(char *fst)
+static struct fstype *__find_fstype_by_name(char *fst, bool force_auto)
 {
 	int i;
 
@@ -1138,7 +1138,7 @@ struct fstype *find_fstype_by_name(char *fst)
 		struct fstype *fstype = fstypes + i;
 
 		if (!fstype->name) {
-			if (!fsname_is_auto(fst))
+			if (!force_auto && !fsname_is_auto(fst))
 				break;
 
 			fstype->name = xstrdup(fst);
@@ -1156,6 +1156,11 @@ struct fstype *find_fstype_by_name(char *fst)
 	return &fstypes[0];
 }
 
+struct fstype *find_fstype_by_name(char *fst)
+{
+	return __find_fstype_by_name(fst, false);
+}
+
 static struct fstype *decode_fstype(u32 fst)
 {
 	int i;
-- 
1.5.5.1



More information about the CRIU mailing list