Ignore:
Timestamp:
Jul 12, 2017, 8:12:41 PM (7 years ago)
Author:
alain
Message:

Redefine the PIC device API.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/kernel/vfs/ramfs.c

    r23 r188  
    3232
    3333
    34 
    35 
    36 
    37 ///////////////////////////////////////////////////////////////////////////////////////
    38 //             The following functions are called by the VFS.
    39 ///////////////////////////////////////////////////////////////////////////////////////
    40 
    4134//////////////////////////////////////////////
    4235error_t ramfs_mount( xptr_t   parent_inode_xp,
    4336                     char   * ramfs_root_name )
    4437{
    45     xptr_t        root_inode_xp;   // unused                     
     38    xptr_t    root_inode_xp;   // unused                     
    4639 
     40    cxy_t     cxy = vfs_cluster_random_select();
     41
    4742    // create VFS dentry and VFS inode for RAMFS root directory
    48     return  vfs_add_child_in_parent( INODE_TYPE_DIR,
     43    return  vfs_add_child_in_parent( cxy,
     44                                     INODE_TYPE_DIR,
    4945                                     FS_TYPE_RAMFS,
    5046                                     parent_inode_xp,
    5147                                     ramfs_root_name,
     48                                     NULL,
    5249                                     &root_inode_xp );
    5350}
    5451
    55 
    56 ////////////////////////////////////////////
    57 error_t ramfs_ctx_init( vfs_ctx_t * vfs_ctx,
    58                         xptr_t      root_inode_xp )
    59 
    60 {
    61     vfs_ctx->type    = FS_TYPE_RAMFS;
    62     vfs_ctx->attr    = 0;                // not READ_ONLY / not SYNC
    63     vfs_ctx->count   = 0;                // unused for RAMFS
    64     vfs_ctx->blksize = 512;              // unused for RAMFS
    65     vfs_ctx->root_xp = root_inode_xp;
    66     vfs_ctx->extend  = NULL;             // unused for DEVFS
    67 
    68     spinlock_init( &vfs_ctx->lock );
    69 
    70     bitmap_init( vfs_ctx->bitmap , CONFIG_VFS_MAX_INODES );
    71 
    72     return 0;
    73 }
    74 
Note: See TracChangeset for help on using the changeset viewer.