chiark / gitweb /
elogind-mount: allow to specify an arbitrary string for arg_mount_what when vfs is...
authorYu Watanabe <watanabe.yu+github@gmail.com>
Mon, 4 Sep 2017 01:55:51 +0000 (10:55 +0900)
committerSven Eden <yamakuzure@gmx.net>
Mon, 25 Sep 2017 12:36:45 +0000 (14:36 +0200)
Fixes #6591.

src/basic/mount-util.c
src/basic/mount-util.h

index b383630763974ac9cd0a834ded1ce3ce90d1b834..adf60c7ee26873944ab8833095c519d210670281 100644 (file)
@@ -552,6 +552,32 @@ bool fstype_is_network(const char *fstype) {
         return nulstr_contains(table, fstype);
 }
 
+bool fstype_is_api_vfs(const char *fstype) {
+        static const char table[] =
+                "autofs\0"
+                "bpf\0"
+                "cgroup\0"
+                "cgroup2\0"
+                "configfs\0"
+                "cpuset\0"
+                "debugfs\0"
+                "devpts\0"
+                "devtmpfs\0"
+                "efivarfs\0"
+                "hugetlbfs\0"
+                "mqueue\0"
+                "proc\0"
+                "pstore\0"
+                "ramfs\0"
+                "securityfs\0"
+                "sysfs\0"
+                "tmpfs\0"
+                "tracefs\0"
+                ;
+
+        return nulstr_contains(table, fstype);
+}
+
 int repeat_unmount(const char *path, int flags) {
         bool done = false;
 
index 5ce7c974723c67e2b46e954ce3813b6fe11baa09..571a0eb50166f52a85e1cf16e444ad0cd6caf829 100644 (file)
@@ -48,6 +48,7 @@ DEFINE_TRIVIAL_CLEANUP_FUNC(FILE*, endmntent);
 #if 0 /// UNNEEDED by elogind
 bool fstype_is_network(const char *fstype);
 #endif // 0
+bool fstype_is_api_vfs(const char *fstype);
 
 union file_handle_union {
         struct file_handle handle;