From 2f68778f08471fb7f13a8634ebb48c6db13c0f69 Mon Sep 17 00:00:00 2001 From: Sebastian Huber Date: Mon, 16 Dec 2013 13:44:13 +0100 Subject: 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. --- cpukit/libfs/src/imfs/imfs_handlers_device.c | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) (limited to 'cpukit/libfs/src/imfs/imfs_handlers_device.c') diff --git a/cpukit/libfs/src/imfs/imfs_handlers_device.c b/cpukit/libfs/src/imfs/imfs_handlers_device.c index 899b3dcf63..451e20161d 100644 --- a/cpukit/libfs/src/imfs/imfs_handlers_device.c +++ b/cpukit/libfs/src/imfs/imfs_handlers_device.c @@ -34,17 +34,19 @@ static int IMFS_stat_device( } static const rtems_filesystem_file_handlers_r IMFS_device_handlers = { - device_open, - device_close, - device_read, - device_write, - device_ioctl, - rtems_filesystem_default_lseek_file, - IMFS_stat_device, - device_ftruncate, - rtems_filesystem_default_fsync_or_fdatasync, - rtems_filesystem_default_fsync_or_fdatasync, - rtems_filesystem_default_fcntl + .open_h = device_open, + .close_h = device_close, + .read_h = device_read, + .write_h = device_write, + .ioctl_h = device_ioctl, + .lseek_h = rtems_filesystem_default_lseek_file, + .fstat_h = IMFS_stat_device, + .ftruncate_h = device_ftruncate, + .fsync_h = rtems_filesystem_default_fsync_or_fdatasync, + .fdatasync_h = rtems_filesystem_default_fsync_or_fdatasync, + .fcntl_h = rtems_filesystem_default_fcntl, + .readv_h = rtems_filesystem_default_readv, + .writev_h = rtems_filesystem_default_writev }; static IMFS_jnode_t *IMFS_node_initialize_device( -- cgit v1.2.3