All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Darrick J. Wong" <darrick.wong@oracle.com>
To: sandeen@redhat.com, darrick.wong@oracle.com
Cc: linux-xfs@vger.kernel.org
Subject: [PATCH 1/5] mkfs: move build-time defaults to a separate file
Date: Wed, 13 Jun 2018 12:31:52 -0700	[thread overview]
Message-ID: <152891831271.3968.10226627538379732223.stgit@magnolia> (raw)
In-Reply-To: <152891829964.3968.4760134019673731615.stgit@magnolia>

From: Darrick J. Wong <darrick.wong@oracle.com>

Move the built-in defaults to a separate file so that we can generate
config files and manpages from them.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
---
 mkfs/Makefile   |    2 +-
 mkfs/config.h   |    2 ++
 mkfs/defaults.c |   27 +++++++++++++++++++++++++++
 mkfs/xfs_mkfs.c |   19 +------------------
 4 files changed, 31 insertions(+), 19 deletions(-)
 create mode 100644 mkfs/defaults.c


diff --git a/mkfs/Makefile b/mkfs/Makefile
index c7815b3e..5af8a6cc 100644
--- a/mkfs/Makefile
+++ b/mkfs/Makefile
@@ -8,7 +8,7 @@ include $(TOPDIR)/include/builddefs
 LTCOMMAND = mkfs.xfs
 
 HFILES =
-CFILES = proto.c xfs_mkfs.c config.c
+CFILES = proto.c xfs_mkfs.c config.c defaults.c
 
 LLDLIBS += $(LIBXFS) $(LIBXCMD) $(LIBFROG) $(LIBRT) $(LIBPTHREAD) $(LIBBLKID) \
 	$(LIBUUID)
diff --git a/mkfs/config.h b/mkfs/config.h
index db22adec..544f8a6d 100644
--- a/mkfs/config.h
+++ b/mkfs/config.h
@@ -119,4 +119,6 @@ parse_defaults_file(
 	struct mkfs_default_params	*dft,
 	const char			*config_file);
 
+extern const struct sb_feat_args default_features;
+
 #endif /* _XFS_MKFS_CONFIG_H */
diff --git a/mkfs/defaults.c b/mkfs/defaults.c
new file mode 100644
index 00000000..6e35a4f9
--- /dev/null
+++ b/mkfs/defaults.c
@@ -0,0 +1,27 @@
+// SPDX-License-Identifier: GPL-2.0+
+/*
+ * Copyright (C) 2018 Oracle.  All Rights Reserved.
+ * Author: Darrick J. Wong <darrick.wong@oracle.com>
+ */
+#include "libxfs.h"
+#include "config.h"
+
+/* build time feature defaults */
+const struct sb_feat_args default_features = {
+	.log_version = 2,
+	.attr_version = 2,
+	.dir_version = 2,
+	.inode_align = true,
+	.nci = false,
+	.lazy_sb_counters = true,
+	.projid32bit = true,
+	.crcs_enabled = true,
+	.dirftype = true,
+	.finobt = true,
+	.spinodes = true,
+	.rmapbt = false,
+	.reflink = false,
+	.parent_pointers = false,
+	.nodalign = false,
+	.nortalign = false,
+};
diff --git a/mkfs/xfs_mkfs.c b/mkfs/xfs_mkfs.c
index d32c2c8e..40a5da12 100644
--- a/mkfs/xfs_mkfs.c
+++ b/mkfs/xfs_mkfs.c
@@ -3725,24 +3725,7 @@ main(
 		.type = DEFAULTS_BUILTIN,
 		.sectorsize = XFS_MIN_SECTORSIZE,
 		.blocksize = 1 << XFS_DFL_BLOCKSIZE_LOG,
-		.sb_feat = {
-			.log_version = 2,
-			.attr_version = 2,
-			.dir_version = 2,
-			.inode_align = true,
-			.nci = false,
-			.lazy_sb_counters = true,
-			.projid32bit = true,
-			.crcs_enabled = true,
-			.dirftype = true,
-			.finobt = true,
-			.spinodes = true,
-			.rmapbt = false,
-			.reflink = false,
-			.parent_pointers = false,
-			.nodalign = false,
-			.nortalign = false,
-		},
+		.sb_feat = default_features,
 	};
 	char			*cli_config_file = NULL;
 	char			*config_file = NULL;


  reply	other threads:[~2018-06-13 19:32 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-06-13 19:31 [PATCH 0/5] xfsprogs-4.17: mkfs config file enhancements Darrick J. Wong
2018-06-13 19:31 ` Darrick J. Wong [this message]
2018-06-14  2:34   ` [PATCH 1/5] mkfs: move build-time defaults to a separate file Eric Sandeen
2018-06-13 19:31 ` [PATCH 2/5] mkfs: move config file enums to config.h Darrick J. Wong
2018-06-14  2:51   ` Eric Sandeen
2018-06-14 16:24     ` Luis R. Rodriguez
2018-06-13 19:32 ` [PATCH 3/5] mkfs: hoist mkfs configfile dir string generation to build system Darrick J. Wong
2018-06-14  2:54   ` Eric Sandeen
2018-06-13 19:32 ` [PATCH 4/5] mkfs: emit config file from builtin defaults Darrick J. Wong
2018-06-14  3:05   ` Eric Sandeen
2018-06-13 19:32 ` [PATCH 5/5] mkfs: generate mkfs config file in man page Darrick J. Wong
2018-06-14  3:17   ` Eric Sandeen
2018-06-14  4:06 ` [PATCH 0/5] xfsprogs-4.17: mkfs config file enhancements Dave Chinner
2018-06-14  4:23   ` Eric Sandeen
2018-06-14  5:08     ` Dave Chinner
2018-06-14  6:29       ` Darrick J. Wong
2018-06-14 17:46         ` Luis R. Rodriguez
2018-06-14 17:59           ` Darrick J. Wong
2018-06-14 18:16             ` Luis R. Rodriguez
2018-06-14 18:35               ` Darrick J. Wong
2018-06-16  0:04                 ` Luis R. Rodriguez
2018-06-14 19:05             ` Eric Sandeen
2018-06-14 22:22               ` Dave Chinner
2018-06-14 23:33         ` Dave Chinner
2018-06-14 23:38           ` Eric Sandeen
2018-06-14 14:31       ` Eric Sandeen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=152891831271.3968.10226627538379732223.stgit@magnolia \
    --to=darrick.wong@oracle.com \
    --cc=linux-xfs@vger.kernel.org \
    --cc=sandeen@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.