ref: 5252521e18749639eb5584a1ef3604a8064a9f43
parent: e40f01af4ed918874efa5279c0e18ab47e80e989
author: gkostka <kostka.grzegorz@gmail.com>
date: Tue Oct 27 15:47:52 EDT 2015
Refactor FEATURE_COMPAT to FCOM
--- a/lwext4/ext4.c
+++ b/lwext4/ext4.c
@@ -202,7 +202,7 @@
#if CONFIG_DIR_INDEX_ENABLE
/* Initialize directory index if supported */
if (ext4_sb_has_feature_compatible(
- &mp->fs.sb, EXT4_FEATURE_COMPAT_DIR_INDEX)) {
+ &mp->fs.sb, EXT4_FCOM_DIR_INDEX)) {
rc = ext4_dir_dx_init(child, parent);
if (rc != EOK)
return rc;
--- a/lwext4/ext4_dir.c
+++ b/lwext4/ext4_dir.c
@@ -338,7 +338,7 @@
#if CONFIG_DIR_INDEX_ENABLE
/* Index adding (if allowed) */
if ((ext4_sb_has_feature_compatible(&fs->sb,
- EXT4_FEATURE_COMPAT_DIR_INDEX)) &&
+ EXT4_FCOM_DIR_INDEX)) &&
(ext4_inode_has_flag(parent->inode, EXT4_INODE_FLAG_INDEX))) {
int rc = ext4_dir_dx_add_entry(parent, child, name);
@@ -441,7 +441,7 @@
#if CONFIG_DIR_INDEX_ENABLE
/* Index search */
if ((ext4_sb_has_feature_compatible(sb,
- EXT4_FEATURE_COMPAT_DIR_INDEX)) &&
+ EXT4_FCOM_DIR_INDEX)) &&
(ext4_inode_has_flag(parent->inode, EXT4_INODE_FLAG_INDEX))) {
int rc = ext4_dir_dx_find_entry(result, parent, name_len, name);
--- a/lwext4/ext4_fs.c
+++ b/lwext4/ext4_fs.c
@@ -159,17 +159,17 @@
}
static void ext4_fs_debug_features_comp(uint32_t features_compatible)
{
- if (features_compatible & EXT4_FEATURE_COMPAT_DIR_PREALLOC)
+ if (features_compatible & EXT4_FCOM_DIR_PREALLOC)
ext4_dbg(DEBUG_FS, DBG_NONE "dir_prealloc\n");
- if (features_compatible & EXT4_FEATURE_COMPAT_IMAGIC_INODES)
+ if (features_compatible & EXT4_FCOM_IMAGIC_INODES)
ext4_dbg(DEBUG_FS, DBG_NONE "imagic_inodes\n");
- if (features_compatible & EXT4_FEATURE_COMPAT_HAS_JOURNAL)
+ if (features_compatible & EXT4_FCOM_HAS_JOURNAL)
ext4_dbg(DEBUG_FS, DBG_NONE "has_journal\n");
- if (features_compatible & EXT4_FEATURE_COMPAT_EXT_ATTR)
+ if (features_compatible & EXT4_FCOM_EXT_ATTR)
ext4_dbg(DEBUG_FS, DBG_NONE "ext_attr\n");
- if (features_compatible & EXT4_FEATURE_COMPAT_RESIZE_INODE)
+ if (features_compatible & EXT4_FCOM_RESIZE_INODE)
ext4_dbg(DEBUG_FS, DBG_NONE "resize_inode\n");
- if (features_compatible & EXT4_FEATURE_COMPAT_DIR_INDEX)
+ if (features_compatible & EXT4_FCOM_DIR_INDEX)
ext4_dbg(DEBUG_FS, DBG_NONE "dir_index\n");
}
@@ -1677,7 +1677,7 @@
bool is_dx =
ext4_sb_has_feature_compatible(&inode_ref->fs->sb,
- EXT4_FEATURE_COMPAT_DIR_INDEX) &&
+ EXT4_FCOM_DIR_INDEX) &&
ext4_inode_has_flag(inode_ref->inode, EXT4_INODE_FLAG_INDEX);
if (is_dx && link > 1) {
--- a/lwext4/ext4_mkfs.c
+++ b/lwext4/ext4_mkfs.c
@@ -253,7 +253,7 @@
sb->s_prealloc_dir_blocks = 0;
//memcpy(sb->journal_uuid, sb->uuid, sizeof(sb->journal_uuid));
- if (info->feat_compat & EXT4_FEATURE_COMPAT_HAS_JOURNAL)
+ if (info->feat_compat & EXT4_FCOM_HAS_JOURNAL)
sb->journal_inode_number = EXT4_JOURNAL_INO;
sb->journal_dev = 0;
sb->last_orphan = 0;
@@ -393,7 +393,7 @@
info->feat_incompat = CONFIG_FEATURE_INCOMPAT_SUPP;
if (info->no_journal == 0)
- info->feat_compat |= EXT4_FEATURE_COMPAT_HAS_JOURNAL;
+ info->feat_compat |= EXT4_FCOM_HAS_JOURNAL;
info->bg_desc_reserve_blocks = compute_bg_desc_reserve_blocks(info);
--- a/lwext4/ext4_types.h
+++ b/lwext4/ext4_types.h
@@ -193,12 +193,12 @@
/*
* Compatible features
*/
-#define EXT4_FEATURE_COMPAT_DIR_PREALLOC 0x0001
-#define EXT4_FEATURE_COMPAT_IMAGIC_INODES 0x0002
-#define EXT4_FEATURE_COMPAT_HAS_JOURNAL 0x0004
-#define EXT4_FEATURE_COMPAT_EXT_ATTR 0x0008
-#define EXT4_FEATURE_COMPAT_RESIZE_INODE 0x0010
-#define EXT4_FEATURE_COMPAT_DIR_INDEX 0x0020
+#define EXT4_FCOM_DIR_PREALLOC 0x0001
+#define EXT4_FCOM_IMAGIC_INODES 0x0002
+#define EXT4_FCOM_HAS_JOURNAL 0x0004
+#define EXT4_FCOM_EXT_ATTR 0x0008
+#define EXT4_FCOM_RESIZE_INODE 0x0010
+#define EXT4_FCOM_DIR_INDEX 0x0020
/*
* Read-only compatible features
@@ -247,7 +247,7 @@
/*
* EXT3 supported feature set
*/
-#define EXT3_FEATURE_COMPAT_SUPP (EXT4_FEATURE_COMPAT_DIR_INDEX)
+#define EXT3_FEATURE_COMPAT_SUPP (EXT4_FCOM_DIR_INDEX)
#define EXT3_FEATURE_INCOMPAT_SUPP \
(EXT4_FEATURE_INCOMPAT_FILETYPE | EXT4_FEATURE_INCOMPAT_META_BG)
@@ -259,7 +259,7 @@
/*
* EXT4 supported feature set
*/
-#define EXT4_FEATURE_COMPAT_SUPP (EXT4_FEATURE_COMPAT_DIR_INDEX)
+#define EXT4_FEATURE_COMPAT_SUPP (EXT4_FCOM_DIR_INDEX)
#define EXT4_FEATURE_INCOMPAT_SUPP \
(EXT4_FEATURE_INCOMPAT_FILETYPE | EXT4_FEATURE_INCOMPAT_META_BG | \