From 9c3fa30a11cf03041d05210a2ffbdaa9001999d4 Mon Sep 17 00:00:00 2001 From: Joel Sherrill Date: Thu, 28 Sep 2000 20:19:23 +0000 Subject: 2000-09-28 Joel Sherrill * libc/libio.h (rtems_filesystem_file_handlers_r, rtems_filesystem_operations_table): Added _h to all structure fields to indicate they are "handlers". * libc/libio_.h, libc/chdir.c, libc/chmod.c, libc/chown.c, libc/close.c, libc/eval.c, libc/fchdir.c, libc/fchmod.c, libc/fcntl.c, libc/fdatasync.c, libc/fstat.c, libc/fsync.c, libc/ftruncate.c, libc/getdents.c, libc/imfs_eval.c, libc/imfs_unlink.c, libc/ioctl.c, libc/ioman.c, libc/link.c, libc/lseek.c, libc/mknod.c, libc/mount.c, libc/open.c, libc/read.c, libc/readlink.c, libc/rmdir.c, libc/stat.c, libc/symlink.c, libc/unlink.c, libc/unmount.c, libc/utime.c, libc/write.c: Modified to reflect above name change. --- c/src/exec/include/rtems/libio_.h | 4 +- c/src/exec/libcsupport/include/rtems/libio.h | 60 +++++++++++++-------------- c/src/exec/libcsupport/include/rtems/libio_.h | 4 +- c/src/exec/libcsupport/src/chdir.c | 4 +- c/src/exec/libcsupport/src/chmod.c | 4 +- c/src/exec/libcsupport/src/chown.c | 4 +- c/src/exec/libcsupport/src/close.c | 4 +- c/src/exec/libcsupport/src/eval.c | 12 +++--- c/src/exec/libcsupport/src/fchdir.c | 4 +- c/src/exec/libcsupport/src/fchmod.c | 4 +- c/src/exec/libcsupport/src/fcntl.c | 4 +- c/src/exec/libcsupport/src/fdatasync.c | 4 +- c/src/exec/libcsupport/src/fstat.c | 4 +- c/src/exec/libcsupport/src/fsync.c | 4 +- c/src/exec/libcsupport/src/ftruncate.c | 8 ++-- c/src/exec/libcsupport/src/getdents.c | 8 ++-- c/src/exec/libcsupport/src/ioctl.c | 4 +- c/src/exec/libcsupport/src/link.c | 8 ++-- c/src/exec/libcsupport/src/lseek.c | 4 +- c/src/exec/libcsupport/src/mknod.c | 8 ++-- c/src/exec/libcsupport/src/mount.c | 10 ++--- c/src/exec/libcsupport/src/open.c | 4 +- c/src/exec/libcsupport/src/read.c | 4 +- c/src/exec/libcsupport/src/readlink.c | 8 ++-- c/src/exec/libcsupport/src/rmdir.c | 8 ++-- c/src/exec/libcsupport/src/stat.c | 4 +- c/src/exec/libcsupport/src/symlink.c | 6 +-- c/src/exec/libcsupport/src/unlink.c | 8 ++-- c/src/exec/libcsupport/src/unmount.c | 4 +- c/src/exec/libcsupport/src/utime.c | 4 +- c/src/exec/libcsupport/src/write.c | 4 +- c/src/exec/libfs/src/imfs/imfs_eval.c | 8 ++-- c/src/exec/libfs/src/imfs/imfs_unlink.c | 6 +-- c/src/exec/libfs/src/imfs/ioman.c | 4 +- c/src/lib/ChangeLog | 15 +++++++ c/src/lib/include/rtems/libio.h | 60 +++++++++++++-------------- c/src/lib/include/rtems/libio_.h | 4 +- c/src/lib/libc/chdir.c | 4 +- c/src/lib/libc/chmod.c | 4 +- c/src/lib/libc/chown.c | 4 +- c/src/lib/libc/close.c | 4 +- c/src/lib/libc/eval.c | 12 +++--- c/src/lib/libc/fchdir.c | 4 +- c/src/lib/libc/fchmod.c | 4 +- c/src/lib/libc/fcntl.c | 4 +- c/src/lib/libc/fdatasync.c | 4 +- c/src/lib/libc/fstat.c | 4 +- c/src/lib/libc/fsync.c | 4 +- c/src/lib/libc/ftruncate.c | 8 ++-- c/src/lib/libc/getdents.c | 8 ++-- c/src/lib/libc/imfs_eval.c | 8 ++-- c/src/lib/libc/imfs_unlink.c | 6 +-- c/src/lib/libc/ioctl.c | 4 +- c/src/lib/libc/ioman.c | 4 +- c/src/lib/libc/libio.h | 60 +++++++++++++-------------- c/src/lib/libc/libio_.h | 4 +- c/src/lib/libc/link.c | 8 ++-- c/src/lib/libc/lseek.c | 4 +- c/src/lib/libc/mknod.c | 8 ++-- c/src/lib/libc/mount.c | 10 ++--- c/src/lib/libc/open.c | 4 +- c/src/lib/libc/read.c | 4 +- c/src/lib/libc/readlink.c | 8 ++-- c/src/lib/libc/rmdir.c | 8 ++-- c/src/lib/libc/stat.c | 4 +- c/src/lib/libc/symlink.c | 6 +-- c/src/lib/libc/unlink.c | 8 ++-- c/src/lib/libc/unmount.c | 4 +- c/src/lib/libc/utime.c | 4 +- c/src/lib/libc/write.c | 4 +- c/src/libfs/src/imfs/imfs_eval.c | 8 ++-- c/src/libfs/src/imfs/imfs_unlink.c | 6 +-- c/src/libfs/src/imfs/ioman.c | 4 +- 73 files changed, 296 insertions(+), 281 deletions(-) (limited to 'c/src') diff --git a/c/src/exec/include/rtems/libio_.h b/c/src/exec/include/rtems/libio_.h index 8e74b34edb..e840c74a1b 100644 --- a/c/src/exec/include/rtems/libio_.h +++ b/c/src/exec/include/rtems/libio_.h @@ -168,8 +168,8 @@ extern mode_t rtems_filesystem_umask; #define rtems_filesystem_freenode( _node ) \ do { \ - if ( (_node)->ops->freenod ) \ - (*(_node)->ops->freenod)( (_node) ); \ + if ( (_node)->ops->freenod_h ) \ + (*(_node)->ops->freenod_h)( (_node) ); \ } while (0) /* diff --git a/c/src/exec/libcsupport/include/rtems/libio.h b/c/src/exec/libcsupport/include/rtems/libio.h index 7d832258ca..6bd626bc5a 100644 --- a/c/src/exec/libcsupport/include/rtems/libio.h +++ b/c/src/exec/libcsupport/include/rtems/libio.h @@ -126,20 +126,20 @@ typedef int (*rtems_filesystem_rmnod_t)( ); typedef struct { - rtems_filesystem_open_t open; - rtems_filesystem_close_t close; - rtems_filesystem_read_t read; - rtems_filesystem_write_t write; - rtems_filesystem_ioctl_t ioctl; - rtems_filesystem_lseek_t lseek; - rtems_filesystem_fstat_t fstat; - rtems_filesystem_fchmod_t fchmod; - rtems_filesystem_ftruncate_t ftruncate; - rtems_filesystem_fpathconf_t fpathconf; - rtems_filesystem_fsync_t fsync; - rtems_filesystem_fdatasync_t fdatasync; - rtems_filesystem_fcntl_t fcntl; - rtems_filesystem_rmnod_t rmnod; + rtems_filesystem_open_t open_h; + rtems_filesystem_close_t close_h; + rtems_filesystem_read_t read_h; + rtems_filesystem_write_t write_h; + rtems_filesystem_ioctl_t ioctl_h; + rtems_filesystem_lseek_t lseek_h; + rtems_filesystem_fstat_t fstat_h; + rtems_filesystem_fchmod_t fchmod_h; + rtems_filesystem_ftruncate_t ftruncate_h; + rtems_filesystem_fpathconf_t fpathconf_h; + rtems_filesystem_fsync_t fsync_h; + rtems_filesystem_fdatasync_t fdatasync_h; + rtems_filesystem_fcntl_t fcntl_h; + rtems_filesystem_rmnod_t rmnod_h; } rtems_filesystem_file_handlers_r; /* @@ -249,22 +249,22 @@ typedef int (*rtems_filesystem_readlink_t)( * File system types */ typedef struct { - rtems_filesystem_evalpath_t evalpath; - rtems_filesystem_evalmake_t evalformake; - rtems_filesystem_link_t link; - rtems_filesystem_unlink_t unlink; - rtems_filesystem_node_type_t node_type; - rtems_filesystem_mknod_t mknod; - rtems_filesystem_chown_t chown; - rtems_filesystem_freenode_t freenod; - rtems_filesystem_mount_t mount; - rtems_filesystem_fsmount_me_t fsmount_me; - rtems_filesystem_unmount_t unmount; - rtems_filesystem_fsunmount_me_t fsunmount_me; - rtems_filesystem_utime_t utime; - rtems_filesystem_evaluate_link_t eval_link; - rtems_filesystem_symlink_t symlink; - rtems_filesystem_readlink_t readlink; + rtems_filesystem_evalpath_t evalpath_h; + rtems_filesystem_evalmake_t evalformake_h; + rtems_filesystem_link_t link_h; + rtems_filesystem_unlink_t unlink_h; + rtems_filesystem_node_type_t node_type_h; + rtems_filesystem_mknod_t mknod_h; + rtems_filesystem_chown_t chown_h; + rtems_filesystem_freenode_t freenod_h; + rtems_filesystem_mount_t mount_h; + rtems_filesystem_fsmount_me_t fsmount_me_h; + rtems_filesystem_unmount_t unmount_h; + rtems_filesystem_fsunmount_me_t fsunmount_me_h; + rtems_filesystem_utime_t utime_h; + rtems_filesystem_evaluate_link_t eval_link_h; + rtems_filesystem_symlink_t symlink_h; + rtems_filesystem_readlink_t readlink_h; } rtems_filesystem_operations_table; #define IMFS_FILE_SYSTEM IMFS_ops diff --git a/c/src/exec/libcsupport/include/rtems/libio_.h b/c/src/exec/libcsupport/include/rtems/libio_.h index 8e74b34edb..e840c74a1b 100644 --- a/c/src/exec/libcsupport/include/rtems/libio_.h +++ b/c/src/exec/libcsupport/include/rtems/libio_.h @@ -168,8 +168,8 @@ extern mode_t rtems_filesystem_umask; #define rtems_filesystem_freenode( _node ) \ do { \ - if ( (_node)->ops->freenod ) \ - (*(_node)->ops->freenod)( (_node) ); \ + if ( (_node)->ops->freenod_h ) \ + (*(_node)->ops->freenod_h)( (_node) ); \ } while (0) /* diff --git a/c/src/exec/libcsupport/src/chdir.c b/c/src/exec/libcsupport/src/chdir.c index 4ab5c84cb8..46a6ad168b 100644 --- a/c/src/exec/libcsupport/src/chdir.c +++ b/c/src/exec/libcsupport/src/chdir.c @@ -37,12 +37,12 @@ int chdir( * Verify you can change directory into this node. */ - if ( !loc.ops->node_type ) { + if ( !loc.ops->node_type_h ) { rtems_filesystem_freenode( &loc ); set_errno_and_return_minus_one( ENOTSUP ); } - if ( (*loc.ops->node_type)( &loc ) != RTEMS_FILESYSTEM_DIRECTORY ) { + if ( (*loc.ops->node_type_h)( &loc ) != RTEMS_FILESYSTEM_DIRECTORY ) { rtems_filesystem_freenode( &loc ); set_errno_and_return_minus_one( ENOTDIR ); } diff --git a/c/src/exec/libcsupport/src/chmod.c b/c/src/exec/libcsupport/src/chmod.c index f1042806b9..4b7ab8c594 100644 --- a/c/src/exec/libcsupport/src/chmod.c +++ b/c/src/exec/libcsupport/src/chmod.c @@ -38,12 +38,12 @@ int chmod( set_errno_and_return_minus_one( EBADF ); } - if ( !loc.handlers->fchmod ){ + if ( !loc.handlers->fchmod_h ){ rtems_filesystem_freenode( &loc ); set_errno_and_return_minus_one( ENOTSUP ); } - result = (*loc.handlers->fchmod)( &loc, mode ); + result = (*loc.handlers->fchmod_h)( &loc, mode ); rtems_filesystem_freenode( &loc ); diff --git a/c/src/exec/libcsupport/src/chown.c b/c/src/exec/libcsupport/src/chown.c index 796fa5370c..c4dfe97ed0 100644 --- a/c/src/exec/libcsupport/src/chown.c +++ b/c/src/exec/libcsupport/src/chown.c @@ -31,12 +31,12 @@ int chown( if ( rtems_filesystem_evaluate_path( path, 0x00, &loc, TRUE ) ) return -1; - if ( !loc.ops->chown ) { + if ( !loc.ops->chown_h ) { rtems_filesystem_freenode( &loc ); set_errno_and_return_minus_one( ENOTSUP ); } - result = (*loc.ops->chown)( &loc, owner, group ); + result = (*loc.ops->chown_h)( &loc, owner, group ); rtems_filesystem_freenode( &loc ); diff --git a/c/src/exec/libcsupport/src/close.c b/c/src/exec/libcsupport/src/close.c index 0ee9df89ed..19149d3bfe 100644 --- a/c/src/exec/libcsupport/src/close.c +++ b/c/src/exec/libcsupport/src/close.c @@ -25,8 +25,8 @@ int close( rtems_libio_check_is_open(iop); rc = RTEMS_SUCCESSFUL; - if ( iop->handlers->close ) - rc = (*iop->handlers->close)( iop ); + if ( iop->handlers->close_h ) + rc = (*iop->handlers->close_h)( iop ); rtems_libio_free( iop ); diff --git a/c/src/exec/libcsupport/src/eval.c b/c/src/exec/libcsupport/src/eval.c index 8d839918a5..60c718d3b8 100644 --- a/c/src/exec/libcsupport/src/eval.c +++ b/c/src/exec/libcsupport/src/eval.c @@ -43,10 +43,10 @@ int rtems_filesystem_evaluate_path( rtems_filesystem_get_start_loc( pathname, &i, pathloc ); - if ( !pathloc->ops->evalpath ) + if ( !pathloc->ops->evalpath_h ) set_errno_and_return_minus_one( ENOTSUP ); - result = (*pathloc->ops->evalpath)( &pathname[i], flags, pathloc ); + result = (*pathloc->ops->evalpath_h)( &pathname[i], flags, pathloc ); /* * Get the Node type and determine if you need to follow the link or @@ -55,18 +55,18 @@ int rtems_filesystem_evaluate_path( if ( (result == 0) && follow_link ) { - if ( !pathloc->ops->node_type ) + if ( !pathloc->ops->node_type_h ) set_errno_and_return_minus_one( ENOTSUP ); - type = (*pathloc->ops->node_type)( pathloc ); + type = (*pathloc->ops->node_type_h)( pathloc ); if ( ( type == RTEMS_FILESYSTEM_HARD_LINK ) || ( type == RTEMS_FILESYSTEM_SYM_LINK ) ) { - if ( !pathloc->ops->eval_link ) + if ( !pathloc->ops->eval_link_h ) set_errno_and_return_minus_one( ENOTSUP ); - result = (*pathloc->ops->eval_link)( pathloc, flags ); + result = (*pathloc->ops->eval_link_h)( pathloc, flags ); } } diff --git a/c/src/exec/libcsupport/src/fchdir.c b/c/src/exec/libcsupport/src/fchdir.c index 99380514df..4a94afe20b 100644 --- a/c/src/exec/libcsupport/src/fchdir.c +++ b/c/src/exec/libcsupport/src/fchdir.c @@ -43,11 +43,11 @@ int fchdir( set_errno_and_return_minus_one( ENOTSUP ); } - if ( !iop->pathinfo.ops->node_type ) { + if ( !iop->pathinfo.ops->node_type_h ) { set_errno_and_return_minus_one( ENOTSUP ); } - if ( (*iop->pathinfo.ops->node_type)( &iop->pathinfo ) != + if ( (*iop->pathinfo.ops->node_type_h)( &iop->pathinfo ) != RTEMS_FILESYSTEM_DIRECTORY ) { set_errno_and_return_minus_one( ENOTDIR ); } diff --git a/c/src/exec/libcsupport/src/fchmod.c b/c/src/exec/libcsupport/src/fchmod.c index 74d9a30647..fbf4cbc0ac 100644 --- a/c/src/exec/libcsupport/src/fchmod.c +++ b/c/src/exec/libcsupport/src/fchmod.c @@ -36,9 +36,9 @@ int fchmod( rtems_libio_check_permissions( iop, LIBIO_FLAGS_WRITE ); - if ( !iop->handlers->fchmod ) + if ( !iop->handlers->fchmod_h ) set_errno_and_return_minus_one( ENOTSUP ); - return (*iop->pathinfo.handlers->fchmod)( &iop->pathinfo, mode ); + return (*iop->pathinfo.handlers->fchmod_h)( &iop->pathinfo, mode ); } diff --git a/c/src/exec/libcsupport/src/fcntl.c b/c/src/exec/libcsupport/src/fcntl.c index 587726f885..819b2f7778 100644 --- a/c/src/exec/libcsupport/src/fcntl.c +++ b/c/src/exec/libcsupport/src/fcntl.c @@ -132,8 +132,8 @@ int fcntl( break; } if (ret >= 0) { - if (iop->handlers->fcntl) { - int err = (*iop->handlers->fcntl)( cmd, iop ); + if (iop->handlers->fcntl_h) { + int err = (*iop->handlers->fcntl_h)( cmd, iop ); if (err) { errno = err; ret = -1; diff --git a/c/src/exec/libcsupport/src/fdatasync.c b/c/src/exec/libcsupport/src/fdatasync.c index 7a86dc53c6..251573ef5d 100644 --- a/c/src/exec/libcsupport/src/fdatasync.c +++ b/c/src/exec/libcsupport/src/fdatasync.c @@ -30,8 +30,8 @@ int fdatasync( * Now process the fdatasync(). */ - if ( !iop->handlers->fdatasync ) + if ( !iop->handlers->fdatasync_h ) set_errno_and_return_minus_one( ENOTSUP ); - return (*iop->handlers->fdatasync)( iop ); + return (*iop->handlers->fdatasync_h)( iop ); } diff --git a/c/src/exec/libcsupport/src/fstat.c b/c/src/exec/libcsupport/src/fstat.c index 8f216e3cfc..ad937c14fa 100644 --- a/c/src/exec/libcsupport/src/fstat.c +++ b/c/src/exec/libcsupport/src/fstat.c @@ -42,7 +42,7 @@ int fstat( if ( !iop->handlers ) set_errno_and_return_minus_one( EBADF ); - if ( !iop->handlers->fstat ) + if ( !iop->handlers->fstat_h ) set_errno_and_return_minus_one( ENOTSUP ); /* @@ -51,7 +51,7 @@ int fstat( */ memset( sbuf, 0, sizeof(struct stat) ); - return (*iop->handlers->fstat)( &iop->pathinfo, sbuf ); + return (*iop->handlers->fstat_h)( &iop->pathinfo, sbuf ); } /* diff --git a/c/src/exec/libcsupport/src/fsync.c b/c/src/exec/libcsupport/src/fsync.c index 3dc9835d31..f27309057f 100644 --- a/c/src/exec/libcsupport/src/fsync.c +++ b/c/src/exec/libcsupport/src/fsync.c @@ -33,8 +33,8 @@ int fsync( if ( !iop->handlers ) set_errno_and_return_minus_one( EBADF ); - if ( !iop->handlers->fsync ) + if ( !iop->handlers->fsync_h ) set_errno_and_return_minus_one( ENOTSUP ); - return (*iop->handlers->fsync)( iop ); + return (*iop->handlers->fsync_h)( iop ); } diff --git a/c/src/exec/libcsupport/src/ftruncate.c b/c/src/exec/libcsupport/src/ftruncate.c index bbf0bc7240..70587d257b 100644 --- a/c/src/exec/libcsupport/src/ftruncate.c +++ b/c/src/exec/libcsupport/src/ftruncate.c @@ -37,17 +37,17 @@ int ftruncate( */ loc = iop->pathinfo; - if ( !loc.ops->node_type ) + if ( !loc.ops->node_type_h ) set_errno_and_return_minus_one( ENOTSUP ); - if ( (*loc.ops->node_type)( &loc ) == RTEMS_FILESYSTEM_DIRECTORY ) + if ( (*loc.ops->node_type_h)( &loc ) == RTEMS_FILESYSTEM_DIRECTORY ) set_errno_and_return_minus_one( EISDIR ); rtems_libio_check_permissions( iop, LIBIO_FLAGS_WRITE ); - if ( !iop->handlers->ftruncate ) + if ( !iop->handlers->ftruncate_h ) set_errno_and_return_minus_one( ENOTSUP ); - return (*iop->handlers->ftruncate)( iop, length ); + return (*iop->handlers->ftruncate_h)( iop, length ); } diff --git a/c/src/exec/libcsupport/src/getdents.c b/c/src/exec/libcsupport/src/getdents.c index b1afbb13f7..e260fe2489 100644 --- a/c/src/exec/libcsupport/src/getdents.c +++ b/c/src/exec/libcsupport/src/getdents.c @@ -40,10 +40,10 @@ int getdents( * Make sure we are working on a directory */ loc = iop->pathinfo; - if ( !loc.ops->node_type ) + if ( !loc.ops->node_type_h ) set_errno_and_return_minus_one( ENOTSUP ); - if ( (*loc.ops->node_type)( &loc ) != RTEMS_FILESYSTEM_DIRECTORY ) + if ( (*loc.ops->node_type_h)( &loc ) != RTEMS_FILESYSTEM_DIRECTORY ) set_errno_and_return_minus_one( ENOTDIR ); /* @@ -51,8 +51,8 @@ int getdents( * of the read attempt. */ - if ( !iop->handlers->read ) + if ( !iop->handlers->read_h ) set_errno_and_return_minus_one( ENOTSUP ); - return (*iop->handlers->read)( iop, dd_buf, dd_len ); + return (*iop->handlers->read_h)( iop, dd_buf, dd_len ); } diff --git a/c/src/exec/libcsupport/src/ioctl.c b/c/src/exec/libcsupport/src/ioctl.c index ce74ba7cf4..38d47da3d3 100644 --- a/c/src/exec/libcsupport/src/ioctl.c +++ b/c/src/exec/libcsupport/src/ioctl.c @@ -44,10 +44,10 @@ int ioctl( if ( !iop->handlers ) set_errno_and_return_minus_one( EBADF ); - if ( !iop->handlers->ioctl ) + if ( !iop->handlers->ioctl_h ) set_errno_and_return_minus_one( ENOTSUP ); - rc = (*iop->handlers->ioctl)( iop, command, buffer ); + rc = (*iop->handlers->ioctl_h)( iop, command, buffer ); return rc; } diff --git a/c/src/exec/libcsupport/src/link.c b/c/src/exec/libcsupport/src/link.c index 03bdaee343..61bcd45e44 100644 --- a/c/src/exec/libcsupport/src/link.c +++ b/c/src/exec/libcsupport/src/link.c @@ -42,13 +42,13 @@ int link( rtems_filesystem_get_start_loc( new, &i, &parent_loc ); - if ( !parent_loc.ops->evalformake ) { + if ( !parent_loc.ops->evalformake_h ) { rtems_filesystem_freenode( &existing_loc ); rtems_filesystem_freenode( &parent_loc ); set_errno_and_return_minus_one( ENOTSUP ); } - result = (*parent_loc.ops->evalformake)( &new[i], &parent_loc, &name_start ); + result = (*parent_loc.ops->evalformake_h)( &new[i], &parent_loc, &name_start ); if ( result != 0 ) { rtems_filesystem_freenode( &existing_loc ); rtems_filesystem_freenode( &parent_loc ); @@ -66,13 +66,13 @@ int link( set_errno_and_return_minus_one( EXDEV ); } - if ( !parent_loc.ops->link ) { + if ( !parent_loc.ops->link_h ) { rtems_filesystem_freenode( &existing_loc ); rtems_filesystem_freenode( &parent_loc ); set_errno_and_return_minus_one( ENOTSUP ); } - result = (*parent_loc.ops->link)( &existing_loc, &parent_loc, name_start ); + result = (*parent_loc.ops->link_h)( &existing_loc, &parent_loc, name_start ); rtems_filesystem_freenode( &existing_loc ); rtems_filesystem_freenode( &parent_loc ); diff --git a/c/src/exec/libcsupport/src/lseek.c b/c/src/exec/libcsupport/src/lseek.c index 992056482e..cb2e329235 100644 --- a/c/src/exec/libcsupport/src/lseek.c +++ b/c/src/exec/libcsupport/src/lseek.c @@ -49,10 +49,10 @@ off_t lseek( return -1; } - if ( !iop->handlers->lseek ) + if ( !iop->handlers->lseek_h ) set_errno_and_return_minus_one( ENOTSUP ); - return (*iop->handlers->lseek)( iop, offset, whence ); + return (*iop->handlers->lseek_h)( iop, offset, whence ); } /* diff --git a/c/src/exec/libcsupport/src/mknod.c b/c/src/exec/libcsupport/src/mknod.c index 30a3f548a2..98eb9ef36e 100644 --- a/c/src/exec/libcsupport/src/mknod.c +++ b/c/src/exec/libcsupport/src/mknod.c @@ -43,12 +43,12 @@ int mknod( rtems_filesystem_get_start_loc( pathname, &i, &temp_loc ); - if ( !temp_loc.ops->evalformake ) { + if ( !temp_loc.ops->evalformake_h ) { rtems_filesystem_freenode( &temp_loc ); set_errno_and_return_minus_one( ENOTSUP ); } - result = (*temp_loc.ops->evalformake)( + result = (*temp_loc.ops->evalformake_h)( &pathname[i], &temp_loc, &name_start @@ -56,12 +56,12 @@ int mknod( if ( result != 0 ) return -1; - if ( !temp_loc.ops->mknod ) { + if ( !temp_loc.ops->mknod_h ) { rtems_filesystem_freenode( &temp_loc ); set_errno_and_return_minus_one( ENOTSUP ); } - result = (*temp_loc.ops->mknod)( name_start, mode, dev, &temp_loc ); + result = (*temp_loc.ops->mknod_h)( name_start, mode, dev, &temp_loc ); rtems_filesystem_freenode( &temp_loc ); diff --git a/c/src/exec/libcsupport/src/mount.c b/c/src/exec/libcsupport/src/mount.c index 578404ecdc..f5861099f6 100644 --- a/c/src/exec/libcsupport/src/mount.c +++ b/c/src/exec/libcsupport/src/mount.c @@ -151,7 +151,7 @@ int mount( */ loc_to_free = &loc; - if ( loc.ops->node_type( &loc ) != RTEMS_FILESYSTEM_DIRECTORY ) { + if ( loc.ops->node_type_h( &loc ) != RTEMS_FILESYSTEM_DIRECTORY ) { errno = ENOTDIR; goto cleanup_and_bail; } @@ -183,12 +183,12 @@ int mount( * below the base file system */ - if ( !loc.ops->mount ){ + if ( !loc.ops->mount_h ){ errno = ENOTSUP; goto cleanup_and_bail; } - if ( loc.ops->mount( temp_mt_entry ) ) { + if ( loc.ops->mount_h( temp_mt_entry ) ) { goto cleanup_and_bail; } } else { @@ -209,12 +209,12 @@ int mount( temp_mt_entry->mt_point_node.mt_entry = NULL; } - if ( !fs_ops->fsmount_me ) { + if ( !fs_ops->fsmount_me_h ) { errno = ENOTSUP; goto cleanup_and_bail; } - if ( fs_ops->fsmount_me( temp_mt_entry ) ) + if ( fs_ops->fsmount_me_h( temp_mt_entry ) ) goto cleanup_and_bail; /* diff --git a/c/src/exec/libcsupport/src/open.c b/c/src/exec/libcsupport/src/open.c index 1203ca9688..3b11209d20 100644 --- a/c/src/exec/libcsupport/src/open.c +++ b/c/src/exec/libcsupport/src/open.c @@ -148,12 +148,12 @@ int open( iop->flags |= rtems_libio_fcntl_flags( flags ); iop->pathinfo = loc; - if ( !iop->handlers->open ) { + if ( !iop->handlers->open_h ) { rc = ENOTSUP; goto done; } - rc = (*iop->handlers->open)( iop, pathname, flags, mode ); + rc = (*iop->handlers->open_h)( iop, pathname, flags, mode ); if ( rc ) goto done; diff --git a/c/src/exec/libcsupport/src/read.c b/c/src/exec/libcsupport/src/read.c index 80ad9abc42..d724e16164 100644 --- a/c/src/exec/libcsupport/src/read.c +++ b/c/src/exec/libcsupport/src/read.c @@ -33,10 +33,10 @@ ssize_t read( * Now process the read(). */ - if ( !iop->handlers->read ) + if ( !iop->handlers->read_h ) set_errno_and_return_minus_one( ENOTSUP ); - rc = (*iop->handlers->read)( iop, buffer, count ); + rc = (*iop->handlers->read_h)( iop, buffer, count ); if ( rc > 0 ) iop->offset += rc; diff --git a/c/src/exec/libcsupport/src/readlink.c b/c/src/exec/libcsupport/src/readlink.c index bec00e5c72..09afb1ca2d 100644 --- a/c/src/exec/libcsupport/src/readlink.c +++ b/c/src/exec/libcsupport/src/readlink.c @@ -29,22 +29,22 @@ int readlink( if ( result != 0 ) return -1; - if ( !loc.ops->node_type ){ + if ( !loc.ops->node_type_h ){ rtems_filesystem_freenode( &loc ); set_errno_and_return_minus_one( ENOTSUP ); } - if ( (*loc.ops->node_type)( &loc ) != RTEMS_FILESYSTEM_SYM_LINK ){ + if ( (*loc.ops->node_type_h)( &loc ) != RTEMS_FILESYSTEM_SYM_LINK ){ rtems_filesystem_freenode( &loc ); set_errno_and_return_minus_one( EINVAL ); } - if ( !loc.ops->readlink ){ + if ( !loc.ops->readlink_h ){ rtems_filesystem_freenode( &loc ); set_errno_and_return_minus_one( ENOTSUP ); } - result = (*loc.ops->readlink)( &loc, buf, bufsize ); + result = (*loc.ops->readlink_h)( &loc, buf, bufsize ); rtems_filesystem_freenode( &loc ); diff --git a/c/src/exec/libcsupport/src/rmdir.c b/c/src/exec/libcsupport/src/rmdir.c index 521a2e6934..87dacf775e 100644 --- a/c/src/exec/libcsupport/src/rmdir.c +++ b/c/src/exec/libcsupport/src/rmdir.c @@ -38,12 +38,12 @@ int rmdir( * Verify you can remove this node as a directory. */ - if ( !loc.ops->node_type ){ + if ( !loc.ops->node_type_h ){ rtems_filesystem_freenode( &loc ); set_errno_and_return_minus_one( ENOTSUP ); } - if ( (*loc.ops->node_type)( &loc ) != RTEMS_FILESYSTEM_DIRECTORY ){ + if ( (*loc.ops->node_type_h)( &loc ) != RTEMS_FILESYSTEM_DIRECTORY ){ rtems_filesystem_freenode( &loc ); set_errno_and_return_minus_one( ENOTDIR ); } @@ -52,12 +52,12 @@ int rmdir( * Use the filesystems rmnod to remove the node. */ - if ( !loc.handlers->rmnod ){ + if ( !loc.handlers->rmnod_h ){ rtems_filesystem_freenode( &loc ); set_errno_and_return_minus_one( ENOTSUP ); } - result = (*loc.handlers->rmnod)( &loc ); + result = (*loc.handlers->rmnod_h)( &loc ); rtems_filesystem_freenode( &loc ); diff --git a/c/src/exec/libcsupport/src/stat.c b/c/src/exec/libcsupport/src/stat.c index 688333ac2e..26b9786d1c 100644 --- a/c/src/exec/libcsupport/src/stat.c +++ b/c/src/exec/libcsupport/src/stat.c @@ -57,7 +57,7 @@ int _STAT_NAME( if ( status != 0 ) return -1; - if ( !loc.handlers->fstat ){ + if ( !loc.handlers->fstat_h ){ rtems_filesystem_freenode( &loc ); set_errno_and_return_minus_one( ENOTSUP ); } @@ -69,7 +69,7 @@ int _STAT_NAME( memset( buf, 0, sizeof(struct stat) ); - status = (*loc.handlers->fstat)( &loc, buf ); + status = (*loc.handlers->fstat_h)( &loc, buf ); rtems_filesystem_freenode( &loc ); diff --git a/c/src/exec/libcsupport/src/symlink.c b/c/src/exec/libcsupport/src/symlink.c index c63abf0a25..59a894ea9f 100644 --- a/c/src/exec/libcsupport/src/symlink.c +++ b/c/src/exec/libcsupport/src/symlink.c @@ -24,16 +24,16 @@ int symlink( int result; rtems_filesystem_get_start_loc( sympath, &i, &loc ); - result = (*loc.ops->evalformake)( &sympath[i], &loc, &name_start ); + result = (*loc.ops->evalformake_h)( &sympath[i], &loc, &name_start ); if ( result != 0 ) return -1; - if ( !loc.ops->symlink ) { + if ( !loc.ops->symlink_h ) { rtems_filesystem_freenode( &loc ); set_errno_and_return_minus_one( ENOTSUP ); } - result = (*loc.ops->symlink)( &loc, actualpath, name_start); + result = (*loc.ops->symlink_h)( &loc, actualpath, name_start); rtems_filesystem_freenode( &loc ); diff --git a/c/src/exec/libcsupport/src/unlink.c b/c/src/exec/libcsupport/src/unlink.c index cf11db227c..e9eadd9453 100644 --- a/c/src/exec/libcsupport/src/unlink.c +++ b/c/src/exec/libcsupport/src/unlink.c @@ -30,22 +30,22 @@ int unlink( if ( result != 0 ) return -1; - if ( !loc.ops->node_type ) { + if ( !loc.ops->node_type_h ) { rtems_filesystem_freenode( &loc ); set_errno_and_return_minus_one( ENOTSUP ); } - if ( (*loc.ops->node_type)( &loc ) == RTEMS_FILESYSTEM_DIRECTORY ) { + if ( (*loc.ops->node_type_h)( &loc ) == RTEMS_FILESYSTEM_DIRECTORY ) { rtems_filesystem_freenode( &loc ); set_errno_and_return_minus_one( EISDIR ); } - if ( !loc.ops->unlink ) { + if ( !loc.ops->unlink_h ) { rtems_filesystem_freenode( &loc ); set_errno_and_return_minus_one( ENOTSUP ); } - result = (*loc.ops->unlink)( &loc ); + result = (*loc.ops->unlink_h)( &loc ); rtems_filesystem_freenode( &loc ); diff --git a/c/src/exec/libcsupport/src/unmount.c b/c/src/exec/libcsupport/src/unmount.c index 46b11d1848..565fa5f8d8 100644 --- a/c/src/exec/libcsupport/src/unmount.c +++ b/c/src/exec/libcsupport/src/unmount.c @@ -105,7 +105,7 @@ int unmount( * XXX I will step off in space when evaluating past the end of the node. */ - if ((temp_mt_entry.mt_point_node.ops->unmount )( temp_loc.mt_entry ) != 0 ) { + if ((temp_mt_entry.mt_point_node.ops->unmount_h )( temp_loc.mt_entry ) != 0 ) { rtems_filesystem_freenode( &temp_loc ); return -1; } @@ -114,7 +114,7 @@ int unmount( * Run the unmount function for the subordinate file system. */ - if ((temp_mt_entry.mt_fs_root.ops->fsunmount_me )( temp_loc.mt_entry ) != 0){ + if ((temp_mt_entry.mt_fs_root.ops->fsunmount_me_h )( temp_loc.mt_entry ) != 0){ rtems_filesystem_freenode( &temp_loc ); return -1; } diff --git a/c/src/exec/libcsupport/src/utime.c b/c/src/exec/libcsupport/src/utime.c index 50eeece59a..8d7d578bf2 100644 --- a/c/src/exec/libcsupport/src/utime.c +++ b/c/src/exec/libcsupport/src/utime.c @@ -28,10 +28,10 @@ int utime( if ( rtems_filesystem_evaluate_path( path, 0x00, &temp_loc, TRUE ) ) return -1; - if ( !temp_loc.ops->utime ) + if ( !temp_loc.ops->utime_h ) set_errno_and_return_minus_one( ENOTSUP ); - result = (*temp_loc.ops->utime)( &temp_loc, times->actime, times->modtime ); + result = (*temp_loc.ops->utime_h)( &temp_loc, times->actime, times->modtime ); rtems_filesystem_freenode( &temp_loc ); diff --git a/c/src/exec/libcsupport/src/write.c b/c/src/exec/libcsupport/src/write.c index a47a4f40a9..aae273a340 100644 --- a/c/src/exec/libcsupport/src/write.c +++ b/c/src/exec/libcsupport/src/write.c @@ -41,10 +41,10 @@ ssize_t write( * Now process the write() request. */ - if ( !iop->handlers->write ) + if ( !iop->handlers->write_h ) set_errno_and_return_minus_one( ENOTSUP ); - rc = (*iop->handlers->write)( iop, buffer, count ); + rc = (*iop->handlers->write_h)( iop, buffer, count ); if ( rc > 0 ) iop->offset += rc; diff --git a/c/src/exec/libfs/src/imfs/imfs_eval.c b/c/src/exec/libfs/src/imfs/imfs_eval.c index 1f1e7c6daf..9cb459de64 100644 --- a/c/src/exec/libfs/src/imfs/imfs_eval.c +++ b/c/src/exec/libfs/src/imfs/imfs_eval.c @@ -333,7 +333,7 @@ int IMFS_evaluate_for_make( } else { newloc = pathloc->mt_entry->mt_point_node; *pathloc = newloc; - return (*pathloc->ops->evalformake)( &path[i-len], pathloc, name ); + return (*pathloc->ops->evalformake_h)( &path[i-len], pathloc, name ); } } else { @@ -381,7 +381,7 @@ int IMFS_evaluate_for_make( if ( node->info.directory.mt_fs != NULL ) { newloc = node->info.directory.mt_fs->mt_fs_root; *pathloc = newloc; - return (*pathloc->ops->evalformake)( &path[i-len], pathloc, name ); + return (*pathloc->ops->evalformake_h)( &path[i-len], pathloc, name ); } /* @@ -526,7 +526,7 @@ int IMFS_eval_path( } else { newloc = pathloc->mt_entry->mt_point_node; *pathloc = newloc; - return (*pathloc->ops->evalpath)(&(pathname[i-len]),flags,pathloc); + return (*pathloc->ops->evalpath_h)(&(pathname[i-len]),flags,pathloc); } } else { @@ -578,7 +578,7 @@ int IMFS_eval_path( if ( node->info.directory.mt_fs != NULL ) { newloc = node->info.directory.mt_fs->mt_fs_root; *pathloc = newloc; - return (*pathloc->ops->evalpath)( &pathname[i-len], flags, pathloc ); + return (*pathloc->ops->evalpath_h)( &pathname[i-len], flags, pathloc ); } /* diff --git a/c/src/exec/libfs/src/imfs/imfs_unlink.c b/c/src/exec/libfs/src/imfs/imfs_unlink.c index f001c6450d..b1d68e194a 100644 --- a/c/src/exec/libfs/src/imfs/imfs_unlink.c +++ b/c/src/exec/libfs/src/imfs/imfs_unlink.c @@ -25,7 +25,7 @@ int IMFS_unlink( { IMFS_jnode_t *node; rtems_filesystem_location_info_t the_link; - int result; + int result = 0; node = loc->node_access; @@ -56,7 +56,7 @@ int IMFS_unlink( node->info.hard_link.link_node->st_nlink --; IMFS_update_ctime( node->info.hard_link.link_node ); if ( node->info.hard_link.link_node->st_nlink < 1) { - result = (*the_link.handlers->rmnod)( &the_link ); + result = (*the_link.handlers->rmnod_h)( &the_link ); if ( result != 0 ) return -1; } @@ -66,7 +66,7 @@ int IMFS_unlink( * Now actually free the node we were asked to free. */ - result = (*loc->handlers->rmnod)( loc ); + result = (*loc->handlers->rmnod_h)( loc ); return result; } diff --git a/c/src/exec/libfs/src/imfs/ioman.c b/c/src/exec/libfs/src/imfs/ioman.c index 4f592a6094..e9b486937c 100644 --- a/c/src/exec/libfs/src/imfs/ioman.c +++ b/c/src/exec/libfs/src/imfs/ioman.c @@ -80,12 +80,12 @@ rtems_status_code rtems_io_lookup_name( result = rtems_filesystem_evaluate_path( name, 0x00, &loc, TRUE ); the_jnode = loc.node_access; - if ( !loc.ops->node_type ) { + if ( !loc.ops->node_type_h ) { rtems_filesystem_freenode( &loc ); set_errno_and_return_minus_one( ENOTSUP ); } - node_type = (*loc.ops->node_type)( &loc ); + node_type = (*loc.ops->node_type_h)( &loc ); if ( (result != 0) || node_type != RTEMS_FILESYSTEM_DEVICE ) { *device_info = 0; diff --git a/c/src/lib/ChangeLog b/c/src/lib/ChangeLog index 0df75cddbb..f16a7bc202 100644 --- a/c/src/lib/ChangeLog +++ b/c/src/lib/ChangeLog @@ -1,4 +1,19 @@ +2000-09-28 Joel Sherrill + + * libc/libio.h (rtems_filesystem_file_handlers_r, + rtems_filesystem_operations_table): Added _h to all structure + fields to indicate they are "handlers". + * libc/libio_.h, libc/chdir.c, libc/chmod.c, libc/chown.c, + libc/close.c, libc/eval.c, libc/fchdir.c, libc/fchmod.c, + libc/fcntl.c, libc/fdatasync.c, libc/fstat.c, libc/fsync.c, + libc/ftruncate.c, libc/getdents.c, libc/imfs_eval.c, + libc/imfs_unlink.c, libc/ioctl.c, libc/ioman.c, libc/link.c, + libc/lseek.c, libc/mknod.c, libc/mount.c, libc/open.c, libc/read.c, + libc/readlink.c, libc/rmdir.c, libc/stat.c, libc/symlink.c, + libc/unlink.c, libc/unmount.c, libc/utime.c, libc/write.c: + Modified to reflect above name change. + 2000-09-22 Joel Sherrill * libc/newlibc.c: Removed _A29K specific ifdef. diff --git a/c/src/lib/include/rtems/libio.h b/c/src/lib/include/rtems/libio.h index 7d832258ca..6bd626bc5a 100644 --- a/c/src/lib/include/rtems/libio.h +++ b/c/src/lib/include/rtems/libio.h @@ -126,20 +126,20 @@ typedef int (*rtems_filesystem_rmnod_t)( ); typedef struct { - rtems_filesystem_open_t open; - rtems_filesystem_close_t close; - rtems_filesystem_read_t read; - rtems_filesystem_write_t write; - rtems_filesystem_ioctl_t ioctl; - rtems_filesystem_lseek_t lseek; - rtems_filesystem_fstat_t fstat; - rtems_filesystem_fchmod_t fchmod; - rtems_filesystem_ftruncate_t ftruncate; - rtems_filesystem_fpathconf_t fpathconf; - rtems_filesystem_fsync_t fsync; - rtems_filesystem_fdatasync_t fdatasync; - rtems_filesystem_fcntl_t fcntl; - rtems_filesystem_rmnod_t rmnod; + rtems_filesystem_open_t open_h; + rtems_filesystem_close_t close_h; + rtems_filesystem_read_t read_h; + rtems_filesystem_write_t write_h; + rtems_filesystem_ioctl_t ioctl_h; + rtems_filesystem_lseek_t lseek_h; + rtems_filesystem_fstat_t fstat_h; + rtems_filesystem_fchmod_t fchmod_h; + rtems_filesystem_ftruncate_t ftruncate_h; + rtems_filesystem_fpathconf_t fpathconf_h; + rtems_filesystem_fsync_t fsync_h; + rtems_filesystem_fdatasync_t fdatasync_h; + rtems_filesystem_fcntl_t fcntl_h; + rtems_filesystem_rmnod_t rmnod_h; } rtems_filesystem_file_handlers_r; /* @@ -249,22 +249,22 @@ typedef int (*rtems_filesystem_readlink_t)( * File system types */ typedef struct { - rtems_filesystem_evalpath_t evalpath; - rtems_filesystem_evalmake_t evalformake; - rtems_filesystem_link_t link; - rtems_filesystem_unlink_t unlink; - rtems_filesystem_node_type_t node_type; - rtems_filesystem_mknod_t mknod; - rtems_filesystem_chown_t chown; - rtems_filesystem_freenode_t freenod; - rtems_filesystem_mount_t mount; - rtems_filesystem_fsmount_me_t fsmount_me; - rtems_filesystem_unmount_t unmount; - rtems_filesystem_fsunmount_me_t fsunmount_me; - rtems_filesystem_utime_t utime; - rtems_filesystem_evaluate_link_t eval_link; - rtems_filesystem_symlink_t symlink; - rtems_filesystem_readlink_t readlink; + rtems_filesystem_evalpath_t evalpath_h; + rtems_filesystem_evalmake_t evalformake_h; + rtems_filesystem_link_t link_h; + rtems_filesystem_unlink_t unlink_h; + rtems_filesystem_node_type_t node_type_h; + rtems_filesystem_mknod_t mknod_h; + rtems_filesystem_chown_t chown_h; + rtems_filesystem_freenode_t freenod_h; + rtems_filesystem_mount_t mount_h; + rtems_filesystem_fsmount_me_t fsmount_me_h; + rtems_filesystem_unmount_t unmount_h; + rtems_filesystem_fsunmount_me_t fsunmount_me_h; + rtems_filesystem_utime_t utime_h; + rtems_filesystem_evaluate_link_t eval_link_h; + rtems_filesystem_symlink_t symlink_h; + rtems_filesystem_readlink_t readlink_h; } rtems_filesystem_operations_table; #define IMFS_FILE_SYSTEM IMFS_ops diff --git a/c/src/lib/include/rtems/libio_.h b/c/src/lib/include/rtems/libio_.h index 8e74b34edb..e840c74a1b 100644 --- a/c/src/lib/include/rtems/libio_.h +++ b/c/src/lib/include/rtems/libio_.h @@ -168,8 +168,8 @@ extern mode_t rtems_filesystem_umask; #define rtems_filesystem_freenode( _node ) \ do { \ - if ( (_node)->ops->freenod ) \ - (*(_node)->ops->freenod)( (_node) ); \ + if ( (_node)->ops->freenod_h ) \ + (*(_node)->ops->freenod_h)( (_node) ); \ } while (0) /* diff --git a/c/src/lib/libc/chdir.c b/c/src/lib/libc/chdir.c index 4ab5c84cb8..46a6ad168b 100644 --- a/c/src/lib/libc/chdir.c +++ b/c/src/lib/libc/chdir.c @@ -37,12 +37,12 @@ int chdir( * Verify you can change directory into this node. */ - if ( !loc.ops->node_type ) { + if ( !loc.ops->node_type_h ) { rtems_filesystem_freenode( &loc ); set_errno_and_return_minus_one( ENOTSUP ); } - if ( (*loc.ops->node_type)( &loc ) != RTEMS_FILESYSTEM_DIRECTORY ) { + if ( (*loc.ops->node_type_h)( &loc ) != RTEMS_FILESYSTEM_DIRECTORY ) { rtems_filesystem_freenode( &loc ); set_errno_and_return_minus_one( ENOTDIR ); } diff --git a/c/src/lib/libc/chmod.c b/c/src/lib/libc/chmod.c index f1042806b9..4b7ab8c594 100644 --- a/c/src/lib/libc/chmod.c +++ b/c/src/lib/libc/chmod.c @@ -38,12 +38,12 @@ int chmod( set_errno_and_return_minus_one( EBADF ); } - if ( !loc.handlers->fchmod ){ + if ( !loc.handlers->fchmod_h ){ rtems_filesystem_freenode( &loc ); set_errno_and_return_minus_one( ENOTSUP ); } - result = (*loc.handlers->fchmod)( &loc, mode ); + result = (*loc.handlers->fchmod_h)( &loc, mode ); rtems_filesystem_freenode( &loc ); diff --git a/c/src/lib/libc/chown.c b/c/src/lib/libc/chown.c index 796fa5370c..c4dfe97ed0 100644 --- a/c/src/lib/libc/chown.c +++ b/c/src/lib/libc/chown.c @@ -31,12 +31,12 @@ int chown( if ( rtems_filesystem_evaluate_path( path, 0x00, &loc, TRUE ) ) return -1; - if ( !loc.ops->chown ) { + if ( !loc.ops->chown_h ) { rtems_filesystem_freenode( &loc ); set_errno_and_return_minus_one( ENOTSUP ); } - result = (*loc.ops->chown)( &loc, owner, group ); + result = (*loc.ops->chown_h)( &loc, owner, group ); rtems_filesystem_freenode( &loc ); diff --git a/c/src/lib/libc/close.c b/c/src/lib/libc/close.c index 0ee9df89ed..19149d3bfe 100644 --- a/c/src/lib/libc/close.c +++ b/c/src/lib/libc/close.c @@ -25,8 +25,8 @@ int close( rtems_libio_check_is_open(iop); rc = RTEMS_SUCCESSFUL; - if ( iop->handlers->close ) - rc = (*iop->handlers->close)( iop ); + if ( iop->handlers->close_h ) + rc = (*iop->handlers->close_h)( iop ); rtems_libio_free( iop ); diff --git a/c/src/lib/libc/eval.c b/c/src/lib/libc/eval.c index 8d839918a5..60c718d3b8 100644 --- a/c/src/lib/libc/eval.c +++ b/c/src/lib/libc/eval.c @@ -43,10 +43,10 @@ int rtems_filesystem_evaluate_path( rtems_filesystem_get_start_loc( pathname, &i, pathloc ); - if ( !pathloc->ops->evalpath ) + if ( !pathloc->ops->evalpath_h ) set_errno_and_return_minus_one( ENOTSUP ); - result = (*pathloc->ops->evalpath)( &pathname[i], flags, pathloc ); + result = (*pathloc->ops->evalpath_h)( &pathname[i], flags, pathloc ); /* * Get the Node type and determine if you need to follow the link or @@ -55,18 +55,18 @@ int rtems_filesystem_evaluate_path( if ( (result == 0) && follow_link ) { - if ( !pathloc->ops->node_type ) + if ( !pathloc->ops->node_type_h ) set_errno_and_return_minus_one( ENOTSUP ); - type = (*pathloc->ops->node_type)( pathloc ); + type = (*pathloc->ops->node_type_h)( pathloc ); if ( ( type == RTEMS_FILESYSTEM_HARD_LINK ) || ( type == RTEMS_FILESYSTEM_SYM_LINK ) ) { - if ( !pathloc->ops->eval_link ) + if ( !pathloc->ops->eval_link_h ) set_errno_and_return_minus_one( ENOTSUP ); - result = (*pathloc->ops->eval_link)( pathloc, flags ); + result = (*pathloc->ops->eval_link_h)( pathloc, flags ); } } diff --git a/c/src/lib/libc/fchdir.c b/c/src/lib/libc/fchdir.c index 99380514df..4a94afe20b 100644 --- a/c/src/lib/libc/fchdir.c +++ b/c/src/lib/libc/fchdir.c @@ -43,11 +43,11 @@ int fchdir( set_errno_and_return_minus_one( ENOTSUP ); } - if ( !iop->pathinfo.ops->node_type ) { + if ( !iop->pathinfo.ops->node_type_h ) { set_errno_and_return_minus_one( ENOTSUP ); } - if ( (*iop->pathinfo.ops->node_type)( &iop->pathinfo ) != + if ( (*iop->pathinfo.ops->node_type_h)( &iop->pathinfo ) != RTEMS_FILESYSTEM_DIRECTORY ) { set_errno_and_return_minus_one( ENOTDIR ); } diff --git a/c/src/lib/libc/fchmod.c b/c/src/lib/libc/fchmod.c index 74d9a30647..fbf4cbc0ac 100644 --- a/c/src/lib/libc/fchmod.c +++ b/c/src/lib/libc/fchmod.c @@ -36,9 +36,9 @@ int fchmod( rtems_libio_check_permissions( iop, LIBIO_FLAGS_WRITE ); - if ( !iop->handlers->fchmod ) + if ( !iop->handlers->fchmod_h ) set_errno_and_return_minus_one( ENOTSUP ); - return (*iop->pathinfo.handlers->fchmod)( &iop->pathinfo, mode ); + return (*iop->pathinfo.handlers->fchmod_h)( &iop->pathinfo, mode ); } diff --git a/c/src/lib/libc/fcntl.c b/c/src/lib/libc/fcntl.c index 587726f885..819b2f7778 100644 --- a/c/src/lib/libc/fcntl.c +++ b/c/src/lib/libc/fcntl.c @@ -132,8 +132,8 @@ int fcntl( break; } if (ret >= 0) { - if (iop->handlers->fcntl) { - int err = (*iop->handlers->fcntl)( cmd, iop ); + if (iop->handlers->fcntl_h) { + int err = (*iop->handlers->fcntl_h)( cmd, iop ); if (err) { errno = err; ret = -1; diff --git a/c/src/lib/libc/fdatasync.c b/c/src/lib/libc/fdatasync.c index 7a86dc53c6..251573ef5d 100644 --- a/c/src/lib/libc/fdatasync.c +++ b/c/src/lib/libc/fdatasync.c @@ -30,8 +30,8 @@ int fdatasync( * Now process the fdatasync(). */ - if ( !iop->handlers->fdatasync ) + if ( !iop->handlers->fdatasync_h ) set_errno_and_return_minus_one( ENOTSUP ); - return (*iop->handlers->fdatasync)( iop ); + return (*iop->handlers->fdatasync_h)( iop ); } diff --git a/c/src/lib/libc/fstat.c b/c/src/lib/libc/fstat.c index 8f216e3cfc..ad937c14fa 100644 --- a/c/src/lib/libc/fstat.c +++ b/c/src/lib/libc/fstat.c @@ -42,7 +42,7 @@ int fstat( if ( !iop->handlers ) set_errno_and_return_minus_one( EBADF ); - if ( !iop->handlers->fstat ) + if ( !iop->handlers->fstat_h ) set_errno_and_return_minus_one( ENOTSUP ); /* @@ -51,7 +51,7 @@ int fstat( */ memset( sbuf, 0, sizeof(struct stat) ); - return (*iop->handlers->fstat)( &iop->pathinfo, sbuf ); + return (*iop->handlers->fstat_h)( &iop->pathinfo, sbuf ); } /* diff --git a/c/src/lib/libc/fsync.c b/c/src/lib/libc/fsync.c index 3dc9835d31..f27309057f 100644 --- a/c/src/lib/libc/fsync.c +++ b/c/src/lib/libc/fsync.c @@ -33,8 +33,8 @@ int fsync( if ( !iop->handlers ) set_errno_and_return_minus_one( EBADF ); - if ( !iop->handlers->fsync ) + if ( !iop->handlers->fsync_h ) set_errno_and_return_minus_one( ENOTSUP ); - return (*iop->handlers->fsync)( iop ); + return (*iop->handlers->fsync_h)( iop ); } diff --git a/c/src/lib/libc/ftruncate.c b/c/src/lib/libc/ftruncate.c index bbf0bc7240..70587d257b 100644 --- a/c/src/lib/libc/ftruncate.c +++ b/c/src/lib/libc/ftruncate.c @@ -37,17 +37,17 @@ int ftruncate( */ loc = iop->pathinfo; - if ( !loc.ops->node_type ) + if ( !loc.ops->node_type_h ) set_errno_and_return_minus_one( ENOTSUP ); - if ( (*loc.ops->node_type)( &loc ) == RTEMS_FILESYSTEM_DIRECTORY ) + if ( (*loc.ops->node_type_h)( &loc ) == RTEMS_FILESYSTEM_DIRECTORY ) set_errno_and_return_minus_one( EISDIR ); rtems_libio_check_permissions( iop, LIBIO_FLAGS_WRITE ); - if ( !iop->handlers->ftruncate ) + if ( !iop->handlers->ftruncate_h ) set_errno_and_return_minus_one( ENOTSUP ); - return (*iop->handlers->ftruncate)( iop, length ); + return (*iop->handlers->ftruncate_h)( iop, length ); } diff --git a/c/src/lib/libc/getdents.c b/c/src/lib/libc/getdents.c index b1afbb13f7..e260fe2489 100644 --- a/c/src/lib/libc/getdents.c +++ b/c/src/lib/libc/getdents.c @@ -40,10 +40,10 @@ int getdents( * Make sure we are working on a directory */ loc = iop->pathinfo; - if ( !loc.ops->node_type ) + if ( !loc.ops->node_type_h ) set_errno_and_return_minus_one( ENOTSUP ); - if ( (*loc.ops->node_type)( &loc ) != RTEMS_FILESYSTEM_DIRECTORY ) + if ( (*loc.ops->node_type_h)( &loc ) != RTEMS_FILESYSTEM_DIRECTORY ) set_errno_and_return_minus_one( ENOTDIR ); /* @@ -51,8 +51,8 @@ int getdents( * of the read attempt. */ - if ( !iop->handlers->read ) + if ( !iop->handlers->read_h ) set_errno_and_return_minus_one( ENOTSUP ); - return (*iop->handlers->read)( iop, dd_buf, dd_len ); + return (*iop->handlers->read_h)( iop, dd_buf, dd_len ); } diff --git a/c/src/lib/libc/imfs_eval.c b/c/src/lib/libc/imfs_eval.c index 1f1e7c6daf..9cb459de64 100644 --- a/c/src/lib/libc/imfs_eval.c +++ b/c/src/lib/libc/imfs_eval.c @@ -333,7 +333,7 @@ int IMFS_evaluate_for_make( } else { newloc = pathloc->mt_entry->mt_point_node; *pathloc = newloc; - return (*pathloc->ops->evalformake)( &path[i-len], pathloc, name ); + return (*pathloc->ops->evalformake_h)( &path[i-len], pathloc, name ); } } else { @@ -381,7 +381,7 @@ int IMFS_evaluate_for_make( if ( node->info.directory.mt_fs != NULL ) { newloc = node->info.directory.mt_fs->mt_fs_root; *pathloc = newloc; - return (*pathloc->ops->evalformake)( &path[i-len], pathloc, name ); + return (*pathloc->ops->evalformake_h)( &path[i-len], pathloc, name ); } /* @@ -526,7 +526,7 @@ int IMFS_eval_path( } else { newloc = pathloc->mt_entry->mt_point_node; *pathloc = newloc; - return (*pathloc->ops->evalpath)(&(pathname[i-len]),flags,pathloc); + return (*pathloc->ops->evalpath_h)(&(pathname[i-len]),flags,pathloc); } } else { @@ -578,7 +578,7 @@ int IMFS_eval_path( if ( node->info.directory.mt_fs != NULL ) { newloc = node->info.directory.mt_fs->mt_fs_root; *pathloc = newloc; - return (*pathloc->ops->evalpath)( &pathname[i-len], flags, pathloc ); + return (*pathloc->ops->evalpath_h)( &pathname[i-len], flags, pathloc ); } /* diff --git a/c/src/lib/libc/imfs_unlink.c b/c/src/lib/libc/imfs_unlink.c index f001c6450d..b1d68e194a 100644 --- a/c/src/lib/libc/imfs_unlink.c +++ b/c/src/lib/libc/imfs_unlink.c @@ -25,7 +25,7 @@ int IMFS_unlink( { IMFS_jnode_t *node; rtems_filesystem_location_info_t the_link; - int result; + int result = 0; node = loc->node_access; @@ -56,7 +56,7 @@ int IMFS_unlink( node->info.hard_link.link_node->st_nlink --; IMFS_update_ctime( node->info.hard_link.link_node ); if ( node->info.hard_link.link_node->st_nlink < 1) { - result = (*the_link.handlers->rmnod)( &the_link ); + result = (*the_link.handlers->rmnod_h)( &the_link ); if ( result != 0 ) return -1; } @@ -66,7 +66,7 @@ int IMFS_unlink( * Now actually free the node we were asked to free. */ - result = (*loc->handlers->rmnod)( loc ); + result = (*loc->handlers->rmnod_h)( loc ); return result; } diff --git a/c/src/lib/libc/ioctl.c b/c/src/lib/libc/ioctl.c index ce74ba7cf4..38d47da3d3 100644 --- a/c/src/lib/libc/ioctl.c +++ b/c/src/lib/libc/ioctl.c @@ -44,10 +44,10 @@ int ioctl( if ( !iop->handlers ) set_errno_and_return_minus_one( EBADF ); - if ( !iop->handlers->ioctl ) + if ( !iop->handlers->ioctl_h ) set_errno_and_return_minus_one( ENOTSUP ); - rc = (*iop->handlers->ioctl)( iop, command, buffer ); + rc = (*iop->handlers->ioctl_h)( iop, command, buffer ); return rc; } diff --git a/c/src/lib/libc/ioman.c b/c/src/lib/libc/ioman.c index 4f592a6094..e9b486937c 100644 --- a/c/src/lib/libc/ioman.c +++ b/c/src/lib/libc/ioman.c @@ -80,12 +80,12 @@ rtems_status_code rtems_io_lookup_name( result = rtems_filesystem_evaluate_path( name, 0x00, &loc, TRUE ); the_jnode = loc.node_access; - if ( !loc.ops->node_type ) { + if ( !loc.ops->node_type_h ) { rtems_filesystem_freenode( &loc ); set_errno_and_return_minus_one( ENOTSUP ); } - node_type = (*loc.ops->node_type)( &loc ); + node_type = (*loc.ops->node_type_h)( &loc ); if ( (result != 0) || node_type != RTEMS_FILESYSTEM_DEVICE ) { *device_info = 0; diff --git a/c/src/lib/libc/libio.h b/c/src/lib/libc/libio.h index 7d832258ca..6bd626bc5a 100644 --- a/c/src/lib/libc/libio.h +++ b/c/src/lib/libc/libio.h @@ -126,20 +126,20 @@ typedef int (*rtems_filesystem_rmnod_t)( ); typedef struct { - rtems_filesystem_open_t open; - rtems_filesystem_close_t close; - rtems_filesystem_read_t read; - rtems_filesystem_write_t write; - rtems_filesystem_ioctl_t ioctl; - rtems_filesystem_lseek_t lseek; - rtems_filesystem_fstat_t fstat; - rtems_filesystem_fchmod_t fchmod; - rtems_filesystem_ftruncate_t ftruncate; - rtems_filesystem_fpathconf_t fpathconf; - rtems_filesystem_fsync_t fsync; - rtems_filesystem_fdatasync_t fdatasync; - rtems_filesystem_fcntl_t fcntl; - rtems_filesystem_rmnod_t rmnod; + rtems_filesystem_open_t open_h; + rtems_filesystem_close_t close_h; + rtems_filesystem_read_t read_h; + rtems_filesystem_write_t write_h; + rtems_filesystem_ioctl_t ioctl_h; + rtems_filesystem_lseek_t lseek_h; + rtems_filesystem_fstat_t fstat_h; + rtems_filesystem_fchmod_t fchmod_h; + rtems_filesystem_ftruncate_t ftruncate_h; + rtems_filesystem_fpathconf_t fpathconf_h; + rtems_filesystem_fsync_t fsync_h; + rtems_filesystem_fdatasync_t fdatasync_h; + rtems_filesystem_fcntl_t fcntl_h; + rtems_filesystem_rmnod_t rmnod_h; } rtems_filesystem_file_handlers_r; /* @@ -249,22 +249,22 @@ typedef int (*rtems_filesystem_readlink_t)( * File system types */ typedef struct { - rtems_filesystem_evalpath_t evalpath; - rtems_filesystem_evalmake_t evalformake; - rtems_filesystem_link_t link; - rtems_filesystem_unlink_t unlink; - rtems_filesystem_node_type_t node_type; - rtems_filesystem_mknod_t mknod; - rtems_filesystem_chown_t chown; - rtems_filesystem_freenode_t freenod; - rtems_filesystem_mount_t mount; - rtems_filesystem_fsmount_me_t fsmount_me; - rtems_filesystem_unmount_t unmount; - rtems_filesystem_fsunmount_me_t fsunmount_me; - rtems_filesystem_utime_t utime; - rtems_filesystem_evaluate_link_t eval_link; - rtems_filesystem_symlink_t symlink; - rtems_filesystem_readlink_t readlink; + rtems_filesystem_evalpath_t evalpath_h; + rtems_filesystem_evalmake_t evalformake_h; + rtems_filesystem_link_t link_h; + rtems_filesystem_unlink_t unlink_h; + rtems_filesystem_node_type_t node_type_h; + rtems_filesystem_mknod_t mknod_h; + rtems_filesystem_chown_t chown_h; + rtems_filesystem_freenode_t freenod_h; + rtems_filesystem_mount_t mount_h; + rtems_filesystem_fsmount_me_t fsmount_me_h; + rtems_filesystem_unmount_t unmount_h; + rtems_filesystem_fsunmount_me_t fsunmount_me_h; + rtems_filesystem_utime_t utime_h; + rtems_filesystem_evaluate_link_t eval_link_h; + rtems_filesystem_symlink_t symlink_h; + rtems_filesystem_readlink_t readlink_h; } rtems_filesystem_operations_table; #define IMFS_FILE_SYSTEM IMFS_ops diff --git a/c/src/lib/libc/libio_.h b/c/src/lib/libc/libio_.h index 8e74b34edb..e840c74a1b 100644 --- a/c/src/lib/libc/libio_.h +++ b/c/src/lib/libc/libio_.h @@ -168,8 +168,8 @@ extern mode_t rtems_filesystem_umask; #define rtems_filesystem_freenode( _node ) \ do { \ - if ( (_node)->ops->freenod ) \ - (*(_node)->ops->freenod)( (_node) ); \ + if ( (_node)->ops->freenod_h ) \ + (*(_node)->ops->freenod_h)( (_node) ); \ } while (0) /* diff --git a/c/src/lib/libc/link.c b/c/src/lib/libc/link.c index 03bdaee343..61bcd45e44 100644 --- a/c/src/lib/libc/link.c +++ b/c/src/lib/libc/link.c @@ -42,13 +42,13 @@ int link( rtems_filesystem_get_start_loc( new, &i, &parent_loc ); - if ( !parent_loc.ops->evalformake ) { + if ( !parent_loc.ops->evalformake_h ) { rtems_filesystem_freenode( &existing_loc ); rtems_filesystem_freenode( &parent_loc ); set_errno_and_return_minus_one( ENOTSUP ); } - result = (*parent_loc.ops->evalformake)( &new[i], &parent_loc, &name_start ); + result = (*parent_loc.ops->evalformake_h)( &new[i], &parent_loc, &name_start ); if ( result != 0 ) { rtems_filesystem_freenode( &existing_loc ); rtems_filesystem_freenode( &parent_loc ); @@ -66,13 +66,13 @@ int link( set_errno_and_return_minus_one( EXDEV ); } - if ( !parent_loc.ops->link ) { + if ( !parent_loc.ops->link_h ) { rtems_filesystem_freenode( &existing_loc ); rtems_filesystem_freenode( &parent_loc ); set_errno_and_return_minus_one( ENOTSUP ); } - result = (*parent_loc.ops->link)( &existing_loc, &parent_loc, name_start ); + result = (*parent_loc.ops->link_h)( &existing_loc, &parent_loc, name_start ); rtems_filesystem_freenode( &existing_loc ); rtems_filesystem_freenode( &parent_loc ); diff --git a/c/src/lib/libc/lseek.c b/c/src/lib/libc/lseek.c index 992056482e..cb2e329235 100644 --- a/c/src/lib/libc/lseek.c +++ b/c/src/lib/libc/lseek.c @@ -49,10 +49,10 @@ off_t lseek( return -1; } - if ( !iop->handlers->lseek ) + if ( !iop->handlers->lseek_h ) set_errno_and_return_minus_one( ENOTSUP ); - return (*iop->handlers->lseek)( iop, offset, whence ); + return (*iop->handlers->lseek_h)( iop, offset, whence ); } /* diff --git a/c/src/lib/libc/mknod.c b/c/src/lib/libc/mknod.c index 30a3f548a2..98eb9ef36e 100644 --- a/c/src/lib/libc/mknod.c +++ b/c/src/lib/libc/mknod.c @@ -43,12 +43,12 @@ int mknod( rtems_filesystem_get_start_loc( pathname, &i, &temp_loc ); - if ( !temp_loc.ops->evalformake ) { + if ( !temp_loc.ops->evalformake_h ) { rtems_filesystem_freenode( &temp_loc ); set_errno_and_return_minus_one( ENOTSUP ); } - result = (*temp_loc.ops->evalformake)( + result = (*temp_loc.ops->evalformake_h)( &pathname[i], &temp_loc, &name_start @@ -56,12 +56,12 @@ int mknod( if ( result != 0 ) return -1; - if ( !temp_loc.ops->mknod ) { + if ( !temp_loc.ops->mknod_h ) { rtems_filesystem_freenode( &temp_loc ); set_errno_and_return_minus_one( ENOTSUP ); } - result = (*temp_loc.ops->mknod)( name_start, mode, dev, &temp_loc ); + result = (*temp_loc.ops->mknod_h)( name_start, mode, dev, &temp_loc ); rtems_filesystem_freenode( &temp_loc ); diff --git a/c/src/lib/libc/mount.c b/c/src/lib/libc/mount.c index 578404ecdc..f5861099f6 100644 --- a/c/src/lib/libc/mount.c +++ b/c/src/lib/libc/mount.c @@ -151,7 +151,7 @@ int mount( */ loc_to_free = &loc; - if ( loc.ops->node_type( &loc ) != RTEMS_FILESYSTEM_DIRECTORY ) { + if ( loc.ops->node_type_h( &loc ) != RTEMS_FILESYSTEM_DIRECTORY ) { errno = ENOTDIR; goto cleanup_and_bail; } @@ -183,12 +183,12 @@ int mount( * below the base file system */ - if ( !loc.ops->mount ){ + if ( !loc.ops->mount_h ){ errno = ENOTSUP; goto cleanup_and_bail; } - if ( loc.ops->mount( temp_mt_entry ) ) { + if ( loc.ops->mount_h( temp_mt_entry ) ) { goto cleanup_and_bail; } } else { @@ -209,12 +209,12 @@ int mount( temp_mt_entry->mt_point_node.mt_entry = NULL; } - if ( !fs_ops->fsmount_me ) { + if ( !fs_ops->fsmount_me_h ) { errno = ENOTSUP; goto cleanup_and_bail; } - if ( fs_ops->fsmount_me( temp_mt_entry ) ) + if ( fs_ops->fsmount_me_h( temp_mt_entry ) ) goto cleanup_and_bail; /* diff --git a/c/src/lib/libc/open.c b/c/src/lib/libc/open.c index 1203ca9688..3b11209d20 100644 --- a/c/src/lib/libc/open.c +++ b/c/src/lib/libc/open.c @@ -148,12 +148,12 @@ int open( iop->flags |= rtems_libio_fcntl_flags( flags ); iop->pathinfo = loc; - if ( !iop->handlers->open ) { + if ( !iop->handlers->open_h ) { rc = ENOTSUP; goto done; } - rc = (*iop->handlers->open)( iop, pathname, flags, mode ); + rc = (*iop->handlers->open_h)( iop, pathname, flags, mode ); if ( rc ) goto done; diff --git a/c/src/lib/libc/read.c b/c/src/lib/libc/read.c index 80ad9abc42..d724e16164 100644 --- a/c/src/lib/libc/read.c +++ b/c/src/lib/libc/read.c @@ -33,10 +33,10 @@ ssize_t read( * Now process the read(). */ - if ( !iop->handlers->read ) + if ( !iop->handlers->read_h ) set_errno_and_return_minus_one( ENOTSUP ); - rc = (*iop->handlers->read)( iop, buffer, count ); + rc = (*iop->handlers->read_h)( iop, buffer, count ); if ( rc > 0 ) iop->offset += rc; diff --git a/c/src/lib/libc/readlink.c b/c/src/lib/libc/readlink.c index bec00e5c72..09afb1ca2d 100644 --- a/c/src/lib/libc/readlink.c +++ b/c/src/lib/libc/readlink.c @@ -29,22 +29,22 @@ int readlink( if ( result != 0 ) return -1; - if ( !loc.ops->node_type ){ + if ( !loc.ops->node_type_h ){ rtems_filesystem_freenode( &loc ); set_errno_and_return_minus_one( ENOTSUP ); } - if ( (*loc.ops->node_type)( &loc ) != RTEMS_FILESYSTEM_SYM_LINK ){ + if ( (*loc.ops->node_type_h)( &loc ) != RTEMS_FILESYSTEM_SYM_LINK ){ rtems_filesystem_freenode( &loc ); set_errno_and_return_minus_one( EINVAL ); } - if ( !loc.ops->readlink ){ + if ( !loc.ops->readlink_h ){ rtems_filesystem_freenode( &loc ); set_errno_and_return_minus_one( ENOTSUP ); } - result = (*loc.ops->readlink)( &loc, buf, bufsize ); + result = (*loc.ops->readlink_h)( &loc, buf, bufsize ); rtems_filesystem_freenode( &loc ); diff --git a/c/src/lib/libc/rmdir.c b/c/src/lib/libc/rmdir.c index 521a2e6934..87dacf775e 100644 --- a/c/src/lib/libc/rmdir.c +++ b/c/src/lib/libc/rmdir.c @@ -38,12 +38,12 @@ int rmdir( * Verify you can remove this node as a directory. */ - if ( !loc.ops->node_type ){ + if ( !loc.ops->node_type_h ){ rtems_filesystem_freenode( &loc ); set_errno_and_return_minus_one( ENOTSUP ); } - if ( (*loc.ops->node_type)( &loc ) != RTEMS_FILESYSTEM_DIRECTORY ){ + if ( (*loc.ops->node_type_h)( &loc ) != RTEMS_FILESYSTEM_DIRECTORY ){ rtems_filesystem_freenode( &loc ); set_errno_and_return_minus_one( ENOTDIR ); } @@ -52,12 +52,12 @@ int rmdir( * Use the filesystems rmnod to remove the node. */ - if ( !loc.handlers->rmnod ){ + if ( !loc.handlers->rmnod_h ){ rtems_filesystem_freenode( &loc ); set_errno_and_return_minus_one( ENOTSUP ); } - result = (*loc.handlers->rmnod)( &loc ); + result = (*loc.handlers->rmnod_h)( &loc ); rtems_filesystem_freenode( &loc ); diff --git a/c/src/lib/libc/stat.c b/c/src/lib/libc/stat.c index 688333ac2e..26b9786d1c 100644 --- a/c/src/lib/libc/stat.c +++ b/c/src/lib/libc/stat.c @@ -57,7 +57,7 @@ int _STAT_NAME( if ( status != 0 ) return -1; - if ( !loc.handlers->fstat ){ + if ( !loc.handlers->fstat_h ){ rtems_filesystem_freenode( &loc ); set_errno_and_return_minus_one( ENOTSUP ); } @@ -69,7 +69,7 @@ int _STAT_NAME( memset( buf, 0, sizeof(struct stat) ); - status = (*loc.handlers->fstat)( &loc, buf ); + status = (*loc.handlers->fstat_h)( &loc, buf ); rtems_filesystem_freenode( &loc ); diff --git a/c/src/lib/libc/symlink.c b/c/src/lib/libc/symlink.c index c63abf0a25..59a894ea9f 100644 --- a/c/src/lib/libc/symlink.c +++ b/c/src/lib/libc/symlink.c @@ -24,16 +24,16 @@ int symlink( int result; rtems_filesystem_get_start_loc( sympath, &i, &loc ); - result = (*loc.ops->evalformake)( &sympath[i], &loc, &name_start ); + result = (*loc.ops->evalformake_h)( &sympath[i], &loc, &name_start ); if ( result != 0 ) return -1; - if ( !loc.ops->symlink ) { + if ( !loc.ops->symlink_h ) { rtems_filesystem_freenode( &loc ); set_errno_and_return_minus_one( ENOTSUP ); } - result = (*loc.ops->symlink)( &loc, actualpath, name_start); + result = (*loc.ops->symlink_h)( &loc, actualpath, name_start); rtems_filesystem_freenode( &loc ); diff --git a/c/src/lib/libc/unlink.c b/c/src/lib/libc/unlink.c index cf11db227c..e9eadd9453 100644 --- a/c/src/lib/libc/unlink.c +++ b/c/src/lib/libc/unlink.c @@ -30,22 +30,22 @@ int unlink( if ( result != 0 ) return -1; - if ( !loc.ops->node_type ) { + if ( !loc.ops->node_type_h ) { rtems_filesystem_freenode( &loc ); set_errno_and_return_minus_one( ENOTSUP ); } - if ( (*loc.ops->node_type)( &loc ) == RTEMS_FILESYSTEM_DIRECTORY ) { + if ( (*loc.ops->node_type_h)( &loc ) == RTEMS_FILESYSTEM_DIRECTORY ) { rtems_filesystem_freenode( &loc ); set_errno_and_return_minus_one( EISDIR ); } - if ( !loc.ops->unlink ) { + if ( !loc.ops->unlink_h ) { rtems_filesystem_freenode( &loc ); set_errno_and_return_minus_one( ENOTSUP ); } - result = (*loc.ops->unlink)( &loc ); + result = (*loc.ops->unlink_h)( &loc ); rtems_filesystem_freenode( &loc ); diff --git a/c/src/lib/libc/unmount.c b/c/src/lib/libc/unmount.c index 46b11d1848..565fa5f8d8 100644 --- a/c/src/lib/libc/unmount.c +++ b/c/src/lib/libc/unmount.c @@ -105,7 +105,7 @@ int unmount( * XXX I will step off in space when evaluating past the end of the node. */ - if ((temp_mt_entry.mt_point_node.ops->unmount )( temp_loc.mt_entry ) != 0 ) { + if ((temp_mt_entry.mt_point_node.ops->unmount_h )( temp_loc.mt_entry ) != 0 ) { rtems_filesystem_freenode( &temp_loc ); return -1; } @@ -114,7 +114,7 @@ int unmount( * Run the unmount function for the subordinate file system. */ - if ((temp_mt_entry.mt_fs_root.ops->fsunmount_me )( temp_loc.mt_entry ) != 0){ + if ((temp_mt_entry.mt_fs_root.ops->fsunmount_me_h )( temp_loc.mt_entry ) != 0){ rtems_filesystem_freenode( &temp_loc ); return -1; } diff --git a/c/src/lib/libc/utime.c b/c/src/lib/libc/utime.c index 50eeece59a..8d7d578bf2 100644 --- a/c/src/lib/libc/utime.c +++ b/c/src/lib/libc/utime.c @@ -28,10 +28,10 @@ int utime( if ( rtems_filesystem_evaluate_path( path, 0x00, &temp_loc, TRUE ) ) return -1; - if ( !temp_loc.ops->utime ) + if ( !temp_loc.ops->utime_h ) set_errno_and_return_minus_one( ENOTSUP ); - result = (*temp_loc.ops->utime)( &temp_loc, times->actime, times->modtime ); + result = (*temp_loc.ops->utime_h)( &temp_loc, times->actime, times->modtime ); rtems_filesystem_freenode( &temp_loc ); diff --git a/c/src/lib/libc/write.c b/c/src/lib/libc/write.c index a47a4f40a9..aae273a340 100644 --- a/c/src/lib/libc/write.c +++ b/c/src/lib/libc/write.c @@ -41,10 +41,10 @@ ssize_t write( * Now process the write() request. */ - if ( !iop->handlers->write ) + if ( !iop->handlers->write_h ) set_errno_and_return_minus_one( ENOTSUP ); - rc = (*iop->handlers->write)( iop, buffer, count ); + rc = (*iop->handlers->write_h)( iop, buffer, count ); if ( rc > 0 ) iop->offset += rc; diff --git a/c/src/libfs/src/imfs/imfs_eval.c b/c/src/libfs/src/imfs/imfs_eval.c index 1f1e7c6daf..9cb459de64 100644 --- a/c/src/libfs/src/imfs/imfs_eval.c +++ b/c/src/libfs/src/imfs/imfs_eval.c @@ -333,7 +333,7 @@ int IMFS_evaluate_for_make( } else { newloc = pathloc->mt_entry->mt_point_node; *pathloc = newloc; - return (*pathloc->ops->evalformake)( &path[i-len], pathloc, name ); + return (*pathloc->ops->evalformake_h)( &path[i-len], pathloc, name ); } } else { @@ -381,7 +381,7 @@ int IMFS_evaluate_for_make( if ( node->info.directory.mt_fs != NULL ) { newloc = node->info.directory.mt_fs->mt_fs_root; *pathloc = newloc; - return (*pathloc->ops->evalformake)( &path[i-len], pathloc, name ); + return (*pathloc->ops->evalformake_h)( &path[i-len], pathloc, name ); } /* @@ -526,7 +526,7 @@ int IMFS_eval_path( } else { newloc = pathloc->mt_entry->mt_point_node; *pathloc = newloc; - return (*pathloc->ops->evalpath)(&(pathname[i-len]),flags,pathloc); + return (*pathloc->ops->evalpath_h)(&(pathname[i-len]),flags,pathloc); } } else { @@ -578,7 +578,7 @@ int IMFS_eval_path( if ( node->info.directory.mt_fs != NULL ) { newloc = node->info.directory.mt_fs->mt_fs_root; *pathloc = newloc; - return (*pathloc->ops->evalpath)( &pathname[i-len], flags, pathloc ); + return (*pathloc->ops->evalpath_h)( &pathname[i-len], flags, pathloc ); } /* diff --git a/c/src/libfs/src/imfs/imfs_unlink.c b/c/src/libfs/src/imfs/imfs_unlink.c index f001c6450d..b1d68e194a 100644 --- a/c/src/libfs/src/imfs/imfs_unlink.c +++ b/c/src/libfs/src/imfs/imfs_unlink.c @@ -25,7 +25,7 @@ int IMFS_unlink( { IMFS_jnode_t *node; rtems_filesystem_location_info_t the_link; - int result; + int result = 0; node = loc->node_access; @@ -56,7 +56,7 @@ int IMFS_unlink( node->info.hard_link.link_node->st_nlink --; IMFS_update_ctime( node->info.hard_link.link_node ); if ( node->info.hard_link.link_node->st_nlink < 1) { - result = (*the_link.handlers->rmnod)( &the_link ); + result = (*the_link.handlers->rmnod_h)( &the_link ); if ( result != 0 ) return -1; } @@ -66,7 +66,7 @@ int IMFS_unlink( * Now actually free the node we were asked to free. */ - result = (*loc->handlers->rmnod)( loc ); + result = (*loc->handlers->rmnod_h)( loc ); return result; } diff --git a/c/src/libfs/src/imfs/ioman.c b/c/src/libfs/src/imfs/ioman.c index 4f592a6094..e9b486937c 100644 --- a/c/src/libfs/src/imfs/ioman.c +++ b/c/src/libfs/src/imfs/ioman.c @@ -80,12 +80,12 @@ rtems_status_code rtems_io_lookup_name( result = rtems_filesystem_evaluate_path( name, 0x00, &loc, TRUE ); the_jnode = loc.node_access; - if ( !loc.ops->node_type ) { + if ( !loc.ops->node_type_h ) { rtems_filesystem_freenode( &loc ); set_errno_and_return_minus_one( ENOTSUP ); } - node_type = (*loc.ops->node_type)( &loc ); + node_type = (*loc.ops->node_type_h)( &loc ); if ( (result != 0) || node_type != RTEMS_FILESYSTEM_DEVICE ) { *device_info = 0; -- cgit v1.2.3