Changeset d496e097 in rtems


Ignore:
Timestamp:
Sep 16, 2016, 11:56:08 AM (3 years ago)
Author:
Sebastian Huber <sebastian.huber@…>
Branches:
master
Children:
29770e12
Parents:
a3e9ae5d
git-author:
Sebastian Huber <sebastian.huber@…> (09/16/16 11:56:08)
git-committer:
Sebastian Huber <sebastian.huber@…> (09/19/16 05:22:01)
Message:

imfs: Untangle dependencies

This helps to use IMFS_make_generic_node() without pulling in the
complete IMFS implementation.

Location:
cpukit/libfs
Files:
1 added
2 edited

Legend:

Unmodified
Added
Removed
  • cpukit/libfs/Makefile.am

    ra3e9ae5d rd496e097  
    6060    src/imfs/imfs_unmount.c src/imfs/imfs_utime.c src/imfs/ioman.c \
    6161    src/imfs/imfs_memfile.c src/imfs/imfs.h
     62libimfs_a_SOURCES += src/imfs/imfs_node.c
    6263
    6364# POSIX FIFO/pipe
  • cpukit/libfs/src/imfs/imfs_initsupp.c

    ra3e9ae5d rd496e097  
    5252}
    5353
    54 IMFS_jnode_t *IMFS_initialize_node(
    55   IMFS_jnode_t *node,
    56   const IMFS_node_control *node_control,
    57   const char *name,
    58   size_t namelen,
    59   mode_t mode,
    60   void *arg
    61 )
    62 {
    63   struct timeval tv;
    64 
    65   if ( namelen > IMFS_NAME_MAX ) {
    66     errno = ENAMETOOLONG;
    67 
    68     return NULL;
    69   }
    70 
    71   gettimeofday( &tv, 0 );
    72 
    73   /*
    74    *  Fill in the basic information
    75    */
    76   node->name = name;
    77   node->namelen = namelen;
    78   node->reference_count = 1;
    79   node->st_nlink = 1;
    80   node->control = node_control;
    81 
    82   /*
    83    *  Fill in the mode and permission information for the jnode structure.
    84    */
    85   node->st_mode = mode;
    86   node->st_uid = geteuid();
    87   node->st_gid = getegid();
    88 
    89   /*
    90    *  Now set all the times.
    91    */
    92 
    93   node->stat_atime  = (time_t) tv.tv_sec;
    94   node->stat_mtime  = (time_t) tv.tv_sec;
    95   node->stat_ctime  = (time_t) tv.tv_sec;
    96 
    97   return (*node_control->node_initialize)( node, arg );
    98 }
    99 
    10054int IMFS_initialize_support(
    10155  rtems_filesystem_mount_table_entry_t *mt_entry,
     
    13488}
    13589
    136 int IMFS_node_clone( rtems_filesystem_location_info_t *loc )
    137 {
    138   IMFS_jnode_t *node = loc->node_access;
    139 
    140   ++node->reference_count;
    141 
    142   return 0;
    143 }
    144 
    145 void IMFS_node_destroy( IMFS_jnode_t *node )
    146 {
    147   IMFS_assert( node->reference_count == 0 );
    148 
    149   (*node->control->node_destroy)( node );
    150 }
    151 
    152 void IMFS_node_free( const rtems_filesystem_location_info_t *loc )
    153 {
    154   IMFS_jnode_t *node = loc->node_access;
    155 
    156   --node->reference_count;
    157 
    158   if ( node->reference_count == 0 ) {
    159     IMFS_node_destroy( node );
    160   }
    161 }
    162 
    16390static IMFS_jnode_t *IMFS_node_initialize_enosys(
    16491  IMFS_jnode_t *node,
     
    179106}
    180107
    181 IMFS_jnode_t *IMFS_node_remove_default(
    182   IMFS_jnode_t *node
    183 )
    184 {
    185   return node;
    186 }
    187 
    188 void IMFS_node_destroy_default( IMFS_jnode_t *node )
    189 {
    190   if ( ( node->flags & IMFS_NODE_FLAG_NAME_ALLOCATED ) != 0 ) {
    191     free( RTEMS_DECONST( char *, node->name ) );
    192   }
    193 
    194   free( node );
    195 }
    196 
    197108const IMFS_mknod_control IMFS_mknod_control_enosys = {
    198109  {
Note: See TracChangeset for help on using the changeset viewer.