Add #ifdef __cplusplus to all header files
[lwext4.git] / lwext4 / ext4_dir.c
index b107776df0abfabdca1a8a7d001f42aeb997e849..61e6bdfa35ecc8fb430ee35692bfe5653ff5a96e 100644 (file)
@@ -309,16 +309,15 @@ void ext4_dir_write_entry(struct ext4_sblock *sb,
        /* Set type of entry */
        switch (ext4_inode_type(sb, child->inode)) {
        case EXT4_INODE_MODE_DIRECTORY:
-               ext4_dir_entry_ll_set_inode_type(sb, entry,
-                                                EXT4_DIRENTRY_DIR);
+               ext4_dir_entry_ll_set_inode_type(sb, entry, EXT4_DIRENTRY_DIR);
                break;
        case EXT4_INODE_MODE_FILE:
-               ext4_dir_entry_ll_set_inode_type(
-                   sb, entry, EXT4_DIRENTRY_REG_FILE);
+               ext4_dir_entry_ll_set_inode_type(sb, entry,
+                                                EXT4_DIRENTRY_REG_FILE);
                break;
        case EXT4_INODE_MODE_SOFTLINK:
-               ext4_dir_entry_ll_set_inode_type(
-                   sb, entry, EXT4_DIRENTRY_SYMLINK);
+               ext4_dir_entry_ll_set_inode_type(sb, entry,
+                                                EXT4_DIRENTRY_SYMLINK);
                break;
        default:
                /* FIXME: right now we only support 3 inode type. */
@@ -452,6 +451,10 @@ int ext4_dir_find_entry(struct ext4_dir_search_result *result,
 {
        struct ext4_sblock *sb = &parent->fs->sb;
 
+       /* Entry clear */
+       result->block.lb_id = 0;
+       result->dentry = NULL;
+
 #if CONFIG_DIR_INDEX_ENABLE
        /* Index search */
        if ((ext4_sb_feature_com(sb, EXT4_FCOM_DIR_INDEX)) &&
@@ -525,11 +528,6 @@ int ext4_dir_find_entry(struct ext4_dir_search_result *result,
                        return rc;
        }
 
-       /* Entry was not found */
-
-       result->block.lb_id = 0;
-       result->dentry = NULL;
-
        return ENOENT;
 }