Changeset 07fd4cd1 in mainline
- Timestamp:
- 2011-12-03T10:50:16Z (13 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- b8b1e631
- Parents:
- 2449396
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/fs/ext4fs/ext4fs_ops.c
r2449396 r07fd4cd1 401 401 ext4_inode_ref_t *inode_ref = enode->inode_ref; 402 402 403 // EXT4FS_DBG("destroying \%u", inode_ref->index);404 405 403 rc = ext4_filesystem_truncate_inode(fs, inode_ref, 0); 406 404 if (rc != EOK) { … … 408 406 return rc; 409 407 } 408 409 uint32_t rev_level = ext4_superblock_get_rev_level(fs->superblock); 410 if (rev_level > 0) { 411 ext4_filesystem_delete_orphan(fs, inode_ref); 412 } 413 414 415 // TODO set real deletion time 416 // time_t now = time(NULL); 417 time_t now = ext4_inode_get_change_inode_time(inode_ref->inode); 418 ext4_inode_set_deletion_time(inode_ref->inode, (uint32_t)now); 419 inode_ref->dirty = true; 410 420 411 421 rc = ext4_filesystem_free_inode(fs, inode_ref); … … 444 454 // Cannot unlink non-empty node 445 455 if (has_children) { 446 EXT4FS_DBG("\%s is not empty", name);447 456 return ENOTEMPTY; 448 457 } … … 471 480 ext4_inode_ref_t *parent_inode_ref = EXT4FS_NODE(pfn)->inode_ref; 472 481 473 // EXT4FS_DBG("parent index = \%u", parent_inode_ref->index);474 475 482 uint32_t parent_lnk_count = ext4_inode_get_links_count( 476 483 parent_inode_ref->inode); … … 479 486 ext4_inode_set_links_count(parent_inode_ref->inode, parent_lnk_count); 480 487 481 parent_inode_ref->dirty = true; 482 } 483 488 parent->dirty = true; 489 } 490 491 uint32_t rev_level = ext4_superblock_get_rev_level(fs->superblock); 492 if ((rev_level > 0) && (lnk_count == 0)) { 493 ext4_filesystem_add_orphan(fs, child_inode_ref); 494 } 495 496 // TODO set timestamps for parent (when we have wall-clock time) 497 // time_t now = time(NULL); 498 // ext4_inode_set_change_inode_time(parent->inode, (uint32_t)now); 499 // ext4_inode_set_modification_time(parent->inode, (uint32_t)now); 500 // parent->dirty = true; 501 502 // TODO set timestamp for inode 503 // ext4_inode_set_change_inode_time(child_inode_ref->inode, (uint32_t)now); 484 504 ext4_inode_set_links_count(child_inode_ref->inode, lnk_count); 485 505 child_inode_ref->dirty = true;
Note:
See TracChangeset
for help on using the changeset viewer.