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


Ignore:
Timestamp:
2012-03-31T20:00:15Z (12 years ago)
Author:
Frantisek Princ <frantisek.princ@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
a2fa350
Parents:
38384ae
Message:

simplied headers of more functions, improved bg_ref and inode_ref structures, added block group checksumming and fixed bug in block_group values updating

File:
1 edited

Legend:

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

    r38384ae r1ac1ab4  
    211211
    212212        ext4_directory_search_result_t result;
    213         rc = ext4_directory_find_entry(fs, &result, eparent->inode_ref, component);
     213        rc = ext4_directory_find_entry(&result, eparent->inode_ref, component);
    214214        if (rc != EOK) {
    215215                if (rc == ENOENT) {
     
    448448        ext4_inode_ref_t *inode_ref = enode->inode_ref;
    449449
    450         rc = ext4_filesystem_truncate_inode(fs, inode_ref, 0);
     450        rc = ext4_filesystem_truncate_inode(inode_ref, 0);
    451451        if (rc != EOK) {
    452452                ext4fs_node_put(fn);
     
    456456        uint32_t rev_level = ext4_superblock_get_rev_level(fs->superblock);
    457457        if (rev_level > 0) {
    458                 ext4_filesystem_delete_orphan(fs, inode_ref);
     458                ext4_filesystem_delete_orphan(inode_ref);
    459459        }
    460460
     
    465465        inode_ref->dirty = true;
    466466
    467         rc = ext4_filesystem_free_inode(fs, inode_ref);
     467        rc = ext4_filesystem_free_inode(inode_ref);
    468468        if (rc != EOK) {
    469469                ext4fs_node_put(fn);
     
    489489
    490490        // Add entry to parent directory
    491         rc = ext4_directory_add_entry(fs, parent->inode_ref, name, child->inode_ref);
     491        rc = ext4_directory_add_entry(parent->inode_ref, name, child->inode_ref);
    492492        if (rc != EOK) {
    493493                return rc;
     
    497497        if (ext4_inode_is_type(fs->superblock, child->inode_ref->inode, EXT4_INODE_MODE_DIRECTORY)) {
    498498
    499                 rc = ext4_directory_add_entry(fs, child->inode_ref, ".", child->inode_ref);
     499                rc = ext4_directory_add_entry(child->inode_ref, ".", child->inode_ref);
    500500                if (rc != EOK) {
    501                         ext4_directory_remove_entry(fs, parent->inode_ref, name);
     501                        ext4_directory_remove_entry(parent->inode_ref, name);
    502502                        return rc;
    503503                }
    504504
    505                 rc = ext4_directory_add_entry(fs, child->inode_ref, "..", parent->inode_ref);
     505                rc = ext4_directory_add_entry(child->inode_ref, "..", parent->inode_ref);
    506506                if (rc != EOK) {
    507                         ext4_directory_remove_entry(fs, parent->inode_ref, name);
    508                         ext4_directory_remove_entry(fs, child->inode_ref, ".");
     507                        ext4_directory_remove_entry(parent->inode_ref, name);
     508                        ext4_directory_remove_entry(child->inode_ref, ".");
    509509                        return rc;
    510510                }
     
    546546        ext4_inode_ref_t *parent = EXT4FS_NODE(pfn)->inode_ref;
    547547        ext4_filesystem_t *fs = EXT4FS_NODE(pfn)->instance->filesystem;
    548         rc = ext4_directory_remove_entry(fs, parent, name);
     548        rc = ext4_directory_remove_entry(parent, name);
    549549        if (rc != EOK) {
    550550                return rc;
     
    576576        uint32_t rev_level = ext4_superblock_get_rev_level(fs->superblock);
    577577        if ((rev_level > 0) && (lnk_count == 0)) {
    578                 ext4_filesystem_add_orphan(fs, child_inode_ref);
     578                ext4_filesystem_add_orphan(child_inode_ref);
    579579        }
    580580
     
    10021002        /* Get the real block number */
    10031003        uint32_t fs_block;
    1004         rc = ext4_filesystem_get_inode_data_block_index(inst->filesystem,
    1005                 inode_ref, file_block, &fs_block);
     1004        rc = ext4_filesystem_get_inode_data_block_index(inode_ref, file_block, &fs_block);
    10061005        if (rc != EOK) {
    10071006                async_answer_0(callid, rc);
     
    10901089
    10911090        ext4_inode_ref_t *inode_ref = enode->inode_ref;
    1092         rc = ext4_filesystem_get_inode_data_block_index(fs, inode_ref, iblock, &fblock);
     1091        rc = ext4_filesystem_get_inode_data_block_index(inode_ref, iblock, &fblock);
    10931092        if (rc != EOK) {
    10941093                ext4fs_node_put(fn);
     
    10981097
    10991098        if (fblock == 0) {
    1100                 rc =  ext4_balloc_alloc_block(fs, inode_ref, &fblock);
     1099                rc =  ext4_balloc_alloc_block(inode_ref, &fblock);
    11011100                if (rc != EOK) {
    11021101                        ext4fs_node_put(fn);
     
    11051104                }
    11061105
    1107                 rc = ext4_filesystem_set_inode_data_block_index(fs, inode_ref, iblock, fblock);
     1106                rc = ext4_filesystem_set_inode_data_block_index(inode_ref, iblock, fblock);
    11081107                if (rc != EOK) {
    1109                         ext4_balloc_free_block(fs, inode_ref, fblock);
     1108                        ext4_balloc_free_block(inode_ref, fblock);
    11101109                        ext4fs_node_put(fn);
    11111110                        async_answer_0(callid, rc);
     
    11691168        ext4fs_node_t *enode = EXT4FS_NODE(fn);
    11701169        ext4_inode_ref_t *inode_ref = enode->inode_ref;
    1171         ext4_filesystem_t *fs = enode->instance->filesystem;
    1172 
    1173         rc = ext4_filesystem_truncate_inode(fs, inode_ref, new_size);
     1170
     1171        rc = ext4_filesystem_truncate_inode(inode_ref, new_size);
    11741172        ext4fs_node_put(fn);
    11751173
Note: See TracChangeset for help on using the changeset viewer.