diff options
author | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2010-08-25 09:37:49 +0000 |
---|---|---|
committer | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2010-08-25 09:37:49 +0000 |
commit | 97882792378d17a167ff9c9249ef178a86e9846f (patch) | |
tree | b2a94cdd6793793d7f27c59dd20c95edb26dbb8d /cpukit/libfs | |
parent | 2010-08-25 Sebastian Huber <sebastian.huber@embedded-brains.de> (diff) | |
download | rtems-97882792378d17a167ff9c9249ef178a86e9846f.tar.bz2 |
2010-08-25 Sebastian Huber <sebastian.huber@embedded-brains.de>
* libfs/src/imfs/imfs_fcntl.c: Removed file.
* libfs/Makefile.am: Reflect change from above.
* libfs/src/defaults/default_fcntl.c: Return 0 instead of -1 and errno.
* libfs/src/imfs/imfs.h, libfs/src/imfs/imfs_fifo.c,
libfs/src/imfs/imfs_handlers_directory.c,
libfs/src/imfs/imfs_handlers_memfile.c, libfs/src/nfsclient/src/nfs.c,
libfs/src/rfs/rtems-rfs-rtems-dir.c,
libfs/src/rfs/rtems-rfs-rtems-file.c, libfs/src/rfs/rtems-rfs-rtems.c,
libfs/src/rfs/rtems-rfs-rtems.h: Use default file system handlers.
Diffstat (limited to 'cpukit/libfs')
-rw-r--r-- | cpukit/libfs/Makefile.am | 2 | ||||
-rw-r--r-- | cpukit/libfs/src/defaults/default_fcntl.c | 2 | ||||
-rw-r--r-- | cpukit/libfs/src/imfs/imfs.h | 5 | ||||
-rw-r--r-- | cpukit/libfs/src/imfs/imfs_fcntl.c | 28 | ||||
-rw-r--r-- | cpukit/libfs/src/imfs/imfs_fifo.c | 2 | ||||
-rw-r--r-- | cpukit/libfs/src/imfs/imfs_handlers_directory.c | 2 | ||||
-rw-r--r-- | cpukit/libfs/src/imfs/imfs_handlers_memfile.c | 2 | ||||
-rw-r--r-- | cpukit/libfs/src/nfsclient/src/nfs.c | 170 | ||||
-rw-r--r-- | cpukit/libfs/src/rfs/rtems-rfs-rtems-dir.c | 2 | ||||
-rw-r--r-- | cpukit/libfs/src/rfs/rtems-rfs-rtems-file.c | 2 | ||||
-rw-r--r-- | cpukit/libfs/src/rfs/rtems-rfs-rtems.c | 15 | ||||
-rw-r--r-- | cpukit/libfs/src/rfs/rtems-rfs-rtems.h | 9 |
12 files changed, 32 insertions, 209 deletions
diff --git a/cpukit/libfs/Makefile.am b/cpukit/libfs/Makefile.am index 8901b184bf..e0122a513f 100644 --- a/cpukit/libfs/Makefile.am +++ b/cpukit/libfs/Makefile.am @@ -40,7 +40,7 @@ libimfs_a_SOURCES = libimfs_a_SOURCES += src/imfs/deviceerrno.c src/imfs/deviceio.c \ src/imfs/fifoimfs_init.c src/imfs/imfs_chown.c src/imfs/imfs_config.c \ src/imfs/imfs_creat.c src/imfs/imfs_debug.c src/imfs/imfs_directory.c \ - src/imfs/imfs_eval.c src/imfs/imfs_fchmod.c src/imfs/imfs_fcntl.c \ + src/imfs/imfs_eval.c src/imfs/imfs_fchmod.c \ src/imfs/imfs_fdatasync.c src/imfs/imfs_fifo.c \ src/imfs/imfs_fsunmount.c src/imfs/imfs_getchild.c \ src/imfs/imfs_gtkn.c src/imfs/imfs_handlers_device.c \ diff --git a/cpukit/libfs/src/defaults/default_fcntl.c b/cpukit/libfs/src/defaults/default_fcntl.c index 58a40c8d6b..d9d8602e40 100644 --- a/cpukit/libfs/src/defaults/default_fcntl.c +++ b/cpukit/libfs/src/defaults/default_fcntl.c @@ -18,5 +18,5 @@ int rtems_filesystem_default_fcntl( rtems_libio_t *iop ) { - rtems_set_errno_and_return_minus_one( ENOTSUP ); + return 0; } diff --git a/cpukit/libfs/src/imfs/imfs.h b/cpukit/libfs/src/imfs/imfs.h index 9b3c541144..3dc8aefc2e 100644 --- a/cpukit/libfs/src/imfs/imfs.h +++ b/cpukit/libfs/src/imfs/imfs.h @@ -542,11 +542,6 @@ extern int IMFS_fdatasync( rtems_libio_t *iop ); -extern int IMFS_fcntl( - int cmd, - rtems_libio_t *iop -); - extern void IMFS_create_orphan( IMFS_jnode_t *jnode ); diff --git a/cpukit/libfs/src/imfs/imfs_fcntl.c b/cpukit/libfs/src/imfs/imfs_fcntl.c deleted file mode 100644 index ca802b8331..0000000000 --- a/cpukit/libfs/src/imfs/imfs_fcntl.c +++ /dev/null @@ -1,28 +0,0 @@ -/* - * IMFS_fcntl - * - * The following routine does a fcntl on an IMFS node. - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.rtems.com/license/LICENSE. - * - * $Id$ - */ - -#if HAVE_CONFIG_H -#include "config.h" -#endif - -#include "imfs.h" - -int IMFS_fcntl( - int cmd, - rtems_libio_t *iop -) -{ - return 0; -} diff --git a/cpukit/libfs/src/imfs/imfs_fifo.c b/cpukit/libfs/src/imfs/imfs_fifo.c index 8e59e2fe14..7cb3bbcd85 100644 --- a/cpukit/libfs/src/imfs/imfs_fifo.c +++ b/cpukit/libfs/src/imfs/imfs_fifo.c @@ -143,6 +143,6 @@ const rtems_filesystem_file_handlers_r IMFS_fifo_handlers = { rtems_filesystem_default_fpathconf, rtems_filesystem_default_fsync, rtems_filesystem_default_fdatasync, - IMFS_fcntl, + rtems_filesystem_default_fcntl, IMFS_rmnod, }; diff --git a/cpukit/libfs/src/imfs/imfs_handlers_directory.c b/cpukit/libfs/src/imfs/imfs_handlers_directory.c index 17407cc5c6..d70957d018 100644 --- a/cpukit/libfs/src/imfs/imfs_handlers_directory.c +++ b/cpukit/libfs/src/imfs/imfs_handlers_directory.c @@ -36,6 +36,6 @@ const rtems_filesystem_file_handlers_r IMFS_directory_handlers = { rtems_filesystem_default_fpathconf, rtems_filesystem_default_fsync, IMFS_fdatasync, - IMFS_fcntl, + rtems_filesystem_default_fcntl, imfs_dir_rmnod }; diff --git a/cpukit/libfs/src/imfs/imfs_handlers_memfile.c b/cpukit/libfs/src/imfs/imfs_handlers_memfile.c index a64bff668d..33003ecba9 100644 --- a/cpukit/libfs/src/imfs/imfs_handlers_memfile.c +++ b/cpukit/libfs/src/imfs/imfs_handlers_memfile.c @@ -36,6 +36,6 @@ const rtems_filesystem_file_handlers_r IMFS_memfile_handlers = { rtems_filesystem_default_fpathconf, IMFS_fdatasync, /* fsync */ IMFS_fdatasync, - IMFS_fcntl, + rtems_filesystem_default_fcntl, IMFS_rmnod }; diff --git a/cpukit/libfs/src/nfsclient/src/nfs.c b/cpukit/libfs/src/nfsclient/src/nfs.c index 52eede17f1..a3c85ea0db 100644 --- a/cpukit/libfs/src/nfsclient/src/nfs.c +++ b/cpukit/libfs/src/nfsclient/src/nfs.c @@ -1861,53 +1861,6 @@ Nfs nfs = ((NfsNode)pathloc->node_access)->nfs; * rather than by recursion. */ -#ifdef DECLARE_BODY -/* This routine is called when they try to mount something - * on top of THIS filesystem, i.e. if one of our directories - * is used as a mount point - */ -static int nfs_mount( - rtems_filesystem_mount_table_entry_t *mt_entry /* in */ -)DECLARE_BODY -#else -#define nfs_mount 0 -#endif - -#ifdef DECLARE_BODY -/* This op is called when they try to unmount a FS - * from a mountpoint managed by THIS FS. - */ -static int nfs_unmount( - rtems_filesystem_mount_table_entry_t *mt_entry /* in */ -)DECLARE_BODY -#else -#define nfs_unmount 0 -#endif - -#if 0 - -/* for reference (libio.h) */ - -struct rtems_filesystem_mount_table_entry_tt { - rtems_chain_node Node; - rtems_filesystem_location_info_t mt_point_node; - rtems_filesystem_location_info_t mt_fs_root; - int options; - void *fs_info; - - rtems_filesystem_limits_and_options_t pathconf_limits_and_options; - - /* - * When someone adds a mounted filesystem on a real device, - * this will need to be used. - * - * The best option long term for this is probably an open file descriptor. - */ - char *dev; -}; -#endif - - int rtems_nfs_initialize( rtems_filesystem_mount_table_entry_t *mt_entry, const void *data @@ -2478,9 +2431,9 @@ struct _rtems_filesystem_operations_table nfs_fs_ops = { nfs_mknod, /* OPTIONAL; may be defaulted */ nfs_chown, /* OPTIONAL; may be defaulted */ nfs_freenode, /* OPTIONAL; may be defaulted; (release node_access) */ - nfs_mount, /* OPTIONAL; may be defaulted */ + rtems_filesystem_default_mount, rtems_nfs_initialize, /* OPTIONAL; may be defaulted -- not used anymore */ - nfs_unmount, /* OPTIONAL; may be defaulted */ + rtems_filesystem_default_unmount, nfs_fsunmount_me, /* OPTIONAL; may be defaulted */ nfs_utime, /* OPTIONAL; may be defaulted */ nfs_eval_link, /* OPTIONAL; may be defaulted */ @@ -2567,8 +2520,6 @@ DirInfo di; return 0; } -#define nfs_link_open 0 - static int nfs_file_close( rtems_libio_t *iop ) @@ -2585,8 +2536,6 @@ static int nfs_dir_close( return 0; } -#define nfs_link_close 0 - static ssize_t nfs_file_read( rtems_libio_t *iop, void *buffer, @@ -2689,8 +2638,6 @@ RpcUdpServer server = ((Nfs)iop->pathinfo.mt_entry->fs_info)->server; return (char*)di->ptr - (char*)buffer; } -#define nfs_link_read 0 - static ssize_t nfs_file_write( rtems_libio_t *iop, const void *buffer, @@ -2741,22 +2688,6 @@ int e; return count; } -#define nfs_dir_write 0 -#define nfs_link_write 0 - -/* IOCTL is unneeded/unsupported */ -#ifdef DECLARE_BODY -static int nfs_file_ioctl( - rtems_libio_t *iop, - uint32_t command, - void *buffer -)DECLARE_BODY -#else -#define nfs_file_ioctl 0 -#define nfs_dir_ioctl 0 -#define nfs_link_ioctl 0 -#endif - static rtems_off64_t nfs_file_lseek( rtems_libio_t *iop, rtems_off64_t length, @@ -2816,8 +2747,6 @@ DirInfo di = iop->pathinfo.node_access_2; return iop->offset; } -#define nfs_link_lseek 0 - #if 0 /* structure types for reference */ struct fattr { ftype type; @@ -3044,55 +2973,6 @@ sattr arg; SATTR_SIZE); } -#define nfs_dir_ftruncate 0 -#define nfs_link_ftruncate 0 - -/* not implemented */ -#ifdef DECLARE_BODY -static int nfs_file_fpathconf( - rtems_libio_t *iop, - int name -)DECLARE_BODY -#else -#define nfs_file_fpathconf 0 -#define nfs_dir_fpathconf 0 -#define nfs_link_fpathconf 0 -#endif - -/* unused */ -#ifdef DECLARE_BODY -static int nfs_file_fsync( - rtems_libio_t *iop -)DECLARE_BODY -#else -#define nfs_file_fsync 0 -#define nfs_dir_fsync 0 -#define nfs_link_fsync 0 -#endif - -/* unused */ -#ifdef DECLARE_BODY -static int nfs_file_fdatasync( - rtems_libio_t *iop -)DECLARE_BODY -#else -#define nfs_file_fdatasync 0 -#define nfs_dir_fdatasync 0 -#define nfs_link_fdatasync 0 -#endif - -/* unused */ -#ifdef DECLARE_BODY -static int nfs_file_fcntl( - int cmd, - rtems_libio_t *iop -)DECLARE_BODY -#else -#define nfs_file_fcntl 0 -#define nfs_dir_fcntl 0 -#define nfs_link_fcntl 0 -#endif - /* files and symlinks are removed * by the common nfs_unlink() routine. * NFS has a different NFSPROC_RMDIR @@ -3113,15 +2993,15 @@ struct _rtems_filesystem_file_handlers_r nfs_file_file_handlers = { nfs_file_close, /* OPTIONAL; may be defaulted */ nfs_file_read, /* OPTIONAL; may be defaulted */ nfs_file_write, /* OPTIONAL; may be defaulted */ - nfs_file_ioctl, /* OPTIONAL; may be defaulted */ + rtems_filesystem_default_ioctl, nfs_file_lseek, /* OPTIONAL; may be defaulted */ nfs_fstat, /* OPTIONAL; may be defaulted */ nfs_fchmod, /* OPTIONAL; may be defaulted */ nfs_file_ftruncate, /* OPTIONAL; may be defaulted */ - nfs_file_fpathconf, /* OPTIONAL; may be defaulted - UNUSED */ - nfs_file_fsync, /* OPTIONAL; may be defaulted */ - nfs_file_fdatasync, /* OPTIONAL; may be defaulted */ - nfs_file_fcntl, /* OPTIONAL; may be defaulted */ + rtems_filesystem_default_fpathconf, + rtems_filesystem_default_fsync, + rtems_filesystem_default_fdatasync, + rtems_filesystem_default_fcntl, nfs_unlink, /* OPTIONAL; may be defaulted */ }; @@ -3131,35 +3011,35 @@ struct _rtems_filesystem_file_handlers_r nfs_dir_file_handlers = { nfs_dir_open, /* OPTIONAL; may be defaulted */ nfs_dir_close, /* OPTIONAL; may be defaulted */ nfs_dir_read, /* OPTIONAL; may be defaulted */ - nfs_dir_write, /* OPTIONAL; may be defaulted */ - nfs_dir_ioctl, /* OPTIONAL; may be defaulted */ + rtems_filesystem_default_write, + rtems_filesystem_default_ioctl, nfs_dir_lseek, /* OPTIONAL; may be defaulted */ nfs_fstat, /* OPTIONAL; may be defaulted */ nfs_fchmod, /* OPTIONAL; may be defaulted */ - nfs_dir_ftruncate, /* OPTIONAL; may be defaulted */ - nfs_dir_fpathconf, /* OPTIONAL; may be defaulted - UNUSED */ - nfs_dir_fsync, /* OPTIONAL; may be defaulted */ - nfs_dir_fdatasync, /* OPTIONAL; may be defaulted */ - nfs_dir_fcntl, /* OPTIONAL; may be defaulted */ + rtems_filesystem_default_ftruncate, + rtems_filesystem_default_fpathconf, + rtems_filesystem_default_fsync, + rtems_filesystem_default_fdatasync, + rtems_filesystem_default_fcntl, nfs_dir_rmnod, /* OPTIONAL; may be defaulted */ }; /* the link handlers table */ static struct _rtems_filesystem_file_handlers_r nfs_link_file_handlers = { - nfs_link_open, /* OPTIONAL; may be defaulted */ - nfs_link_close, /* OPTIONAL; may be defaulted */ - nfs_link_read, /* OPTIONAL; may be defaulted */ - nfs_link_write, /* OPTIONAL; may be defaulted */ - nfs_link_ioctl, /* OPTIONAL; may be defaulted */ - nfs_link_lseek, /* OPTIONAL; may be defaulted */ + rtems_filesystem_default_open, + rtems_filesystem_default_close, + rtems_filesystem_default_read, + rtems_filesystem_default_write, + rtems_filesystem_default_ioctl, + rtems_filesystem_default_lseek, nfs_fstat, /* OPTIONAL; may be defaulted */ nfs_fchmod, /* OPTIONAL; may be defaulted */ - nfs_link_ftruncate, /* OPTIONAL; may be defaulted */ - nfs_link_fpathconf, /* OPTIONAL; may be defaulted - UNUSED */ - nfs_link_fsync, /* OPTIONAL; may be defaulted */ - nfs_link_fdatasync, /* OPTIONAL; may be defaulted */ - nfs_link_fcntl, /* OPTIONAL; may be defaulted */ + rtems_filesystem_default_ftruncate, + rtems_filesystem_default_fpathconf, + rtems_filesystem_default_fsync, + rtems_filesystem_default_fdatasync, + rtems_filesystem_default_fcntl, nfs_unlink, /* OPTIONAL; may be defaulted */ }; diff --git a/cpukit/libfs/src/rfs/rtems-rfs-rtems-dir.c b/cpukit/libfs/src/rfs/rtems-rfs-rtems-dir.c index 46a2f4f894..ad7b65298a 100644 --- a/cpukit/libfs/src/rfs/rtems-rfs-rtems-dir.c +++ b/cpukit/libfs/src/rfs/rtems-rfs-rtems-dir.c @@ -239,6 +239,6 @@ const rtems_filesystem_file_handlers_r rtems_rfs_rtems_dir_handlers = { .fpathconf_h = rtems_filesystem_default_fpathconf, .fsync_h = rtems_filesystem_default_fsync, .fdatasync_h = rtems_rfs_rtems_fdatasync, - .fcntl_h = rtems_rfs_rtems_fcntl, + .fcntl_h = rtems_filesystem_default_fcntl, .rmnod_h = rtems_rfs_rtems_dir_rmnod }; diff --git a/cpukit/libfs/src/rfs/rtems-rfs-rtems-file.c b/cpukit/libfs/src/rfs/rtems-rfs-rtems-file.c index 8525e3c80c..093d7b0623 100644 --- a/cpukit/libfs/src/rfs/rtems-rfs-rtems-file.c +++ b/cpukit/libfs/src/rfs/rtems-rfs-rtems-file.c @@ -341,6 +341,6 @@ const rtems_filesystem_file_handlers_r rtems_rfs_rtems_file_handlers = { .fpathconf_h = rtems_filesystem_default_fpathconf, .fsync_h = rtems_rfs_rtems_fdatasync, .fdatasync_h = rtems_rfs_rtems_fdatasync, - .fcntl_h = rtems_rfs_rtems_fcntl, + .fcntl_h = rtems_filesystem_default_fcntl, .rmnod_h = rtems_rfs_rtems_rmnod }; diff --git a/cpukit/libfs/src/rfs/rtems-rfs-rtems.c b/cpukit/libfs/src/rfs/rtems-rfs-rtems.c index e7a363639e..b5d665e159 100644 --- a/cpukit/libfs/src/rfs/rtems-rfs-rtems.c +++ b/cpukit/libfs/src/rfs/rtems-rfs-rtems.c @@ -853,21 +853,6 @@ rtems_rfs_rtems_fchmod (rtems_filesystem_location_info_t* pathloc, } /** - * The following routine does a fcntl on an node. - * - * @param cmd - * @param iop - * @return int - */ - -int -rtems_rfs_rtems_fcntl (int cmd, - rtems_libio_t* iop) -{ - return 0; -} - -/** * The following routine does a stat on a node. * * @param pathloc diff --git a/cpukit/libfs/src/rfs/rtems-rfs-rtems.h b/cpukit/libfs/src/rfs/rtems-rfs-rtems.h index b7028b0851..dd2c5b7cd9 100644 --- a/cpukit/libfs/src/rfs/rtems-rfs-rtems.h +++ b/cpukit/libfs/src/rfs/rtems-rfs-rtems.h @@ -306,13 +306,4 @@ int rtems_rfs_rtems_rmnod (rtems_filesystem_location_info_t* parent_pathloc, */ int rtems_rfs_rtems_fdatasync (rtems_libio_t* iop); -/** - * The following routine does a fcntl on an node. - * - * @param cmd - * @param iop - * @return int - */ -int rtems_rfs_rtems_fcntl (int cmd, rtems_libio_t* iop); - #endif |