Changeset 13ecdac9 in mainline for uspace/srv/fs/minixfs/mfs_ops.c


Ignore:
Timestamp:
2011-05-30T20:00:24Z (13 years ago)
Author:
Maurizio Lombardi <m.lombardi85@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
1affcdf3
Parents:
ff2e72e
Message:

Add support to directories (mkdir now works)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/srv/fs/minixfs/mfs_ops.c

    rff2e72e r13ecdac9  
    265265        on_error(r, return r);
    266266
    267         if (flags & L_DIRECTORY) {
    268                 /*Not yet supported*/
    269                 return ENOTSUP;
    270         }
    271 
    272267        /*Alloc a new inode*/
    273268        r = mfs_alloc_bit(inst, &inum, BMAP_INODE);
     
    294289        }
    295290
    296         ino_i->i_mode = S_IFREG;
     291        if (flags & L_DIRECTORY)
     292                ino_i->i_mode = S_IFDIR;
     293        else
     294                ino_i->i_mode = S_IFREG;
     295
    297296        ino_i->i_nlinks = 1;
    298297        ino_i->i_uid = 0;
     
    527526
    528527        int r = insert_dentry(parent, name, child->ino_i->index);
    529 
     528        on_error(r, goto exit_error);
     529
     530        if (S_ISDIR(child->ino_i->i_mode)) {
     531                r = insert_dentry(child, ".", child->ino_i->index);
     532                on_error(r, goto exit_error);
     533                r = insert_dentry(child, "..", parent->ino_i->index);
     534        }
     535
     536exit_error:
    530537        return r;
    531538}
Note: See TracChangeset for help on using the changeset viewer.