mkfs: replace defaults source with an enum
Using an enum will let us later just use a switch statement to print
out the source, this makes sources easier to document, update and
manage.
Signed-off-by: Luis R. Rodriguez <mcgrof@kernel.org>
diff --git a/mkfs/xfs_mkfs.c b/mkfs/xfs_mkfs.c
index ac97039..de0eab3 100644
--- a/mkfs/xfs_mkfs.c
+++ b/mkfs/xfs_mkfs.c
@@ -3697,7 +3697,7 @@
/* build time defaults */
struct mkfs_default_params dft = {
- .source = _("package build definitions"),
+ .type = DEFAULTS_BUILTIN,
.sectorsize = XFS_MIN_SECTORSIZE,
.blocksize = 1 << XFS_DFL_BLOCKSIZE_LOG,
.sb_feat = {
@@ -3737,7 +3737,8 @@
* implemented, emit a message to indicate where the defaults being
* used came from.
*
- * printf(_("Default configuration sourced from %s\n"), dft.source);
+ * printf(_("Default configuration sourced from %s\n"),
+ * default_type_str(dft.type));
*/
/* copy new defaults into CLI parsing structure */
diff --git a/mkfs/xfs_mkfs_common.h b/mkfs/xfs_mkfs_common.h
index 9b0f67b..d867ab3 100644
--- a/mkfs/xfs_mkfs_common.h
+++ b/mkfs/xfs_mkfs_common.h
@@ -41,6 +41,17 @@
};
/*
+ * File configuration type settings
+ *
+ * These are the different possibilities by which you can end up parsing
+ * default settings with. DEFAULTS_BUILTIN indicates there was no configuration
+ * file parsed and we are using the built-in defaults on this code.
+ */
+enum default_params_type {
+ DEFAULTS_BUILTIN = 0,
+};
+
+/*
* Default filesystem features and configuration values
*
* This structure contains the default mkfs values that are to be used when
@@ -49,7 +60,7 @@
* calculations.
*/
struct mkfs_default_params {
- char *source; /* where the defaults came from */
+ enum default_params_type type; /* where the defaults came from */
int sectorsize;
int blocksize;