#include "errno-util.h"
#include "fd-util.h"
#include "fileio.h"
+#include "filesystems.h"
#include "fs-util.h"
#include "home-util.h"
#include "homed-home-bus.h"
ret_access_mode);
}
-static const char *fstype_magic_to_name(statfs_f_type_t magic) {
- /* For now, let's only translate the magic values of the file systems we actually are able to manage */
-
- if (F_TYPE_EQUAL(magic, EXT4_SUPER_MAGIC))
- return "ext4";
- if (F_TYPE_EQUAL(magic, XFS_SUPER_MAGIC))
- return "xfs";
- if (F_TYPE_EQUAL(magic, BTRFS_SUPER_MAGIC))
- return "btrfs";
-
- return NULL;
-}
-
int home_augment_status(
Home *h,
UserRecordLoadFlags flags,
if (r < 0)
return r;
- fstype = fstype_magic_to_name(magic);
+ fstype = fs_type_to_string(magic);
if (disk_floor == UINT64_MAX || (disk_usage != UINT64_MAX && disk_floor < disk_usage))
disk_floor = disk_usage;
#include "copy.h"
#include "fd-util.h"
#include "fileio.h"
+#include "filesystems.h"
#include "fs-util.h"
#include "home-util.h"
#include "homework-cifs.h"
return NULL;
}
- if (is_fs_type(&sfs, XFS_SB_MAGIC))
- return "xfs";
- if (is_fs_type(&sfs, EXT4_SUPER_MAGIC))
- return "ext4";
- if (is_fs_type(&sfs, BTRFS_SUPER_MAGIC))
- return "btrfs";
-
- return NULL;
+ return fs_type_to_string(sfs.f_type);
}
int home_extend_embedded_identity(UserRecord *h, UserRecord *used, HomeSetup *setup) {