Commit Graph

19 Commits

Author SHA1 Message Date
Sebastian Huber
eb7753437f Filesystem: Delete unused fsmountme_h handler 2015-02-09 15:38:48 +01:00
Sebastian Huber
c625a64121 Filesystem: Delete node type operation
Use the fstat handler instead.
2015-01-22 07:52:40 +01:00
Chris Johns
c49985691f Change all references of rtems.com to rtems.org. 2014-03-21 08:10:47 +11:00
Sebastian Huber
56bea4339f Filesystem: Use default kqfilter and poll handler 2013-12-20 10:31:53 +01:00
Sebastian Huber
2f68778f08 Filesystem: Add readv/writev handlers
The readv() and writev() support was implemented in terms of multiple
calls to the read and write handlers.  This imposes a problem on device
files which use an IO vector as single request entity.  For example a
low-level network device (e.g. BPF(4)) may use an IO vector to create
one frame from multiple protocol layers each with its own IO vector
entry.
2013-12-20 10:31:53 +01:00
Mathew Kallada
9bff3752de libfs: Doxygen Enhancement GCI Task #7
http://www.google-melange.com/gci/task/view/google/gci2012/8006219
2012-12-11 18:54:46 -05:00
Sebastian Huber
da154e14f6 Filesystem: Move operations to mount table entry
The scope of the file system operations is the file system instance.
The scope of the file system node handlers is the file location.  The
benefit of moving the operations to the mount table entry is a size
reduction of the file location (rtems_filesystem_location_info_t).  The
code size is slightly increased due to additional load instructions.

Restructure rtems_filesystem_mount_table_entry_t to improve cache
efficiency.
2012-05-15 10:01:43 +02:00
Joel Sherrill
9b4422a251 Remove All CVS Id Strings Possible Using a Script
Script does what is expected and tries to do it as
smartly as possible.

+ remove occurrences of two blank comment lines
  next to each other after Id string line removed.
+ remove entire comment blocks which only exited to
  contain CVS Ids
+ If the processing left a blank line at the top of
  a file, it was removed.
2012-05-11 08:44:13 -05:00
Sebastian Huber
30d412469c Filesystem: PR1398: Fix lseek() mechanic
According to POSIX the lseek() function shall not, by itself, extend the
size of a file.

Remove the size field of rtems_libio_t.  A file has only one size but
may have multiple open file descriptors.  Thus a file size field in the
file descriptor may lead to inconsistencies.

New default handlers rtems_filesystem_default_lseek_file() and
rtems_filesystem_default_lseek_directory().
2012-05-11 13:58:43 +02:00
Sebastian Huber
4116fce629 Filesystem: New defaults fsync_h and fdatasync_h
New defaults rtems_filesystem_default_fsync_or_fdatasync() and
rtems_filesystem_default_fsync_or_fdatasync_success() for fsync_h and
fdatasync_h.  The rtems_filesystem_default_fsync_or_fdatasync() sets now
errno to EINVAL according to POSIX.
2012-03-13 12:23:45 +01:00
Sebastian Huber
3b7c123c8d Filesystem: Reference counting for locations
o A new data structure rtems_filesystem_global_location_t was
   introduced to be used for
    o the mount point location in the mount table entry,
    o the file system root location in the mount table entry,
    o the root directory location in the user environment, and
    o the current directory location in the user environment.
   During the path evaluation global start locations are obtained to
   ensure that the current file system instance will be not unmounted in
   the meantime.
 o The user environment uses now reference counting and is protected
   from concurrent access.
 o The path evaluation process was completely rewritten and simplified.
   The IMFS, RFS, NFS, and DOSFS use now a generic path evaluation
   method.  Recursive calls in the path evaluation have been replaced
   with iteration to avoid stack overflows.  Only the evaluation of
   symbolic links is recursive.  No dynamic memory allocations and
   intermediate buffers are used in the high level path evaluation.  No
   global locks are held during the file system instance specific path
   evaluation process.
 o Recursive symbolic link evaluation is now limited by
   RTEMS_FILESYSTEM_SYMLOOP_MAX.  Applications can retrieve this value
   via sysconf().
 o The device file system (devFS) uses now no global variables and
   allocation from the workspace.  Node names are allocated from the
   heap.
 o The upper layer lseek() performs now some parameter checks.
 o The upper layer ftruncate() performs now some parameter checks.
 o unmask() is now restricted to the RWX flags and protected from
   concurrent access.
 o The fchmod_h and rmnod_h file system node handlers are now a file
   system operation.
 o The unlink_h operation has been removed.  All nodes are now destroyed
   with the rmnod_h operation.
 o New lock_h, unlock_h, clonenod_h, and are_nodes_equal_h file system
   operations.
 o The path evaluation and file system operations are now protected by
   per file system instance lock and unlock operations.
 o Fix and test file descriptor duplicate in fcntl().
 o New test fstests/fsnofs01.
2012-03-13 12:23:37 +01:00
Sebastian Huber
1052242d23 Removed fpathconf file system node handler.
There existed no calling function for this handler.
2012-02-02 15:55:33 +01:00
Ralf Corsepius
66b8047e52 Remove stray whitespaces. 2011-11-06 12:44:24 +00:00
Jennifer Averett
dace9ed18b 2010-06-29 Jennifer.Averett <Jennifer.Averett@OARcorp.com>
* libcsupport/include/rtems/libio.h, libfs/Makefile.am,
	libfs/src/defaults/default_chown.c,
	libfs/src/defaults/default_evalpath.c,
	libfs/src/defaults/default_freenode.c,
	libfs/src/defaults/default_fsmount.c,
	libfs/src/defaults/default_link.c,
	libfs/src/defaults/default_mount.c,
	libfs/src/defaults/default_rename.c,
	libfs/src/defaults/default_statvfs.c,
	libfs/src/defaults/default_symlink.c,
	libfs/src/defaults/default_unlink.c,
	libfs/src/defaults/default_utime.c, libfs/src/devfs/devfs_init.c,
	libfs/src/dosfs/msdos_init.c, libfs/src/imfs/imfs_init.c,
	libfs/src/nfsclient/src/nfs.c, libfs/src/rfs/rtems-rfs-rtems.c,
	wrapup/Makefile.am: Fixed typo in default names. Added default
	methods into filesystem tables.
	* libfs/src/defaults/default_close.c,
	libfs/src/defaults/default_evaluate_link.c,
	libfs/src/defaults/default_fpathconf.c,
	libfs/src/defaults/default_fsunmount.c,
	libfs/src/defaults/default_open.c,
	libfs/src/defaults/default_unmount.c: New files.
2010-06-29 19:37:28 +00:00
Chris Johns
29e92b090c 2010-05-31 Chris Johns <chrisj@rtems.org>
* libcsupport/Makefile.am: Add mount-mgr.c.
        * libcsupport/src/mount-mgr.c: New.
        * include/rtems/fs.h: Added rtems_filesystem_location_mount.
        * libcsupport/include/rtems/libio.h, libcsupport/src/mount.c: New
        mount interface. It is similar to Linux.
        * libcsupport/include/rtems/libio_.h: Remove the
        init_fs_mount_table call.
        * libcsupport/src/base_fs.c: Remove init_fs_mount_table_call. Use
        the new mount call. Remove setting the root node in the global
        pathloc. Mount does this now.
        * libcsupport/src/privateenv.c: Remove the hack to set the root
        mount table entry in the environment.
        * libcsupport/src/unmount.cL Free the target string.
        * libblock/src/bdpart-mount.c: New mount API.

        * libfs/src/devfs/devfs.h, libfs/src/devfs/devfs_init.c,
        libfs/src/dosfs/dosfs.h, libfs/src/dosfs/msdos.h,
        libfs/src/dosfs/msdos_init.c, libfs/src/imfs/imfs.h,
        libfs/src/imfs/imfs_eval.c, libfs/src/imfs/imfs_init.c,
        libfs/src/imfs/miniimfs_init.c,
        libfs/src/nfsclient/src/librtemsNfs.h,
        libfs/src/rfs/rtems-rfs-rtems.c, libfs/src/rfs/rtems-rfs.h,
        libnetworking/lib/ftpfs.c, libnetworking/rtems/ftpfs.h,
        libnetworking/rtems/tftp.h: New mount_h API.

        * libfs/src/devfs/devfs_eval.c: Local include of extern ops.
        * libfs/src/nfsclient/src/nfs.c: New mount API. Removed the mount
        me call and fixed the initialisation to happen when mounting.

        * libmisc/Makefile.am, libmisc/shell/shellconfig.h: Remove mount
        filesystem files.

        * libmisc/fsmount/fsmount.c, libmisc/fsmount/fsmount.h: Updated to
        the new mount table values.

        * libmisc/shell/main_mount_ftp.c,
        libmisc/shell/main_mount_msdos.c, libmisc/shell/main_mount_rfs.c,
        libmisc/shell/main_mount_tftp.c: Removed.

        * libmisc/shell/main_mount.c: Use the new mount API. Also access
        the file system table for the file system types.

        * libnetworking/lib/tftpDriver.c: Updated to the new mount
        API. Fixed to allow mounting from any mount point. Also can now
        have more than file system mounted.

        * sapi/include/confdefs.h: Add file system configuration support.
2010-05-31 13:56:37 +00:00
Ralf Corsepius
0a7278e497 Whitespace removal. 2009-11-29 13:20:53 +00:00
Chris Johns
eb649786c8 2009-10-08 Chris Johns <chrisj@rtems.org>
* Makefile.am, preinstall.am: Added statvfs.h.
        * libcsupport/Makefile.am: Add statvfs.c.
        * libcsupport/include/sys/statvfs.h, libcsupport/src/statvfs.c:
        New.
        * libcsupport/include/rtems/libio.h: Add a file system handler for
        the statvfs call.
        * libfs/src/devfs/devfs_init.c, libfs/src/dosfs/msdos_init.c,
        libfs/src/imfs/imfs_init.c, libfs/src/nfsclient/src/nfs.c: Set the
        statvfs handler to NULL.
        * include/rtems/fs.h: Add a second node access field for the RFS
        file system to hold a directory offset while the existing field
        holds the inode number. This save a rescan of the directory when
        working with directories.
        * libblock/include/rtems/bdbuf.h: Added references and user fields
        to the buffer descriptor.
        * libblock/src/bdbuf.c: Added dynamic buffer support for different
        block sizes. Fixed a number of bugs.
        * libblock/src/blkdev.c: Release the disk device on an error.
        * libblock/src/diskdevs.c: Set the block size to the media block
        size during initialisation of the disk device.
        * libblock/src/flashdisk.c, libblock/src/nvdisk.c,
        libblock/src/ramdisk.c: Updated the drivers to handle variable
        block sizes.
        * libfs/src/dosfs/fat.c, libfs/src/dosfs/fat.h: Release any
        buffers when an error occurs. The FAT buffer layer hangs onto a
        single buffer while mounted. This should be fixed.
        * sapi/inline/rtems/chain.inl: Added rtems_chain_set_off_chain,
        rtems_chain_is_node_off_chain, and rtems_chain_previous.
        * score/inline/rtems/score/chain.inl: Added _Chain_Set_off_chain,
        and _Chain_Is_node_off_chain.
        * libmisc/shell/main_ln.c, libmisc/shell/main_mknod.c,
        libmisc/shell/mknod-pack_dev.c, libmisc/shell/mknod-pack_dev.h:
        New shell commands.
        * libmisc/Makefile.am, libmisc/shell/shellconfig.h: Added ln and
        mknod commands.
        * libmisc/shell/hexdump-display.c: Fixed the reopen bug which
        showed up as a free with a bad pointer.
        * libmisc/shell/main_mount.c: List the user adding file system
        when listing the available file systems to mount.
        * libmisc/shell/utils-cp.c: Remove the fixed static copy buffer
        and use a large dynamic buffer.
        * score/inline/rtems/score/address.inl, score/src/coremsgsubmit.c,
        score/src/objectallocate.c, score/src/objectfree.c: Remove
        warnings.
2009-10-08 07:07:36 +00:00
Joel Sherrill
6a14d440bc 2008-09-17 Joel Sherrill <joel.sherrill@oarcorp.com>
* libfs/src/devfs/devclose.c, libfs/src/devfs/devfs_init.c,
	libfs/src/devfs/devfs_show.c, libfs/src/devfs/devioctl.c,
	libfs/src/devfs/devopen.c, libfs/src/devfs/devread.c,
	libfs/src/devfs/devwrite.c: Fix warnings.
2008-09-17 19:14:20 +00:00
Joel Sherrill
d40da79b04 2008-09-17 Miao Yan <yanmiaobest@gmail.com>
* Makefile.am, preinstall.am, libcsupport/Makefile.am,
	libcsupport/include/rtems/libcsupport.h,
	libcsupport/include/rtems/libio.h, libcsupport/src/base_fs.c,
	libcsupport/src/libio_init.c, libcsupport/src/newlibc_exit.c,
	libcsupport/src/newlibc_init.c, libcsupport/src/sync.c,
	libfs/Makefile.am, libfs/src/imfs/deviceio.c,
	sapi/include/confdefs.h: Merge GSOC project code to add simple device
	only filesystem (devfs), optionally completely drop out filesystem,
	and to clean up disabling newlib reentrancy support. This dropped 17K
	from the minimum.exe for sparc/sis and arm/rtl22xx_t now has a 15K
	code space.
	* libcsupport/src/__usrenv.c, libcsupport/src/newlibc_reent.c,
	libfs/src/devfs/devclose.c, libfs/src/devfs/devfs.h,
	libfs/src/devfs/devfs_eval.c, libfs/src/devfs/devfs_init.c,
	libfs/src/devfs/devfs_mknod.c, libfs/src/devfs/devfs_node_type.c,
	libfs/src/devfs/devfs_show.c, libfs/src/devfs/devioctl.c,
	libfs/src/devfs/devopen.c, libfs/src/devfs/devread.c,
	libfs/src/devfs/devstat.c, libfs/src/devfs/devwrite.c,
	libfs/src/imfs/deviceerrno.c: New files.
	* libcsupport/src/newlibc.c: Removed.
2008-09-17 16:12:04 +00:00