chiark / gitweb /
dissect: split list of discard-supporting fs out into mount-util.c
authorLennart Poettering <lennart@poettering.net>
Fri, 29 Sep 2017 12:23:17 +0000 (14:23 +0200)
committerSven Eden <yamakuzure@gmx.net>
Wed, 22 Nov 2017 07:25:28 +0000 (08:25 +0100)
Let's manage the list of file systems that do a specific thing at one
place, following similar naming.

No functional changes.

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

index d8850bf83c05628ff9cf3e76c7e59da58de86ede..6e6596d57cdbff94cc6774cdad6f083824baebb6 100644 (file)
@@ -591,6 +591,18 @@ bool fstype_is_ro(const char *fstype) {
         return nulstr_contains(table, fstype);
 }
 
+bool fstype_can_discard(const char *fstype) {
+
+        static const char table[] =
+                "btrfs\0"
+                "ext4\0"
+                "vfat\0"
+                "xfs\0"
+                ;
+
+        return nulstr_contains(table, fstype);
+}
+
 int repeat_unmount(const char *path, int flags) {
         bool done = false;
 
index 3b026c1b543e5ef19a59ad21203c6682c4cfdac8..5e8b47c84f017a457e6f374bf8c62817b8c6f77d 100644 (file)
@@ -50,6 +50,7 @@ bool fstype_is_network(const char *fstype);
 #endif // 0
 bool fstype_is_api_vfs(const char *fstype);
 bool fstype_is_ro(const char *fsype);
+bool fstype_can_discard(const char *fstype);
 
 union file_handle_union {
         struct file_handle handle;