Changeset e5f8762 in mainline
- Timestamp:
- 2011-11-27T12:16:40Z (13 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- d4d2954
- Parents:
- 5f6cb14
- Location:
- uspace
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/ext4/libext4_directory.c
r5f6cb14 re5f8762 317 317 } 318 318 319 if (rc != EOK) {320 ext4_directory_iterator_fini(&it);321 return rc;322 }323 324 319 // TODO modify HTREE index if exists 325 320 -
uspace/lib/ext4/libext4_filesystem.c
r5f6cb14 re5f8762 387 387 } 388 388 389 inode_ref->dirty = true; 390 389 391 // Free inode 390 392 rc = ext4_ialloc_free_inode(fs, inode_ref); … … 441 443 for (i = 1; i <= blocks_count; ++i) { 442 444 // TODO check retval 443 // TODO decrement inode->blocks_count444 445 445 ext4_filesystem_release_inode_block(fs, inode_ref, total_blocks - i); 446 446 } -
uspace/lib/ext4/libext4_ialloc.c
r5f6cb14 re5f8762 37 37 38 38 #include <errno.h> 39 #include <time.h> 39 40 #include "libext4.h" 40 41 … … 90 91 } 91 92 93 time_t now = time(NULL); 94 ext4_inode_set_deletion_time(inode_ref->inode, (uint32_t)now); 95 inode_ref->dirty = true; 96 97 // if inode is directory, decrement directories count 98 if (ext4_inode_is_type(fs->superblock, inode_ref->inode, EXT4_INODE_MODE_DIRECTORY)) { 99 uint32_t bg_used_dirs = ext4_block_group_get_used_dirs_count( 100 bg_ref->block_group, fs->superblock); 101 bg_used_dirs--; 102 ext4_block_group_set_used_dirs_count( 103 bg_ref->block_group, fs->superblock, bg_used_dirs); 104 } 105 92 106 // Update superblock free inodes count 93 107 uint32_t sb_free_inodes = ext4_superblock_get_free_inodes_count(fs->superblock); 94 sb_free_inodes --;108 sb_free_inodes++; 95 109 ext4_superblock_set_free_inodes_count(fs->superblock, sb_free_inodes); 96 110 -
uspace/srv/fs/ext4fs/ext4fs_ops.c
r5f6cb14 re5f8762 469 469 // If directory - handle links from parent 470 470 if (lnk_count <= 1 && ext4fs_is_directory(cfn)) { 471 472 if (lnk_count) {473 lnk_count--;474 }475 476 471 ext4_inode_ref_t *parent_inode_ref = EXT4FS_NODE(pfn)->inode_ref; 477 472 … … 567 562 unsigned ext4fs_lnkcnt_get(fs_node_t *fn) 568 563 { 564 if (ext4fs_is_directory(fn)) { 565 if (lnkcnt > 1) { 566 EXT4FS_DBG("dir: returning \%u", 1); 567 return 1; 568 } else { 569 EXT4FS_DBG("dir: returning \%u", 0); 570 return 0; 571 } 572 } 573 574 // For regular files return real links count 569 575 ext4fs_node_t *enode = EXT4FS_NODE(fn); 570 576 return ext4_inode_get_links_count(enode->inode_ref->inode); … … 685 691 return rc; 686 692 } 687 ext4fs_node_t *enode = EXT4FS_NODE(root_node);688 693 689 694 /* Add instance to the list */ … … 694 699 *index = EXT4_INODE_ROOT_INDEX; 695 700 *size = 0; 696 *lnkcnt = ext4_inode_get_links_count(enode->inode_ref->inode);701 *lnkcnt = 1; 697 702 698 703 ext4fs_node_put(root_node);
Note:
See TracChangeset
for help on using the changeset viewer.