diff options
32 files changed, 99 insertions, 98 deletions
diff --git a/cpukit/ChangeLog b/cpukit/ChangeLog index aefeb447ff..7ffbc1ec2a 100644 --- a/cpukit/ChangeLog +++ b/cpukit/ChangeLog @@ -1,5 +1,26 @@ 2010-07-16 Sebastian Huber <sebastian.huber@embedded-brains.de> + * libcsupport/include/rtems/libio.h: Removed file_info and handlers + fields in rtems_libio_t. + * libcsupport/src/close.c, libcsupport/src/fcntl.c, + libcsupport/src/fdatasync.c, libcsupport/src/fstat.c, + libcsupport/src/fsync.c, libcsupport/src/ftruncate.c, + libcsupport/src/getdents.c, libcsupport/src/ioctl.c, + libcsupport/src/libio_sockets.c, libcsupport/src/lseek.c, + libcsupport/src/open.c, libcsupport/src/read.c, + libcsupport/src/readv.c, libcsupport/src/write.c, + libcsupport/src/writev.c, libfs/src/devfs/devclose.c, + libfs/src/devfs/devioctl.c, libfs/src/devfs/devopen.c, + libfs/src/devfs/devread.c, libfs/src/devfs/devwrite.c + libfs/src/dosfs/msdos_dir.c libfs/src/dosfs/msdos_file.c + libfs/src/imfs/deviceio.c libfs/src/imfs/imfs_directory.c + libfs/src/imfs/imfs_fifo.c libfs/src/imfs/memfile.c + libfs/src/nfsclient/src/nfs.c libfs/src/rfs/rtems-rfs-rtems-file.c + libfs/src/rfs/rtems-rfs-rtems.h libnetworking/lib/ftpfs.c: Reflect + changes above. + +2010-07-16 Sebastian Huber <sebastian.huber@embedded-brains.de> + * libfs/src/devfs/devfs.h, libfs/src/devfs/devfs_node_type.c: Fixed devFS_node_type() prototype. diff --git a/cpukit/libcsupport/include/rtems/libio.h b/cpukit/libcsupport/include/rtems/libio.h index 536e4513d7..1068074682 100644 --- a/cpukit/libcsupport/include/rtems/libio.h +++ b/cpukit/libcsupport/include/rtems/libio.h @@ -1119,8 +1119,6 @@ struct rtems_libio_tt { rtems_id sem; uint32_t data0; /* private to "driver" */ void *data1; /* ... */ - void *file_info; /* used by file handlers */ - const rtems_filesystem_file_handlers_r *handlers; /* type specific handlers */ }; /** diff --git a/cpukit/libcsupport/src/close.c b/cpukit/libcsupport/src/close.c index d14c4e18f5..726bca11d9 100644 --- a/cpukit/libcsupport/src/close.c +++ b/cpukit/libcsupport/src/close.c @@ -29,7 +29,7 @@ int close( rtems_libio_check_is_open(iop); rc = RTEMS_SUCCESSFUL; - rc = (*iop->handlers->close_h)( iop ); + rc = (*iop->pathinfo.handlers->close_h)( iop ); rtems_filesystem_freenode( &iop->pathinfo ); rtems_libio_free( iop ); diff --git a/cpukit/libcsupport/src/fcntl.c b/cpukit/libcsupport/src/fcntl.c index ad4fef7bbe..988a9414ee 100644 --- a/cpukit/libcsupport/src/fcntl.c +++ b/cpukit/libcsupport/src/fcntl.c @@ -62,8 +62,6 @@ static int vfcntl( } } - diop->handlers = iop->handlers; - diop->file_info = iop->file_info; diop->flags = iop->flags; diop->pathinfo = iop->pathinfo; ret = (int) (diop - rtems_libio_iops); @@ -140,7 +138,7 @@ static int vfcntl( */ if (ret >= 0) { - int err = (*iop->handlers->fcntl_h)( cmd, iop ); + int err = (*iop->pathinfo.handlers->fcntl_h)( cmd, iop ); if (err) { errno = err; ret = -1; diff --git a/cpukit/libcsupport/src/fdatasync.c b/cpukit/libcsupport/src/fdatasync.c index 504f7a9de4..de226af5c1 100644 --- a/cpukit/libcsupport/src/fdatasync.c +++ b/cpukit/libcsupport/src/fdatasync.c @@ -35,5 +35,5 @@ int fdatasync( * Now process the fdatasync(). */ - return (*iop->handlers->fdatasync_h)( iop ); + return (*iop->pathinfo.handlers->fdatasync_h)( iop ); } diff --git a/cpukit/libcsupport/src/fstat.c b/cpukit/libcsupport/src/fstat.c index 45eb450947..8ec12e0637 100644 --- a/cpukit/libcsupport/src/fstat.c +++ b/cpukit/libcsupport/src/fstat.c @@ -50,7 +50,7 @@ int fstat( */ memset( sbuf, 0, sizeof(struct stat) ); - return (*iop->handlers->fstat_h)( &iop->pathinfo, sbuf ); + return (*iop->pathinfo.handlers->fstat_h)( &iop->pathinfo, sbuf ); } /* diff --git a/cpukit/libcsupport/src/fsync.c b/cpukit/libcsupport/src/fsync.c index d8ecb88f3b..4d2fe2ae12 100644 --- a/cpukit/libcsupport/src/fsync.c +++ b/cpukit/libcsupport/src/fsync.c @@ -35,5 +35,5 @@ int fsync( * Now process the fsync(). */ - return (*iop->handlers->fsync_h)( iop ); + return (*iop->pathinfo.handlers->fsync_h)( iop ); } diff --git a/cpukit/libcsupport/src/ftruncate.c b/cpukit/libcsupport/src/ftruncate.c index e23db2c724..64946d7bb6 100644 --- a/cpukit/libcsupport/src/ftruncate.c +++ b/cpukit/libcsupport/src/ftruncate.c @@ -47,5 +47,5 @@ int ftruncate( rtems_libio_check_permissions( iop, LIBIO_FLAGS_WRITE ); - return (*iop->handlers->ftruncate_h)( iop, length ); + return (*iop->pathinfo.handlers->ftruncate_h)( iop, length ); } diff --git a/cpukit/libcsupport/src/getdents.c b/cpukit/libcsupport/src/getdents.c index 6b5dbfe76c..d0b787cd88 100644 --- a/cpukit/libcsupport/src/getdents.c +++ b/cpukit/libcsupport/src/getdents.c @@ -51,5 +51,5 @@ int getdents( * Return the number of bytes that were actually transfered as a result * of the read attempt. */ - return (*iop->handlers->read_h)( iop, dd_buf, dd_len ); + return (*iop->pathinfo.handlers->read_h)( iop, dd_buf, dd_len ); } diff --git a/cpukit/libcsupport/src/ioctl.c b/cpukit/libcsupport/src/ioctl.c index 95cdaf8881..a2328e22f8 100644 --- a/cpukit/libcsupport/src/ioctl.c +++ b/cpukit/libcsupport/src/ioctl.c @@ -47,7 +47,7 @@ int ioctl( /* * Now process the ioctl(). */ - rc = (*iop->handlers->ioctl_h)( iop, command, buffer ); + rc = (*iop->pathinfo.handlers->ioctl_h)( iop, command, buffer ); return rc; } diff --git a/cpukit/libcsupport/src/libio_sockets.c b/cpukit/libcsupport/src/libio_sockets.c index eec74aaa63..c67e19d78c 100644 --- a/cpukit/libcsupport/src/libio_sockets.c +++ b/cpukit/libcsupport/src/libio_sockets.c @@ -16,10 +16,7 @@ #include "config.h" #endif -#include <rtems/libio_.h> /* libio_.h pulls in rtems */ -#include <rtems.h> - -#include <errno.h> +#include <rtems/libio_.h> #include <rtems/seterr.h> /* @@ -70,8 +67,7 @@ int rtems_bsdnet_makeFdForSocket( iop->flags |= LIBIO_FLAGS_WRITE | LIBIO_FLAGS_READ; iop->data0 = fd; iop->data1 = so; - iop->handlers = h; - iop->pathinfo.handlers = rtems_filesystem_root.handlers; - iop->pathinfo.ops = rtems_filesystem_root.ops; + iop->pathinfo.handlers = h; + iop->pathinfo.ops = &rtems_filesystem_operations_default; return fd; } diff --git a/cpukit/libcsupport/src/lseek.c b/cpukit/libcsupport/src/lseek.c index 840ec3c9d4..3f37029807 100644 --- a/cpukit/libcsupport/src/lseek.c +++ b/cpukit/libcsupport/src/lseek.c @@ -61,7 +61,7 @@ off_t lseek( * new offset. */ - status = (*iop->handlers->lseek_h)( iop, offset, whence ); + status = (*iop->pathinfo.handlers->lseek_h)( iop, offset, whence ); if ( status == (off_t) -1 ) iop->offset = old_offset; diff --git a/cpukit/libcsupport/src/open.c b/cpukit/libcsupport/src/open.c index 58db254a39..d8fe7aba49 100644 --- a/cpukit/libcsupport/src/open.c +++ b/cpukit/libcsupport/src/open.c @@ -154,12 +154,10 @@ int open( * Fill in the file control block based on the loc structure * returned by successful path evaluation. */ - iop->handlers = loc.handlers; - iop->file_info = loc.node_access; iop->flags |= rtems_libio_fcntl_flags( flags ); iop->pathinfo = loc; - rc = (*iop->handlers->open_h)( iop, pathname, flags, mode ); + rc = (*iop->pathinfo.handlers->open_h)( iop, pathname, flags, mode ); if ( rc ) { rc = errno; goto done; diff --git a/cpukit/libcsupport/src/read.c b/cpukit/libcsupport/src/read.c index 77ba4b1314..d3398ebee6 100644 --- a/cpukit/libcsupport/src/read.c +++ b/cpukit/libcsupport/src/read.c @@ -40,7 +40,7 @@ ssize_t read( /* * Now process the read(). */ - rc = (*iop->handlers->read_h)( iop, buffer, count ); + rc = (*iop->pathinfo.handlers->read_h)( iop, buffer, count ); if ( rc > 0 ) iop->offset += rc; diff --git a/cpukit/libcsupport/src/readv.c b/cpukit/libcsupport/src/readv.c index 184bc1f41b..3f97b14f14 100644 --- a/cpukit/libcsupport/src/readv.c +++ b/cpukit/libcsupport/src/readv.c @@ -97,7 +97,11 @@ ssize_t readv( * Now process the readv(). */ for ( total=0, v=0 ; v < iovcnt ; v++ ) { - bytes = (*iop->handlers->read_h)( iop, iov[v].iov_base, iov[v].iov_len ); + bytes = (*iop->pathinfo.handlers->read_h)( + iop, + iov[v].iov_base, + iov[v].iov_len + ); if ( bytes < 0 ) return -1; diff --git a/cpukit/libcsupport/src/write.c b/cpukit/libcsupport/src/write.c index 1a792f708d..fafb96a7a3 100644 --- a/cpukit/libcsupport/src/write.c +++ b/cpukit/libcsupport/src/write.c @@ -47,7 +47,7 @@ ssize_t write( /* * Now process the write() request. */ - rc = (*iop->handlers->write_h)( iop, buffer, count ); + rc = (*iop->pathinfo.handlers->write_h)( iop, buffer, count ); if ( rc > 0 ) iop->offset += rc; diff --git a/cpukit/libcsupport/src/writev.c b/cpukit/libcsupport/src/writev.c index 151258e3a4..8dabe1d598 100644 --- a/cpukit/libcsupport/src/writev.c +++ b/cpukit/libcsupport/src/writev.c @@ -104,7 +104,11 @@ ssize_t writev( if ( iov[v].iov_len == 0 ) continue; - bytes = (*iop->handlers->write_h)( iop, iov[v].iov_base, iov[v].iov_len ); + bytes = (*iop->pathinfo.handlers->write_h)( + iop, + iov[v].iov_base, + iov[v].iov_len + ); if ( bytes < 0 ) return -1; diff --git a/cpukit/libfs/src/devfs/devclose.c b/cpukit/libfs/src/devfs/devclose.c index eaaf164c84..773cade5c6 100644 --- a/cpukit/libfs/src/devfs/devclose.c +++ b/cpukit/libfs/src/devfs/devclose.c @@ -23,7 +23,7 @@ int devFS_close( rtems_status_code status; rtems_device_name_t *np; - np = (rtems_device_name_t *)iop->file_info; + np = (rtems_device_name_t *)iop->pathinfo.node_access; args.iop = iop; args.flags = 0; diff --git a/cpukit/libfs/src/devfs/devioctl.c b/cpukit/libfs/src/devfs/devioctl.c index 59a5c907e9..15965b8c0e 100644 --- a/cpukit/libfs/src/devfs/devioctl.c +++ b/cpukit/libfs/src/devfs/devioctl.c @@ -25,7 +25,7 @@ int devFS_ioctl( rtems_status_code status; rtems_device_name_t *np; - np = (rtems_device_name_t *)iop->file_info; + np = (rtems_device_name_t *)iop->pathinfo.node_access; args.iop = iop; args.command = command; diff --git a/cpukit/libfs/src/devfs/devopen.c b/cpukit/libfs/src/devfs/devopen.c index f06aa8939b..67be3678e1 100644 --- a/cpukit/libfs/src/devfs/devopen.c +++ b/cpukit/libfs/src/devfs/devopen.c @@ -26,7 +26,7 @@ int devFS_open( rtems_status_code status; rtems_device_name_t *np; - np = (rtems_device_name_t *)iop->file_info; + np = (rtems_device_name_t *)iop->pathinfo.node_access; args.iop = iop; args.flags = iop->flags; diff --git a/cpukit/libfs/src/devfs/devread.c b/cpukit/libfs/src/devfs/devread.c index 90c8203cb5..10f74e81c9 100644 --- a/cpukit/libfs/src/devfs/devread.c +++ b/cpukit/libfs/src/devfs/devread.c @@ -25,7 +25,7 @@ ssize_t devFS_read( rtems_status_code status; rtems_device_name_t *np; - np = (rtems_device_name_t *)iop->file_info; + np = (rtems_device_name_t *)iop->pathinfo.node_access; args.iop = iop; args.offset = iop->offset; diff --git a/cpukit/libfs/src/devfs/devwrite.c b/cpukit/libfs/src/devfs/devwrite.c index 400422fd64..5389c69bc5 100644 --- a/cpukit/libfs/src/devfs/devwrite.c +++ b/cpukit/libfs/src/devfs/devwrite.c @@ -25,7 +25,7 @@ ssize_t devFS_write( rtems_status_code status; rtems_device_name_t *np; - np = (rtems_device_name_t *)iop->file_info; + np = (rtems_device_name_t *)iop->pathinfo.node_access; args.iop = iop; args.offset = iop->offset; diff --git a/cpukit/libfs/src/dosfs/msdos_dir.c b/cpukit/libfs/src/dosfs/msdos_dir.c index c1bd0c2735..7e6bcf3db6 100644 --- a/cpukit/libfs/src/dosfs/msdos_dir.c +++ b/cpukit/libfs/src/dosfs/msdos_dir.c @@ -51,7 +51,7 @@ msdos_dir_open(rtems_libio_t *iop, const char *pathname, uint32_t flag, int rc = RC_OK; rtems_status_code sc = RTEMS_SUCCESSFUL; msdos_fs_info_t *fs_info = iop->pathinfo.mt_entry->fs_info; - fat_file_fd_t *fat_fd = iop->file_info; + fat_file_fd_t *fat_fd = iop->pathinfo.node_access; sc = rtems_semaphore_obtain(fs_info->vol_sema, RTEMS_WAIT, MSDOS_VOLUME_SEMAPHORE_TIMEOUT); @@ -86,7 +86,7 @@ msdos_dir_close(rtems_libio_t *iop) int rc = RC_OK; rtems_status_code sc = RTEMS_SUCCESSFUL; msdos_fs_info_t *fs_info = iop->pathinfo.mt_entry->fs_info; - fat_file_fd_t *fat_fd = iop->file_info; + fat_file_fd_t *fat_fd = iop->pathinfo.node_access; sc = rtems_semaphore_obtain(fs_info->vol_sema, RTEMS_WAIT, MSDOS_VOLUME_SEMAPHORE_TIMEOUT); @@ -201,7 +201,7 @@ msdos_dir_read(rtems_libio_t *iop, void *buffer, size_t count) int rc = RC_OK; rtems_status_code sc = RTEMS_SUCCESSFUL; msdos_fs_info_t *fs_info = iop->pathinfo.mt_entry->fs_info; - fat_file_fd_t *fat_fd = iop->file_info; + fat_file_fd_t *fat_fd = iop->pathinfo.node_access; fat_file_fd_t *tmp_fat_fd = NULL; struct dirent tmp_dirent; uint32_t start = 0; @@ -591,7 +591,7 @@ msdos_dir_sync(rtems_libio_t *iop) { int rc = RC_OK; rtems_status_code sc = RTEMS_SUCCESSFUL; - fat_file_fd_t *fat_fd = iop->file_info; + fat_file_fd_t *fat_fd = iop->pathinfo.node_access; msdos_fs_info_t *fs_info = iop->pathinfo.mt_entry->fs_info; sc = rtems_semaphore_obtain(fs_info->vol_sema, RTEMS_WAIT, diff --git a/cpukit/libfs/src/dosfs/msdos_file.c b/cpukit/libfs/src/dosfs/msdos_file.c index d56e1231ec..0b05296df9 100644 --- a/cpukit/libfs/src/dosfs/msdos_file.c +++ b/cpukit/libfs/src/dosfs/msdos_file.c @@ -47,7 +47,7 @@ msdos_file_open(rtems_libio_t *iop, const char *pathname, uint32_t flag, int rc = RC_OK; rtems_status_code sc = RTEMS_SUCCESSFUL; msdos_fs_info_t *fs_info = iop->pathinfo.mt_entry->fs_info; - fat_file_fd_t *fat_fd = iop->file_info; + fat_file_fd_t *fat_fd = iop->pathinfo.node_access; sc = rtems_semaphore_obtain(fs_info->vol_sema, RTEMS_WAIT, MSDOS_VOLUME_SEMAPHORE_TIMEOUT); @@ -88,7 +88,7 @@ msdos_file_close(rtems_libio_t *iop) int rc = RC_OK; rtems_status_code sc = RTEMS_SUCCESSFUL; msdos_fs_info_t *fs_info = iop->pathinfo.mt_entry->fs_info; - fat_file_fd_t *fat_fd = iop->file_info; + fat_file_fd_t *fat_fd = iop->pathinfo.node_access; sc = rtems_semaphore_obtain(fs_info->vol_sema, RTEMS_WAIT, MSDOS_VOLUME_SEMAPHORE_TIMEOUT); @@ -148,7 +148,7 @@ msdos_file_read(rtems_libio_t *iop, void *buffer, size_t count) ssize_t ret = 0; rtems_status_code sc = RTEMS_SUCCESSFUL; msdos_fs_info_t *fs_info = iop->pathinfo.mt_entry->fs_info; - fat_file_fd_t *fat_fd = iop->file_info; + fat_file_fd_t *fat_fd = iop->pathinfo.node_access; sc = rtems_semaphore_obtain(fs_info->vol_sema, RTEMS_WAIT, MSDOS_VOLUME_SEMAPHORE_TIMEOUT); @@ -181,7 +181,7 @@ msdos_file_write(rtems_libio_t *iop,const void *buffer, size_t count) ssize_t ret = 0; rtems_status_code sc = RTEMS_SUCCESSFUL; msdos_fs_info_t *fs_info = iop->pathinfo.mt_entry->fs_info; - fat_file_fd_t *fat_fd = iop->file_info; + fat_file_fd_t *fat_fd = iop->pathinfo.node_access; sc = rtems_semaphore_obtain(fs_info->vol_sema, RTEMS_WAIT, MSDOS_VOLUME_SEMAPHORE_TIMEOUT); @@ -228,7 +228,7 @@ msdos_file_lseek(rtems_libio_t *iop, rtems_off64_t offset, int whence) int rc = RC_OK; rtems_status_code sc = RTEMS_SUCCESSFUL; msdos_fs_info_t *fs_info = iop->pathinfo.mt_entry->fs_info; - fat_file_fd_t *fat_fd = iop->file_info; + fat_file_fd_t *fat_fd = iop->pathinfo.node_access; uint32_t real_size = 0; sc = rtems_semaphore_obtain(fs_info->vol_sema, RTEMS_WAIT, @@ -306,7 +306,7 @@ msdos_file_ftruncate(rtems_libio_t *iop, rtems_off64_t length) int rc = RC_OK; rtems_status_code sc = RTEMS_SUCCESSFUL; msdos_fs_info_t *fs_info = iop->pathinfo.mt_entry->fs_info; - fat_file_fd_t *fat_fd = iop->file_info; + fat_file_fd_t *fat_fd = iop->pathinfo.node_access; if (length >= fat_fd->fat_file_size) return RC_OK; @@ -349,7 +349,7 @@ msdos_file_sync(rtems_libio_t *iop) { int rc = RC_OK; rtems_status_code sc = RTEMS_SUCCESSFUL; - fat_file_fd_t *fat_fd = iop->file_info; + fat_file_fd_t *fat_fd = iop->pathinfo.node_access; msdos_fs_info_t *fs_info = iop->pathinfo.mt_entry->fs_info; sc = rtems_semaphore_obtain(fs_info->vol_sema, RTEMS_WAIT, @@ -409,7 +409,7 @@ msdos_file_datasync(rtems_libio_t *iop) { int rc = RC_OK; rtems_status_code sc = RTEMS_SUCCESSFUL; - fat_file_fd_t *fat_fd = iop->file_info; + fat_file_fd_t *fat_fd = iop->pathinfo.node_access; msdos_fs_info_t *fs_info = iop->pathinfo.mt_entry->fs_info; sc = rtems_semaphore_obtain(fs_info->vol_sema, RTEMS_WAIT, diff --git a/cpukit/libfs/src/imfs/deviceio.c b/cpukit/libfs/src/imfs/deviceio.c index 289df648db..ff6cf2a01e 100644 --- a/cpukit/libfs/src/imfs/deviceio.c +++ b/cpukit/libfs/src/imfs/deviceio.c @@ -41,7 +41,7 @@ int device_open( rtems_status_code status; IMFS_jnode_t *the_jnode; - the_jnode = iop->file_info; + the_jnode = iop->pathinfo.node_access; args.iop = iop; args.flags = iop->flags; @@ -70,7 +70,7 @@ int device_close( rtems_status_code status; IMFS_jnode_t *the_jnode; - the_jnode = iop->file_info; + the_jnode = iop->pathinfo.node_access; args.iop = iop; args.flags = 0; @@ -103,7 +103,7 @@ ssize_t device_read( rtems_status_code status; IMFS_jnode_t *the_jnode; - the_jnode = iop->file_info; + the_jnode = iop->pathinfo.node_access; args.iop = iop; args.offset = iop->offset; @@ -140,7 +140,7 @@ ssize_t device_write( rtems_status_code status; IMFS_jnode_t *the_jnode; - the_jnode = iop->file_info; + the_jnode = iop->pathinfo.node_access; args.iop = iop; args.offset = iop->offset; @@ -181,7 +181,7 @@ int device_ioctl( args.command = command; args.buffer = buffer; - the_jnode = iop->file_info; + the_jnode = iop->pathinfo.node_access; status = rtems_io_control( the_jnode->info.device.major, diff --git a/cpukit/libfs/src/imfs/imfs_directory.c b/cpukit/libfs/src/imfs/imfs_directory.c index c7612455e2..6381c7b18a 100644 --- a/cpukit/libfs/src/imfs/imfs_directory.c +++ b/cpukit/libfs/src/imfs/imfs_directory.c @@ -47,7 +47,7 @@ int imfs_dir_open( IMFS_jnode_t *the_jnode; /* Is the node a directory ? */ - the_jnode = (IMFS_jnode_t *) iop->file_info; + the_jnode = (IMFS_jnode_t *) iop->pathinfo.node_access; if ( the_jnode->type != IMFS_DIRECTORY ) return -1; /* It wasn't a directory --> return error */ @@ -90,7 +90,7 @@ ssize_t imfs_dir_read( int last_entry; struct dirent tmp_dirent; - the_jnode = (IMFS_jnode_t *)iop->file_info; + the_jnode = (IMFS_jnode_t *)iop->pathinfo.node_access; the_chain = &the_jnode->info.directory.Entries; if ( rtems_chain_is_empty( the_chain ) ) diff --git a/cpukit/libfs/src/imfs/imfs_fifo.c b/cpukit/libfs/src/imfs/imfs_fifo.c index 1c9d032c79..4090c16c0d 100644 --- a/cpukit/libfs/src/imfs/imfs_fifo.c +++ b/cpukit/libfs/src/imfs/imfs_fifo.c @@ -22,7 +22,7 @@ #define JNODE2PIPE(_jnode) ( (_jnode)->info.fifo.pipe ) -#define LIBIO2PIPE(_iop) ( JNODE2PIPE((IMFS_jnode_t *)(_iop)->file_info) ) +#define LIBIO2PIPE(_iop) ( JNODE2PIPE((IMFS_jnode_t *)(_iop)->pathinfo.node_access) ) /* Set errno and return -1 if error, else return _err */ #define IMFS_FIFO_RETURN(_err) \ @@ -39,7 +39,7 @@ int IMFS_fifo_open( uint32_t mode ) { - IMFS_jnode_t *jnode = iop->file_info; + IMFS_jnode_t *jnode = iop->pathinfo.node_access; int err = fifo_open(&JNODE2PIPE(jnode), iop); IMFS_FIFO_RETURN(err); @@ -49,7 +49,7 @@ int IMFS_fifo_close( rtems_libio_t *iop ) { - IMFS_jnode_t *jnode = iop->file_info; + IMFS_jnode_t *jnode = iop->pathinfo.node_access; int err = pipe_release(&JNODE2PIPE(jnode), iop); @@ -67,7 +67,7 @@ ssize_t IMFS_fifo_read( size_t count ) { - IMFS_jnode_t *jnode = iop->file_info; + IMFS_jnode_t *jnode = iop->pathinfo.node_access; int err = pipe_read(JNODE2PIPE(jnode), buffer, count, iop); if (err > 0) @@ -82,7 +82,7 @@ ssize_t IMFS_fifo_write( size_t count ) { - IMFS_jnode_t *jnode = iop->file_info; + IMFS_jnode_t *jnode = iop->pathinfo.node_access; int err = pipe_write(JNODE2PIPE(jnode), buffer, count, iop); if (err > 0) { diff --git a/cpukit/libfs/src/imfs/memfile.c b/cpukit/libfs/src/imfs/memfile.c index 2d91e217e3..c7ff2b1157 100644 --- a/cpukit/libfs/src/imfs/memfile.c +++ b/cpukit/libfs/src/imfs/memfile.c @@ -98,7 +98,7 @@ int memfile_open( { IMFS_jnode_t *the_jnode; - the_jnode = iop->file_info; + the_jnode = iop->pathinfo.node_access; /* * Perform 'copy on write' for linear files @@ -137,7 +137,7 @@ int memfile_close( { IMFS_jnode_t *the_jnode; - the_jnode = iop->file_info; + the_jnode = iop->pathinfo.node_access; if (iop->flags & LIBIO_FLAGS_APPEND) iop->offset = the_jnode->info.file.size; @@ -161,7 +161,7 @@ ssize_t memfile_read( { IMFS_jnode_t *the_jnode; - the_jnode = iop->file_info; + the_jnode = iop->pathinfo.node_access; return IMFS_memfile_read( the_jnode, iop->offset, buffer, count ); } @@ -181,7 +181,7 @@ ssize_t memfile_write( IMFS_jnode_t *the_jnode; ssize_t status; - the_jnode = iop->file_info; + the_jnode = iop->pathinfo.node_access; status = IMFS_memfile_write( the_jnode, iop->offset, buffer, count ); iop->size = the_jnode->info.file.size; @@ -205,7 +205,7 @@ int memfile_ioctl( { IMFS_jnode_t *the_jnode; - the_jnode = iop->file_info; + the_jnode = iop->pathinfo.node_access; return 0; } @@ -224,7 +224,7 @@ rtems_off64_t memfile_lseek( { IMFS_jnode_t *the_jnode; - the_jnode = iop->file_info; + the_jnode = iop->pathinfo.node_access; if (the_jnode->type == IMFS_LINEAR_FILE) { if (iop->offset > the_jnode->info.linearfile.size) @@ -258,7 +258,7 @@ int memfile_ftruncate( { IMFS_jnode_t *the_jnode; - the_jnode = iop->file_info; + the_jnode = iop->pathinfo.node_access; /* * POSIX 1003.1b does not specify what happens if you truncate a file diff --git a/cpukit/libfs/src/nfsclient/src/nfs.c b/cpukit/libfs/src/nfsclient/src/nfs.c index 6b349445c2..ae50cd8b81 100644 --- a/cpukit/libfs/src/nfsclient/src/nfs.c +++ b/cpukit/libfs/src/nfsclient/src/nfs.c @@ -2515,23 +2515,6 @@ struct _rtems_filesystem_operations_table nfs_fs_ops = { 'nfs_xxx'. *****************************************/ - -#if 0 -/* from rtems/libio.h for convenience */ -struct rtems_libio_tt { - rtems_driver_name_t *driver; - off_t size; /* size of file */ - off_t offset; /* current offset into file */ - uint32_t flags; - rtems_filesystem_location_info_t pathinfo; - Objects_Id sem; - uint32_t data0; /* private to "driver" */ - void *data1; /* ... */ - void *file_info; /* used by file handlers */ - rtems_filesystem_file_handlers_r *handlers; /* type specific handlers */ -}; -#endif - /* stateless NFS protocol makes this trivial */ static int nfs_file_open( rtems_libio_t *iop, @@ -2540,14 +2523,13 @@ static int nfs_file_open( uint32_t mode ) { - iop->file_info = 0; return 0; } /* reading directories is not stateless; we must * remember the last 'read' position, i.e. * the server 'cookie'. We do manage this information - * attached to the iop->file_info. + * attached to the pathinfo.node_access_2. */ static int nfs_dir_open( rtems_libio_t *iop, @@ -2560,11 +2542,11 @@ NfsNode node = iop->pathinfo.node_access; DirInfo di; /* create a readdirargs object and copy the file handle; - * attach to the file_info. + * attach to the pathinfo.node_access_2 */ di = (DirInfo) malloc(sizeof(*di)); - iop->file_info = di; + iop->pathinfo.node_access_2 = di; if ( !di ) { errno = ENOMEM; @@ -2598,8 +2580,8 @@ static int nfs_dir_close( rtems_libio_t *iop ) { - free(iop->file_info); - iop->file_info = 0; + free(iop->pathinfo.node_access_2); + iop->pathinfo.node_access_2 = 0; return 0; } @@ -2656,7 +2638,7 @@ static ssize_t nfs_dir_read( size_t count ) { -DirInfo di = iop->file_info; +DirInfo di = iop->pathinfo.node_access_2; RpcUdpServer server = ((Nfs)iop->pathinfo.mt_entry->fs_info)->server; if ( di->eofreached ) @@ -2814,7 +2796,7 @@ static rtems_off64_t nfs_dir_lseek( int whence ) { -DirInfo di = iop->file_info; +DirInfo di = iop->pathinfo.node_access_2; /* we don't support anything other than * rewinding diff --git a/cpukit/libfs/src/rfs/rtems-rfs-rtems-file.c b/cpukit/libfs/src/rfs/rtems-rfs-rtems-file.c index d62e65254a..8525e3c80c 100644 --- a/cpukit/libfs/src/rfs/rtems-rfs-rtems-file.c +++ b/cpukit/libfs/src/rfs/rtems-rfs-rtems-file.c @@ -70,7 +70,7 @@ rtems_rfs_rtems_file_open (rtems_libio_t* iop, if (rtems_rfs_rtems_trace (RTEMS_RFS_RTEMS_DEBUG_FILE_OPEN)) printf("rtems-rfs: file-open: handle:%p\n", file); - iop->file_info = file; + iop->pathinfo.node_access = file; rtems_rfs_rtems_unlock (fs); return 0; @@ -86,7 +86,7 @@ rtems_rfs_rtems_file_open (rtems_libio_t* iop, static int rtems_rfs_rtems_file_close (rtems_libio_t* iop) { - rtems_rfs_file_handle* file = iop->file_info; + rtems_rfs_file_handle* file = iop->pathinfo.node_access; rtems_rfs_file_system* fs = rtems_rfs_file_fs (file); int rc; @@ -116,7 +116,7 @@ rtems_rfs_rtems_file_read (rtems_libio_t* iop, void* buffer, size_t count) { - rtems_rfs_file_handle* file = iop->file_info; + rtems_rfs_file_handle* file = iop->pathinfo.node_access; rtems_rfs_pos pos; uint8_t* data = buffer; ssize_t read = 0; @@ -181,7 +181,7 @@ rtems_rfs_rtems_file_write (rtems_libio_t* iop, const void* buffer, size_t count) { - rtems_rfs_file_handle* file = iop->file_info; + rtems_rfs_file_handle* file = iop->pathinfo.node_access; rtems_rfs_pos pos; const uint8_t* data = buffer; ssize_t write = 0; @@ -271,7 +271,7 @@ rtems_rfs_rtems_file_lseek (rtems_libio_t* iop, rtems_off64_t offset, int whence) { - rtems_rfs_file_handle* file = iop->file_info; + rtems_rfs_file_handle* file = iop->pathinfo.node_access; rtems_rfs_pos pos; int rc; @@ -305,7 +305,7 @@ int rtems_rfs_rtems_file_ftruncate (rtems_libio_t* iop, rtems_off64_t length) { - rtems_rfs_file_handle* file = iop->file_info; + rtems_rfs_file_handle* file = iop->pathinfo.node_access; int rc; if (rtems_rfs_rtems_trace (RTEMS_RFS_RTEMS_DEBUG_FILE_FTRUNC)) diff --git a/cpukit/libfs/src/rfs/rtems-rfs-rtems.h b/cpukit/libfs/src/rfs/rtems-rfs-rtems.h index 3415d0abfb..b7028b0851 100644 --- a/cpukit/libfs/src/rfs/rtems-rfs-rtems.h +++ b/cpukit/libfs/src/rfs/rtems-rfs-rtems.h @@ -194,7 +194,7 @@ typedef struct rtems_rfs_rtems_private * @return */ #define rtems_rfs_rtems_get_iop_ino(_iop) \ - ((intptr_t)(_iop)->file_info) + ((intptr_t)(_iop)->pathinfo.node_access) /** * Create the name of the handler's table given the type of handlers. diff --git a/cpukit/libnetworking/lib/ftpfs.c b/cpukit/libnetworking/lib/ftpfs.c index c9d6363863..892c1500be 100644 --- a/cpukit/libnetworking/lib/ftpfs.c +++ b/cpukit/libnetworking/lib/ftpfs.c @@ -958,7 +958,7 @@ static int rtems_ftpfs_open( ? "STOR " : "RETR "; uint32_t client_address = 0; - char *location = iop->file_info; + char *location = iop->pathinfo.node_access; /* Invalidate data handle */ iop->data1 = NULL; @@ -982,7 +982,7 @@ static int rtems_ftpfs_open( * This is an access to the root node that will be used for file system * option settings. */ - iop->handlers = &rtems_ftpfs_root_handlers; + iop->pathinfo.handlers = &rtems_ftpfs_root_handlers; return 0; } else { @@ -1166,7 +1166,7 @@ static int rtems_ftpfs_eval_path( /* * The caller of this routine has striped off the mount prefix from the path. * We need to store this path here or otherwise we would have to do this job - * again. The path is used in rtems_ftpfs_open() via iop->file_info. + * again. The path is used in rtems_ftpfs_open() via iop->pathinfo.node_access. */ char *pathname_dup = malloc(pathnamelen + 1); |