mirror of
https://github.com/systemd/systemd.git
synced 2025-03-22 06:50:18 +03:00
basic: New function fstype_is_blockdev_backed for fstypes that need a blockdev
The function returns true if the specified filesystem requires a block device.
This commit is contained in:
parent
639375e0b6
commit
ac2474e4ff
@ -338,6 +338,16 @@ bool fstype_is_api_vfs(const char *fstype) {
|
||||
"tracefs");
|
||||
}
|
||||
|
||||
bool fstype_is_blockdev_backed(const char *fstype) {
|
||||
const char *x;
|
||||
|
||||
x = startswith(fstype, "fuse.");
|
||||
if (x)
|
||||
fstype = x;
|
||||
|
||||
return !streq(fstype, "9p") && !fstype_is_network(fstype) && !fstype_is_api_vfs(fstype);
|
||||
}
|
||||
|
||||
bool fstype_is_ro(const char *fstype) {
|
||||
/* All Linux file systems that are necessarily read-only */
|
||||
return STR_IN_SET(fstype,
|
||||
|
@ -14,6 +14,7 @@ int path_is_mount_point(const char *path, const char *root, int flags);
|
||||
|
||||
bool fstype_is_network(const char *fstype);
|
||||
bool fstype_is_api_vfs(const char *fstype);
|
||||
bool fstype_is_blockdev_backed(const char *fstype);
|
||||
bool fstype_is_ro(const char *fsype);
|
||||
bool fstype_can_discard(const char *fstype);
|
||||
bool fstype_can_uid_gid(const char *fstype);
|
||||
|
Loading…
x
Reference in New Issue
Block a user