Commit Graph

25 Commits

Author SHA1 Message Date
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
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
Joel Sherrill
2d08be11dd 2010-08-02 Joel Sherrill <joel.sherrill@oarcorp.com>
* libcsupport/src/base_fs.c, libcsupport/src/rtems_mkdir.c: Formatting.
2010-08-02 18:24:15 +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
9839023a9b 2009-10-14 Ralf Corsépius <ralf.corsepius@rtems.org>
* libcsupport/src/base_fs.c: Eliminate RTEMS_UNIX.
2009-10-14 16:21:28 +00:00
Chris Johns
7baa484300 2009-06-12 Chris Johns <chrisj@rtems.org>
* libblock/src/bdbuf.c: Update comments.
        * libblock/src/bdpart.c, libblock/src/ide_part_table.c: Get the
        device from the rdev field of the stat buf.
        * libcsupport/include/rtems/libio.h: Add a path length to evalpath
        handler. Add parent locations to rmmod and unlink handlers.
        * libcsupport/include/rtems/libio_.h: Add a path length to
        rtems_filesystem_evaluate_path. Add
        rtems_filesystem_evaluate_relative_path, rtems_filesystem_dirname,
        and rtems_filesystem_prefix_separators. Remove
        rtems_filesystem_evaluate_parent.
        * libcsupport/src/base_fs.c, libcsupport/src/chdir.c,
        libcsupport/src/chmod.c, libcsupport/src/chown.c,
        libcsupport/src/chroot.c, libcsupport/src/fchdir.c,
        libcsupport/src/link.c, libcsupport/src/mount.c,
        libcsupport/src/open.c, libcsupport/src/privateenv.c,
        libcsupport/src/readlink.c, libcsupport/src/unmount.c,
        libcsupport/src/utime.c, libcsupport/src/unmount.c,
        libcsupport/src/utime.c, libfs/src/devfs/devfs.h,
        libfs/src/devfs/devfs_eval.c, libfs/src/devfs/devstat.c,
        libfs/src/dosfs/msdos_create.c, libfs/src/dosfs/msdos_misc.c,
        libfs/src/imfs/imfs.h, libfs/src/imfs/imfs_eval.c,
        libfs/src/imfs/imfs_load_tar.c, libfs/src/imfs/ioman.c,
        libfs/src/pipe/pipe.c, libmisc/fsmount/fsmount.c,
        libnetworking/lib/ftpfs.c: Add the length parameter to the eval
        call.
        * libcsupport/src/eval.c: Add rtems_filesystem_prefix_separators,
        rtems_filesystem_dirname,
        rtems_filesystem_evaluate_relative_path. Add the length parameter
        to the eval call.
        * libcsupport/src/rmdir.c: Find the parent pathloc then the node
        pathloc from that node. Remove the call to find the parent given
        the node pathloc.
        * libcsupport/src/stat.c: Add the length parameter to the eval
        call. Set the device into the rdev field.
        * libcsupport/src/unlink.c: Find the parent pathloc then the node
        pathloc from that node. Remove the call to find the parent given
        the node pathloc.
        * libfs/src/dosfs/fat.c, libfs/src/dosfs/msdos_format.c: Get the
        disk device number from the stat rdev field.
        * libfs/src/dosfs/msdos.h: Add the length parameter to the eval
        call. Add the parent pathloc to the rmnod handler.
        * libfs/src/dosfs/msdos_dir.c: Add the parent pathloc to the rmnod
        handler.
        * libfs/src/dosfs/msdos_eval.c: Add the length parameter to the
        eval and token call.
        * libfs/src/imfs/imfs_directory.c: Add the parent pathloc to the
        rmnod handler.
        * libfs/src/imfs/imfs_fchmod.c: Do not test the mode flags for
        only the allowed flags. Add the missing flags spec'ed in the POSIX
        standard.
        * libfs/src/imfs/imfs_fsunmount.c, libfs/src/imfs/imfs_rmnod.c,
        libfs/src/imfs/imfs_unlink.c, libfs/src/imfs/memfile.c: Add the
        parent node. Currently ignored in the IMFS.
        * libfs/src/imfs/imfs_stat.c: Return the device number in the rdev
        field.
        * libfs/src/imfs/imfs_mknod.c, libfs/src/imfs/imfs_symlink.c : Add
        the length parameter to the token call.
        * libfs/src/nfsclient/src/nfs.c: Add the length parameter to the
        eval call and parent node to the rmnod and unlink command.
        * libmisc/shell/internal.h: Remove the libc mounter decl to make
        public.
        * libmisc/shell/main_mount.c: Add support for hooking external
        mount support for new file systems.
        * libmisc/shell/shell.h: Add helper functions for the mount
        command.
2009-06-12 01:53:33 +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
Thomas Doerfler
bf95ccb506 Added const qualifier to various pointers and data tables to
reduce size of data area.
	IMFS: Fixed creation of symbolic links to avoid a compiler warning.
	DOSFS: Use LibBlock instead of read() to read the boot record.
2008-05-27 10:34:15 +00:00
Joel Sherrill
f3333d1700 PR 1101/rtems
* libcsupport/src/base_fs.c: Remove extra endif.
2006-06-22 22:27:24 +00:00
Joel Sherrill
1d63ebb9b9 2006-06-22 Joel Sherrill <joel@OARcorp.com>
PR 1101/rtems
	* libcsupport/src/base_fs.c, rtems/src/taskcreate.c, rtems/src/tasks.c,
	score/src/coremutex.c: Remove dead code.
2006-06-22 21:56:13 +00:00
Ralf Corsepius
50f32b1165 Remove stray white spaces. 2004-04-18 06:05:35 +00:00
Joel Sherrill
0eae36c7c7 2003-09-04 Joel Sherrill <joel@OARcorp.com>
* include/chain.h, include/clockdrv.h, include/console.h,
	include/iosupp.h, include/rtc.h, include/spurious.h,
	include/timerdrv.h, include/vmeintr.h, include/motorola/mc68230.h,
	include/rtems/libcsupport.h, include/rtems/libio.h,
	include/rtems/libio_.h, include/rtems/termiostypes.h,
	include/sys/termios.h, include/zilog/z8036.h, include/zilog/z8530.h,
	include/zilog/z8536.h, src/__brk.c, src/__gettod.c, src/__sbrk.c,
	src/__times.c, src/access.c, src/base_fs.c, src/cfgetispeed.c,
	src/cfgetospeed.c, src/cfsetispeed.c, src/cfsetospeed.c, src/chdir.c,
	src/chmod.c, src/chown.c, src/chroot.c, src/close.c, src/ctermid.c,
	src/dup.c, src/dup2.c, src/eval.c, src/fchdir.c, src/fchmod.c,
	src/fcntl.c, src/fdatasync.c, src/fpathconf.c,
	src/fs_null_handlers.c, src/fstat.c, src/fsync.c, src/ftruncate.c,
	src/getdents.c, src/getpwent.c, src/hosterr.c, src/ioctl.c,
	src/isatty.c, src/libio.c, src/libio_sockets.c, src/link.c,
	src/lseek.c, src/lstat.c, src/malloc.c, src/mallocfreespace.c,
	src/mkdir.c, src/mkfifo.c, src/mknod.c, src/mount.c, src/newlibc.c,
	src/no_libc.c, src/no_posix.c, src/open.c, src/pathconf.c,
	src/pipe.c, src/privateenv.c, src/read.c, src/readlink.c,
	src/rewinddir.c, src/rmdir.c, src/seekdir.c, src/stat.c,
	src/symlink.c, src/sync.c, src/tcdrain.c, src/tcflow.c,
	src/tcflush.c, src/tcgetattr.c, src/tcgetprgrp.c, src/tcsendbreak.c,
	src/tcsetattr.c, src/tcsetpgrp.c, src/telldir.c, src/termios.c,
	src/termiosinitialize.c, src/truncate.c, src/umask.c, src/unixlibc.c,
	src/unlink.c, src/unmount.c, src/utime.c, src/write.c: URL for
	license changed.
2003-09-04 18:54:13 +00:00
Jennifer Averett
f6161c72d1 2003-01-03 Till Straumann <strauman@slac.stanford.edu>
* ChangeLog, base_fs.c, getpwent.c, privateenv.c
	Per PR303, Fix violation of node_access copy syemantics
2003-01-03 18:14:09 +00:00
Joel Sherrill
c891fe082e 2001-05-25 Joel Sherrill <joel@OARcorp.com>
* libc/base_fs.c: Deleted chmod() now that IMFS creates the
	root node with the desired permissions.  chmod() is also not
	supported by the miniIMFS so this is not allowable.
2001-05-25 13:46:02 +00:00
Joel Sherrill
e565720aad 2000-05-24 Fernando Ruiz Casas <fernando.ruiz@ctv.es>
* libc/ttyname.c (ttyname_r): Removed duplicate call to closedir().
	* libc/getpwent.c: Create a more robust /etc/passwd and /etc/group.
	* libc/base_fs.c: Change permissions of files and directories.  Now uses
	octal constants.
2001-05-24 21:43:08 +00:00
Joel Sherrill
2a929cc871 2001-01-25 Fernando Ruiz <fernando.ruiz@ctv.es>
* Alternate email is correo@fernando-ruiz.com
	* libc/privateenv.c: New file.
	* include/rtems/libio_.h, libc/Makefile.am, libc/base_fs.c,
	libc/unmount.c: Moved default umask, current working directory,
	root, and links followed count into a structure "user environment"
	that can then be treated as a unit.  This enable giving unique
	copies of these to individual threads or collection of threads.
2001-01-25 15:59:58 +00:00
Joel Sherrill
9c49db4d6a 2001-01-08 Ralf Corsepius <corsepiu@faw.uni-ulm.de>
* configure.in: Add libc/config.h
	* libc/Makefile.am: Add INCLUDES += -I. to pickup config.h
	* libc/.cvsignore: Add config.h and stamp-h
	* libc/*.c: Add config.h support.
2001-01-08 18:26:44 +00:00
Joel Sherrill
3ba74c733f 2000-11-01 Joel Sherrill <joel@OARcorp.com>
* include/Makefile.am, include/rtems/libio_.h, libc/Makefile.am,
	libc/assoc.c, libc/assocnamebad.c, libc/base_fs.c, libc/cfsetispeed.c,
	libc/cfsetospeed.c, libc/chdir.c, libc/chmod.c, libc/chown.c,
	libc/close.c, libc/closedir.c, libc/dup2.c, libc/error.c, libc/eval.c,
	libc/fchdir.c, libc/fchmod.c, libc/fcntl.c, libc/fdatasync.c,
	libc/fpathconf.c, libc/fstat.c, libc/fsync.c, libc/ftruncate.c,
	libc/getdents.c, libc/ioctl.c, libc/libio.c, libc/libio_sockets.c,
	libc/link.c, libc/lseek.c, libc/malloc.c, libc/mallocfreespace.c,
	libc/mknod.c, libc/mount.c, libc/newlibc.c, libc/no_libc.c,
	libc/open.c, libc/read.c, libc/readlink.c, libc/rmdir.c, libc/stat.c,
	libc/symlink.c, libc/tcsetattr.c, libc/telldir.c, libc/ttyname.c,
	libc/ttyname_r.c, libc/umask.c, libc/unlink.c, libc/unmount.c,
	libc/utime.c, libc/write.c:
	assoc.h, error.h, libio_.h, libio.h, and libcsupport.h moved
	from libc to lib/include/rtems and now must be referenced as
	<rtems/XXX.h>.
	* include/rtems/Makefile.am, include/rtems/.cvsignore: New file.
	* include/rtems/assoc.h, include/rtems/error.h,
	include/rtems/libcsupport.h, include/rtems/libio.h,
	include/rtems/libio_.h: New/moved files.
2000-11-01 21:08:14 +00:00
Joel Sherrill
7b0001f795 2000-10-24 Joel Sherrill <joel@OARcorp.com>
* libc/ioman.c: Moved to libfs.
	* libc/Makefile.am: Removed ioman.c as part of moving it to libfs.
	* libc/base_fs.c: Removed include of imfs.h and reworded comment
	to avoid being IMFS specific.
	* libc/libio.h: Removed prototype of IMFS_ops since it should
	not be in this file.
	* libc/mount.c: Removed IMFS specific configuration information.
	* libc/unmount.c: Removed include of imfs.h and reworded comment
	to avoid being IMFS specific.
2000-10-25 16:56:11 +00:00
Joel Sherrill
08311cc3a9 Updated copyright notice. 1999-11-17 17:51:34 +00:00
Joel Sherrill
063e4950f4 Added support for configuring base filesystem. First attempt at
a full mount table at initialization.  This is the wrong place
to mount filesystems 2-n since no device drivers are initialized
yet.
1999-11-02 16:27:05 +00:00
Joel Sherrill
657e1bf66b Added initial cut at miniIMFS which leaves out memfile and directory
readdir support.  The next step is to add a mount table and configure
either the miniIMFS or the full IMFS at the application level.
1999-10-26 20:17:13 +00:00
Joel Sherrill
937ab62c30 After comments D. V. Henkel-Wallace <gumby@zembu.com>, the interface to
mount() was changed to avoid the use of a string as the options.
1999-06-15 22:16:30 +00:00
Jennifer Averett
7a3878b26f Modifications for RTEMS_UNIX. 1998-12-03 22:17:13 +00:00
Joel Sherrill
07a3253de2 Added base version of file system infrastructure. This includes a major
overhaul of the RTEMS system call interface.  This base file system is
the "In-Memory File System" aka IMFS.

The design and implementation was done by the following people:

  + Joel Sherrill (joel@OARcorp.com)
  + Jennifer Averett (jennifer@OARcorp.com)
  + Steve "Mr Mount" Salitasc (salitasc@OARcorp.com)
  + Kerwin Wade (wade@OARcorp.com)

PROBLEMS
========
  + It is VERY likely that merging this will break the UNIX port.  This
    can/will be fixed.

  + There is likely some reentrancy/mutual exclusion needed.

  + Eventually, there should be a "mini-IMFS" description table to
    eliminate links, symlinks, etc to save memory.  All you need to
    have "classic RTEMS" functionality is technically directories
    and device IO.  All the rest could be left out to save memory.
1998-11-23 19:07:58 +00:00