Changeset 8158db7 in mainline for uspace/srv/fs/ext4fs/ext4fs_ops.c


Ignore:
Timestamp:
2011-10-19T11:44:13Z (14 years ago)
Author:
Frantisek Princ <frantisek.princ@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
246a5af
Parents:
7bd2c19
Message:

Hash functions implementation (ported from Linux)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/srv/fs/ext4fs/ext4fs_ops.c

    r7bd2c19 r8158db7  
    216216        }
    217217
    218         // TODO check super block COMPAT FEATURES
    219         if (ext4_inode_has_flag(eparent->inode_ref->inode, EXT4_INODE_FLAG_INDEX)) {
    220 
    221                 rc = ext4_directory_dx_find_entry(&it, fs, eparent->inode_ref, component);
    222 
    223                 // Index isn't corrupted
    224                 if (rc != EXT4_ERR_BAD_DX_DIR) {
    225 
    226                         // TODO check return value
    227                         if (rc != EOK) {
    228                                 return rc;
    229                         }
    230 
    231                         inode = ext4_directory_entry_ll_get_inode(it.current);
    232                         return ext4fs_node_get_core(rfn, eparent->instance, inode);
    233                 }
    234 
    235         }
    236 
    237         rc = ext4_directory_iterator_init(&it, fs, eparent->inode_ref, 0);
    238         if (rc != EOK) {
    239                 return rc;
    240         }
    241 
    242218        /* Find length of component in bytes
    243219         * TODO: check for library function call that does this
     
    246222        while (*(component+component_size) != 0) {
    247223                component_size++;
     224        }
     225
     226        // TODO check super block COMPAT FEATURES
     227        if (ext4_inode_has_flag(eparent->inode_ref->inode, EXT4_INODE_FLAG_INDEX)) {
     228
     229                rc = ext4_directory_dx_find_entry(&it, fs, eparent->inode_ref, component_size, component);
     230
     231                // Index isn't corrupted
     232                if (rc != EXT4_ERR_BAD_DX_DIR) {
     233
     234                        // TODO check return value
     235                        if (rc != EOK) {
     236                                return rc;
     237                        }
     238
     239                        inode = ext4_directory_entry_ll_get_inode(it.current);
     240                        return ext4fs_node_get_core(rfn, eparent->instance, inode);
     241                }
     242
     243        }
     244
     245        rc = ext4_directory_iterator_init(&it, fs, eparent->inode_ref, 0);
     246        if (rc != EOK) {
     247                return rc;
    248248        }
    249249
Note: See TracChangeset for help on using the changeset viewer.