mirror of
https://github.com/checkpoint-restore/criu
synced 2025-08-30 13:58:34 +00:00
mnt: add matching on fs kernel subtypes
Signed-off-by: Tycho Andersen <tycho.andersen@canonical.com> Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
This commit is contained in:
committed by
Pavel Emelyanov
parent
dfa96b5514
commit
71398f5cf5
19
mount.c
19
mount.c
@@ -1127,11 +1127,26 @@ struct fstype *find_fstype_by_name(char *fst)
|
|||||||
* anything is wrong, almost every fs has its own features)
|
* anything is wrong, almost every fs has its own features)
|
||||||
* 2nd -- save some space in the image (since we scan all
|
* 2nd -- save some space in the image (since we scan all
|
||||||
* names anyway)
|
* names anyway)
|
||||||
|
*
|
||||||
|
* The kernel reports "subtypes" sometimes and the valid
|
||||||
|
* type-vs-subtype delimiter is the dot symbol. We disregard any
|
||||||
|
* subtypes for the purpose of finding the fstype.
|
||||||
*/
|
*/
|
||||||
|
char fstype[1024];
|
||||||
|
|
||||||
for (i = 0; i < ARRAY_SIZE(fstypes); i++)
|
for (i = 0; fst[i] && i < sizeof(fstype) - 1; i++) {
|
||||||
if (!strcmp(fstypes[i].name, fst))
|
if (fst[i] == '.')
|
||||||
|
break;
|
||||||
|
|
||||||
|
fstype[i] = fst[i];
|
||||||
|
}
|
||||||
|
|
||||||
|
fstype[i] = 0;
|
||||||
|
|
||||||
|
for (i = 0; i < ARRAY_SIZE(fstypes); i++) {
|
||||||
|
if (!strcmp(fstypes[i].name, fstype))
|
||||||
return fstypes + i;
|
return fstypes + i;
|
||||||
|
}
|
||||||
|
|
||||||
return &fstypes[0];
|
return &fstypes[0];
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user