Commit 039cf95d authored by Oleg Nesterov's avatar Oleg Nesterov Committed by Pavel Emelyanov

introduce __fsname_is_auto(name, force_auto)

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: 's avatarOleg Nesterov <oleg@redhat.com>
Signed-off-by: 's avatarPavel Emelyanov <xemul@parallels.com>
parent 38e148e5
...@@ -1177,7 +1177,7 @@ static bool fsname_is_auto(const char *name) ...@@ -1177,7 +1177,7 @@ static bool fsname_is_auto(const char *name)
return false; return false;
} }
struct fstype *find_fstype_by_name(char *_fst) static struct fstype *__find_fstype_by_name(char *_fst, bool force_auto)
{ {
int i; int i;
...@@ -1207,7 +1207,7 @@ struct fstype *find_fstype_by_name(char *_fst) ...@@ -1207,7 +1207,7 @@ struct fstype *find_fstype_by_name(char *_fst)
struct fstype *fstype = fstypes + i; struct fstype *fstype = fstypes + i;
if (!fstype->name) { if (!fstype->name) {
if (!fsname_is_auto(fst)) if (!force_auto && !fsname_is_auto(fst))
break; break;
fstype->name = xstrdup(fst); fstype->name = xstrdup(fst);
...@@ -1225,6 +1225,11 @@ struct fstype *find_fstype_by_name(char *_fst) ...@@ -1225,6 +1225,11 @@ struct fstype *find_fstype_by_name(char *_fst)
return &fstypes[0]; 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) static struct fstype *decode_fstype(u32 fst)
{ {
int i; int i;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment