basic: use filesystem database
This commit is contained in:
committed by
Iago Lopez Galeiras
parent
1315ce3120
commit
659d19243c
+20
-32
@@ -8,11 +8,13 @@
|
||||
#include "chase-symlinks.h"
|
||||
#include "fd-util.h"
|
||||
#include "fileio.h"
|
||||
#include "filesystems.h"
|
||||
#include "fs-util.h"
|
||||
#include "missing_stat.h"
|
||||
#include "missing_syscall.h"
|
||||
#include "mkdir.h"
|
||||
#include "mountpoint-util.h"
|
||||
#include "nulstr-util.h"
|
||||
#include "parse-util.h"
|
||||
#include "path-util.h"
|
||||
#include "stat-util.h"
|
||||
@@ -366,48 +368,34 @@ bool fstype_is_network(const char *fstype) {
|
||||
if (x)
|
||||
fstype = x;
|
||||
|
||||
if (nulstr_contains(filesystem_sets[FILESYSTEM_SET_NETWORK].value, fstype))
|
||||
return true;
|
||||
|
||||
/* Filesystems not present in the internal database */
|
||||
return STR_IN_SET(fstype,
|
||||
"afs",
|
||||
"ceph",
|
||||
"cifs",
|
||||
"smb3",
|
||||
"smbfs",
|
||||
"sshfs",
|
||||
"ncpfs",
|
||||
"ncp",
|
||||
"nfs",
|
||||
"nfs4",
|
||||
"gfs",
|
||||
"gfs2",
|
||||
"davfs",
|
||||
"glusterfs",
|
||||
"pvfs2", /* OrangeFS */
|
||||
"ocfs2",
|
||||
"lustre",
|
||||
"davfs");
|
||||
"sshfs");
|
||||
}
|
||||
|
||||
bool fstype_is_api_vfs(const char *fstype) {
|
||||
const FilesystemSet *fs;
|
||||
|
||||
FOREACH_POINTER(fs,
|
||||
filesystem_sets + FILESYSTEM_SET_BASIC_API,
|
||||
filesystem_sets + FILESYSTEM_SET_AUXILIARY_API,
|
||||
filesystem_sets + FILESYSTEM_SET_PRIVILEGED_API,
|
||||
filesystem_sets + FILESYSTEM_SET_TEMPORARY)
|
||||
if (nulstr_contains(fs->value, fstype))
|
||||
return true;
|
||||
|
||||
/* Filesystems not present in the internal database */
|
||||
return STR_IN_SET(fstype,
|
||||
"autofs",
|
||||
"bpf",
|
||||
"cgroup",
|
||||
"cgroup2",
|
||||
"configfs",
|
||||
"cpuset",
|
||||
"debugfs",
|
||||
"devpts",
|
||||
"devtmpfs",
|
||||
"efivarfs",
|
||||
"fusectl",
|
||||
"hugetlbfs",
|
||||
"mqueue",
|
||||
"proc",
|
||||
"pstore",
|
||||
"ramfs",
|
||||
"securityfs",
|
||||
"sysfs",
|
||||
"tmpfs",
|
||||
"tracefs");
|
||||
"devtmpfs");
|
||||
}
|
||||
|
||||
bool fstype_is_blockdev_backed(const char *fstype) {
|
||||
|
||||
Reference in New Issue
Block a user