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


Ignore:
Timestamp:
2012-03-03T17:44:38Z (13 years ago)
Author:
Frantisek Princ <frantisek.princ@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
e63ce679
Parents:
c30a015
Message:

Code refactoring (for dentry searching)

File:
1 edited

Legend:

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

    rc30a015 r7689590  
    210210        }
    211211
    212 
    213         ext4_directory_iterator_t it;
    214         rc = ext4_directory_iterator_init(&it, fs, eparent->inode_ref, 0);
    215         if (rc != EOK) {
    216                 return rc;
    217         }
    218 
    219         rc = ext4_directory_find_entry(&it, eparent->inode_ref, component);
    220         if (rc != EOK) {
    221                 ext4_directory_iterator_fini(&it);
     212        ext4_directory_search_result_t result;
     213        rc = ext4_directory_find_entry(fs, &result, eparent->inode_ref, component);
     214        if (rc != EOK) {
    222215                if (rc == ENOENT) {
    223216                        *rfn = NULL;
     
    227220        }
    228221
    229         uint32_t inode = ext4_directory_entry_ll_get_inode(it.current);
     222        uint32_t inode = ext4_directory_entry_ll_get_inode(result.dentry);
    230223
    231224        rc = ext4fs_node_get_core(rfn, eparent->instance, inode);
    232225        if (rc != EOK) {
    233                 ext4_directory_iterator_fini(&it);
    234                 return rc;
    235         }
    236 
    237         ext4_directory_iterator_fini(&it);
     226                return rc;
     227        }
     228
     229        rc = ext4_directory_destroy_result(&result);
     230        if (rc != EOK) {
     231                return rc;
     232        }
     233
    238234        return EOK;
    239235}
Note: See TracChangeset for help on using the changeset viewer.