File mkfs-default-features.patch of Package btrfsprogs

From: Jeff Mahoney <jeffm@suse.com>
Subject: mkfs: allow site to override defaults
Patch-mainline: Never, a real solution with a config file is required
References: FATE#320615

This is a simple method to allow us to set site defaults for mkfs by
adding -include <includefile> to cflags.

Signed-off-by: Jeff Mahoney <jeffm@suse.com>
---
 utils.h |    4 ++++
 1 file changed, 4 insertions(+)

Index: btrfs-progs-v6.5.3/common/fsfeatures.h
===================================================================
--- btrfs-progs-v6.5.3.orig/common/fsfeatures.h
+++ btrfs-progs-v6.5.3/common/fsfeatures.h
@@ -21,7 +21,9 @@
 #include <stdio.h>
 #include "kernel-lib/sizes.h"
 
+#ifndef BTRFS_MKFS_DEFAULT_NODE_SIZE
 #define BTRFS_MKFS_DEFAULT_NODE_SIZE SZ_16K
+#endif
 
 /*
  * Since one feature can set at least one bit in either
@@ -44,11 +46,20 @@ struct btrfs_mkfs_features {
 #define BTRFS_FEATURE_STRING_BUF_SIZE		(512)
 
 static const struct btrfs_mkfs_features btrfs_mkfs_default_features = {
+#ifndef BTRFS_MKFS_DEFAULT_RUNTIME_FEATURES
 	.compat_ro_flags = BTRFS_FEATURE_COMPAT_RO_FREE_SPACE_TREE |
 			   BTRFS_FEATURE_COMPAT_RO_FREE_SPACE_TREE_VALID,
+#else
+	.compat_ro_flags = BTRFS_MKFS_DEFAULT_RUNTIME_FEATURES ,
+#endif
+
+#ifndef BTRFS_MKFS_DEFAULT_FEATURES
 	.incompat_flags	 = BTRFS_FEATURE_INCOMPAT_EXTENDED_IREF |
 			   BTRFS_FEATURE_INCOMPAT_NO_HOLES |
 			   BTRFS_FEATURE_INCOMPAT_SKINNY_METADATA,
+#else
+	.incompat_flags = BTRFS_MKFS_DEFAULT_FEATURES ,
+#endif
 };
 
 /*
openSUSE Build Service is sponsored by