meta_bg feature helper functions
[lwext4.git] / lwext4 / ext4_config.h
index 3a371f6c9dc0106bb8ce3691a047e531e9c9e909..e7d067fc9ad0cc21c1f31e21a66411402ca263b7 100644 (file)
 #include <config.h>
 #endif
 
+/*****************************************************************************/
 
-/**@brief   Enable directory indexing feature (EXT3 feature)*/
-#ifndef CONFIG_DIR_INDEX_ENABLE
-#define CONFIG_DIR_INDEX_ENABLE     1
+#define F_SET_EXT2    2
+#define F_SET_EXT3    3
+#define F_SET_EXT4    4
+
+#ifndef CONFIG_EXT_FEATURE_SET_LVL
+#define CONFIG_EXT_FEATURE_SET_LVL  F_SET_EXT4
 #endif
 
-/**@brief   Enable extents feature (EXT4 feature)*/
-#ifndef CONFIG_EXTENT_ENABLE
-#define CONFIG_EXTENT_ENABLE        1
+/*****************************************************************************/
+
+#if CONFIG_EXT_FEATURE_SET_LVL == F_SET_EXT2
+    #define CONFIG_DIR_INDEX_ENABLE     0
+    #define CONFIG_EXTENT_ENABLE        0
+
+    /*Superblock features flag*/
+    #define CONFIG_FEATURE_COMPAT_SUPP    EXT2_FEATURE_COMPAT_SUPP
+
+    #define CONFIG_FEATURE_INCOMPAT_SUPP  (EXT2_FEATURE_INCOMPAT_SUPP | \
+                                          FEATURE_INCOMPAT_IGNORED)
+
+    #define CONFIG_FEATURE_RO_COMPAT_SUPP EXT2_FEATURE_RO_COMPAT_SUPP
+#elif CONFIG_EXT_FEATURE_SET_LVL == F_SET_EXT3
+    #define CONFIG_DIR_INDEX_ENABLE     1
+    #define CONFIG_EXTENT_ENABLE        0
+
+    /*Superblock features flag*/
+    #define CONFIG_FEATURE_COMPAT_SUPP    EXT3_FEATURE_COMPAT_SUPP
+
+    #define CONFIG_FEATURE_INCOMPAT_SUPP  (EXT3_FEATURE_INCOMPAT_SUPP | \
+                                          FEATURE_INCOMPAT_IGNORED)
+
+    #define CONFIG_FEATURE_RO_COMPAT_SUPP EXT3_FEATURE_RO_COMPAT_SUPP
+#elif CONFIG_EXT_FEATURE_SET_LVL == F_SET_EXT4
+    #define CONFIG_DIR_INDEX_ENABLE     1
+    #define CONFIG_EXTENT_ENABLE        1
+
+    /*Superblock features flag*/
+    #define CONFIG_FEATURE_COMPAT_SUPP    EXT4_FEATURE_COMPAT_SUPP
+
+    #define CONFIG_FEATURE_INCOMPAT_SUPP  (EXT4_FEATURE_INCOMPAT_SUPP | \
+                                          FEATURE_INCOMPAT_IGNORED)
+
+    #define CONFIG_FEATURE_RO_COMPAT_SUPP EXT4_FEATURE_RO_COMPAT_SUPP
+#else
+#define "Unsupported CONFIG_EXT_FEATURE_SET_LVL"
+#endif
+
+
+/*****************************************************************************/
+
+/**@brief   Enable directory indexing comb sort*/
+#ifndef CONFIG_DIR_INDEX_COMB_SORT
+#define CONFIG_DIR_INDEX_COMB_SORT  1
 #endif