Changeset e03d545 in mainline


Ignore:
Timestamp:
2011-09-05T19:41:25Z (13 years ago)
Author:
Maurizio Lombardi <m.lombardi85@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
5987f917, 9dbf5587
Parents:
5222e746
Message:

Minor fixes to minixfs:

  • Do not check the value of nlinks in the mfs_destroy() function
  • Rename the mfs_put_inode() function to mfs_put_inode_core()
  • Read the entire superblock when mounting the fs image
Location:
uspace/srv/fs/minixfs
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • uspace/srv/fs/minixfs/mfs.h

    r5222e746 re03d545  
    159159
    160160extern int
    161 mfs_put_inode(struct mfs_node *mnode);
     161mfs_put_inode_core(struct mfs_node *mnode);
    162162
    163163extern int
  • uspace/srv/fs/minixfs/mfs_inode.c

    r5222e746 re03d545  
    186186
    187187int
    188 mfs_put_inode(struct mfs_node *mnode)
     188mfs_put_inode_core(struct mfs_node *mnode)
    189189{
    190190        int rc = EOK;
  • uspace/srv/fs/minixfs/mfs_ops.c

    r5222e746 re03d545  
    191191
    192192        /* Read the superblock */
    193         rc = block_read_direct(service_id, MFS_SUPERBLOCK << 1, 1, sb);
     193        rc = block_read_direct(service_id, MFS_SUPERBLOCK << 1, 2, sb);
    194194        if (rc != EOK) {
    195195                free(instance);
     
    513513                assert(mnode->instance->open_nodes_cnt > 0);
    514514                mnode->instance->open_nodes_cnt--;
    515                 rc = mfs_put_inode(mnode);
     515                rc = mfs_put_inode_core(mnode);
    516516                free(mnode->ino_i);
    517517                free(mnode);
     
    961961
    962962        /*Destroy the inode*/
    963         r = mfs_destroy_node(fn);
    964         return r;
     963        return mfs_destroy_node(fn);
    965964}
    966965
     
    979978
    980979        assert(!has_children);
    981 
    982         if (mnode->ino_i->i_nlinks > 0) {
    983                 mfsdebug("nlinks = %d", mnode->ino_i->i_nlinks);
    984                 r = EOK;
    985                 goto out;
    986         }
    987980
    988981        /*Free the entire inode content*/
     
    990983        if (r != EOK)
    991984                goto out;
     985
     986        /*Mark the inode as free in the bitmap*/
    992987        r = mfs_free_inode(mnode->instance, mnode->ino_i->index);
    993988
Note: See TracChangeset for help on using the changeset viewer.