Changeset 3d3a18e6 in rtems


Ignore:
Timestamp:
Jul 1, 2010, 2:39:39 PM (9 years ago)
Author:
Sebastian Huber <sebastian.huber@…>
Branches:
4.10
Children:
e8cec9e
Parents:
615d8cc
Message:

2010-06-10 Sebastian Huber <sebastian.huber@…>

  • libcsupport/src/unmount.c: Removed obsolete declarations. Fixed invalid memory free.

2010-06-10 Sebastian Huber <sebastian.huber@…>

  • libnetworking/rtems/ftpfs.h, libnetworking/lib/ftpfs.c: Removed rtems_ftpfs_mount().

2010-06-10 Sebastian Huber <sebastian.huber@…>

  • libcsupport/src/mount-mktgt.c: New file.
  • libcsupport/Makefile.am: Reflect change above.
  • libcsupport/include/rtems/libio.h: Declare mount_and_make_target_path().

2010-06-09 Sebastian Huber <sebastian.huber@…>

  • libnetworking/rtems/ftpfs.h, libnetworking/lib/ftpfs.c: Added rtems_ftpfs_mount() again. Documentation.

2010-06-09 Sebastian Huber <sebastian.huber@…>

  • libcsupport/include/rtems/libio.h, sapi/include/confdefs.h: Added and use defines for file system types.

2010-06-09 Sebastian Huber <sebastian.huber@…>

  • libcsupport/src/mount.c: Fixed NULL pointer access.
Location:
cpukit
Files:
1 added
8 edited

Legend:

Unmodified
Added
Removed
  • cpukit/ChangeLog

    r615d8cc r3d3a18e6  
    197197        libfs/src/rfs/rtems-rfs-group.h, libfs/src/rfs/rtems-rfs-inode.h:
    198198        Fix broken doxygen commands.
     199
     2002010-06-10      Sebastian Huber <sebastian.huber@embedded-brains.de>
     201
     202        * libcsupport/src/unmount.c: Removed obsolete declarations.  Fixed
     203        invalid memory free.
     204
     2052010-06-10      Sebastian Huber <sebastian.huber@embedded-brains.de>
     206
     207        * libnetworking/rtems/ftpfs.h, libnetworking/lib/ftpfs.c:  Removed
     208        rtems_ftpfs_mount().
     209
     2102010-06-10      Sebastian Huber <sebastian.huber@embedded-brains.de>
     211
     212        * libcsupport/src/mount-mktgt.c: New file.
     213        * libcsupport/Makefile.am: Reflect change above.
     214        * libcsupport/include/rtems/libio.h: Declare
     215        mount_and_make_target_path().
     216
     2172010-06-09      Sebastian Huber <sebastian.huber@embedded-brains.de>
     218
     219        * libnetworking/rtems/ftpfs.h, libnetworking/lib/ftpfs.c:  Added
     220        rtems_ftpfs_mount() again.  Documentation.
     221
     2222010-06-09      Sebastian Huber <sebastian.huber@embedded-brains.de>
     223
     224        * libcsupport/include/rtems/libio.h, sapi/include/confdefs.h: Added
     225        and use defines for file system types.
     226
     2272010-06-09      Sebastian Huber <sebastian.huber@embedded-brains.de>
     228
     229        * libcsupport/src/mount.c: Fixed NULL pointer access.
    199230
    2002312010-06-09      Ralf Corsépius <ralf.corsepius@rtems.org>
  • cpukit/libcsupport/Makefile.am

    r615d8cc r3d3a18e6  
    4545
    4646BASE_FS_C_FILES = src/base_fs.c src/mount.c src/unmount.c src/libio.c \
    47     src/mount-mgr.c src/libio_init.c \
     47    src/mount-mgr.c src/mount-mktgt.c src/libio_init.c \
    4848    src/libio_sockets.c src/eval.c src/fs_null_handlers.c src/privateenv.c \
    4949    src/open_dev_console.c src/__usrenv.c src/rtems_mkdir.c
  • cpukit/libcsupport/include/rtems/libio.h

    r615d8cc r3d3a18e6  
    5757
    5858/**
    59  * @name File system node types.
     59 * @name File System Node Types
    6060 *
    6161 * @{
     
    670670 (~ ((~RTEMS_LIBIO_PERMS_RWX) & _perm ))
    671671
     672/**
     673 * @name File System Types
     674 *
     675 * @{
     676 */
     677
     678#define RTEMS_FILESYSTEM_TYPE_IMFS "imfs"
     679#define RTEMS_FILESYSTEM_TYPE_MINIIMFS "mimfs"
     680#define RTEMS_FILESYSTEM_TYPE_DEVFS "devfs"
     681#define RTEMS_FILESYSTEM_TYPE_FTPFS "ftpfs"
     682#define RTEMS_FILESYSTEM_TYPE_TFTPFS "tftpfs"
     683#define RTEMS_FILESYSTEM_TYPE_NFS "nfs"
     684#define RTEMS_FILESYSTEM_TYPE_DOSFS "dosfs"
     685#define RTEMS_FILESYSTEM_TYPE_RFS "rfs"
     686
     687/** @} */
     688
    672689/*
    673690 *  Prototypes for filesystem
     
    688705);
    689706
     707/**
     708 * @brief Mounts a file system and makes the @a target path.
     709 *
     710 * The @a target path will be created with rtems_mkdir() and must not be
     711 * @c NULL.
     712 *
     713 * @see mount().
     714 *
     715 * @retval 0 Successful operation.
     716 * @retval -1 An error occured.  The @c errno indicates the error.
     717 */
     718int mount_and_make_target_path(
     719  const char                 *source,
     720  const char                 *target,
     721  const char                 *filesystemtype,
     722  rtems_filesystem_options_t options,
     723  const void                 *data
     724);
     725
    690726/*
    691727 *  Boot Time Mount Table Structure
     
    720756 *
    721757 * @retval 0 Successful operation.
    722  * @retval -1 An error occured.  @c errno indicates the error.
     758 * @retval -1 An error occured.  The @c errno indicates the error.
    723759 */
    724760extern int rtems_mkdir(const char *path, mode_t mode);
  • cpukit/libcsupport/src/mount.c

    r615d8cc r3d3a18e6  
    9494
    9595static rtems_filesystem_mount_table_entry_t *alloc_mount_table_entry(
    96   const char *source,
    97   const char *target,
     96  const char *source_or_null,
     97  const char *target_or_null,
    9898  const char *filesystemtype,
    9999  size_t *target_length_ptr
    100100)
    101101{
    102   const char *target_str = target ? target : "/";
     102  const char *target = target_or_null != NULL ? target_or_null : "/";
    103103  size_t filesystemtype_size = strlen( filesystemtype ) + 1;
    104   size_t source_size = source ? strlen( source ) + 1 : 0;
    105   size_t target_length = strlen( target_str );
     104  size_t source_size = source_or_null != NULL ?
     105    strlen( source_or_null ) + 1 : 0;
     106  size_t target_length = strlen( target );
    106107  size_t size = sizeof( rtems_filesystem_mount_table_entry_t )
    107108    + filesystemtype_size + source_size + target_length + 1;
    108109  rtems_filesystem_mount_table_entry_t *mt_entry = calloc( 1, size );
    109110
    110   if ( mt_entry ) {
     111  if ( mt_entry != NULL ) {
    111112    char *str = (char *) mt_entry + sizeof( *mt_entry );
    112113
     
    114115    strcpy( str, filesystemtype );
    115116
    116     if ( source ) {
     117    if ( source_or_null != NULL ) {
    117118      str += filesystemtype_size;
    118119      mt_entry->dev = str;
    119       strcpy( str, source );
     120      strcpy( str, source_or_null );
    120121    }
    121122
  • cpukit/libcsupport/src/unmount.c

    r615d8cc r3d3a18e6  
    3333#include <rtems/libio_.h>
    3434#include <rtems/seterr.h>
    35 
    36 /*
    37  *  Data structures and routines private to mount/unmount pair.
    38  */
    39 
    40 extern rtems_chain_control rtems_filesystem_mount_table_control;
    41 
    42 int search_mt_for_mount_point(
    43   rtems_filesystem_location_info_t *location_of_mount_point
    44 );
    4535
    4636bool rtems_filesystem_nodes_equal(
     
    214204
    215205  rtems_filesystem_freenode( fs_mount_loc );
    216   free( (void*) mt_entry->target );
    217206  free( mt_entry );
    218207
  • cpukit/libnetworking/lib/ftpfs.c

    r615d8cc r3d3a18e6  
    100100} rtems_ftpfs_mount_entry;
    101101
     102static const rtems_filesystem_operations_table rtems_ftpfs_ops;
     103
    102104static const rtems_filesystem_file_handlers_r rtems_ftpfs_handlers;
    103105
     
    130132  return 0;
    131133}
    132 
    133 #if 0
    134 CCJ_REMOVE_MOUNT
    135 rtems_status_code rtems_ftpfs_mount(const char *mount_point)
    136 {
    137   int rv = 0;
    138 
    139   if (mount_point == NULL) {
    140     mount_point = RTEMS_FTPFS_MOUNT_POINT_DEFAULT;
    141   }
    142 
    143   rv = mkdir(mount_point, S_IRWXU | S_IRWXG | S_IRWXO);
    144   if (rv != 0) {
    145     return RTEMS_IO_ERROR;
    146   }
    147 
    148   rv = mount(
    149     NULL,
    150     &rtems_ftpfs_ops,
    151     RTEMS_FILESYSTEM_READ_WRITE,
    152     NULL,
    153     mount_point
    154   );
    155   if (rv != 0) {
    156     return RTEMS_IO_ERROR;
    157   }
    158 
    159   return RTEMS_SUCCESSFUL;
    160 }
    161 #endif
    162134
    163135static rtems_status_code rtems_ftpfs_do_ioctl(
     
    13191291}
    13201292
    1321 const rtems_filesystem_operations_table rtems_ftpfs_ops = {
     1293static const rtems_filesystem_operations_table rtems_ftpfs_ops = {
    13221294  .evalpath_h = rtems_ftpfs_eval_path,
    13231295  .evalformake_h = NULL,
  • cpukit/libnetworking/rtems/ftpfs.h

    r615d8cc r3d3a18e6  
    22 * @file
    33 *
    4  * File Transfer Protocol file system (FTP client).
     4 * @brief File Transfer Protocol file system (FTP client).
    55 */
    66
     
    4747 * @defgroup rtems_ftpfs File Transfer Protocol File System
    4848 *
    49  * The FTP file system (FTP client) can be used to transfer files from or to
    50  * remote hosts.
     49 * @brief The FTP file system (FTP client) can be used to transfer files from
     50 * or to remote hosts.
    5151 *
    52  * You can mount the FTP file system with a call to rtems_ftpfs_mount().
    53  * Alternatively you can use mount() with the @ref rtems_ftpfs_ops operations
    54  * table.
     52 * You can mount the FTP file system with a call to mount() or
     53 * mount_and_make_target_path() with the @ref RTEMS_FILESYSTEM_TYPE_FTPFS file
     54 * system type.
     55 *
     56 * You have to add @ref CONFIGURE_FILESYSTEM_FTPFS to your application
     57 * configuration.
    5558 *
    5659 * You can open files either read-only or write-only.  A seek is not allowed.
     
    7578
    7679/**
    77  * Well-known port number for FTP control connection.
     80 * @brief Well-known port number for FTP control connection.
    7881 */
    7982#define RTEMS_FTPFS_CTRL_PORT 21
    8083
    8184/**
    82  * Default mount point for FTP file system.
     85 * @brief Default mount point for FTP file system.
    8386 */
    8487#define RTEMS_FTPFS_MOUNT_POINT_DEFAULT "/FTP"
    8588
    8689/**
    87  * FTP file system IO control requests.
     90 * @brief FTP file system IO control requests.
    8891 */
    8992typedef enum {
     
    9598
    9699/**
    97  * FTP file system operations table.
    98  */
    99 extern const rtems_filesystem_operations_table rtems_ftpfs_ops;
    100 
    101 /**
    102  * Returns in @a verbose if the verbose mode is enabled or disabled for the
    103  * file system at @a mount_point.
     100 * @brief Returns in @a verbose if the verbose mode is enabled or disabled for
     101 * the file system at @a mount_point.
    104102 *
    105103 * If @a mount_point is @c NULL the default mount point
     
    109107
    110108/**
    111  * Enables or disables the verbose mode if @a verbose is @c true or
     109 * @brief Enables or disables the verbose mode if @a verbose is @c true or
    112110 * @c false respectively for the file system at @a mount_point.
    113111 *
     
    121119
    122120/**
    123  * Returns the current timeout value in @a timeout for the file system at
    124  * @a mount_point.
     121 * @brief Returns the current timeout value in @a timeout for the file system
     122 * at @a mount_point.
    125123 *
    126124 * If @a mount_point is @c NULL the default mount point
     
    133131
    134132/**
    135  * Sets the timeout value to @a timeout for the file system at @a mount_point.
     133 * @brief Sets the timeout value to @a timeout for the file system at
     134 * @a mount_point.
    136135 *
    137136 * The timeout value will be used during connection establishment of active
     
    150149
    151150/**
    152  * Creates the default mount point @ref RTEMS_FTPFS_MOUNT_POINT_DEFAULT and
    153  * mounts the FTP file system. Do not call directly, use mount.xs
    154  *
    155  * It is mounted with read and write access.
     151 * @brief Do not call directly, use mount().
    156152 */
    157 int rtems_ftpfs_initialize(rtems_filesystem_mount_table_entry_t *e,
    158                            const void                           *d);
     153int rtems_ftpfs_initialize(
     154  rtems_filesystem_mount_table_entry_t *mt_entry,
     155  const void *data
     156);
    159157
    160158#ifdef __cplusplus
  • cpukit/sapi/include/confdefs.h

    r615d8cc r3d3a18e6  
    285285#if !defined(CONFIGURE_FILESYSTEM_ENTRY_miniIMFS) && \
    286286    defined(CONFIGURE_FILESYSTEM_miniIMFS)
    287 #define CONFIGURE_FILESYSTEM_ENTRY_miniIMFS { "mimfs", miniIMFS_initialize }
     287  #define CONFIGURE_FILESYSTEM_ENTRY_miniIMFS \
     288    { RTEMS_FILESYSTEM_TYPE_MINIIMFS, miniIMFS_initialize }
    288289#endif
    289290
     
    302303    defined(CONFIGURE_FILESYSTEM_DEVFS)
    303304#include <rtems/devfs.h>
    304 #define CONFIGURE_FILESYSTEM_ENTRY_DEVFS { "devfs", devFS_initialize }
     305  #define CONFIGURE_FILESYSTEM_ENTRY_DEVFS \
     306    { RTEMS_FILESYSTEM_TYPE_DEVFS, devFS_initialize }
    305307#endif
    306308
     
    312314      defined(CONFIGURE_FILESYSTEM_FTPFS)
    313315    #include <rtems/ftpfs.h>
    314     #define CONFIGURE_FILESYSTEM_ENTRY_FTPFS { "ftpfs", rtems_ftpfs_initialize }
     316    #define CONFIGURE_FILESYSTEM_ENTRY_FTPFS \
     317      { RTEMS_FILESYSTEM_TYPE_FTPFS, rtems_ftpfs_initialize }
    315318  #endif
    316319
     
    321324      defined(CONFIGURE_FILESYSTEM_TFTPFS)
    322325    #include <rtems/tftp.h>
    323     #define CONFIGURE_FILESYSTEM_ENTRY_TFTPFS { "tftpfs", rtems_tftpfs_initialize }
     326    #define CONFIGURE_FILESYSTEM_ENTRY_TFTPFS \
     327      { RTEMS_FILESYSTEM_TYPE_TFTPFS, rtems_tftpfs_initialize }
    324328  #endif
    325329
     
    330334      defined(CONFIGURE_FILESYSTEM_NFSFS)
    331335    #include <librtemsNfs.h>
    332     #define CONFIGURE_FILESYSTEM_ENTRY_NFSFS { "nfs", rtems_nfsfs_initialize }
     336    #define CONFIGURE_FILESYSTEM_ENTRY_NFSFS \
     337      { RTEMS_FILESYSTEM_TYPE_NFS, rtems_nfsfs_initialize }
    333338  #endif
    334339#endif
     
    340345    defined(CONFIGURE_FILESYSTEM_DOSFS)
    341346  #include <rtems/dosfs.h>
    342   #define CONFIGURE_FILESYSTEM_ENTRY_DOSFS { "dosfs", rtems_dosfs_initialize }
     347  #define CONFIGURE_FILESYSTEM_ENTRY_DOSFS \
     348    { RTEMS_FILESYSTEM_TYPE_DOSFS, rtems_dosfs_initialize }
    343349#endif
    344350
     
    349355    defined(CONFIGURE_FILESYSTEM_RFS)
    350356  #include <rtems/rtems-rfs.h>
    351   #define CONFIGURE_FILESYSTEM_ENTRY_RFS { "rfs", rtems_rfs_rtems_initialise }
     357  #define CONFIGURE_FILESYSTEM_ENTRY_RFS \
     358    { RTEMS_FILESYSTEM_TYPE_RFS, rtems_rfs_rtems_initialise }
    352359#endif
    353360
     
    441448    const rtems_filesystem_mount_table_t configuration_mount_table = {
    442449      #if defined(CONFIGURE_USE_DEVFS_AS_BASE_FILESYSTEM)
    443         "devfs",
     450        RTEMS_FILESYSTEM_TYPE_DEVFS,
    444451      #elif defined(CONFIGURE_USE_MINIIMFS_AS_BASE_FILESYSTEM)
    445         "mimfs",
     452        RTEMS_FILESYSTEM_TYPE_MINIIMFS,
    446453      #else  /* using IMFS as base filesystem */
    447         "imfs",
     454        RTEMS_FILESYSTEM_TYPE_IMFS,
    448455      #endif
    449456      RTEMS_FILESYSTEM_READ_WRITE,
Note: See TracChangeset for help on using the changeset viewer.