Ignore:
Timestamp:
Jul 1, 2010, 3:18:06 PM (10 years ago)
Author:
Sebastian Huber <sebastian.huber@…>
Branches:
4.10
Children:
df719841
Parents:
c114654
Message:

2010-07-01 Sebastian Huber <sebastian.huber@…>

  • libcsupport/include/rtems/libio_.h: Removed rtems_filesystem_mount_table_control.
  • libcsupport/include/rtems/libio.h, libcsupport/src/mount-mgr.c, libcsupport/src/mount.c libcsupport/src/statvfs.c, libcsupport/src/unmount.c, libmisc/shell/main_mount.c: Documentation. Removed rtems_filesystem_mounts_first() and rtems_filesystem_mounts_next(). Added rtems_filesystem_mount_iterate(). Changed return type of rtems_filesystem_iterate(). Removed rtems_filesystem_nodes_equal().

2010-07-01 Sebastian Huber <sebastian.huber@…>

  • libfs/src/nfsclient/src/nfs.c, libfs/src/nfsclient/src/nfs.c, libfs/src/nfsclient/src/librtemsNfs.h: Renamed rtems_nfsfs_initialize() in rtems_nfs_initialize().
  • sapi/include/confdefs.h: Reflect changes above. Renamed *_miniIMFS in *_MINIIMFS. Renamed *_NFSFS in *_NFS.
File:
1 edited

Legend:

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

    rc114654 r955a34b5  
    2323#include <sys/types.h>
    2424#include <sys/stat.h>
    25 #include <rtems/chain.h>
    2625#include <fcntl.h>
    2726#include <unistd.h>
     
    3332#include <rtems/libio_.h>
    3433#include <rtems/seterr.h>
     34#include <rtems/chain.h>
    3535
    36 bool rtems_filesystem_nodes_equal(
    37   const rtems_filesystem_location_info_t   *loc1,
    38   const rtems_filesystem_location_info_t   *loc2
    39 ){
    40   return ( loc1->node_access == loc2->node_access );
    41 }
    42 
    43 
    44 /*
    45  *  file_systems_below_this_mountpoint
    46  *
    47  *  This routine will run through the entries that currently exist in the
    48  *  mount table chain. For each entry in the mount table chain it will
    49  *  compare the mount tables mt_fs_root to the new_fs_root_node. If any of the
    50  *  mount table file system root nodes matches the new file system root node
    51  *  this indicates that we are trying to mount a file system that has already
    52  *  been mounted. This is not a permitted operation. temp_loc is set to
    53  *  the root node of the file system being unmounted.
    54  */
    55 
    56 bool file_systems_below_this_mountpoint(
    57   const char                            *path __attribute__((unused)),
    58   rtems_filesystem_location_info_t      *fs_root_loc,
    59   rtems_filesystem_mount_table_entry_t  *fs_to_unmount __attribute__((unused))
     36static bool is_fs_below_mount_point(
     37  const rtems_filesystem_mount_table_entry_t *mt_entry,
     38  void *arg
    6039)
    6140{
    62   rtems_chain_node                     *the_node;
    63   rtems_filesystem_mount_table_entry_t *the_mount_entry;
    64 
    65   /*
    66    * Search the mount table for any mount entries referencing this
    67    * mount entry.
    68    */
    69 
    70   for ( the_node = rtems_filesystem_mount_table_control.first;
    71         !rtems_chain_is_tail( &rtems_filesystem_mount_table_control, the_node );
    72         the_node = the_node->next ) {
    73      the_mount_entry = ( rtems_filesystem_mount_table_entry_t * )the_node;
    74      if (the_mount_entry->mt_point_node.mt_entry  == fs_root_loc->mt_entry ) {
    75         return true;
    76      }
    77   }
    78 
    79   return false;
     41  return arg == mt_entry->mt_point_node.mt_entry;
    8042}
    8143
     
    11577   */
    11678
    117   if ( !rtems_filesystem_nodes_equal( fs_root_loc, &loc) ){
     79  if ( fs_root_loc->node_access != loc.node_access ){
    11880    rtems_filesystem_freenode( &loc );
    11981    rtems_set_errno_and_return_minus_one( EACCES );
     
    152114   */
    153115
    154   if ( file_systems_below_this_mountpoint( path, fs_root_loc, mt_entry ) != 0 )
     116  if ( rtems_filesystem_mount_iterate( is_fs_below_mount_point,
     117                                       fs_root_loc->mt_entry ) )
    155118    rtems_set_errno_and_return_minus_one( EBUSY );
    156119
     
    196159   */
    197160
    198   rtems_chain_extract( ( rtems_chain_node * ) mt_entry );
     161  rtems_libio_lock();
     162  rtems_chain_extract( &mt_entry->Node );
     163  rtems_libio_unlock();
    199164
    200165  /*
Note: See TracChangeset for help on using the changeset viewer.