Changeset 4b0d1ab in rtems for cpukit/libcsupport/src/mount.c


Ignore:
Timestamp:
Nov 17, 2000, 6:42:02 PM (20 years ago)
Author:
Jennifer Averett <Jennifer.Averett@…>
Branches:
4.10, 4.11, 4.8, 4.9, 5, master
Children:
13e47e2e
Parents:
ee6d205
Message:

2000-11-17 Jennifer Averret <jennifer@…>

  • libc/mount.c (search_mt_for_mount_point): Deleted routine.
  • libc/mount.c (Is_node_fs_root): Replacement for above that accounts for the imaginary root node being returned by the filesystem evaluation routine.
  • libc/unmount.c (unmount): Account for imaginary root node being returned and improved variable names to clarify code.
  • libc/unmount.c (file_systems_below_this_mountpoint): Body of routine replaced to account for imaginary root node being returned.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • cpukit/libcsupport/src/mount.c

    ree6d205 r4b0d1ab  
    3636 */
    3737
    38 int search_mt_for_mount_point(
    39   rtems_filesystem_location_info_t *location_of_mount_point
     38int init_fs_mount_table( void );
     39static int Is_node_fs_root(
     40  rtems_filesystem_location_info_t  *loc
    4041);
    41 
    42 int init_fs_mount_table( void );
    4342
    4443
     
    141140     */
    142141
    143     if ( search_mt_for_mount_point( &loc ) == FOUND ) {
     142    if ( Is_node_fs_root(  &loc ) ){
    144143      errno = EBUSY;
    145144      goto cleanup_and_bail;
     
    233232}
    234233
    235 
    236 /*
    237  *  search_mt_for_mount_point
     234/*
     235 *  Is_node_fs_root
    238236 *
    239237 *  This routine will run through the entries that currently exist in the
    240238 *  mount table chain. For each entry in the mount table chain it will
    241  *  compare the mount tables mt_point_node to the node describing the selected
    242  *  mount point.. If any of the mount table file system mount point nodes
    243  *  match the new file system selected mount point node, we are attempting
    244  *  to mount the new file system onto a node that already has a file system
    245  *  mounted to it. This is not a permitted operation.
    246  */
    247 
    248 int search_mt_for_mount_point(
    249   rtems_filesystem_location_info_t *location_of_mount_point
     239 *  compare the mount tables root node to the node describing the selected
     240 *  mount point. If any match is found true is returned else false is
     241 *  returned.
     242 *
     243 */
     244
     245static int Is_node_fs_root(
     246  rtems_filesystem_location_info_t  *loc
    250247)
    251248{
     
    253250  rtems_filesystem_mount_table_entry_t *the_mount_entry;
    254251
     252  /*
     253   * For each mount table entry
     254   */
     255
    255256  for ( the_node = rtems_filesystem_mount_table_control.first;
    256257        !Chain_Is_tail( &rtems_filesystem_mount_table_control, the_node );
    257258        the_node = the_node->next ) {
    258 
    259259     the_mount_entry = (rtems_filesystem_mount_table_entry_t *) the_node;
    260      if ( the_mount_entry->mt_point_node.node_access  ==
    261              location_of_mount_point->node_access )
    262         return FOUND;
    263   }
    264   return NOT_FOUND;
     260     if ( the_mount_entry->mt_fs_root.node_access  == loc->node_access )
     261        return TRUE;
     262  }
     263  return FALSE;
    265264}
    266 
Note: See TracChangeset for help on using the changeset viewer.