Changeset 955a34b5 in rtems


Ignore:
Timestamp:
Jul 1, 2010, 3:18:06 PM (9 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.
Location:
cpukit
Files:
11 edited

Legend:

Unmodified
Added
Removed
  • cpukit/ChangeLog

    rc114654 r955a34b5  
     12010-07-01      Sebastian Huber <sebastian.huber@embedded-brains.de>
     2
     3        * libcsupport/include/rtems/libio_.h: Removed
     4        rtems_filesystem_mount_table_control.
     5        * libcsupport/include/rtems/libio.h, libcsupport/src/mount-mgr.c,
     6        libcsupport/src/mount.c libcsupport/src/statvfs.c,
     7        libcsupport/src/unmount.c, libmisc/shell/main_mount.c: Documentation.
     8        Removed rtems_filesystem_mounts_first() and
     9        rtems_filesystem_mounts_next().  Added
     10        rtems_filesystem_mount_iterate().  Changed return type of
     11        rtems_filesystem_iterate().  Removed rtems_filesystem_nodes_equal().
     12
     132010-07-01      Sebastian Huber <sebastian.huber@embedded-brains.de>
     14
     15        * libfs/src/nfsclient/src/nfs.c, libfs/src/nfsclient/src/nfs.c,
     16        libfs/src/nfsclient/src/librtemsNfs.h: Renamed
     17        rtems_nfsfs_initialize() in rtems_nfs_initialize().
     18        * sapi/include/confdefs.h: Reflect changes above.  Renamed
     19        *_miniIMFS in *_MINIIMFS.  Renamed *_NFSFS in *_NFS.
     20
    1212010-06-29      Sebastian Huber <sebastian.huber@embedded-brains.de>
    222
  • cpukit/libcsupport/include/rtems/libio.h

    rc114654 r955a34b5  
    315315
    316316/**
    317  * @brief File system table entry.
    318  */
    319 typedef struct rtems_filesystem_table_t {
    320   const char                    *type;
    321   rtems_filesystem_fsmount_me_t  mount_h;
    322 } rtems_filesystem_table_t;
    323 
    324 /**
    325  * @brief Static table of file systems.
    326  *
    327  * Externally defined by confdefs.h or the user.
    328  */
    329 extern const rtems_filesystem_table_t rtems_filesystem_table [];
    330 
    331 /**
    332  * @brief Per file system table entry routine type.
    333  *
    334  * @see rtems_filesystem_iterate().
    335  *
    336  * @retval true Continue the iteration.
    337  * @retval false Stop the iteration.
    338  */
    339 typedef bool (*rtems_per_filesystem_routine)(
    340   const rtems_filesystem_table_t *entry,
    341   void *arg
    342 );
    343 
    344 /**
    345  * @brief Iterates over the file system table.
    346  *
    347  * For each file system table entry the @a routine will be called with the
    348  * table entry and the @a routine_arg parameter.
    349  */
    350 void
    351 rtems_filesystem_iterate(
    352   rtems_per_filesystem_routine routine,
    353   void *routine_arg
    354 );
    355 
    356 /**
    357317 * @brief Gets the mount handler for the file system @a type.
    358318 *
     
    362322rtems_filesystem_fsmount_me_t
    363323rtems_filesystem_get_mount_handler(
    364   const char *type
    365 );
    366 
    367 /*
    368  * Get the first entry in the mount table.
    369  */
    370 rtems_filesystem_mount_table_entry_t*
    371 rtems_filesystem_mounts_first( void );
    372 
    373 /*
    374  * Get the next entry in the mount table.
    375  */
    376 rtems_filesystem_mount_table_entry_t*
    377 rtems_filesystem_mounts_next( rtems_filesystem_mount_table_entry_t *entry );
    378 
    379 /*
    380  * Register a file system.
    381  */
    382 int
    383 rtems_filesystem_register(
    384   const char                    *type,
    385   rtems_filesystem_fsmount_me_t  mount_h
    386 );
    387 
    388 /*
    389  * Unregister a file system.
    390  */
    391 int
    392 rtems_filesystem_unregister(
    393324  const char *type
    394325);
     
    421352
    422353/**
    423  * @brief Mount table entry.
    424  */
    425 struct rtems_filesystem_mount_table_entry_tt {
    426   rtems_chain_node                       Node;
    427   rtems_filesystem_location_info_t       mt_point_node;
    428   rtems_filesystem_location_info_t       mt_fs_root;
    429   int                                    options;
    430   void                                  *fs_info;
    431 
    432   rtems_filesystem_limits_and_options_t  pathconf_limits_and_options;
    433 
    434   /*
    435    * The target or mount point of the file system.
    436    */
    437   const char                            *target;
    438 
    439   /*
    440    * The type of filesystem or the name of the filesystem.
    441    */
    442   const char                            *type;
    443 
    444   /*
    445    *  When someone adds a mounted filesystem on a real device,
    446    *  this will need to be used.
    447    *
    448    *  The lower layers can manage how this is managed. Leave as a
    449    *  string.
    450    */
    451   char                                  *dev;
    452 };
    453 
    454 /**
    455  * @brief The pathconf setting for a file system.
    456  */
    457 #define rtems_filesystem_pathconf(_mte) ((_mte)->pathconf_limits_and_options)
    458 
    459 /**
    460  * @brief The type of file system. Its name.
    461  */
    462 #define rtems_filesystem_type(_mte) ((_mte)->type)
    463 
    464 /**
    465  * @brief The mount point of a file system.
    466  */
    467 #define rtems_filesystem_mount_point(_mte) ((_mte)->target)
    468 
    469 /**
    470  * @brief The device entry of a file system.
    471  */
    472 #define rtems_filesystem_mount_device(_mte) ((_mte)->dev)
    473 
    474 /**
    475  * @brief File systems options.
    476  */
    477 typedef enum {
    478   RTEMS_FILESYSTEM_READ_ONLY,
    479   RTEMS_FILESYSTEM_READ_WRITE,
    480   RTEMS_FILESYSTEM_BAD_OPTIONS
    481 } rtems_filesystem_options_t;
    482 
    483 /**
    484354 * @brief An open file data structure.
    485355 *
     
    670540 (~ ((~RTEMS_LIBIO_PERMS_RWX) & _perm ))
    671541
     542/*
     543 *  Prototypes for filesystem
     544 */
     545
     546void rtems_filesystem_initialize( void );
     547
     548typedef void (*rtems_libio_init_functions_t)(void);
     549extern  rtems_libio_init_functions_t rtems_libio_init_helper;
     550
     551void    open_dev_console(void);
     552
     553typedef void (*rtems_libio_supp_functions_t)(void);
     554extern  rtems_libio_supp_functions_t rtems_libio_supp_helper;
     555
     556typedef void (*rtems_fs_init_functions_t)(void);
     557extern  rtems_fs_init_functions_t    rtems_fs_init_helper;
     558
     559/**
     560 * @brief Creates a directory and all its parent directories according to
     561 * @a path.
     562 *
     563 * The @a mode value selects the access permissions of the directory.
     564 *
     565 * @retval 0 Successful operation.
     566 * @retval -1 An error occured.  The @c errno indicates the error.
     567 */
     568extern int rtems_mkdir(const char *path, mode_t mode);
     569
     570/** @} */
     571
     572/**
     573 * @defgroup FileSystemTypesAndMount File System Types and Mount
     574 *
     575 * @ingroup LibIO
     576 *
     577 * @brief File system types and mount.
     578 *
     579 * @{
     580 */
     581
    672582/**
    673583 * @name File System Types
     
    687597/** @} */
    688598
    689 /*
    690  *  Prototypes for filesystem
    691  */
    692 
    693 void rtems_filesystem_initialize( void );
    694 
     599/**
     600 * @brief Mount table entry.
     601 */
     602struct rtems_filesystem_mount_table_entry_tt {
     603  rtems_chain_node                       Node;
     604  rtems_filesystem_location_info_t       mt_point_node;
     605  rtems_filesystem_location_info_t       mt_fs_root;
     606  int                                    options;
     607  void                                  *fs_info;
     608
     609  rtems_filesystem_limits_and_options_t  pathconf_limits_and_options;
     610
     611  /*
     612   * The target or mount point of the file system.
     613   */
     614  const char                            *target;
     615
     616  /*
     617   * The type of filesystem or the name of the filesystem.
     618   */
     619  const char                            *type;
     620
     621  /*
     622   *  When someone adds a mounted filesystem on a real device,
     623   *  this will need to be used.
     624   *
     625   *  The lower layers can manage how this is managed. Leave as a
     626   *  string.
     627   */
     628  char                                  *dev;
     629};
     630
     631/**
     632 * @brief File system options.
     633 */
     634typedef enum {
     635  RTEMS_FILESYSTEM_READ_ONLY,
     636  RTEMS_FILESYSTEM_READ_WRITE,
     637  RTEMS_FILESYSTEM_BAD_OPTIONS
     638} rtems_filesystem_options_t;
     639
     640/**
     641 * @brief File system table entry.
     642 */
     643typedef struct rtems_filesystem_table_t {
     644  const char                    *type;
     645  rtems_filesystem_fsmount_me_t  mount_h;
     646} rtems_filesystem_table_t;
     647
     648/**
     649 * @brief Static table of file systems.
     650 *
     651 * Externally defined by confdefs.h or the user.
     652 */
     653extern const rtems_filesystem_table_t rtems_filesystem_table [];
     654
     655/**
     656 * @brief Registers a file system @a type.
     657 *
     658 * The @a mount_h handler will be used to mount a file system of this @a type.
     659 *
     660 * @retval 0 Successful operation.
     661 * @retval -1 An error occured.  The @c errno indicates the error.
     662 */
     663int rtems_filesystem_register(
     664  const char                    *type,
     665  rtems_filesystem_fsmount_me_t  mount_h
     666);
     667
     668/**
     669 * @brief Unregisters a file system @a type.
     670 *
     671 * @retval 0 Successful operation.
     672 * @retval -1 An error occured.  The @c errno indicates the error.
     673 */
     674int rtems_filesystem_unregister(
     675  const char *type
     676);
     677
     678/**
     679 * @brief Unmounts the file system at @a mount_path.
     680 *
     681 * @todo Due to file system implementation shortcomings it is possible to
     682 * unmount file systems in use.  This likely leads to heap corruption.  Unmount
     683 * only file systems which are not in use by the application.
     684 *
     685 * @retval 0 Successful operation.
     686 * @retval -1 An error occured.  The @c errno indicates the error.
     687 */
    695688int unmount(
    696689  const char *mount_path
    697690);
    698691
     692/**
     693 * @brief Mounts a file system at @a target.
     694 *
     695 * The @a source may be a path to the corresponding device file, or @c NULL.
     696 * The @a target path must lead to an existing directory, or @c NULL.  In case
     697 * @a target is @c NULL, the root file system will be mounted.  The @a data
     698 * parameter will be forwarded to the file system initialization handler.  The
     699 * file system type is selected by @a filesystemtype and may be one of
     700 * - RTEMS_FILESYSTEM_TYPE_DEVFS,
     701 * - RTEMS_FILESYSTEM_TYPE_DOSFS,
     702 * - RTEMS_FILESYSTEM_TYPE_FTPFS,
     703 * - RTEMS_FILESYSTEM_TYPE_IMFS,
     704 * - RTEMS_FILESYSTEM_TYPE_MINIIMFS,
     705 * - RTEMS_FILESYSTEM_TYPE_NFS,
     706 * - RTEMS_FILESYSTEM_TYPE_RFS, or
     707 * - RTEMS_FILESYSTEM_TYPE_TFTPFS.
     708 *
     709 * Only configured or registered file system types are available.  You can add
     710 * file system types to your application configuration with
     711 * - CONFIGURE_FILESYSTEM_DEVFS,
     712 * - CONFIGURE_FILESYSTEM_DOSFS,
     713 * - CONFIGURE_FILESYSTEM_FTPFS,
     714 * - CONFIGURE_FILESYSTEM_IMFS,
     715 * - CONFIGURE_FILESYSTEM_MINIIMFS,
     716 * - CONFIGURE_FILESYSTEM_NFS,
     717 * - CONFIGURE_FILESYSTEM_RFS, and
     718 * - CONFIGURE_FILESYSTEM_TFTPFS.
     719 *
     720 * @see rtems_filesystem_register() and mount_and_make_target_path().
     721 *
     722 * @retval 0 Successful operation.
     723 * @retval -1 An error occured.  The @c errno indicates the error.
     724 */
    699725int mount(
    700726  const char                 *source,
     
    724750);
    725751
    726 /*
    727  *  Boot Time Mount Table Structure
    728  */
    729 
     752/**
     753 * @brief Per file system type routine.
     754 *
     755 * @see rtems_filesystem_iterate().
     756 *
     757 * @retval true Stop the iteration.
     758 * @retval false Continue the iteration.
     759 */
     760typedef bool (*rtems_per_filesystem_routine)(
     761  const rtems_filesystem_table_t *fs_entry,
     762  void *arg
     763);
     764
     765/**
     766 * @brief Iterates over all file system types.
     767 *
     768 * For each file system type the @a routine will be called with the entry and
     769 * the @a routine_arg parameter.
     770 *
     771 * Do not register or unregister file system types in @a routine.
     772 *
     773 * The iteration is protected by the IO library mutex.
     774 *
     775 * @retval true Iteration stopped due to @a routine return status.
     776 * @retval false Iteration through all entries.
     777 */
     778bool rtems_filesystem_iterate(
     779  rtems_per_filesystem_routine routine,
     780  void *routine_arg
     781);
     782
     783/**
     784 * @brief Per file system mount routine.
     785 *
     786 * @see rtems_filesystem_mount_iterate().
     787 *
     788 * @retval true Stop the iteration.
     789 * @retval false Continue the iteration.
     790 */
     791typedef bool (*rtems_per_filesystem_mount_routine)(
     792  const rtems_filesystem_mount_table_entry_t *mt_entry,
     793  void *arg
     794);
     795
     796/**
     797 * @brief Iterates over all file system mounts.
     798 *
     799 * For each file system mount the @a routine will be called with the entry and
     800 * the @a routine_arg parameter.
     801 *
     802 * Do not mount or unmount file systems in @a routine.
     803 *
     804 * The iteration is protected by the IO library mutex.
     805 *
     806 * @retval true Iteration stopped due to @a routine return status.
     807 * @retval false Iteration through all entries.
     808 */
     809bool
     810rtems_filesystem_mount_iterate(
     811  rtems_per_filesystem_mount_routine routine,
     812  void *routine_arg
     813);
     814
     815/**
     816 * @brief Boot time mount table entry.
     817 */
    730818typedef struct {
    731819  const char                              *type;
     
    737825extern const rtems_filesystem_mount_table_t *rtems_filesystem_mount_table;
    738826extern const int                             rtems_filesystem_mount_table_size;
    739 
    740 typedef void (*rtems_libio_init_functions_t)(void);
    741 extern  rtems_libio_init_functions_t rtems_libio_init_helper;
    742 
    743 void    open_dev_console(void);
    744 
    745 typedef void (*rtems_libio_supp_functions_t)(void);
    746 extern  rtems_libio_supp_functions_t rtems_libio_supp_helper;
    747 
    748 typedef void (*rtems_fs_init_functions_t)(void);
    749 extern  rtems_fs_init_functions_t    rtems_fs_init_helper;
    750827
    751828/**
     
    832909/** @} */
    833910
     911/**
     912 * @brief The pathconf setting for a file system.
     913 */
     914#define rtems_filesystem_pathconf(_mte) ((_mte)->pathconf_limits_and_options)
     915
     916/**
     917 * @brief The type of file system. Its name.
     918 */
     919#define rtems_filesystem_type(_mte) ((_mte)->type)
     920
     921/**
     922 * @brief The mount point of a file system.
     923 */
     924#define rtems_filesystem_mount_point(_mte) ((_mte)->target)
     925
     926/**
     927 * @brief The device entry of a file system.
     928 */
     929#define rtems_filesystem_mount_device(_mte) ((_mte)->dev)
     930
    834931#ifdef __cplusplus
    835932}
  • cpukit/libcsupport/include/rtems/libio_.h

    rc114654 r955a34b5  
    3939extern rtems_id                          rtems_libio_semaphore;
    4040extern const rtems_filesystem_file_handlers_r rtems_filesystem_null_handlers;
    41 
    42 /*
    43  * Mount table list.
    44  */
    45 extern rtems_chain_control rtems_filesystem_mount_table_control;
    4641
    4742/*
  • cpukit/libcsupport/src/mount-mgr.c

    rc114654 r955a34b5  
    3838} filesystem_node;
    3939
    40 RTEMS_CHAIN_DEFINE_EMPTY(filesystem_chain);
     40static RTEMS_CHAIN_DEFINE_EMPTY(filesystem_chain);
    4141
    42 void
    43 rtems_filesystem_iterate(
     42bool rtems_filesystem_iterate(
    4443  rtems_per_filesystem_routine routine,
    4544  void *routine_arg
     
    4847  const rtems_filesystem_table_t *table_entry = &rtems_filesystem_table [0];
    4948  rtems_chain_node *node = NULL;
     49  bool stop = false;
    5050
    51   while ( table_entry->type ) {
    52     if ( !(*routine)( table_entry, routine_arg ) ) {
    53       break;
    54     }
    55 
     51  while ( table_entry->type && !stop ) {
     52    stop = (*routine)( table_entry, routine_arg );
    5653    ++table_entry;
    5754  }
    5855
    59   rtems_libio_lock();
    60   for (
    61     node = rtems_chain_first( &filesystem_chain );
    62     !rtems_chain_is_tail( &filesystem_chain, node );
    63     node = rtems_chain_next( node )
    64   ) {
    65     const filesystem_node *fsn = (filesystem_node *) node;
     56  if ( !stop ) {
     57    rtems_libio_lock();
     58    for (
     59      node = rtems_chain_first( &filesystem_chain );
     60      !rtems_chain_is_tail( &filesystem_chain, node ) && !stop;
     61      node = rtems_chain_next( node )
     62    ) {
     63      const filesystem_node *fsn = (filesystem_node *) node;
    6664
    67     if ( !(*routine)( &fsn->entry, routine_arg ) ) {
    68       break;
     65      stop = (*routine)( &fsn->entry, routine_arg );
    6966    }
     67    rtems_libio_unlock();
    7068  }
    71   rtems_libio_unlock();
     69
     70  return stop;
    7271}
    7372
     
    8281
    8382  if ( strcmp( entry->type, fa->type ) != 0 ) {
    84     return true;
     83    return false;
    8584  } else {
    8685    fa->mount_h = entry->mount_h;
  • cpukit/libcsupport/src/mount.c

    rc114654 r955a34b5  
    3737#include <rtems/libio_.h>
    3838
    39 /*
    40  * Mount table list.
    41  */
    42 RTEMS_CHAIN_DEFINE_EMPTY(rtems_filesystem_mount_table_control);
     39static RTEMS_CHAIN_DEFINE_EMPTY(mount_chain);
    4340
    4441/*
     
    6057};
    6158
    62 /*
    63  *  Is_node_fs_root
    64  *
    65  *  This routine will run through the entries that currently exist in the
    66  *  mount table chain. For each entry in the mount table chain it will
    67  *  compare the mount tables root node to the node describing the selected
    68  *  mount point. If any match is found true is returned else false is
    69  *  returned.
    70  *
    71  */
    72 
    73 static bool Is_node_fs_root(
    74   rtems_filesystem_location_info_t *loc
     59static bool is_node_fs_root(
     60  const rtems_filesystem_mount_table_entry_t *mt_entry,
     61  void *arg
    7562)
    7663{
    77   rtems_chain_node *node = NULL;
    78 
    79   /*
    80    * For each mount table entry
    81    */
    82   for ( node = rtems_chain_first( &rtems_filesystem_mount_table_control );
    83         !rtems_chain_is_tail( &rtems_filesystem_mount_table_control, node );
    84         node = rtems_chain_next( node ) ) {
    85     rtems_filesystem_mount_table_entry_t *mount_table_entry =
    86       (rtems_filesystem_mount_table_entry_t *) node;
    87 
    88     if ( mount_table_entry->mt_fs_root.node_access == loc->node_access )
    89       return true;
    90   }
    91 
    92   return false;
     64  return arg == mt_entry->mt_fs_root.node_access;
    9365}
    9466
     
    226198     */
    227199
    228     if ( Is_node_fs_root(  &loc ) ){
     200    if ( rtems_filesystem_mount_iterate( is_node_fs_root, loc.node_access ) ) {
    229201      errno = EBUSY;
    230202      goto cleanup_and_bail;
     
    261233     * Do we already have a base file system ?
    262234     */
    263     if ( !rtems_chain_is_empty( &rtems_filesystem_mount_table_control ) ) {
     235    if ( !rtems_chain_is_empty( &mount_chain ) ) {
    264236      errno = EINVAL;
    265237      goto cleanup_and_bail;
     
    286258   *  Add the mount table entry to the mount table chain
    287259   */
    288   rtems_chain_append( &rtems_filesystem_mount_table_control,
    289                       &mt_entry->Node );
     260  rtems_libio_lock();
     261  rtems_chain_append( &mount_chain, &mt_entry->Node );
     262  rtems_libio_unlock();
    290263
    291264  if ( !has_target )
     
    304277}
    305278
    306 /*
    307  * Get the first entry in the mount table.
    308  */
    309 rtems_filesystem_mount_table_entry_t *
    310 rtems_filesystem_mounts_first(
    311   void
     279bool rtems_filesystem_mount_iterate(
     280  rtems_per_filesystem_mount_routine routine,
     281  void *routine_arg
    312282)
    313283{
    314   rtems_filesystem_mount_table_entry_t *entry = NULL;
    315 
    316   if ( !rtems_chain_is_empty( &rtems_filesystem_mount_table_control ) )
    317     entry = (rtems_filesystem_mount_table_entry_t *)
    318       rtems_chain_first( &rtems_filesystem_mount_table_control );
    319 
    320   return entry;
     284  rtems_chain_node *node = NULL;
     285  bool stop = false;
     286
     287  rtems_libio_lock();
     288  for (
     289    node = rtems_chain_first( &mount_chain );
     290    !rtems_chain_is_tail( &mount_chain, node ) && !stop;
     291    node = rtems_chain_next( node )
     292  ) {
     293    const rtems_filesystem_mount_table_entry_t *mt_entry =
     294      (rtems_filesystem_mount_table_entry_t *) node;
     295
     296    stop = (*routine)( mt_entry, routine_arg );
     297  }
     298  rtems_libio_unlock();
     299
     300  return stop;
    321301}
    322 
    323 /*
    324  * Get the next entry in the mount table.
    325  */
    326 rtems_filesystem_mount_table_entry_t *
    327 rtems_filesystem_mounts_next(
    328   rtems_filesystem_mount_table_entry_t *entry
    329 )
    330 {
    331   if ( !entry )
    332     return NULL;
    333   return (rtems_filesystem_mount_table_entry_t *)
    334     rtems_chain_next( &entry->Node );
    335 }
  • cpukit/libcsupport/src/statvfs.c

    rc114654 r955a34b5  
    2121
    2222#include <sys/statvfs.h>
    23 
    24 /*
    25  *  Data structures and routines private to mount/unmount pair.
    26  */
    27 extern rtems_chain_control rtems_filesystem_mount_table_control;
    2823
    2924int
  • 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  /*
  • cpukit/libfs/src/nfsclient/src/librtemsNfs.h

    rc114654 r955a34b5  
    144144 */
    145145int
    146 rtems_nfsfs_initialize(rtems_filesystem_mount_table_entry_t *mt_entry,
    147                        const void                           *data);
     146rtems_nfs_initialize(rtems_filesystem_mount_table_entry_t *mt_entry,
     147                     const void                           *data);
    148148
    149149/* A utility routine to find the path leading to a
  • cpukit/libfs/src/nfsclient/src/nfs.c

    rc114654 r955a34b5  
    19091909
    19101910
    1911 int rtems_nfsfs_initialize(
    1912         rtems_filesystem_mount_table_entry_t *mt_entry,
     1911int rtems_nfs_initialize(
     1912  rtems_filesystem_mount_table_entry_t *mt_entry,
    19131913  const void                           *data
    19141914)
     
    24802480                nfs_freenode,           /* OPTIONAL; may be NULL; (release node_access) */
    24812481                nfs_mount,                      /* OPTIONAL; may be NULL */
    2482                 rtems_nfsfs_initialize,         /* OPTIONAL; may be NULL -- not used anymore */
     2482                rtems_nfs_initialize,           /* OPTIONAL; may be NULL -- not used anymore */
    24832483                nfs_unmount,            /* OPTIONAL; may be NULL */
    24842484                nfs_fsunmount_me,       /* OPTIONAL; may be NULL */
  • cpukit/libmisc/shell/main_mount.c

    rc114654 r955a34b5  
    3232  printf("%s ", entry->type);
    3333
    34   return true;
     34  return false;
    3535}
    3636
  • cpukit/sapi/include/confdefs.h

    rc114654 r955a34b5  
    189189 *
    190190 *   List of available file systems. You can define as many as you like:
    191  *     CONFIGURE_FILESYSTEM_miniIMFS - MiniIMFS, use DEVFS now
     191 *     CONFIGURE_FILESYSTEM_MINIIMFS - MiniIMFS, use DEVFS now
    192192 *     CONFIGURE_FILESYSTEM_IMFS     - In Memory File System (IMFS)
    193193 *     CONFIGURE_FILESYSTEM_DEVFS    - Device File System (DSVFS)
    194194 *     CONFIGURE_FILESYSTEM_TFTPFS   - TFTP File System, networking enabled
    195195 *     CONFIGURE_FILESYSTEM_FTPFS    - FTP File System, networking enabled
    196  *     CONFIGURE_FILESYSTEM_NFSFS    - Network File System, networking enabled
     196 *     CONFIGURE_FILESYSTEM_NFS      - Network File System, networking enabled
    197197 *     CONFIGURE_FILESYSTEM_DOSFS    - DOS File System, uses libblock
    198198 *     CONFIGURE_FILESYSTEM_RFS      - RTEMS File System (RFS), uses libblock
     
    216216   */
    217217  #ifdef CONFIGURE_FILESYSTEM_ALL
    218     #define CONFIGURE_FILESYSTEM_miniIMFS
     218    #define CONFIGURE_FILESYSTEM_MINIIMFS
    219219    #define CONFIGURE_FILESYSTEM_IMFS
    220220    #define CONFIGURE_FILESYSTEM_DEVFS
    221221    #define CONFIGURE_FILESYSTEM_TFTPFS
    222222    #define CONFIGURE_FILESYSTEM_FTPFS
    223     #define CONFIGURE_FILESYSTEM_NFSFS
     223    #define CONFIGURE_FILESYSTEM_NFS
    224224    #define CONFIGURE_FILESYSTEM_DOSFS
    225225    #define CONFIGURE_FILESYSTEM_RFS
     
    240240      #undef CONFIGURE_USE_MINIIMFS_AS_BASE_FILESYSTEM
    241241    #endif
    242     #undef CONFIGURE_FILESYSTEM_miniIMFS
     242    #undef CONFIGURE_FILESYSTEM_MINIIMFS
    243243    #undef CONFIGURE_FILESYSTEM_IMFS
    244244    #undef CONFIGURE_FILESYSTEM_DEVFS
    245245    #undef CONFIGURE_FILESYSTEM_TFTPFS
    246246    #undef CONFIGURE_FILESYSTEM_FTPFS
    247     #undef CONFIGURE_FILESYSTEM_NFSFS
     247    #undef CONFIGURE_FILESYSTEM_NFS
    248248    #undef CONFIGURE_FILESYSTEM_DOSFS
    249249    #undef CONFIGURE_FILESYSTEM_RFS
     
    258258      #define CONFIGURE_FILESYSTEM_DEVFS
    259259    #elif defined(CONFIGURE_USE_MINIIMFS_AS_BASE_FILESYSTEM)
    260       #define CONFIGURE_FILESYSTEM_miniIMFS
     260      #define CONFIGURE_FILESYSTEM_MINIIMFS
    261261    #elif !defined(CONFIGURE_FILESYSTEM_IMFS)
    262262      #define CONFIGURE_FILESYSTEM_IMFS
     
    286286 */
    287287#if !defined(CONFIGURE_FILESYSTEM_ENTRY_miniIMFS) && \
    288     defined(CONFIGURE_FILESYSTEM_miniIMFS)
     288    defined(CONFIGURE_FILESYSTEM_MINIIMFS)
    289289  #define CONFIGURE_FILESYSTEM_ENTRY_miniIMFS \
    290290    { RTEMS_FILESYSTEM_TYPE_MINIIMFS, miniIMFS_initialize }
     
    331331
    332332  /**
    333    * NFSFS
     333   * NFS
    334334   */
    335   #if !defined(CONFIGURE_FILESYSTEM_ENTRY_NFSFS) && \
    336       defined(CONFIGURE_FILESYSTEM_NFSFS)
     335  #if !defined(CONFIGURE_FILESYSTEM_ENTRY_NFS) && \
     336      defined(CONFIGURE_FILESYSTEM_NFS)
    337337    #include <librtemsNfs.h>
    338     #define CONFIGURE_FILESYSTEM_ENTRY_NFSFS \
    339       { RTEMS_FILESYSTEM_TYPE_NFS, rtems_nfsfs_initialize }
     338    #define CONFIGURE_FILESYSTEM_ENTRY_NFS \
     339      { RTEMS_FILESYSTEM_TYPE_NFS, rtems_nfs_initialize }
    340340  #endif
    341341#endif
     
    382382
    383383  #if defined(CONFIGURE_FILESYSTEM_IMFS) || \
    384       defined(CONFIGURE_FILESYSTEM_miniIMFS)
     384      defined(CONFIGURE_FILESYSTEM_MINIIMFS)
    385385    int imfs_rq_memfile_bytes_per_block = CONFIGURE_IMFS_MEMFILE_BYTES_PER_BLOCK;
    386386  #endif
     
    397397  #ifndef CONFIGURE_HAS_OWN_FILESYSTEM_TABLE
    398398    const rtems_filesystem_table_t rtems_filesystem_table[] = {
    399       #if defined(CONFIGURE_FILESYSTEM_miniIMFS) && \
     399      #if defined(CONFIGURE_FILESYSTEM_MINIIMFS) && \
    400400          defined(CONFIGURE_FILESYSTEM_ENTRY_miniIMFS)
    401401        CONFIGURE_FILESYSTEM_ENTRY_miniIMFS,
     
    417417        CONFIGURE_FILESYSTEM_ENTRY_FTPFS,
    418418      #endif
    419       #if defined(CONFIGURE_FILESYSTEM_NFSFS) && \
    420           defined(CONFIGURE_FILESYSTEM_ENTRY_NFSFS)
    421         CONFIGURE_FILESYSTEM_ENTRY_NFSFS,
     419      #if defined(CONFIGURE_FILESYSTEM_NFS) && \
     420          defined(CONFIGURE_FILESYSTEM_ENTRY_NFS)
     421        CONFIGURE_FILESYSTEM_ENTRY_NFS,
    422422      #endif
    423423      #if defined(CONFIGURE_FILESYSTEM_DOSFS) && \
Note: See TracChangeset for help on using the changeset viewer.