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


Ignore:
Timestamp:
2011-11-27T12:16:40Z (13 years ago)
Author:
Frantisek Princ <frantisek.princ@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
d4d2954
Parents:
5f6cb14
Message:

Fixed bugs in directory removal process

File:
1 edited

Legend:

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

    r5f6cb14 re5f8762  
    469469        // If directory - handle links from parent
    470470        if (lnk_count <= 1 && ext4fs_is_directory(cfn)) {
    471 
    472                 if (lnk_count) {
    473                         lnk_count--;
    474                 }
    475 
    476471                ext4_inode_ref_t *parent_inode_ref = EXT4FS_NODE(pfn)->inode_ref;
    477472
     
    567562unsigned ext4fs_lnkcnt_get(fs_node_t *fn)
    568563{
     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
    569575        ext4fs_node_t *enode = EXT4FS_NODE(fn);
    570576        return ext4_inode_get_links_count(enode->inode_ref->inode);
     
    685691                return rc;
    686692        }
    687         ext4fs_node_t *enode = EXT4FS_NODE(root_node);
    688693
    689694        /* Add instance to the list */
     
    694699        *index = EXT4_INODE_ROOT_INDEX;
    695700        *size = 0;
    696         *lnkcnt = ext4_inode_get_links_count(enode->inode_ref->inode);
     701        *lnkcnt = 1;
    697702
    698703        ext4fs_node_put(root_node);
Note: See TracChangeset for help on using the changeset viewer.