Browse Source

Refactor FEATURE_COMPAT to FCOM

pull/11/head
gkostka 9 years ago
parent
commit
5252521e18
  1. 2
      lwext4/ext4.c
  2. 4
      lwext4/ext4_dir.c
  3. 14
      lwext4/ext4_fs.c
  4. 4
      lwext4/ext4_mkfs.c
  5. 16
      lwext4/ext4_types.h

2
lwext4/ext4.c

@ -202,7 +202,7 @@ static int ext4_link(struct ext4_mountpoint *mp, struct ext4_inode_ref *parent,
#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;

4
lwext4/ext4_dir.c

@ -338,7 +338,7 @@ int ext4_dir_add_entry(struct ext4_inode_ref *parent, const char *name,
#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 @@ int ext4_dir_find_entry(struct ext4_directory_search_result *result,
#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);

14
lwext4/ext4_fs.c

@ -159,17 +159,17 @@ static void ext4_fs_debug_features_inc(uint32_t features_incompatible)
}
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 @@ void ext4_fs_inode_links_count_inc(struct ext4_inode_ref *inode_ref)
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) {

4
lwext4/ext4_mkfs.c

@ -253,7 +253,7 @@ static void fill_in_sb(struct fs_aux_info *aux_info, struct ext4_mkfs_info *info
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 @@ int ext4_mkfs(struct ext4_blockdev *bd, struct ext4_mkfs_info *info)
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);

16
lwext4/ext4_types.h

@ -193,12 +193,12 @@ struct ext4_sblock {
/*
* 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 @@ struct ext4_sblock {
/*
* 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 @@ struct ext4_sblock {
/*
* 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 | \

Loading…
Cancel
Save