Fork us on GitHub Follow us on Facebook Follow us on Twitter

Changeset 13ecdac9 in mainline


Ignore:
Timestamp:
2011-05-30T20:00:24Z (11 years ago)
Author:
Maurizio Lombardi <m.lombardi85@…>
Branches:
lfn, master, serial
Children:
1affcdf3
Parents:
ff2e72e
Message:

Add support to directories (mkdir now works)

Location:
uspace/srv/fs/minixfs
Files:
2 edited

Legend:

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

    rff2e72e r13ecdac9  
    154154        /*Search for an empty dentry*/
    155155
    156         for (i = 2; ; ++i) {
     156        for (i = 0; ; ++i) {
    157157                r = read_directory_entry(mnode, &d_info, i);
    158158                if (r != EOK)
  • 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.