Make the workaround function globally available.
Signed-off-by: Karel Zak <kzak@redhat.com>
#endif
#endif /* HAVE_STATMOUNT_API */
-
#endif /* HAVE_LINUX_MOUNT_H */
+/*
+ * Default NTFS mount type (used by libmount and libblkid)
+ */
+#ifndef CONFIG_UL_NTFS_MOUNTTYPE
+# define CONFIG_UL_NTFS_MOUNTTYPE "ntfs3"
+#endif
+
+/*
+ * Convert FS-type (as provided by libblkid or udev) to the preferred
+ * kernel FS driver (type used to mount the FS).
+ *
+ * This is a temporary solution; the final solution should be based on config
+ * files like /etc/mount/fs.d/<name> (from lib/configs.c) and managed by
+ * libmount.
+ */
+static inline const char *ul_fstype_to_mounttype(const char *fstype)
+{
+ if (!fstype)
+ return NULL;
+
+ if (strcmp(fstype, "ntfs") == 0)
+ return CONFIG_UL_NTFS_MOUNTTYPE;
+
+ return NULL;
+}
#endif /* UTIL_LINUX_MOUNTUTILS_H */
}
if (rc == 0 && *type) {
- const char *x = mnt_fstype_to_mounttype(*type);
+ const char *x = ul_fstype_to_mounttype(*type);
if (x) {
free(*type);
close(fd);
}
if (type) {
- const char *x = mnt_fstype_to_mounttype(type);
+ const char *x = ul_fstype_to_mounttype(type);
int rc = mnt_fs_set_fstype(cxt->fs, x ? x : type);
if (rc)
extern int mnt_valid_tagname(const char *tagname);
extern const char *mnt_statfs_get_fstype(struct statfs *vfs);
-extern const char *mnt_fstype_to_mounttype(const char *fstype);
extern int is_file_empty(const char *name);
extern int mnt_is_readonly(const char *path)
return NULL;
}
-/*
- * Default NTFS mount type (used by libmount and libblkid)
- */
-#ifndef CONFIG_UL_NTFS_MOUNTTYPE
-# define CONFIG_UL_NTFS_MOUNTTYPE "ntfs3"
-#endif
-
-/*
- * Convert FS-type (as provided by libblkid or udev) to the preferred
- * kernel FS driver (type used to mount the FS).
- *
- * This is a temporary solution; the final solution should be
- * based on config files like /etc/mount/fs.d/<name> (from lib/configs.c).
- */
-const char *mnt_fstype_to_mounttype(const char *fstype)
-{
- if (!fstype)
- return NULL;
-
- if (strcmp(fstype, "ntfs") == 0)
- return CONFIG_UL_NTFS_MOUNTTYPE;
-
- return NULL;
-}
-
/**
* mnt_match_fstype:
* @type: filesystem type