Changeset 2f68778 in rtems


Ignore:
Timestamp:
Dec 16, 2013, 12:44:13 PM (5 years ago)
Author:
Sebastian Huber <sebastian.huber@…>
Branches:
4.11, master
Children:
56bea43
Parents:
95a57280
git-author:
Sebastian Huber <sebastian.huber@…> (12/16/13 12:44:13)
git-committer:
Sebastian Huber <sebastian.huber@…> (12/20/13 09:31:53)
Message:

Filesystem: Add readv/writev handlers

The readv() and writev() support was implemented in terms of multiple
calls to the read and write handlers. This imposes a problem on device
files which use an IO vector as single request entity. For example a
low-level network device (e.g. BPF(4)) may use an IO vector to create
one frame from multiple protocol layers each with its own IO vector
entry.

Files:
2 added
26 edited

Legend:

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

    r95a57280 r2f68778  
    676676  .fsync_h = rtems_filesystem_default_fsync_or_fdatasync,
    677677  .fdatasync_h = rtems_filesystem_default_fsync_or_fdatasync,
    678   .fcntl_h = rtems_filesystem_default_fcntl
     678  .fcntl_h = rtems_filesystem_default_fcntl,
     679  .readv_h = rtems_filesystem_default_readv,
     680  .writev_h = rtems_filesystem_default_writev
    679681};
  • cpukit/libblock/src/blkdev-imfs.c

    r95a57280 r2f68778  
    221221  .fsync_h = rtems_blkdev_imfs_fsync_or_fdatasync,
    222222  .fdatasync_h = rtems_blkdev_imfs_fsync_or_fdatasync,
    223   .fcntl_h = rtems_filesystem_default_fcntl
     223  .fcntl_h = rtems_filesystem_default_fcntl,
     224  .readv_h = rtems_filesystem_default_readv,
     225  .writev_h = rtems_filesystem_default_writev
    224226};
    225227
  • cpukit/libcsupport/include/rtems/libio.h

    r95a57280 r2f68778  
    3030#include <sys/ioctl.h>
    3131#include <sys/statvfs.h>
     32#include <sys/uio.h>
    3233
    3334#include <unistd.h>
     
    809810
    810811/**
     812 * @brief Reads an IO vector from a node.
     813 *
     814 * This handler is responsible to update the offset field of the IO descriptor.
     815 *
     816 * @param[in, out] iop The IO pointer.
     817 * @param[in] iov The IO vector with buffer for read data.  The caller must
     818 * ensure that the IO vector values are valid.
     819 * @param[in] iovcnt The count of buffers in the IO vector.
     820 * @param[in] total The total count of bytes in the buffers in the IO vector.
     821 *
     822 * @retval non-negative Count of read characters.
     823 * @retval -1 An error occurred.  The errno is set to indicate the error.
     824 *
     825 * @see rtems_filesystem_default_readv().
     826 */
     827typedef ssize_t (*rtems_filesystem_readv_t)(
     828  rtems_libio_t      *iop,
     829  const struct iovec *iov,
     830  int                 iovcnt,
     831  ssize_t             total
     832);
     833
     834/**
    811835 * @brief Writes to a node.
    812836 *
     
    826850  const void    *buffer,
    827851  size_t         count
     852);
     853
     854/**
     855 * @brief Writes an IO vector to a node.
     856 *
     857 * This handler is responsible to update the offset field of the IO descriptor.
     858 *
     859 * @param[in, out] iop The IO pointer.
     860 * @param[in] iov The IO vector with buffer for write data.  The caller must
     861 * ensure that the IO vector values are valid.
     862 * @param[in] iovcnt The count of buffers in the IO vector.
     863 * @param[in] total The total count of bytes in the buffers in the IO vector.
     864 *
     865 * @retval non-negative Count of written characters.
     866 * @retval -1 An error occurred.  The errno is set to indicate the error.
     867 *
     868 * @see rtems_filesystem_default_writev().
     869 */
     870typedef ssize_t (*rtems_filesystem_writev_t)(
     871  rtems_libio_t      *iop,
     872  const struct iovec *iov,
     873  int                 iovcnt,
     874  ssize_t             total
    828875);
    829876
     
    9931040  rtems_filesystem_poll_t poll_h;
    9941041  rtems_filesystem_kqfilter_t kqfilter_h;
     1042  rtems_filesystem_readv_t readv_h;
     1043  rtems_filesystem_writev_t writev_h;
    9951044};
    9961045
     
    10341083
    10351084/**
     1085 * @brief Calls the read handler for each IO vector entry.
     1086 *
     1087 * @see rtems_filesystem_readv_t.
     1088 */
     1089ssize_t rtems_filesystem_default_readv(
     1090  rtems_libio_t      *iop,
     1091  const struct iovec *iov,
     1092  int                 iovcnt,
     1093  ssize_t             total
     1094);
     1095
     1096/**
    10361097 * @retval -1 Always.  The errno is set to ENOTSUP.
    10371098 *
     
    10421103  const void    *buffer,
    10431104  size_t         count
     1105);
     1106
     1107/**
     1108 * @brief Calls the write handler for each IO vector entry.
     1109 *
     1110 * @see rtems_filesystem_write_t.
     1111 */
     1112ssize_t rtems_filesystem_default_writev(
     1113  rtems_libio_t      *iop,
     1114  const struct iovec *iov,
     1115  int                 iovcnt,
     1116  ssize_t             total
    10441117);
    10451118
  • cpukit/libcsupport/src/__usrenv.c

    r95a57280 r2f68778  
    5555  .fsync_h = rtems_filesystem_default_fsync_or_fdatasync,
    5656  .fdatasync_h = rtems_filesystem_default_fsync_or_fdatasync,
    57   .fcntl_h = rtems_filesystem_default_fcntl
     57  .fcntl_h = rtems_filesystem_default_fcntl,
     58  .readv_h = rtems_filesystem_default_readv,
     59  .writev_h = rtems_filesystem_default_writev
    5860};
    5961
  • cpukit/libcsupport/src/readv.c

    r95a57280 r2f68778  
    3737{
    3838  ssize_t        total;
    39   int            v;
    4039  rtems_libio_t *iop;
    4140
     
    4342
    4443  if ( total > 0 ) {
    45     /*
    46      *  Now process the readv().
    47      */
    48     total = 0;
    49     for ( v = 0 ; v < iovcnt ; v++ ) {
    50       ssize_t bytes = ( *iop->pathinfo.handlers->read_h )(
    51         iop,
    52         iov[ v ].iov_base,
    53         iov[ v ].iov_len
    54       );
    55 
    56       if ( bytes < 0 )
    57         return -1;
    58 
    59       total += bytes;
    60 
    61       if ( bytes != iov[ v ].iov_len )
    62         break;
    63     }
     44    total = ( *iop->pathinfo.handlers->readv_h )( iop, iov, iovcnt, total );
    6445  }
    6546
  • cpukit/libcsupport/src/writev.c

    r95a57280 r2f68778  
    2929{
    3030  ssize_t        total;
    31   int            v;
    3231  rtems_libio_t *iop;
    3332
     
    3534
    3635  if ( total > 0 ) {
    37     /*
    38      *  Now process the writev().
    39      */
    40     total = 0;
    41     for ( v = 0 ; v < iovcnt ; v++ ) {
    42       ssize_t bytes = ( *iop->pathinfo.handlers->write_h )(
    43         iop,
    44         iov[ v ].iov_base,
    45         iov[ v ].iov_len
    46       );
    47 
    48       if ( bytes < 0 )
    49         return -1;
    50 
    51       total += bytes;
    52 
    53       if ( bytes != iov[ v ].iov_len )
    54         break;
    55     }
     36    total = ( *iop->pathinfo.handlers->writev_h )( iop, iov, iovcnt, total );
    5637  }
    5738
  • cpukit/libfs/Makefile.am

    r95a57280 r2f68778  
    3636libdefaultfs_a_SOURCES += src/defaults/default_kqfilter.c
    3737libdefaultfs_a_SOURCES += src/defaults/default_poll.c
     38libdefaultfs_a_SOURCES += src/defaults/default_readv.c
     39libdefaultfs_a_SOURCES += src/defaults/default_writev.c
    3840
    3941noinst_LIBRARIES += libimfs.a
  • cpukit/libfs/src/defaults/default_handlers.c

    r95a57280 r2f68778  
    3333  .fsync_h = rtems_filesystem_default_fsync_or_fdatasync,
    3434  .fdatasync_h = rtems_filesystem_default_fsync_or_fdatasync,
    35   .fcntl_h = rtems_filesystem_default_fcntl
     35  .fcntl_h = rtems_filesystem_default_fcntl,
     36  .readv_h = rtems_filesystem_default_readv,
     37  .writev_h = rtems_filesystem_default_writev
    3638};
  • cpukit/libfs/src/devfs/devfs_init.c

    r95a57280 r2f68778  
    5353  .fsync_h = rtems_filesystem_default_fsync_or_fdatasync,
    5454  .fdatasync_h = rtems_filesystem_default_fsync_or_fdatasync,
    55   .fcntl_h = rtems_filesystem_default_fcntl
     55  .fcntl_h = rtems_filesystem_default_fcntl,
     56  .readv_h = rtems_filesystem_default_readv,
     57  .writev_h = rtems_filesystem_default_writev
    5658};
    5759
  • cpukit/libfs/src/dosfs/msdos_handlers_dir.c

    r95a57280 r2f68778  
    2323
    2424const rtems_filesystem_file_handlers_r msdos_dir_handlers = {
    25     rtems_filesystem_default_open,
    26     rtems_filesystem_default_close,
    27     msdos_dir_read,
    28     rtems_filesystem_default_write,
    29     rtems_filesystem_default_ioctl,
    30     rtems_filesystem_default_lseek_directory,
    31     msdos_dir_stat,
    32     rtems_filesystem_default_ftruncate_directory,
    33     msdos_sync,
    34     msdos_sync,
    35     rtems_filesystem_default_fcntl
     25  .open_h = rtems_filesystem_default_open,
     26  .close_h = rtems_filesystem_default_close,
     27  .read_h = msdos_dir_read,
     28  .write_h = rtems_filesystem_default_write,
     29  .ioctl_h = rtems_filesystem_default_ioctl,
     30  .lseek_h = rtems_filesystem_default_lseek_directory,
     31  .fstat_h = msdos_dir_stat,
     32  .ftruncate_h = rtems_filesystem_default_ftruncate_directory,
     33  .fsync_h = msdos_sync,
     34  .fdatasync_h = msdos_sync,
     35  .fcntl_h = rtems_filesystem_default_fcntl,
     36  .readv_h = rtems_filesystem_default_readv,
     37  .writev_h = rtems_filesystem_default_writev
    3638};
  • cpukit/libfs/src/dosfs/msdos_handlers_file.c

    r95a57280 r2f68778  
    2323
    2424const rtems_filesystem_file_handlers_r msdos_file_handlers = {
    25     rtems_filesystem_default_open,
    26     msdos_file_close,
    27     msdos_file_read,
    28     msdos_file_write,
    29     rtems_filesystem_default_ioctl,
    30     rtems_filesystem_default_lseek_file,
    31     msdos_file_stat,
    32     msdos_file_ftruncate,
    33     msdos_file_sync,
    34     msdos_sync,
    35     rtems_filesystem_default_fcntl
     25  .open_h = rtems_filesystem_default_open,
     26  .close_h = msdos_file_close,
     27  .read_h = msdos_file_read,
     28  .write_h = msdos_file_write,
     29  .ioctl_h = rtems_filesystem_default_ioctl,
     30  .lseek_h = rtems_filesystem_default_lseek_file,
     31  .fstat_h = msdos_file_stat,
     32  .ftruncate_h = msdos_file_ftruncate,
     33  .fsync_h = msdos_file_sync,
     34  .fdatasync_h = msdos_sync,
     35  .fcntl_h = rtems_filesystem_default_fcntl,
     36  .readv_h = rtems_filesystem_default_readv,
     37  .writev_h = rtems_filesystem_default_writev
    3638};
  • cpukit/libfs/src/imfs/imfs_fifo.c

    r95a57280 r2f68778  
    114114
    115115static const rtems_filesystem_file_handlers_r IMFS_fifo_handlers = {
    116   IMFS_fifo_open,
    117   IMFS_fifo_close,
    118   IMFS_fifo_read,
    119   IMFS_fifo_write,
    120   IMFS_fifo_ioctl,
    121   rtems_filesystem_default_lseek,
    122   IMFS_stat,
    123   rtems_filesystem_default_ftruncate,
    124   rtems_filesystem_default_fsync_or_fdatasync,
    125   rtems_filesystem_default_fsync_or_fdatasync,
    126   rtems_filesystem_default_fcntl
     116  .open_h = IMFS_fifo_open,
     117  .close_h = IMFS_fifo_close,
     118  .read_h = IMFS_fifo_read,
     119  .write_h = IMFS_fifo_write,
     120  .ioctl_h = IMFS_fifo_ioctl,
     121  .lseek_h = rtems_filesystem_default_lseek,
     122  .fstat_h = IMFS_stat,
     123  .ftruncate_h = rtems_filesystem_default_ftruncate,
     124  .fsync_h = rtems_filesystem_default_fsync_or_fdatasync,
     125  .fdatasync_h = rtems_filesystem_default_fsync_or_fdatasync,
     126  .fcntl_h = rtems_filesystem_default_fcntl,
     127  .readv_h = rtems_filesystem_default_readv,
     128  .writev_h = rtems_filesystem_default_writev
    127129};
    128130
  • cpukit/libfs/src/imfs/imfs_handlers_device.c

    r95a57280 r2f68778  
    3535
    3636static const rtems_filesystem_file_handlers_r IMFS_device_handlers = {
    37   device_open,
    38   device_close,
    39   device_read,
    40   device_write,
    41   device_ioctl,
    42   rtems_filesystem_default_lseek_file,
    43   IMFS_stat_device,
    44   device_ftruncate,
    45   rtems_filesystem_default_fsync_or_fdatasync,
    46   rtems_filesystem_default_fsync_or_fdatasync,
    47   rtems_filesystem_default_fcntl
     37  .open_h = device_open,
     38  .close_h = device_close,
     39  .read_h = device_read,
     40  .write_h = device_write,
     41  .ioctl_h = device_ioctl,
     42  .lseek_h = rtems_filesystem_default_lseek_file,
     43  .fstat_h = IMFS_stat_device,
     44  .ftruncate_h = device_ftruncate,
     45  .fsync_h = rtems_filesystem_default_fsync_or_fdatasync,
     46  .fdatasync_h = rtems_filesystem_default_fsync_or_fdatasync,
     47  .fcntl_h = rtems_filesystem_default_fcntl,
     48  .readv_h = rtems_filesystem_default_readv,
     49  .writev_h = rtems_filesystem_default_writev
    4850};
    4951
  • cpukit/libfs/src/imfs/imfs_handlers_directory.c

    r95a57280 r2f68778  
    5151
    5252static const rtems_filesystem_file_handlers_r IMFS_directory_handlers = {
    53   rtems_filesystem_default_open,
    54   rtems_filesystem_default_close,
    55   imfs_dir_read,
    56   rtems_filesystem_default_write,
    57   rtems_filesystem_default_ioctl,
    58   rtems_filesystem_default_lseek_directory,
    59   IMFS_stat_directory,
    60   rtems_filesystem_default_ftruncate_directory,
    61   rtems_filesystem_default_fsync_or_fdatasync_success,
    62   rtems_filesystem_default_fsync_or_fdatasync_success,
    63   rtems_filesystem_default_fcntl
     53  .open_h = rtems_filesystem_default_open,
     54  .close_h = rtems_filesystem_default_close,
     55  .read_h = imfs_dir_read,
     56  .write_h = rtems_filesystem_default_write,
     57  .ioctl_h = rtems_filesystem_default_ioctl,
     58  .lseek_h = rtems_filesystem_default_lseek_directory,
     59  .fstat_h = IMFS_stat_directory,
     60  .ftruncate_h = rtems_filesystem_default_ftruncate_directory,
     61  .fsync_h = rtems_filesystem_default_fsync_or_fdatasync_success,
     62  .fdatasync_h = rtems_filesystem_default_fsync_or_fdatasync_success,
     63  .fcntl_h = rtems_filesystem_default_fcntl,
     64  .readv_h = rtems_filesystem_default_readv,
     65  .writev_h = rtems_filesystem_default_writev
    6466};
    6567
  • cpukit/libfs/src/imfs/imfs_handlers_link.c

    r95a57280 r2f68778  
    4646
    4747static const rtems_filesystem_file_handlers_r IMFS_link_handlers = {
    48   rtems_filesystem_default_open,
    49   rtems_filesystem_default_close,
    50   rtems_filesystem_default_read,
    51   rtems_filesystem_default_write,
    52   rtems_filesystem_default_ioctl,
    53   rtems_filesystem_default_lseek,
    54   IMFS_stat_link,
    55   rtems_filesystem_default_ftruncate,
    56   rtems_filesystem_default_fsync_or_fdatasync,
    57   rtems_filesystem_default_fsync_or_fdatasync,
    58   rtems_filesystem_default_fcntl
     48  .open_h = rtems_filesystem_default_open,
     49  .close_h = rtems_filesystem_default_close,
     50  .read_h = rtems_filesystem_default_read,
     51  .write_h = rtems_filesystem_default_write,
     52  .ioctl_h = rtems_filesystem_default_ioctl,
     53  .lseek_h = rtems_filesystem_default_lseek,
     54  .fstat_h = IMFS_stat_link,
     55  .ftruncate_h = rtems_filesystem_default_ftruncate,
     56  .fsync_h = rtems_filesystem_default_fsync_or_fdatasync,
     57  .fdatasync_h = rtems_filesystem_default_fsync_or_fdatasync,
     58  .fcntl_h = rtems_filesystem_default_fcntl,
     59  .readv_h = rtems_filesystem_default_readv,
     60  .writev_h = rtems_filesystem_default_writev
    5961};
    6062
  • cpukit/libfs/src/imfs/imfs_handlers_memfile.c

    r95a57280 r2f68778  
    3535
    3636static const rtems_filesystem_file_handlers_r IMFS_memfile_handlers = {
    37   memfile_open,
    38   rtems_filesystem_default_close,
    39   memfile_read,
    40   memfile_write,
    41   rtems_filesystem_default_ioctl,
    42   rtems_filesystem_default_lseek_file,
    43   IMFS_stat_file,
    44   memfile_ftruncate,
    45   rtems_filesystem_default_fsync_or_fdatasync_success,
    46   rtems_filesystem_default_fsync_or_fdatasync_success,
    47   rtems_filesystem_default_fcntl
     37  .open_h = memfile_open,
     38  .close_h = rtems_filesystem_default_close,
     39  .read_h = memfile_read,
     40  .write_h = memfile_write,
     41  .ioctl_h = rtems_filesystem_default_ioctl,
     42  .lseek_h = rtems_filesystem_default_lseek_file,
     43  .fstat_h = IMFS_stat_file,
     44  .ftruncate_h = memfile_ftruncate,
     45  .fsync_h = rtems_filesystem_default_fsync_or_fdatasync_success,
     46  .fdatasync_h = rtems_filesystem_default_fsync_or_fdatasync_success,
     47  .fcntl_h = rtems_filesystem_default_fcntl,
     48  .readv_h = rtems_filesystem_default_readv,
     49  .writev_h = rtems_filesystem_default_writev
    4850};
    4951
  • cpukit/libfs/src/jffs2/src/fs-rtems.c

    r95a57280 r2f68778  
    517517        .fsync_h = rtems_filesystem_default_fsync_or_fdatasync,
    518518        .fdatasync_h = rtems_filesystem_default_fsync_or_fdatasync,
    519         .fcntl_h = rtems_filesystem_default_fcntl
     519        .fcntl_h = rtems_filesystem_default_fcntl,
     520        .readv_h = rtems_filesystem_default_readv,
     521        .writev_h = rtems_filesystem_default_writev
    520522};
    521523
     
    655657        .fsync_h = rtems_filesystem_default_fsync_or_fdatasync,
    656658        .fdatasync_h = rtems_filesystem_default_fsync_or_fdatasync,
    657         .fcntl_h = rtems_filesystem_default_fcntl
     659        .fcntl_h = rtems_filesystem_default_fcntl,
     660        .readv_h = rtems_filesystem_default_readv,
     661        .writev_h = rtems_filesystem_default_writev
    658662};
    659663
     
    669673        .fsync_h = rtems_filesystem_default_fsync_or_fdatasync,
    670674        .fdatasync_h = rtems_filesystem_default_fsync_or_fdatasync,
    671         .fcntl_h = rtems_filesystem_default_fcntl
     675        .fcntl_h = rtems_filesystem_default_fcntl,
     676        .readv_h = rtems_filesystem_default_readv,
     677        .writev_h = rtems_filesystem_default_writev
    672678};
    673679
  • cpukit/libfs/src/nfsclient/src/nfs.c

    r95a57280 r2f68778  
    28702870        .fsync_h     = rtems_filesystem_default_fsync_or_fdatasync,
    28712871        .fdatasync_h = rtems_filesystem_default_fsync_or_fdatasync,
    2872         .fcntl_h     = rtems_filesystem_default_fcntl
     2872        .fcntl_h     = rtems_filesystem_default_fcntl,
     2873        .readv_h     = rtems_filesystem_default_readv,
     2874        .writev_h    = rtems_filesystem_default_writev
    28732875};
    28742876
     
    28862888        .fsync_h     = rtems_filesystem_default_fsync_or_fdatasync,
    28872889        .fdatasync_h = rtems_filesystem_default_fsync_or_fdatasync,
    2888         .fcntl_h     = rtems_filesystem_default_fcntl
     2890        .fcntl_h     = rtems_filesystem_default_fcntl,
     2891        .readv_h     = rtems_filesystem_default_readv,
     2892        .writev_h    = rtems_filesystem_default_writev
    28892893};
    28902894
     
    29022906        .fsync_h     = rtems_filesystem_default_fsync_or_fdatasync,
    29032907        .fdatasync_h = rtems_filesystem_default_fsync_or_fdatasync,
    2904         .fcntl_h     = rtems_filesystem_default_fcntl
     2908        .fcntl_h     = rtems_filesystem_default_fcntl,
     2909        .readv_h     = rtems_filesystem_default_readv,
     2910        .writev_h    = rtems_filesystem_default_writev
    29052911};
    29062912
  • cpukit/libfs/src/rfs/rtems-rfs-rtems-dev.c

    r95a57280 r2f68778  
    194194  .fsync_h     = rtems_filesystem_default_fsync_or_fdatasync,
    195195  .fdatasync_h = rtems_filesystem_default_fsync_or_fdatasync,
    196   .fcntl_h     = rtems_filesystem_default_fcntl
     196  .fcntl_h     = rtems_filesystem_default_fcntl,
     197  .readv_h     = rtems_filesystem_default_readv,
     198  .writev_h    = rtems_filesystem_default_writev
    197199};
  • cpukit/libfs/src/rfs/rtems-rfs-rtems-dir.c

    r95a57280 r2f68778  
    163163  .fsync_h     = rtems_filesystem_default_fsync_or_fdatasync,
    164164  .fdatasync_h = rtems_rfs_rtems_fdatasync,
    165   .fcntl_h     = rtems_filesystem_default_fcntl
     165  .fcntl_h     = rtems_filesystem_default_fcntl,
     166  .readv_h     = rtems_filesystem_default_readv,
     167  .writev_h    = rtems_filesystem_default_writev
    166168};
  • cpukit/libfs/src/rfs/rtems-rfs-rtems-file.c

    r95a57280 r2f68778  
    354354  .fsync_h     = rtems_rfs_rtems_fdatasync,
    355355  .fdatasync_h = rtems_rfs_rtems_fdatasync,
    356   .fcntl_h     = rtems_filesystem_default_fcntl
     356  .fcntl_h     = rtems_filesystem_default_fcntl,
     357  .readv_h     = rtems_filesystem_default_readv,
     358  .writev_h    = rtems_filesystem_default_writev
    357359};
  • cpukit/libfs/src/rfs/rtems-rfs-rtems.c

    r95a57280 r2f68778  
    781781  .fsync_h     = rtems_filesystem_default_fsync_or_fdatasync,
    782782  .fdatasync_h = rtems_filesystem_default_fsync_or_fdatasync,
    783   .fcntl_h     = rtems_filesystem_default_fcntl
     783  .fcntl_h     = rtems_filesystem_default_fcntl,
     784  .readv_h     = rtems_filesystem_default_readv,
     785  .writev_h    = rtems_filesystem_default_writev
    784786};
    785787
  • cpukit/libnetworking/lib/ftpfs.c

    r95a57280 r2f68778  
    14131413  .fsync_h = rtems_filesystem_default_fsync_or_fdatasync,
    14141414  .fdatasync_h = rtems_filesystem_default_fsync_or_fdatasync,
    1415   .fcntl_h = rtems_filesystem_default_fcntl
     1415  .fcntl_h = rtems_filesystem_default_fcntl,
     1416  .readv_h = rtems_filesystem_default_readv,
     1417  .writev_h = rtems_filesystem_default_writev
    14161418};
    14171419
     
    14271429  .fsync_h = rtems_filesystem_default_fsync_or_fdatasync,
    14281430  .fdatasync_h = rtems_filesystem_default_fsync_or_fdatasync,
    1429   .fcntl_h = rtems_filesystem_default_fcntl
     1431  .fcntl_h = rtems_filesystem_default_fcntl,
     1432  .readv_h = rtems_filesystem_default_readv,
     1433  .writev_h = rtems_filesystem_default_writev
    14301434};
  • cpukit/libnetworking/lib/tftpDriver.c

    r95a57280 r2f68778  
    10521052   .fsync_h = rtems_filesystem_default_fsync_or_fdatasync,
    10531053   .fdatasync_h = rtems_filesystem_default_fsync_or_fdatasync,
    1054    .fcntl_h = rtems_filesystem_default_fcntl
     1054   .fcntl_h = rtems_filesystem_default_fcntl,
     1055   .readv_h = rtems_filesystem_default_readv,
     1056   .writev_h = rtems_filesystem_default_writev
    10551057};
  • cpukit/libnetworking/rtems/rtems_syscall.c

    r95a57280 r2f68778  
    813813
    814814static const rtems_filesystem_file_handlers_r socket_handlers = {
    815         rtems_filesystem_default_open,          /* open */
    816         rtems_bsdnet_close,                     /* close */
    817         rtems_bsdnet_read,                      /* read */
    818         rtems_bsdnet_write,                     /* write */
    819         rtems_bsdnet_ioctl,                     /* ioctl */
    820         rtems_filesystem_default_lseek,         /* lseek */
    821         rtems_bsdnet_fstat,                     /* fstat */
    822         rtems_filesystem_default_ftruncate,     /* ftruncate */
    823         rtems_filesystem_default_fsync_or_fdatasync,    /* fsync */
    824         rtems_filesystem_default_fsync_or_fdatasync,    /* fdatasync */
    825         rtems_bsdnet_fcntl                      /* fcntl */
     815        .open_h = rtems_filesystem_default_open,
     816        .close_h = rtems_bsdnet_close,
     817        .read_h = rtems_bsdnet_read,
     818        .write_h = rtems_bsdnet_write,
     819        .ioctl_h = rtems_bsdnet_ioctl,
     820        .lseek_h = rtems_filesystem_default_lseek,
     821        .fstat_h = rtems_bsdnet_fstat,
     822        .ftruncate_h = rtems_filesystem_default_ftruncate,
     823        .fstat_h = rtems_filesystem_default_fsync_or_fdatasync,
     824        .fdatasync_h = rtems_filesystem_default_fsync_or_fdatasync,
     825        .fcntl_h = rtems_bsdnet_fcntl,
     826        .readv_h = rtems_filesystem_default_readv,
     827        .writev_h = rtems_filesystem_default_writev
    826828};
  • testsuites/fstests/fsimfsgeneric01/init.c

    r95a57280 r2f68778  
    2121#include <sys/stat.h>
    2222#include <sys/ioctl.h>
     23#include <sys/uio.h>
    2324#include <fcntl.h>
    2425#include <unistd.h>
     
    4243  TEST_FDATASYNC,
    4344  TEST_FCNTL,
     45  TEST_READV,
     46  TEST_WRITEV,
    4447  TEST_CLOSED,
    4548  TEST_FSTAT_UNLINK,
     
    6972  test_state *state = IMFS_generic_get_context_by_iop(iop);
    7073
    71   rtems_test_assert(*state == TEST_FCNTL);
     74  rtems_test_assert(*state == TEST_WRITEV);
    7275  *state = TEST_CLOSED;
    7376
     
    203206}
    204207
     208static ssize_t handler_readv(
     209  rtems_libio_t *iop,
     210  const struct iovec *iov,
     211  int iovcnt,
     212  ssize_t total
     213)
     214{
     215  test_state *state = IMFS_generic_get_context_by_iop(iop);
     216
     217  rtems_test_assert(*state == TEST_FCNTL);
     218  *state = TEST_READV;
     219
     220  return 0;
     221}
     222
     223static ssize_t handler_writev(
     224  rtems_libio_t *iop,
     225  const struct iovec *iov,
     226  int iovcnt,
     227  ssize_t total
     228)
     229{
     230  test_state *state = IMFS_generic_get_context_by_iop(iop);
     231
     232  rtems_test_assert(*state == TEST_READV);
     233  *state = TEST_WRITEV;
     234
     235  return 0;
     236}
     237
    205238static const rtems_filesystem_file_handlers_r node_handlers = {
    206239  .open_h = handler_open,
     
    214247  .fsync_h = handler_fsync,
    215248  .fdatasync_h = handler_fdatasync,
    216   .fcntl_h = handler_fcntl
     249  .fcntl_h = handler_fcntl,
     250  .readv_h = handler_readv,
     251  .writev_h = handler_writev
    217252};
    218253
     
    270305  ssize_t n = 0;
    271306  off_t off = 0;
     307  struct iovec iov = {
     308    .iov_base = &buf [0],
     309    .iov_len = (int) sizeof(buf)
     310  };
    272311
    273312  rv = IMFS_make_generic_node(
     
    305344  rv = fcntl(fd, F_GETFD);
    306345  rtems_test_assert(rv >= 0);
     346
     347  rv = readv(fd, &iov, 1);
     348  rtems_test_assert(rv == 0);
     349
     350  rv = writev(fd, &iov, 1);
     351  rtems_test_assert(rv == 0);
    307352
    308353  rv = close(fd);
Note: See TracChangeset for help on using the changeset viewer.