Changeset a7d1992c in rtems


Ignore:
Timestamp:
May 15, 2012, 8:06:18 AM (7 years ago)
Author:
Sebastian Huber <sebastian.huber@…>
Children:
1c0263c
Parents:
d5d071d (diff), da154e14 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge branch 'upstream'

Files:
6 added
73 edited
1 moved

Legend:

Unmodified
Added
Removed
  • c/src/lib/libbsp/shared/umon/tfsDriver.c

    rd5d071d ra7d1992c  
    9393  }
    9494
     95  mt_entry->ops = &rtems_tfs_ops;
    9596  mt_entry->mt_fs_root->location.handlers = &rtems_tfs_handlers;
    96   mt_entry->mt_fs_root->location.ops = &rtems_tfs_ops;
    9797  mt_entry->mt_fs_root->location.node_access = root_path;
    9898
  • cpukit/include/rtems/fs.h

    rd5d071d ra7d1992c  
    5454   void                                    *node_access_2;
    5555   const rtems_filesystem_file_handlers_r  *handlers;
    56    const rtems_filesystem_operations_table *ops;
    5756   rtems_filesystem_mount_table_entry_t    *mt_entry;
    5857} rtems_filesystem_location_info_t;
  • cpukit/libblock/src/bdbuf.c

    rd5d071d ra7d1992c  
    28542854    else
    28552855    {
    2856       while (*prev != NULL && cur == (*prev)->avl.right)
     2856      while (*prev != NULL
     2857             && (cur == (*prev)->avl.right || (*prev)->avl.right == NULL))
    28572858      {
    28582859        /* Up */
  • cpukit/libblock/src/blkdev-imfs.c

    rd5d071d ra7d1992c  
    7676
    7777  if (remaining >= 0) {
     78    iop->offset += count;
    7879    rv = (ssize_t) count;
    7980  } else {
     
    135136
    136137  if (remaining >= 0) {
     138    iop->offset += count;
    137139    rv = (ssize_t) count;
    138140  } else {
  • cpukit/libcsupport/Makefile.am

    rd5d071d ra7d1992c  
    2525## rtems
    2626include_rtems_HEADERS += include/rtems/assoc.h
     27include_rtems_HEADERS += include/rtems/deviceio.h
    2728include_rtems_HEADERS += include/rtems/error.h
    2829include_rtems_HEADERS += include/rtems/libcsupport.h
     
    128129    src/sup_fs_mount_iterate.c \
    129130    src/sup_fs_node_type.c \
     131    src/sup_fs_deviceio.c \
     132    src/sup_fs_deviceerrno.c \
    130133    src/clonenode.c \
    131134    src/freenode.c \
  • cpukit/libcsupport/include/rtems/libio.h

    rd5d071d ra7d1992c  
    7070 */
    7171typedef void (*rtems_filesystem_mt_entry_lock_t)(
    72   rtems_filesystem_mount_table_entry_t *mt_entry
     72  const rtems_filesystem_mount_table_entry_t *mt_entry
    7373);
    7474
     
    8181 */
    8282typedef void (*rtems_filesystem_mt_entry_unlock_t)(
    83   rtems_filesystem_mount_table_entry_t *mt_entry
     83  const rtems_filesystem_mount_table_entry_t *mt_entry
    8484);
    8585
     
    524524 */
    525525void rtems_filesystem_default_lock(
    526   rtems_filesystem_mount_table_entry_t *mt_entry
     526  const rtems_filesystem_mount_table_entry_t *mt_entry
    527527);
    528528
     
    533533 */
    534534void rtems_filesystem_default_unlock(
    535   rtems_filesystem_mount_table_entry_t *mt_entry
     535  const rtems_filesystem_mount_table_entry_t *mt_entry
    536536);
    537537
     
    787787 * @brief Reads from a node.
    788788 *
     789 * This handler is responsible to update the offset field of the IO descriptor.
     790 *
    789791 * @param[in, out] iop The IO pointer.
    790792 * @param[out] buffer The buffer for read data.
     
    805807 * @brief Writes to a node.
    806808 *
     809 * This handler is responsible to update the offset field of the IO descriptor.
     810 *
    807811 * @param[in, out] iop The IO pointer.
    808812 * @param[out] buffer The buffer for write data.
     
    833837 */
    834838typedef int (*rtems_filesystem_ioctl_t)(
    835   rtems_libio_t *iop,
    836   uint32_t       request,
    837   void          *buffer
     839  rtems_libio_t   *iop,
     840  ioctl_command_t  request,
     841  void            *buffer
    838842);
    839843
     
    10091013 */
    10101014int rtems_filesystem_default_ioctl(
    1011   rtems_libio_t *iop,
    1012   uint32_t       command,
    1013   void          *buffer
     1015  rtems_libio_t   *iop,
     1016  ioctl_command_t  request,
     1017  void            *buffer
    10141018);
    10151019
     
    10631067  off_t offset,
    10641068  int whence
    1065 );
    1066 
    1067 /**
    1068  * @retval 0 Always.
    1069  *
    1070  * @see rtems_filesystem_lseek_t.
    1071  */
    1072 off_t rtems_filesystem_default_lseek_file(
    1073   rtems_libio_t *iop,
    1074   off_t          offset,
    1075   int            whence
    10761069);
    10771070
     
    12371230typedef struct {
    12381231  rtems_libio_t          *iop;
    1239   uint32_t                command;
     1232  ioctl_command_t         command;
    12401233  void                   *buffer;
    12411234  int                     ioctl_return;
     
    14391432struct rtems_filesystem_mount_table_entry_tt {
    14401433  rtems_chain_node                       mt_node;
     1434  void                                  *fs_info;
     1435  const rtems_filesystem_operations_table *ops;
     1436  const void                            *immutable_fs_info;
    14411437  rtems_chain_control                    location_chain;
    14421438  rtems_filesystem_global_location_t    *mt_point_node;
     
    14441440  bool                                   mounted;
    14451441  bool                                   writeable;
    1446   void                                  *fs_info;
    1447   const void                            *immutable_fs_info;
    14481442  rtems_filesystem_limits_and_options_t  pathconf_limits_and_options;
    14491443
  • cpukit/libcsupport/include/rtems/libio_.h

    rd5d071d ra7d1992c  
    251251)
    252252{
    253   (*loc->ops->lock_h)( loc->mt_entry );
     253  const rtems_filesystem_mount_table_entry_t *mt_entry = loc->mt_entry;
     254
     255  (*mt_entry->ops->lock_h)( mt_entry );
    254256}
    255257
     
    258260)
    259261{
    260   (*loc->ops->unlock_h)( loc->mt_entry );
     262  const rtems_filesystem_mount_table_entry_t *mt_entry = loc->mt_entry;
     263
     264  (*mt_entry->ops->unlock_h)( mt_entry );
    261265}
    262266
     
    583587)
    584588{
    585   return (*loc->ops->are_nodes_equal_h)(
     589  const rtems_filesystem_mount_table_entry_t *mt_entry = loc->mt_entry;
     590
     591  return (*mt_entry->ops->are_nodes_equal_h)(
    586592    loc,
    587     &loc->mt_entry->mt_fs_root->location
     593    &mt_entry->mt_fs_root->location
    588594  );
    589595}
  • cpukit/libcsupport/include/sys/ioccom.h

    rd5d071d ra7d1992c  
    107107#define FIOGETOWN       _IOR('f', 123, int)     /* get owner */
    108108
     109typedef uint32_t ioctl_command_t;
     110
    109111#ifndef _KERNEL
    110112
    111113#include <sys/cdefs.h>
    112 
    113 #ifndef __ioctl_command_defined
    114 typedef u_int32_t ioctl_command_t;
    115 #define __ioctl_command_defined
    116 #endif
    117114
    118115__BEGIN_DECLS
  • cpukit/libcsupport/preinstall.am

    rd5d071d ra7d1992c  
    7272PREINSTALL_FILES += $(PROJECT_INCLUDE)/rtems/assoc.h
    7373
     74$(PROJECT_INCLUDE)/rtems/deviceio.h: include/rtems/deviceio.h $(PROJECT_INCLUDE)/rtems/$(dirstamp)
     75        $(INSTALL_DATA) $< $(PROJECT_INCLUDE)/rtems/deviceio.h
     76PREINSTALL_FILES += $(PROJECT_INCLUDE)/rtems/deviceio.h
     77
    7478$(PROJECT_INCLUDE)/rtems/error.h: include/rtems/error.h $(PROJECT_INCLUDE)/rtems/$(dirstamp)
    7579        $(INSTALL_DATA) $< $(PROJECT_INCLUDE)/rtems/error.h
  • cpukit/libcsupport/src/__usrenv.c

    rd5d071d ra7d1992c  
    5252
    5353static void null_op_lock_or_unlock(
    54   rtems_filesystem_mount_table_entry_t *mt_entry
     54  const rtems_filesystem_mount_table_entry_t *mt_entry
    5555)
    5656{
     
    221221    }
    222222  },
     223  .ops = &null_ops,
    223224  .mt_point_node = &rtems_filesystem_global_location_null,
    224225  .mt_fs_root = &rtems_filesystem_global_location_null,
     
    234235    },
    235236    .handlers = &rtems_filesystem_null_handlers,
    236     .ops = &null_ops,
    237237    .mt_entry = &rtems_filesystem_null_mt_entry
    238238  },
  • cpukit/libcsupport/src/_rename_r.c

    rd5d071d ra7d1992c  
    5858  );
    5959  if ( rv == 0 ) {
    60     rv = (*new_currentloc->ops->rename_h)(
     60    rv = (*new_currentloc->mt_entry->ops->rename_h)(
    6161      &old_parentloc,
    6262      old_currentloc,
  • cpukit/libcsupport/src/chmod.c

    rd5d071d ra7d1992c  
    2626    rtems_filesystem_eval_path_start( &ctx, path, eval_flags );
    2727
    28   rv = (*currentloc->ops->fchmod_h)( currentloc, mode );
     28  rv = (*currentloc->mt_entry->ops->fchmod_h)( currentloc, mode );
    2929
    3030  rtems_filesystem_eval_path_cleanup( &ctx );
  • cpukit/libcsupport/src/chown.c

    rd5d071d ra7d1992c  
    3333  const rtems_filesystem_location_info_t *currentloc =
    3434    rtems_filesystem_eval_path_start( &ctx, path, eval_flags );
     35  const rtems_filesystem_operations_table *ops = currentloc->mt_entry->ops;
    3536
    36   rv = (*currentloc->ops->chown_h)(
    37     currentloc,
    38     owner,
    39     group
    40   );
     37  rv = (*ops->chown_h)( currentloc, owner, group );
    4138
    4239  rtems_filesystem_eval_path_cleanup( &ctx );
  • cpukit/libcsupport/src/chroot.c

    rd5d071d ra7d1992c  
    5050      rtems_filesystem_global_location_obtain( &new_current_loc );
    5151    rtems_filesystem_node_types_t type =
    52       (*new_root_loc->location.ops->node_type_h)( &new_root_loc->location );
     52      (*new_root_loc->location.mt_entry->ops->node_type_h)(
     53        &new_root_loc->location
     54      );
    5355
    5456    if ( type == RTEMS_FILESYSTEM_DIRECTORY ) {
  • cpukit/libcsupport/src/clonenode.c

    rd5d071d ra7d1992c  
    2727
    2828  clone = rtems_filesystem_location_copy( clone, master );
    29   rv = (*clone->ops->clonenod_h)( clone );
     29  rv = (*clone->mt_entry->ops->clonenod_h)( clone );
    3030  if ( rv != 0 ) {
    3131    rtems_filesystem_location_remove_from_mt_entry( clone );
  • cpukit/libcsupport/src/fchmod.c

    rd5d071d ra7d1992c  
    2929  if (iop->pathinfo.mt_entry->writeable) {
    3030    rtems_filesystem_instance_lock( &iop->pathinfo );
    31     rv = (*iop->pathinfo.ops->fchmod_h)( &iop->pathinfo, mode );
     31    rv = (*iop->pathinfo.mt_entry->ops->fchmod_h)( &iop->pathinfo, mode );
    3232    rtems_filesystem_instance_unlock( &iop->pathinfo );
    3333  } else {
  • cpukit/libcsupport/src/fchown.c

    rd5d071d ra7d1992c  
    2929  if (iop->pathinfo.mt_entry->writeable) {
    3030    rtems_filesystem_instance_lock( &iop->pathinfo );
    31     rv = (*iop->pathinfo.ops->chown_h)( &iop->pathinfo, owner, group );
     31    rv = (*iop->pathinfo.mt_entry->ops->chown_h)(
     32      &iop->pathinfo,
     33      owner,
     34      group
     35    );
    3236    rtems_filesystem_instance_unlock( &iop->pathinfo );
    3337  } else {
  • cpukit/libcsupport/src/freenode.c

    rd5d071d ra7d1992c  
    2222{
    2323  rtems_filesystem_instance_lock( loc );
    24   (*loc->ops->freenod_h)( loc );
     24  (*loc->mt_entry->ops->freenod_h)( loc );
    2525  rtems_filesystem_instance_unlock( loc );
    2626  rtems_filesystem_location_remove_from_mt_entry( loc );
  • cpukit/libcsupport/src/link.c

    rd5d071d ra7d1992c  
    3737  );
    3838  if ( rv == 0 ) {
    39     rv = (*currentloc_2->ops->link_h)(
     39    rv = (*currentloc_2->mt_entry->ops->link_h)(
    4040      currentloc_2,
    4141      currentloc_1,
  • cpukit/libcsupport/src/mknod.c

    rd5d071d ra7d1992c  
    4848 
    4949  if ( rv == 0 ) {
    50     rv = (*parentloc->ops->mknod_h)( parentloc, name, namelen, mode, dev );
     50    const rtems_filesystem_operations_table *ops = parentloc->mt_entry->ops;
     51
     52    rv = (*ops->mknod_h)( parentloc, name, namelen, mode, dev );
    5153  }
    5254
  • cpukit/libcsupport/src/mount.c

    rd5d071d ra7d1992c  
    123123    mt_point_node = rtems_filesystem_location_transform_to_global( &targetloc );
    124124    mt_entry->mt_point_node = mt_point_node;
    125     rv = (*mt_point_node->location.ops->mount_h)( mt_entry );
     125    rv = (*mt_point_node->location.mt_entry->ops->mount_h)( mt_entry );
    126126    if ( rv == 0 ) {
    127127      rtems_filesystem_mt_lock();
     
    219219
    220220          if ( rv != 0 ) {
    221             (*mt_entry->mt_fs_root->location.ops->fsunmount_me_h)( mt_entry );
     221            (*mt_entry->ops->fsunmount_me_h)( mt_entry );
    222222          }
    223223        }
  • cpukit/libcsupport/src/open.c

    rd5d071d ra7d1992c  
    8686      rtems_filesystem_eval_path_get_currentloc( &ctx );
    8787    rtems_filesystem_node_types_t type =
    88       (*currentloc->ops->node_type_h)( currentloc );
     88      (*currentloc->mt_entry->ops->node_type_h)( currentloc );
    8989
    9090    if ( type == RTEMS_FILESYSTEM_DIRECTORY ) {
  • cpukit/libcsupport/src/read.c

    rd5d071d ra7d1992c  
    2323)
    2424{
    25   ssize_t      rc;
    2625  rtems_libio_t *iop;
    2726
     
    3635   *  Now process the read().
    3736   */
    38   rc = (*iop->pathinfo.handlers->read_h)( iop, buffer, count );
    39 
    40   if ( rc > 0 )
    41     iop->offset += rc;
    42 
    43   return rc;
     37  return (*iop->pathinfo.handlers->read_h)( iop, buffer, count );
    4438}
    4539
  • cpukit/libcsupport/src/readlink.c

    rd5d071d ra7d1992c  
    2525  const rtems_filesystem_location_info_t *currentloc =
    2626    rtems_filesystem_eval_path_start( &ctx, path, eval_flags );
    27   rtems_filesystem_node_types_t type =
    28     (*currentloc->ops->node_type_h)( currentloc );
     27  const rtems_filesystem_operations_table *ops = currentloc->mt_entry->ops;
     28  rtems_filesystem_node_types_t type = (*ops->node_type_h)( currentloc );
    2929
    3030  if ( type == RTEMS_FILESYSTEM_SYM_LINK ) {
    31     rv = (*currentloc->ops->readlink_h)( currentloc, buf, bufsize );
     31    rv = (*ops->readlink_h)( currentloc, buf, bufsize );
    3232  } else {
    3333    rtems_filesystem_eval_path_error( &ctx, EINVAL );
  • cpukit/libcsupport/src/readv.c

    rd5d071d ra7d1992c  
    107107
    108108    if ( bytes > 0 ) {
    109       iop->offset += bytes;
    110109      total       += bytes;
    111110    }
  • cpukit/libcsupport/src/rmdir.c

    rd5d071d ra7d1992c  
    3535      parent_eval_flags
    3636    );
    37   rtems_filesystem_node_types_t type =
    38     (*currentloc->ops->node_type_h)( currentloc );
     37  const rtems_filesystem_operations_table *ops = currentloc->mt_entry->ops;
     38  rtems_filesystem_node_types_t type = (*ops->node_type_h)( currentloc );
    3939
    4040  if ( type == RTEMS_FILESYSTEM_DIRECTORY ) {
    41     rv = (*currentloc->ops->rmnod_h)(
    42       &parentloc,
    43       currentloc
    44     );
     41    rv = (*ops->rmnod_h)( &parentloc, currentloc );
    4542  } else {
    4643    rtems_filesystem_eval_path_error( &ctx, ENOTDIR );
  • cpukit/libcsupport/src/statvfs.c

    rd5d071d ra7d1992c  
    3030  memset( buf, 0, sizeof( *buf ) );
    3131
    32   rv = (*currentloc->ops->statvfs_h)( currentloc, buf );
     32  rv = (*currentloc->mt_entry->ops->statvfs_h)( currentloc, buf );
    3333
    3434  rtems_filesystem_eval_path_cleanup( &ctx );
  • cpukit/libcsupport/src/sup_fs_deviceerrno.c

    rd5d071d ra7d1992c  
    1414
    1515#if HAVE_CONFIG_H
    16 #include "config.h"
     16  #include "config.h"
    1717#endif
    1818
     19#include <rtems/deviceio.h>
     20
    1921#include <errno.h>
    20 
    21 #include <rtems.h>
    22 #include <rtems/libio.h>
    23 #include <rtems/devfs.h>
    2422
    2523static const int status_code_to_errno [RTEMS_STATUS_CODES_LAST + 1] = {
  • cpukit/libcsupport/src/sup_fs_eval_path.c

    rd5d071d ra7d1992c  
    105105
    106106  while (ctx->pathlen > 0) {
    107     (*ctx->currentloc.ops->eval_path_h)(ctx);
     107    (*ctx->currentloc.mt_entry->ops->eval_path_h)(ctx);
    108108  }
    109109
     
    261261      ++ctx->recursionlevel;
    262262      while (ctx->pathlen > 0) {
    263         (*ctx->currentloc.ops->eval_path_h)(ctx);
     263        (*ctx->currentloc.mt_entry->ops->eval_path_h)(ctx);
    264264      }
    265265      --ctx->recursionlevel;
     
    298298  rtems_filesystem_mt_entry_declare_lock_context(lock_context);
    299299
    300   (*loc->ops->freenod_h)(loc);
     300  (*loc->mt_entry->ops->freenod_h)(loc);
    301301
    302302  rtems_filesystem_mt_entry_lock(lock_context);
  • cpukit/libcsupport/src/sup_fs_eval_path_generic.c

    rd5d071d ra7d1992c  
    2121static bool is_fs_root( const rtems_filesystem_location_info_t *loc )
    2222{
     23  const rtems_filesystem_mount_table_entry_t *mt_entry = loc->mt_entry;
    2324  const rtems_filesystem_location_info_t *mt_fs_root =
    24     &loc->mt_entry->mt_fs_root->location;
     25    &mt_entry->mt_fs_root->location;
    2526
    26   return (*loc->ops->are_nodes_equal_h)( loc, mt_fs_root );
     27  return (*mt_entry->ops->are_nodes_equal_h)( loc, mt_fs_root );
    2728}
    2829
     
    3233)
    3334{
     35  const rtems_filesystem_mount_table_entry_t *mt_entry = loc->mt_entry;
    3436  const rtems_filesystem_location_info_t *rootloc = &ctx->rootloc->location;
    3537
    36   return loc->mt_entry == rootloc->mt_entry
    37     && (*loc->ops->are_nodes_equal_h)( loc, rootloc );
     38  return mt_entry == rootloc->mt_entry
     39    && (*mt_entry->ops->are_nodes_equal_h)( loc, rootloc );
    3840}
    3941
  • cpukit/libcsupport/src/sup_fs_location.c

    rd5d071d ra7d1992c  
    3434  dst->node_access_2 = src->node_access_2;
    3535  dst->handlers = src->handlers;
    36   dst->ops = src->ops;
    3736  dst->mt_entry = src->mt_entry;
    3837  rtems_filesystem_location_add_to_mt_entry(dst);
     
    214213  rtems_filesystem_mt_unlock();
    215214  rtems_filesystem_global_location_release(mt_entry->mt_point_node);
    216   (*mt_entry->mt_fs_root->location.ops->fsunmount_me_h)(mt_entry);
     215  (*mt_entry->ops->fsunmount_me_h)(mt_entry);
    217216  free(mt_entry);
    218217}
  • cpukit/libcsupport/src/sup_fs_node_type.c

    rd5d071d ra7d1992c  
    2626
    2727  rtems_filesystem_instance_lock(loc);
    28   type = (*loc->ops->node_type_h)(loc);
     28  type = (*loc->mt_entry->ops->node_type_h)(loc);
    2929  rtems_filesystem_instance_unlock(loc);
    3030
  • cpukit/libcsupport/src/symlink.c

    rd5d071d ra7d1992c  
    2828    rtems_filesystem_eval_path_start( &ctx, path2, eval_flags );
    2929
    30   rv = (*currentloc->ops->symlink_h)(
     30  rv = (*currentloc->mt_entry->ops->symlink_h)(
    3131    currentloc,
    3232    rtems_filesystem_eval_path_get_token( &ctx ),
  • cpukit/libcsupport/src/unlink.c

    rd5d071d ra7d1992c  
    3535      parent_eval_flags
    3636    );
     37  const rtems_filesystem_operations_table *ops = currentloc->mt_entry->ops;
    3738
    38   rv = (*currentloc->ops->rmnod_h)(
    39     &parentloc,
    40     currentloc
    41   );
     39  rv = (*ops->rmnod_h)( &parentloc, currentloc );
    4240
    4341  rtems_filesystem_eval_path_cleanup_with_parent( &ctx, &parentloc );
  • cpukit/libcsupport/src/unmount.c

    rd5d071d ra7d1992c  
    3333
    3434  if ( rtems_filesystem_location_is_root( currentloc ) ) {
    35     rv = (*mt_entry->mt_point_node->location.ops->unmount_h)( mt_entry );
     35    const rtems_filesystem_operations_table *mt_point_ops =
     36      mt_entry->mt_point_node->location.mt_entry->ops;
     37
     38    rv = (*mt_point_ops->unmount_h)( mt_entry );
    3639    if ( rv == 0 ) {
    3740      rtems_filesystem_mt_entry_declare_lock_context( lock_context );
  • cpukit/libcsupport/src/utime.c

    rd5d071d ra7d1992c  
    3939  }
    4040
    41   rv = (*currentloc->ops->utime_h)(
     41  rv = (*currentloc->mt_entry->ops->utime_h)(
    4242    currentloc,
    4343    times->actime,
  • cpukit/libcsupport/src/write.c

    rd5d071d ra7d1992c  
    3030)
    3131{
    32   ssize_t  rc;
    3332  rtems_libio_t     *iop;
    3433
     
    4342   *  Now process the write() request.
    4443   */
    45   rc = (*iop->pathinfo.handlers->write_h)( iop, buffer, count );
    46 
    47   if ( rc > 0 )
    48     iop->offset += rc;
    49 
    50   return rc;
     44  return (*iop->pathinfo.handlers->write_h)( iop, buffer, count );
    5145}
  • cpukit/libcsupport/src/writev.c

    rd5d071d ra7d1992c  
    114114
    115115    if ( bytes > 0 ) {
    116       iop->offset += bytes;
    117116      total       += bytes;
    118117    }
  • cpukit/libfs/Makefile.am

    rd5d071d ra7d1992c  
    3838libimfs_a_SOURCES =
    3939
    40 libimfs_a_SOURCES += src/imfs/deviceerrno.c src/imfs/deviceio.c \
     40libimfs_a_SOURCES += src/imfs/deviceio.c \
    4141    src/imfs/fifoimfs_init.c src/imfs/imfs_chown.c src/imfs/imfs_config.c \
    4242    src/imfs/imfs_creat.c src/imfs/imfs_debug.c src/imfs/imfs_directory.c \
  • cpukit/libfs/src/defaults/default_ioctl.c

    rd5d071d ra7d1992c  
    88 */
    99
    10 #include <rtems/libio.h>
     10#if HAVE_CONFIG_H
     11  #include "config.h"
     12#endif
     13
    1114#include <rtems/libio_.h>
    12 #include <rtems/seterr.h>
    1315
    1416int rtems_filesystem_default_ioctl(
    15   rtems_libio_t *iop,
    16   uint32_t       command,
    17   void          *buffer
     17  rtems_libio_t   *iop,
     18  ioctl_command_t  request,
     19  void            *buffer
    1820)
    1921{
  • cpukit/libfs/src/defaults/default_lock_and_unlock.c

    rd5d071d ra7d1992c  
    2020
    2121void rtems_filesystem_default_lock(
    22   rtems_filesystem_mount_table_entry_t *mt_entry
     22  const rtems_filesystem_mount_table_entry_t *mt_entry
    2323)
    2424{
     
    2727
    2828void rtems_filesystem_default_unlock(
    29   rtems_filesystem_mount_table_entry_t *mt_entry
     29  const rtems_filesystem_mount_table_entry_t *mt_entry
    3030)
    3131{
  • cpukit/libfs/src/devfs/devclose.c

    rd5d071d ra7d1992c  
    66
    77#if HAVE_CONFIG_H
    8 #include "config.h"
     8  #include "config.h"
    99#endif
    1010
    11 #include <rtems.h>
    12 #include <rtems/io.h>
     11#include "devfs.h"
    1312
    14 #include "devfs.h"
     13#include <rtems/deviceio.h>
    1514
    1615int devFS_close(
     
    1817)
    1918{
    20   rtems_libio_open_close_args_t  args;
    21   rtems_status_code              status;
    2219  const devFS_node *np = iop->pathinfo.node_access;
    2320
    24   args.iop   = iop;
    25   args.flags = 0;
    26   args.mode  = 0;
    27 
    28   status = rtems_io_close(
    29     np->major,
    30     np->minor,
    31     (void *) &args
    32   );
    33 
    34   return rtems_deviceio_errno(status);
     21  return rtems_deviceio_close( iop, np->major, np->minor );
    3522}
    36 
    37 
  • cpukit/libfs/src/devfs/devfs.h

    rd5d071d ra7d1992c  
    5050extern const rtems_filesystem_file_handlers_r  devFS_file_handlers;
    5151
    52 /**
    53  *  This routine associates RTEMS status code with errno
    54  */
    55 
    56 extern int rtems_deviceio_errno(rtems_status_code code);
    57 
    5852static inline const devFS_data *devFS_get_data(
    5953  const rtems_filesystem_location_info_t *loc
    6054)
    6155{
    62   return loc->mt_entry->immutable_fs_info;
     56  return (const devFS_data *) loc->mt_entry->immutable_fs_info;
    6357}
    6458
     
    138132
    139133extern int devFS_ioctl(
    140   rtems_libio_t *iop,
    141   uint32_t       command,
    142   void          *buffer
     134  rtems_libio_t   *iop,
     135  ioctl_command_t  command,
     136  void            *buffer
    143137);
    144138
  • cpukit/libfs/src/devfs/devfs_init.c

    rd5d071d ra7d1992c  
    5757
    5858  if (data != NULL) {
     59    mt_entry->ops = &devFS_ops;
    5960    mt_entry->immutable_fs_info = data;
    6061    mt_entry->mt_fs_root->location.handlers = &devFS_file_handlers;
    61     mt_entry->mt_fs_root->location.ops = &devFS_ops;
    6262  } else {
    6363    errno = EINVAL;
  • cpukit/libfs/src/devfs/devfs_show.c

    rd5d071d ra7d1992c  
    1515  rtems_filesystem_location_info_t *rootloc = &rtems_filesystem_root->location;
    1616
    17   if (rootloc->ops == &devFS_ops) {
     17  if (rootloc->mt_entry->ops == &devFS_ops) {
    1818    const devFS_data *data = devFS_get_data(rootloc);
    1919    size_t i = 0;
  • cpukit/libfs/src/devfs/devioctl.c

    rd5d071d ra7d1992c  
    1 #if HAVE_CONFIG_H
    21/*
    32 *  The license and distribution terms for this file may be
     
    65 */
    76
    8 #include "config.h"
     7#if HAVE_CONFIG_H
     8  #include "config.h"
    99#endif
    10 
    11 #include <rtems.h>
    12 #include <rtems/io.h>
    1310
    1411#include "devfs.h"
    1512
     13#include <rtems/deviceio.h>
     14
    1615int devFS_ioctl(
    17   rtems_libio_t *iop,
    18   uint32_t       command,
    19   void          *buffer
     16  rtems_libio_t   *iop,
     17  ioctl_command_t  command,
     18  void            *buffer
    2019)
    2120{
    22   rtems_libio_ioctl_args_t  args;
    23   rtems_status_code         status;
    2421  const devFS_node *np = iop->pathinfo.node_access;
    2522
    26   args.iop     = iop;
    27   args.command = command;
    28   args.buffer  = buffer;
    29 
    30   status = rtems_io_control(
    31     np->major,
    32     np->minor,
    33     (void *) &args
    34   );
    35 
    36   if ( status )
    37     return rtems_deviceio_errno(status);
    38 
    39   return args.ioctl_return;
     23  return rtems_deviceio_control( iop, command, buffer, np->major, np->minor );
    4024}
    41 
  • cpukit/libfs/src/devfs/devopen.c

    rd5d071d ra7d1992c  
    66
    77#if HAVE_CONFIG_H
    8 #include "config.h"
     8  #include "config.h"
    99#endif
    1010
    11 #include <rtems.h>
    12 #include <rtems/io.h>
     11#include "devfs.h"
    1312
    14 #include "devfs.h"
     13#include <rtems/deviceio.h>
    1514
    1615int devFS_open(
     
    2120)
    2221{
    23   rtems_libio_open_close_args_t  args;
    24   rtems_status_code              status;
    2522  const devFS_node *np = iop->pathinfo.node_access;
    2623
    27   args.iop   = iop;
    28   args.flags = iop->flags;
    29   args.mode  = mode;
    30 
    31   status = rtems_io_open(
     24  return rtems_deviceio_open(
     25    iop,
     26    pathname,
     27    oflag,
     28    mode,
    3229    np->major,
    33     np->minor,
    34     (void *) &args
     30    np->minor
    3531  );
    36 
    37   return rtems_deviceio_errno(status);
    3832}
  • cpukit/libfs/src/devfs/devread.c

    rd5d071d ra7d1992c  
    66
    77#if HAVE_CONFIG_H
    8 #include "config.h"
     8  #include "config.h"
    99#endif
    1010
    11 #include <rtems.h>
    12 #include <rtems/io.h>
     11#include "devfs.h"
    1312
    14 #include "devfs.h"
     13#include <rtems/deviceio.h>
    1514
    1615ssize_t devFS_read(
     
    2019)
    2120{
    22   rtems_libio_rw_args_t   args;
    23   rtems_status_code       status;
    2421  const devFS_node *np = iop->pathinfo.node_access;
    2522
    26   args.iop         = iop;
    27   args.offset      = iop->offset;
    28   args.buffer      = buffer;
    29   args.count       = count;
    30   args.flags       = iop->flags;
    31   args.bytes_moved = 0;
    32 
    33   status = rtems_io_read(
    34     np->major,
    35     np->minor,
    36     (void *) &args
    37   );
    38 
    39   if ( status )
    40     return rtems_deviceio_errno(status);
    41 
    42   return (ssize_t) args.bytes_moved;
     23  return rtems_deviceio_read( iop, buffer, count, np->major, np->minor );
    4324}
    44 
  • cpukit/libfs/src/devfs/devwrite.c

    rd5d071d ra7d1992c  
    66
    77#if HAVE_CONFIG_H
    8 #include "config.h"
     8  #include "config.h"
    99#endif
    1010
    11 #include <rtems.h>
    12 #include <rtems/io.h>
     11#include "devfs.h"
    1312
    14 #include "devfs.h"
     13#include <rtems/deviceio.h>
    1514
    1615ssize_t devFS_write(
     
    2019)
    2120{
    22   rtems_libio_rw_args_t   args;
    23   rtems_status_code       status;
    2421  const devFS_node *np = iop->pathinfo.node_access;
    2522
    26   args.iop         = iop;
    27   args.offset      = iop->offset;
    28   args.buffer      = (void *) buffer;
    29   args.count       = count;
    30   args.flags       = iop->flags;
    31   args.bytes_moved = 0;
    32 
    33   status = rtems_io_write(
    34     np->major,
    35     np->minor,
    36     (void *) &args
    37   );
    38 
    39   if ( status )
    40     return rtems_deviceio_errno(status);
    41 
    42   return (ssize_t) args.bytes_moved;
     23  return rtems_deviceio_write( iop, buffer, count, np->major, np->minor );
    4324}
    44 
  • cpukit/libfs/src/dosfs/msdos.h

    rd5d071d ra7d1992c  
    253253);
    254254
    255 void msdos_lock(rtems_filesystem_mount_table_entry_t *mt_entry);
    256 
    257 void msdos_unlock(rtems_filesystem_mount_table_entry_t *mt_entry);
     255void msdos_lock(const rtems_filesystem_mount_table_entry_t *mt_entry);
     256
     257void msdos_unlock(const rtems_filesystem_mount_table_entry_t *mt_entry);
    258258
    259259int msdos_initialize_support(
  • cpukit/libfs/src/dosfs/msdos_file.c

    rd5d071d ra7d1992c  
    118118    ret = fat_file_read(iop->pathinfo.mt_entry, fat_fd, iop->offset, count,
    119119                        buffer);
     120    if (ret > 0)
     121        iop->offset += ret;
    120122
    121123    rtems_semaphore_release(fs_info->vol_sema);
     
    164166     * file was extended
    165167     */
    166     if (iop->offset + ret > fat_fd->fat_file_size)
    167         fat_fd->fat_file_size = iop->offset + ret;
     168    iop->offset += ret;
     169    if (iop->offset > fat_fd->fat_file_size)
     170        fat_fd->fat_file_size = iop->offset;
    168171
    169172    rtems_semaphore_release(fs_info->vol_sema);
     
    274277    int                rc = RC_OK;
    275278    rtems_status_code  sc = RTEMS_SUCCESSFUL;
    276     fat_file_fd_t     *fat_fd = iop->pathinfo.node_access;
    277279    msdos_fs_info_t   *fs_info = iop->pathinfo.mt_entry->fs_info;
    278280
  • cpukit/libfs/src/dosfs/msdos_init.c

    rd5d071d ra7d1992c  
    5252};
    5353
    54 void msdos_lock(rtems_filesystem_mount_table_entry_t *mt_entry)
     54void msdos_lock(const rtems_filesystem_mount_table_entry_t *mt_entry)
    5555{
    5656  msdos_fs_info_t *fs_info = mt_entry->fs_info;
     
    6565}
    6666
    67 void msdos_unlock(rtems_filesystem_mount_table_entry_t *mt_entry)
     67void msdos_unlock(const rtems_filesystem_mount_table_entry_t *mt_entry)
    6868{
    6969  msdos_fs_info_t *fs_info = mt_entry->fs_info;
  • cpukit/libfs/src/dosfs/msdos_initsupp.c

    rd5d071d ra7d1992c  
    142142    temp_mt_entry->mt_fs_root->location.node_access = fat_fd;
    143143    temp_mt_entry->mt_fs_root->location.handlers = directory_handlers;
    144     temp_mt_entry->mt_fs_root->location.ops = op_table;
     144    temp_mt_entry->ops = op_table;
    145145
    146146    return rc;
  • cpukit/libfs/src/imfs/deviceio.c

    rd5d071d ra7d1992c  
    55 *  IMFS device nodes onto calls to the RTEMS Classic API IO Manager.
    66 *
    7  *  COPYRIGHT (c) 1989-2008.
     7 *  COPYRIGHT (c) 1989-2012.
    88 *  On-Line Applications Research Corporation (OAR).
    99 *
     
    1919#include "imfs.h"
    2020
    21 #include <rtems/devfs.h>
    22 
    23 /*
    24  *  device_open
    25  *
    26  *  This handler maps an open() operation onto rtems_io_open().
    27  */
     21#include <rtems/deviceio.h>
    2822
    2923int device_open(
     
    3428)
    3529{
    36   rtems_libio_open_close_args_t  args;
    37   rtems_status_code              status;
    3830  IMFS_jnode_t                  *the_jnode;
    3931
    4032  the_jnode  = iop->pathinfo.node_access;
    4133
    42   args.iop   = iop;
    43   args.flags = iop->flags;
    44   args.mode  = mode;
    45 
    46   status = rtems_io_open(
     34  return rtems_deviceio_open(
     35    iop,
     36    pathname,
     37    oflag,
     38    mode,
    4739    the_jnode->info.device.major,
    48     the_jnode->info.device.minor,
    49     (void *) &args
     40    the_jnode->info.device.minor
    5041  );
    51 
    52   return rtems_deviceio_errno( status );
    5342}
    54 
    55 /*
    56  *  device_close
    57  *
    58  *  This handler maps a close() operation onto rtems_io_close().
    59  */
    6043
    6144int device_close(
     
    6346)
    6447{
    65   rtems_libio_open_close_args_t  args;
    66   rtems_status_code              status;
    6748  IMFS_jnode_t                  *the_jnode;
    6849
    6950  the_jnode = iop->pathinfo.node_access;
    7051
    71   args.iop   = iop;
    72   args.flags = 0;
    73   args.mode  = 0;
    74 
    75   status = rtems_io_close(
     52  return rtems_deviceio_close(
     53    iop,
    7654    the_jnode->info.device.major,
    77     the_jnode->info.device.minor,
    78     (void *) &args
     55    the_jnode->info.device.minor
    7956  );
    80 
    81   return rtems_deviceio_errno( status );
    8257}
    83 
    84 /*
    85  *  device_read
    86  *
    87  *  This handler maps a read() operation onto rtems_io_read().
    88  */
    8958
    9059ssize_t device_read(
     
    9463)
    9564{
    96   rtems_libio_rw_args_t   args;
    97   rtems_status_code       status;
    9865  IMFS_jnode_t           *the_jnode;
    9966
    10067  the_jnode = iop->pathinfo.node_access;
    10168
    102   args.iop         = iop;
    103   args.offset      = iop->offset;
    104   args.buffer      = buffer;
    105   args.count       = count;
    106   args.flags       = iop->flags;
    107   args.bytes_moved = 0;
    108 
    109   status = rtems_io_read(
     69  return rtems_deviceio_read(
     70    iop,
     71    buffer,
     72    count,
    11073    the_jnode->info.device.major,
    111     the_jnode->info.device.minor,
    112     (void *) &args
     74    the_jnode->info.device.minor
    11375  );
    114 
    115   if ( status )
    116     return rtems_deviceio_errno(status);
    117 
    118   return (ssize_t) args.bytes_moved;
    11976}
    120 
    121 /*
    122  *  device_write
    123  *
    124  *  This handler maps a write() operation onto rtems_io_write().
    125  */
    12677
    12778ssize_t device_write(
     
    13182)
    13283{
    133   rtems_libio_rw_args_t   args;
    134   rtems_status_code       status;
    13584  IMFS_jnode_t           *the_jnode;
    13685
    13786  the_jnode = iop->pathinfo.node_access;
    13887
    139   args.iop         = iop;
    140   args.offset      = iop->offset;
    141   args.buffer      = (void *) buffer;
    142   args.count       = count;
    143   args.flags       = iop->flags;
    144   args.bytes_moved = 0;
    145 
    146   status = rtems_io_write(
     88  return rtems_deviceio_write(
     89    iop,
     90    buffer,
     91    count,
    14792    the_jnode->info.device.major,
    148     the_jnode->info.device.minor,
    149     (void *) &args
     93    the_jnode->info.device.minor
    15094  );
    151 
    152   if ( status )
    153     return rtems_deviceio_errno(status);
    154 
    155   return (ssize_t) args.bytes_moved;
    15695}
    15796
    158 /*
    159  *  device_ioctl
    160  *
    161  *  This handler maps an ioctl() operation onto rtems_io_ioctl().
    162  */
    163 
    16497int device_ioctl(
    165   rtems_libio_t *iop,
    166   uint32_t       command,
    167   void          *buffer
     98  rtems_libio_t   *iop,
     99  ioctl_command_t  command,
     100  void            *buffer
    168101)
    169102{
    170   rtems_libio_ioctl_args_t  args;
    171   rtems_status_code         status;
    172103  IMFS_jnode_t             *the_jnode;
    173 
    174   args.iop     = iop;
    175   args.command = command;
    176   args.buffer  = buffer;
    177104
    178105  the_jnode = iop->pathinfo.node_access;
    179106
    180   status = rtems_io_control(
     107  return rtems_deviceio_control(
     108    iop,
     109    command,
     110    buffer,
    181111    the_jnode->info.device.major,
    182     the_jnode->info.device.minor,
    183     (void *) &args
     112    the_jnode->info.device.minor
    184113  );
    185 
    186   if ( status )
    187     return rtems_deviceio_errno(status);
    188 
    189   return args.ioctl_return;
    190114}
    191 
    192 /*
    193  *  device_stat
    194  *
    195  *  The IMFS_stat() is used.
    196  */
    197 
    198 /*
    199  *  device_rmnod
    200  *
    201  *  The IMFS_rmnod() is used.
    202  */
    203115
    204116int device_ftruncate(
  • cpukit/libfs/src/imfs/imfs.h

    rd5d071d ra7d1992c  
    436436);
    437437
    438 extern int memfile_ioctl(
    439   rtems_libio_t *iop,             /* IN  */
    440   uint32_t       command,         /* IN  */
    441   void          *buffer           /* IN  */
    442 );
    443 
    444438extern int device_open(
    445439  rtems_libio_t *iop,            /* IN  */
     
    466460
    467461extern int device_ioctl(
    468   rtems_libio_t *iop,               /* IN  */
    469   uint32_t       command,           /* IN  */
    470   void          *buffer             /* IN  */
     462  rtems_libio_t   *iop,
     463  ioctl_command_t  command,
     464  void            *buffer
    471465);
    472466
  • cpukit/libfs/src/imfs/imfs_fifo.c

    rd5d071d ra7d1992c  
    8484
    8585static int IMFS_fifo_ioctl(
    86   rtems_libio_t *iop,
    87   uint32_t       command,
    88   void          *buffer
     86  rtems_libio_t   *iop,
     87  ioctl_command_t  command,
     88  void            *buffer
    8989)
    9090{
  • cpukit/libfs/src/imfs/imfs_handlers_memfile.c

    rd5d071d ra7d1992c  
    3434  memfile_read,
    3535  memfile_write,
    36   memfile_ioctl,
     36  rtems_filesystem_default_ioctl,
    3737  rtems_filesystem_default_lseek_file,
    3838  IMFS_stat_file,
  • cpukit/libfs/src/imfs/imfs_initsupp.c

    rd5d071d ra7d1992c  
    8080    if ( root_node != NULL ) {
    8181      mt_entry->fs_info = fs_info;
     82      mt_entry->ops = op_table;
    8283      mt_entry->pathconf_limits_and_options = IMFS_LIMITS_AND_OPTIONS;
    8384      mt_entry->mt_fs_root->location.node_access = root_node;
    84       mt_entry->mt_fs_root->location.ops = op_table;
    8585      IMFS_Set_handlers( &mt_entry->mt_fs_root->location );
    8686    } else {
  • cpukit/libfs/src/imfs/imfs_load_tar.c

    rd5d071d ra7d1992c  
    102102     RTEMS_FS_MAKE | RTEMS_FS_EXCLUSIVE
    103103   );
    104    if (rootloc.ops != &IMFS_ops && rootloc.ops != &fifoIMFS_ops) {
     104
     105   if (
     106     rootloc.mt_entry->ops != &IMFS_ops
     107       && rootloc.mt_entry->ops != &fifoIMFS_ops
     108   ) {
    105109     rv = -1;
    106110   }
  • cpukit/libfs/src/imfs/memfile.c

    rd5d071d ra7d1992c  
    122122{
    123123  IMFS_jnode_t   *the_jnode;
     124  ssize_t         status;
    124125
    125126  the_jnode = iop->pathinfo.node_access;
    126127
    127   return IMFS_memfile_read( the_jnode, iop->offset, buffer, count );
     128  status = IMFS_memfile_read( the_jnode, iop->offset, buffer, count );
     129
     130  if ( status > 0 )
     131    iop->offset += status;
     132
     133  return status;
    128134}
    129135
     
    149155  status = IMFS_memfile_write( the_jnode, iop->offset, buffer, count );
    150156
     157  if ( status > 0 )
     158    iop->offset += status;
     159
    151160  return status;
    152 }
    153 
    154 /*
    155  *  memfile_ioctl
    156  *
    157  *  This routine processes the ioctl() system call.
    158  *
    159  *  NOTE:  No ioctl()'s are supported for in-memory files.
    160  */
    161 int memfile_ioctl(
    162   rtems_libio_t *iop,
    163   uint32_t       command,
    164   void          *buffer
    165 )
    166 {
    167   return 0;
    168161}
    169162
  • cpukit/libfs/src/nfsclient/src/nfs.c

    rd5d071d ra7d1992c  
    17541754        rootNode = 0;
    17551755
    1756         mt_entry->mt_fs_root->location.ops              = &nfs_fs_ops;
     1756        mt_entry->ops = &nfs_fs_ops;
    17571757        mt_entry->mt_fs_root->location.handlers  = &nfs_dir_file_handlers;
    17581758        mt_entry->pathconf_limits_and_options = nfs_limits_and_options;
     
    20872087}
    20882088
    2089 static void nfs_lock(rtems_filesystem_mount_table_entry_t *mt_entry)
    2090 {
    2091 }
    2092 
    2093 static void nfs_unlock(rtems_filesystem_mount_table_entry_t *mt_entry)
     2089static void nfs_lock(const rtems_filesystem_mount_table_entry_t *mt_entry)
     2090{
     2091}
     2092
     2093static void nfs_unlock(const rtems_filesystem_mount_table_entry_t *mt_entry)
    20942094{
    20952095}
     
    23122312        } while (count > 0);
    23132313
     2314        if (rv > 0) {
     2315                iop->offset = offset;
     2316        }
     2317
    23142318        return rv;
    23152319}
     
    24192423
    24202424        node->age = nowSeconds();
     2425
     2426        iop->offset += count;
    24212427
    24222428        return count;
  • cpukit/libfs/src/pipe/fifo.c

    rd5d071d ra7d1992c  
    613613 */
    614614int pipe_ioctl(
    615   pipe_control_t *pipe,
    616   uint32_t        cmd,
    617   void           *buffer,
    618   rtems_libio_t  *iop
     615  pipe_control_t  *pipe,
     616  ioctl_command_t  cmd,
     617  void            *buffer,
     618  rtems_libio_t   *iop
    619619)
    620620{
  • cpukit/libfs/src/pipe/pipe.h

    rd5d071d ra7d1992c  
    9999 */
    100100extern int pipe_ioctl(
    101   pipe_control_t *pipe,
    102   uint32_t        cmd,
    103   void           *buffer,
    104   rtems_libio_t  *iop
     101  pipe_control_t  *pipe,
     102  ioctl_command_t  cmd,
     103  void            *buffer,
     104  rtems_libio_t   *iop
    105105);
    106106
  • cpukit/libfs/src/rfs/rtems-rfs-rtems-dev.c

    rd5d071d ra7d1992c  
    1919
    2020#if HAVE_CONFIG_H
    21 #include "config.h"
     21  #include "config.h"
    2222#endif
    2323
    24 #include <rtems/devfs.h>
    2524#include "rtems-rfs-rtems.h"
     25
     26#include <rtems/deviceio.h>
     27
     28static void
     29rtems_rfs_rtems_device_get_major_and_minor ( const rtems_libio_t       *iop,
     30                                             rtems_device_major_number *major,
     31                                             rtems_device_minor_number *minor)
     32{
     33  *major = iop->data0;
     34  *minor = (rtems_device_minor_number) iop->data1;
     35}
    2636
    2737/**
     
    4050                              mode_t         mode)
    4151{
    42   rtems_libio_open_close_args_t args;
    4352  rtems_rfs_file_system*        fs = rtems_rfs_rtems_pathloc_dev (&iop->pathinfo);
    4453  rtems_rfs_ino                 ino = rtems_rfs_rtems_get_iop_ino (iop);
    4554  rtems_rfs_inode_handle        inode;
    46   int                           major;
    47   int                           minor;
    48   rtems_status_code             status;
     55  rtems_device_major_number     major;
     56  rtems_device_minor_number     minor;
    4957  int                           rc;
    5058
     
    7179
    7280  iop->data0 = major;
    73   iop->data1 = (void*)((intptr_t) minor);
     81  iop->data1 = (void *) minor;
    7482
    75   args.iop   = iop;
    76   args.flags = iop->flags;
    77   args.mode  = mode;
    78 
    79   status = rtems_io_open (major, minor, (void *) &args);
    80 
    81   return rtems_deviceio_errno (status);
     83  return rtems_deviceio_open (iop, pathname, oflag, mode, minor, major);
    8284}
    8385
     
    9294rtems_rfs_rtems_device_close (rtems_libio_t* iop)
    9395{
    94   rtems_libio_open_close_args_t args;
    95   rtems_status_code             status;
    96   int                           major;
    97   int                           minor;
     96  rtems_device_major_number     major;
     97  rtems_device_minor_number     minor;
    9898
    99   major = (int) iop->data0;
    100   minor = (intptr_t) iop->data1;
     99  rtems_rfs_rtems_device_get_major_and_minor (iop, &major, &minor);
    101100
    102   args.iop   = iop;
    103   args.flags = 0;
    104   args.mode  = 0;
    105 
    106   status = rtems_io_close (major, minor, (void *) &args);
    107 
    108   return rtems_deviceio_errno (status);
     101  return rtems_deviceio_close (iop, major, minor);
    109102}
    110103
     
    121114rtems_rfs_rtems_device_read (rtems_libio_t* iop, void* buffer, size_t count)
    122115{
    123   rtems_libio_rw_args_t args;
    124   rtems_status_code     status;
    125   int                   major;
    126   int                   minor;
     116  rtems_device_major_number major;
     117  rtems_device_minor_number minor;
    127118
    128   major = (int) iop->data0;
    129   minor = (intptr_t) iop->data1;
     119  rtems_rfs_rtems_device_get_major_and_minor (iop, &major, &minor);
    130120
    131   args.iop         = iop;
    132   args.offset      = iop->offset;
    133   args.buffer      = buffer;
    134   args.count       = count;
    135   args.flags       = iop->flags;
    136   args.bytes_moved = 0;
    137 
    138   status = rtems_io_read (major, minor, (void *) &args);
    139   if (status)
    140     return rtems_deviceio_errno (status);
    141 
    142   return (ssize_t) args.bytes_moved;
     121  return rtems_deviceio_read (iop, buffer, count, major, minor);
    143122}
    144123
     
    157136                              size_t         count)
    158137{
    159   rtems_libio_rw_args_t args;
    160   rtems_status_code     status;
    161   int                   major;
    162   int                   minor;
     138  rtems_device_major_number major;
     139  rtems_device_minor_number minor;
    163140
    164   major = (int) iop->data0;
    165   minor = (intptr_t) iop->data1;
     141  rtems_rfs_rtems_device_get_major_and_minor (iop, &major, &minor);
    166142
    167   args.iop         = iop;
    168   args.offset      = iop->offset;
    169   args.buffer      = (void *) buffer;
    170   args.count       = count;
    171   args.flags       = iop->flags;
    172   args.bytes_moved = 0;
    173 
    174   status = rtems_io_write (major, minor, (void *) &args);
    175   if (status)
    176     return rtems_deviceio_errno (status);
    177 
    178   return (ssize_t) args.bytes_moved;
     143  return rtems_deviceio_write (iop, buffer, count, major, minor);
    179144}
    180145
     
    189154
    190155static int
    191 rtems_rfs_rtems_device_ioctl (rtems_libio_t* iop,
    192                               uint32_t      command,
    193                               void*          buffer)
     156rtems_rfs_rtems_device_ioctl (rtems_libio_t*  iop,
     157                              ioctl_command_t command,
     158                              void*           buffer)
    194159{
    195   rtems_libio_ioctl_args_t args;
    196   rtems_status_code        status;
    197   int                      major;
    198   int                      minor;
     160  rtems_device_major_number major;
     161  rtems_device_minor_number minor;
    199162
    200   major = (int) iop->data0;
    201   minor = (intptr_t) iop->data1;
     163  rtems_rfs_rtems_device_get_major_and_minor (iop, &major, &minor);
    202164
    203   args.iop     = iop;
    204   args.command = command;
    205   args.buffer  = buffer;
    206 
    207   status = rtems_io_control (major, minor, (void *) &args);
    208   if (status)
    209     return rtems_deviceio_errno (status);
    210 
    211   return args.ioctl_return;
     165  return rtems_deviceio_control (iop, command, buffer, major, minor);
    212166}
    213167
  • cpukit/libfs/src/rfs/rtems-rfs-rtems-file.c

    rd5d071d ra7d1992c  
    164164  }
    165165
     166  if (read >= 0)
     167    iop->offset = pos + read;
     168
    166169  rtems_rfs_rtems_unlock (rtems_rfs_file_fs (file));
    167170
     
    221224      return rtems_rfs_rtems_error ("file-write: write append seek", rc);
    222225    }
    223     iop->offset = pos;
    224226  }
    225227
     
    252254  }
    253255
     256  if (write >= 0)
     257    iop->offset = pos + write;
     258
    254259  rtems_rfs_rtems_unlock (rtems_rfs_file_fs (file));
    255260
    256261  return write;
    257 }
    258 
    259 /**
    260  * This routine processes the ioctl() system call.
    261  *
    262  * @note  No ioctl()'s are currently supported for RFS files.
    263  *
    264  * @param iop
    265  * @param command
    266  * @param buffer
    267  */
    268 
    269 static int
    270 rtems_rfs_rtems_file_ioctl (rtems_libio_t* iop, uint32_t command, void* buffer)
    271 {
    272   return 0;
    273262}
    274263
     
    352341  .read_h      = rtems_rfs_rtems_file_read,
    353342  .write_h     = rtems_rfs_rtems_file_write,
    354   .ioctl_h     = rtems_rfs_rtems_file_ioctl,
     343  .ioctl_h     = rtems_filesystem_default_ioctl,
    355344  .lseek_h     = rtems_rfs_rtems_file_lseek,
    356345  .fstat_h     = rtems_rfs_rtems_fstat,
  • cpukit/libfs/src/rfs/rtems-rfs-rtems.c

    rd5d071d ra7d1992c  
    7474
    7575static void
    76 rtems_rfs_rtems_lock_by_mt_entry (rtems_filesystem_mount_table_entry_t *mt_entry)
     76rtems_rfs_rtems_lock_by_mt_entry (
     77  const rtems_filesystem_mount_table_entry_t *mt_entry
     78)
    7779{
    7880  rtems_rfs_file_system* fs = mt_entry->fs_info;
     
    8284
    8385static void
    84 rtems_rfs_rtems_unlock_by_mt_entry (rtems_filesystem_mount_table_entry_t *mt_entry)
     86rtems_rfs_rtems_unlock_by_mt_entry (
     87  const rtems_filesystem_mount_table_entry_t *mt_entry
     88)
    8589{
    8690  rtems_rfs_file_system* fs = mt_entry->fs_info;
     
    915919  }
    916920
    917   mt_entry->fs_info = fs;
    918 
     921  mt_entry->fs_info                          = fs;
     922  mt_entry->ops                              = &rtems_rfs_ops;
    919923  mt_entry->mt_fs_root->location.node_access = (void*) RTEMS_RFS_ROOT_INO;
    920924  mt_entry->mt_fs_root->location.handlers    = &rtems_rfs_rtems_dir_handlers;
    921   mt_entry->mt_fs_root->location.ops         = &rtems_rfs_ops;
    922925
    923926  rtems_rfs_rtems_unlock (fs);
  • cpukit/libnetworking/lib/ftpfs.c

    rd5d071d ra7d1992c  
    11951195  /* Set handler and oparations table */
    11961196  e->mt_fs_root->location.handlers = &rtems_ftpfs_root_handlers;
    1197   e->mt_fs_root->location.ops = &rtems_ftpfs_ops;
     1197  e->ops = &rtems_ftpfs_ops;
    11981198
    11991199  /* We maintain no real file system nodes, so there is no real root */
  • cpukit/libnetworking/lib/tftpDriver.c

    rd5d071d ra7d1992c  
    206206  mt_entry->mt_fs_root->location.node_access = root_path;
    207207  mt_entry->mt_fs_root->location.handlers = &rtems_tftp_handlers;
    208   mt_entry->mt_fs_root->location.ops = &rtems_tftp_ops;
     208  mt_entry->ops = &rtems_tftp_ops;
    209209 
    210210  /*
  • cpukit/libnetworking/rtems/rtems_bsdnet_internal.h

    rd5d071d ra7d1992c  
    2323typedef unsigned int            vm_size_t;
    2424
    25 #ifndef __ioctl_command_defined
    26 typedef u_int32_t ioctl_command_t;
    27 #define __ioctl_command_defined
    28 #endif
    29 
    30 
    3125#define _BSD_OFF_T_     int32_t
    3226#define _BSD_PID_T_     rtems_id
     
    3933
    4034#include <sys/time.h>
     35#include <sys/ioctl.h>
    4136
    4237struct mdproc {
  • cpukit/libnetworking/rtems/rtems_syscall.c

    rd5d071d ra7d1992c  
    8989  iop->data1 = so;
    9090  iop->pathinfo.handlers = &socket_handlers;
    91   iop->pathinfo.ops = &rtems_filesystem_operations_default;
    9291  iop->pathinfo.mt_entry = &rtems_filesystem_null_mt_entry;
    9392  rtems_filesystem_location_add_to_mt_entry(&iop->pathinfo);
  • testsuites/fstests/fsnofs01/init.c

    rd5d071d ra7d1992c  
    5454  rtems_test_assert(null_loc->location.node_access_2 == local_loc->node_access_2);
    5555  rtems_test_assert(null_loc->location.handlers == local_loc->handlers);
    56   rtems_test_assert(null_loc->location.ops == local_loc->ops);
    5756  rtems_test_assert(null_loc->location.mt_entry == local_loc->mt_entry);
    5857}
  • testsuites/libtests/Makefile.am

    rd5d071d ra7d1992c  
    1212    termios06 termios07 termios08 \
    1313    rtems++ tztest block01 block02 block03 block04 block05 block06 block07 \
    14     block08 block09 block10 block11 stringto01 \
     14    block08 block09 block10 block11 block12 stringto01 \
    1515    tar01 tar02 tar03 \
    1616    math mathf mathl complex \
  • testsuites/libtests/configure.ac

    rd5d071d ra7d1992c  
    5656block10/Makefile
    5757block11/Makefile
     58block12/Makefile
    5859bspcmdline01/Makefile
    5960cpuuse/Makefile
  • testsuites/psxtests/psxfile01/test.c

    rd5d071d ra7d1992c  
    335335  fd = open( "/tmp/john", O_RDWR|O_CREAT, S_IRWXU|S_IRWXG|S_IRWXO );
    336336  rtems_test_assert( fd != -1 );
    337 
    338   puts("tcdrain /tmp/john" );
    339   status = tcdrain( fd );
     337  status = close( fd );
    340338  rtems_test_assert( status == 0 );
    341339
Note: See TracChangeset for help on using the changeset viewer.