Mkfs works for ext2/ext3 features
[lwext4.git] / lwext4 / ext4_config.h
index 5080256c54514a59ac29362abaac080212b38c34..805c52a199c963ef2b3790c31f37129791b5e2e9 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
+/*Superblock features flag EXT2*/
+#define CONFIG_SUPPORTED_FCOM EXT2_SUPPORTED_FCOM
+#define CONFIG_SUPPORTED_FINCOM (EXT2_SUPPORTED_FINCOM | EXT_FINCOM_IGNORED)
+#define CONFIG_SUPPORTED_FRO_COM EXT2_SUPPORTED_FRO_COM
+
+#elif CONFIG_EXT_FEATURE_SET_LVL == F_SET_EXT3
+/*Superblock features flag EXT3*/
+#define CONFIG_SUPPORTED_FCOM EXT3_SUPPORTED_FCOM
+#define CONFIG_SUPPORTED_FINCOM (EXT3_SUPPORTED_FINCOM | EXT_FINCOM_IGNORED)
+#define CONFIG_SUPPORTED_FRO_COM EXT3_SUPPORTED_FRO_COM
+#elif CONFIG_EXT_FEATURE_SET_LVL == F_SET_EXT4
+/*Superblock features flag EXT4*/
+#define CONFIG_SUPPORTED_FCOM EXT4_SUPPORTED_FCOM
+#define CONFIG_SUPPORTED_FINCOM (EXT4_SUPPORTED_FINCOM | EXT_FINCOM_IGNORED)
+#define CONFIG_SUPPORTED_FRO_COM EXT4_SUPPORTED_FRO_COM
+#else
+#define "Unsupported CONFIG_EXT_FEATURE_SET_LVL"
 #endif
 
+#define CONFIG_DIR_INDEX_ENABLE (CONFIG_SUPPORTED_FCOM & EXT4_FCOM_DIR_INDEX)
+#define CONFIG_EXTENT_ENABLE (CONFIG_SUPPORTED_FINCOM & EXT4_FINCOM_EXTENTS)
+#define CONFIG_META_CSUM_ENABLE (CONFIG_SUPPORTED_FRO_COM & EXT4_FRO_COM_METADATA_CSUM)
 
+/*****************************************************************************/
 
-/**@brief      Include error codes from ext4_errno or sandard library.*/
-#ifndef CONFIG_HAVE_OWN_ERRNO
-#define CONFIG_HAVE_OWN_ERRNO                          1
+/**@brief   Enable directory indexing comb sort*/
+#ifndef CONFIG_DIR_INDEX_COMB_SORT
+#define CONFIG_DIR_INDEX_COMB_SORT 1
 #endif
 
+/**@brief   Include error codes from ext4_errno or standard library.*/
+#ifndef CONFIG_HAVE_OWN_ERRNO
+#define CONFIG_HAVE_OWN_ERRNO 1
+#endif
 
-/**@brief      Debug printf enable (stdout)*/
+/**@brief   Debug printf enable (stdout)*/
 #ifndef CONFIG_DEBUG_PRINTF
-#define CONFIG_DEBUG_PRINTF                                    1
+#define CONFIG_DEBUG_PRINTF 1
 #endif
 
-/**@brief      Assert printf enable (stdout)*/
+/**@brief   Debug printf prefixes*/
+#ifndef CONFIG_DEBUG_PREFIX
+#define CONFIG_DEBUG_PREFIX 1
+#endif
+
+
+/**@brief   Assert printf enable (stdout)*/
 #ifndef CONFIG_DEBUG_ASSERT
-#define CONFIG_DEBUG_ASSERT                                    1
+#define CONFIG_DEBUG_ASSERT 1
 #endif
 
-/**@brief      Statistics of block device*/
+/**@brief   Include assert codes from ext4_debug or standard library.*/
+#ifndef CONFIG_HAVE_OWN_ASSERT
+#define CONFIG_HAVE_OWN_ASSERT 1
+#endif
+
+/**@brief   Statistics of block device*/
 #ifndef CONFIG_BLOCK_DEV_ENABLE_STATS
-#define CONFIG_BLOCK_DEV_ENABLE_STATS          1
+#define CONFIG_BLOCK_DEV_ENABLE_STATS 1
 #endif
 
-/**@brief      Cache size of block device.*/
+/**@brief   Cache size of block device.*/
 #ifndef CONFIG_BLOCK_DEV_CACHE_SIZE
-#define CONFIG_BLOCK_DEV_CACHE_SIZE                    8
+#define CONFIG_BLOCK_DEV_CACHE_SIZE 8
 #endif
 
-
-/**@brief      Ilosc urzadzen blokowych.*/
+/**@brief   Maximum block device count*/
 #ifndef CONFIG_EXT4_BLOCKDEVS_COUNT
-#define CONFIG_EXT4_BLOCKDEVS_COUNT                    2
+#define CONFIG_EXT4_BLOCKDEVS_COUNT 2
 #endif
 
-/**@brief      Ilosc punktow montowania systemu plikow*/
+/**@brief   Maximum mountpoint count*/
 #ifndef CONFIG_EXT4_MOUNTPOINTS_COUNT
-#define CONFIG_EXT4_MOUNTPOINTS_COUNT          2
+#define CONFIG_EXT4_MOUNTPOINTS_COUNT 2
+#endif
+
+/**@brief   Include open flags from ext4_errno or standard library.*/
+#ifndef CONFIG_HAVE_OWN_OFLAGS
+#define CONFIG_HAVE_OWN_OFLAGS 0
 #endif
 
+/**@brief   Use full extent implemrntation*/
+#ifndef CONFIG_EXTENT_FULL
+#define CONFIG_EXTENT_FULL 1
+#endif
+
+
 
 #endif /* EXT4_CONFIG_H_ */