btrfsprogs/mkfs-default-features.patch
2022-11-03 18:13:32 +00:00

49 lines
1.5 KiB
Diff

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.0/common/fsfeatures.h
===================================================================
--- btrfs-progs-v6.0.orig/common/fsfeatures.h
+++ btrfs-progs-v6.0/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 (160)
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
};
/*