From: Lennart Poettering Date: Fri, 29 Sep 2017 12:23:17 +0000 (+0200) Subject: dissect: split list of discard-supporting fs out into mount-util.c X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=commitdiff_plain;h=c821caff64158792756f7e020c29af11a703685f;p=elogind.git dissect: split list of discard-supporting fs out into mount-util.c Let's manage the list of file systems that do a specific thing at one place, following similar naming. No functional changes. --- diff --git a/src/basic/mount-util.c b/src/basic/mount-util.c index d8850bf83..6e6596d57 100644 --- a/src/basic/mount-util.c +++ b/src/basic/mount-util.c @@ -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; diff --git a/src/basic/mount-util.h b/src/basic/mount-util.h index 3b026c1b5..5e8b47c84 100644 --- a/src/basic/mount-util.h +++ b/src/basic/mount-util.h @@ -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;