mountpoint-util: move 'norecovery' detection into its own helper call
And let's also ask the kernel explicitly for support.
This commit is contained in:
@@ -478,6 +478,23 @@ bool fstype_can_discard(const char *fstype) {
|
||||
"xfs");
|
||||
}
|
||||
|
||||
bool fstype_can_norecovery(const char *fstype) {
|
||||
int r;
|
||||
|
||||
assert(fstype);
|
||||
|
||||
/* On new kernels we can just ask the kernel */
|
||||
r = mount_option_supported(fstype, "norecovery", NULL);
|
||||
if (r >= 0)
|
||||
return r;
|
||||
|
||||
return STR_IN_SET(fstype,
|
||||
"ext3",
|
||||
"ext4",
|
||||
"xfs",
|
||||
"btrfs");
|
||||
}
|
||||
|
||||
bool fstype_can_uid_gid(const char *fstype) {
|
||||
|
||||
/* All file systems that have a uid=/gid= mount option that fixates the owners of all files and directories,
|
||||
|
||||
@@ -49,6 +49,7 @@ 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);
|
||||
bool fstype_can_norecovery(const char *fstype);
|
||||
|
||||
int dev_is_devtmpfs(void);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user