[CRIU] [RFC PATCH v2 6/6] turn "proc" into FSTYPE__AUTO

Oleg Nesterov oleg at redhat.com
Fri Mar 27 11:49:16 PDT 2015


On 03/27, Oleg Nesterov wrote:
>
> So we could remove a lot more from fstypes[].

Sorry for noise... Not sure why I didn't do this... Let me send V2
with more A() checks. Still seems to work. Again, again, this is just
to test it all works more or less.

-------------------------------------------------------------------------------
Subject: [RFC PATCH v2 6/6] turn proc,sysfs,securityfs,debugfs,cgroup into FSTYPE__AUTO

Obviously not for inclusion, this is incompatible change. Just to see
if this works or not. Seems to work. So we could remove all "simple"
filesystems from fstypes[].

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

diff --git a/mount.c b/mount.c
index d5df3e5..03670d5 100644
--- a/mount.c
+++ b/mount.c
@@ -1038,12 +1038,6 @@ static struct fstype fstypes[32] = {
 		.name = "unsupported",
 		.code = FSTYPE__UNSUPPORTED,
 	}, {
-		.name = "proc",
-		.code = FSTYPE__PROC,
-	}, {
-		.name = "sysfs",
-		.code = FSTYPE__SYSFS,
-	}, {
 		.name = "devtmpfs",
 		.code = FSTYPE__DEVTMPFS,
 		.dump = devtmpfs_dump,
@@ -1076,19 +1070,10 @@ static struct fstype fstypes[32] = {
 		.dump = dump_empty_fs,
 		.code = FSTYPE__MQUEUE,
 	}, {
-		.name = "securityfs",
-		.code = FSTYPE__SECURITYFS,
-	}, {
 		.name = "fusectl",
 		.dump = dump_empty_fs,
 		.code = FSTYPE__FUSECTL,
 	}, {
-		.name = "debugfs",
-		.code = FSTYPE__DEBUGFS,
-	}, {
-		.name = "cgroup",
-		.code = FSTYPE__CGROUP,
-	}, {
 		.name = "aufs",
 		.code = FSTYPE__AUFS,
 		.parse = aufs_parse,
@@ -1105,6 +1090,14 @@ static bool fstype_is_auto(const char *name)
 	if (!fsauto_names)
 		goto ret;;
 
+#define A(n)	(strcmp(name, #n) == 0)
+
+	if (A(proc) || A(sysfs) || A(securityfs) || A(debugfs) || A(cgroup))
+		return true;
+
+#undef  A
+
+
 	yes = strcmp(fsauto_names, "all") == 0;
 	if (yes)
 		goto ret;
-- 
1.5.5.1




More information about the CRIU mailing list