Commit Graph

483 Commits

Author SHA1 Message Date
Ralf Corsépius
0f06a0e540 Remove rtems-rfs-bitmaps-ut.c. 2012-11-06 04:59:40 +01:00
Ralf Corsépius
b44f994052 Include "rtems-rfs-shell.h". 2012-10-19 14:02:48 +02:00
Sebastian Huber
c17d0b315b Filesystem: Reject removal of root nodes
Reject the removal of file system instance root nodes in rmdir() and
unlink() and return the EBUSY error status.  File system instances can
be removed with unmount().  Remove root node special cases in IMFS,
DOSFS, and RFS.
2012-10-07 17:03:20 +02:00
Sebastian Huber
5633c54cdf nfsclient: Format changes 2012-10-02 15:38:51 +02:00
Sebastian Huber
c69ef3b6a5 nfsclient: Add and use nfsEvaluateStatus()
The NFS status codes do not map directly to the corresponding errno
values.
2012-10-02 15:27:35 +02:00
Sebastian Huber
3becac2ca3 nfsclient: Fix for short enums
The XDR library has a problem on architectures with short enums like the
default ARM EABI.  Short enums means that the size of the enum type is
variable and the smallest integer type to hold all enum values will be
selected.  For many enums this is char.  The XDR library uses int32_t
for enum_t.  There are several evil casts from an enum type to enum_t
which leads to invalid memory accesses on short enum architectures.  A
workaround is to add appropriate dummy enum values.
2012-10-02 15:27:35 +02:00
Sebastian Huber
86f6e8b73b nfsclient: PR2075: Fix node initialization 2012-10-02 15:27:34 +02:00
Sebastian Huber
6c92e1b8e9 IMFS: Typo 2012-08-09 12:45:37 +02:00
Sebastian Huber
c65afce430 dosfs: Use fs_info instead of mt_entry 2012-07-11 17:14:51 +02:00
Sebastian Huber
96b1d7fcfe dosfs: Fix for no space left on device condition
The file size was wrong in the no space left on device condition.  This
resulted in turn in a read of an invalid block which lead to an EIO
error status.
2012-06-04 09:54:32 +02:00
Joel Sherrill
721fe34aae Fix C files which had two semi-colons at EOL 2012-05-31 15:34:36 -05:00
Sebastian Huber
53f2ca3be6 dosfs: Fix format request with sectors per cluster 2012-05-31 13:50:08 +02:00
Sebastian Huber
f7f2eb5799 dosfs: Fix print format string 2012-05-29 16:18:44 +02:00
Sebastian Huber
ca764e66ea nfsclient: Fix symbolic link evaluation 2012-05-16 12:40:21 +02:00
Sebastian Huber
0a95800a58 Filesystem: Change pathconf_limits_and_options
The pathconf_limits_and_options field of
rtems_filesystem_mount_table_entry_t is now a const pointer to reduce
the read-write memory demands of file system instances.
2012-05-15 10:37:00 +02: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
Sebastian Huber
7666afc97a Filesystem: Add const qualifier to lock/unlock 2012-05-15 10:01:43 +02:00
Sebastian Huber
53da07e436 Filesystem: PR1255: Move offset update to handlers
It is now the responsibility of the read() and write() handler to update
the offset field of the IO descriptor (rtems_libio_t).  This change
makes it possible to protect the IO descriptor from concurrent access by
per file locks.
2012-05-15 10:01:42 +02:00
Sebastian Huber
fed66f9910 Filesystem: Add shared device IO support
The device IO file system support in IMFS, devFS, and RFS uses now a
shared implementation.
2012-05-15 10:01:42 +02:00
Sebastian Huber
df01da6707 Filesystem: Use ioctl_command_t 2012-05-15 10:01:42 +02:00
Sebastian Huber
a1c6b96ac7 rfs: Fix major and minor number integer types 2012-05-15 10:01:42 +02:00
Sebastian Huber
fce1169de0 dosfs: Remove unused parameter 2012-05-14 16:57:59 +02:00
Sebastian Huber
29192481a8 devfs: C++ compatibility 2012-05-14 16:57:59 +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
86ef0df976 dosfs: Remove fat_file_datasync()
The fat_file_datasync() read every cluster of the file into the cache
and then synchronized it step-by-step.  For unmodified buffers this is a
non-operation.  For modified buffers this will wake-up the swapout task
which performs then a single buffer write operation.  This is usually
quite inefficient.  Firstly we do single buffer writes, secondly we
may perform a lot of unnecessary read operations (for huge files this is
really bad), and thirdly this leads likely to cache evictions.

The synchronization procedure is replaced by a simple
rtems_bdbuf_sync_dev().  This has the side-effect that also buffers not
related to the file are synchronized, but since the modified list is
normally short this should be acceptable.
2012-05-11 13:58:43 +02:00
Sebastian Huber
3d0c96c7f3 Filesystem: PR1893: Fix write and truncate handler
Space that grows due to truncate or write offsets beyond the current
file size must be zero filled.
2012-05-11 13:58:43 +02:00
Sebastian Huber
d61b0a5abf Filesystem: PR1871: Fix O_APPEND 2012-05-11 13:58:43 +02: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
Joel Sherrill
33a105fb69 Revert: Remove CVS Ids
See http://www.rtems.org/pipermail/rtems-devel/2012-May/001006.html
for details.
2012-05-07 11:08:48 -05:00
Sebastian Huber
2cd2ed3288 nfsclient: Add rename operation 2012-05-04 13:29:45 +02:00
Sebastian Huber
078369f41d nfsclient: Fix hard link operation 2012-05-04 13:29:28 +02:00
Sebastian Huber
1747208963 Filesystem: Use proper parameter in NFS 2012-05-04 10:53:52 +02:00
Sebastian Huber
6b36ca2371 Filesystem: Remove pipe_lseek() 2012-05-04 10:53:52 +02:00
Ralf Corsépius
ee32f67a6f Remove CVS-Ids. 2012-05-04 09:36:25 +02:00
Chris Johns
3756041b00 IMFS: Update IMS_assert check when RTEMS_DEBUG is enabled.
Update the assert macro to the new IMFS_jnode_t.
2012-04-28 12:21:45 +10:00
Sebastian Huber
bc04436cce nfsclient: Use UID and GID of NFS handle
Use UID and GID of the NFS handle for node and symbolic link creation.
2012-04-23 16:26:13 +02:00
Sebastian Huber
e384438b9c nfsclient: POSIX conformance
According to POSIX the read() call should return the maximum number of
bytes available for regular files.
2012-04-23 16:02:09 +02:00
Sebastian Huber
790f04ddbb PR2039: Fix NULL pointer access
In case rtems_bdbuf_read() returns an error status, the block device
buffer pointer will be set to NULL.  In RFS the chain node of the block
device buffer will be used for RFS purposes.  We must not do this after
an erroneous read.
2012-03-14 09:11:13 +01:00
Sebastian Huber
796967c3df libblock: Change bdbuf API
The functions
 o rtems_bdbuf_get(),
 o rtems_bdbuf_read(),
 o rtems_bdbuf_syncdev(), and
 o rtems_bdbuf_purge_dev(),
use now the disk device instead of the device identifier.  This makes
bdbuf independent of rtems_disk_obtain() and rtems_disk_release().  It
is the responsiblity of the file system to obtain the disk device.  This
also reduces the overhead to get a buffer.

The key for the AVL tree uses now the disk device instead of the device
identifier.  The pointer is interpreted as an unsigned integer.  This
reduces the memory overhead and makes the comparison operation a bit
faster.

Removed function rtems_bdbuf_purge_major().  This function was too
destructive and could have unpredictable side effects.
2012-03-13 12:24:18 +01:00
Sebastian Huber
e998c98518 IMFS: Node specific stat handlers 2012-03-13 12:24:16 +01:00
Sebastian Huber
04ca77e31d IMFS: Generic device identifier 2012-03-13 12:24:16 +01:00
Sebastian Huber
c5392ef924 IMFS: Add make generic node support
Generic nodes are an alternative to standard drivers in RTEMS.  The
handlers of a generic node are called with less overhead compared to the
standard driver operations.  The usage of file system node handlers
enable more features like support for fsync() and fdatasync().  The
generic nodes use the reference counting of the IMFS.  This provides
automatic node destruction when the last reference vanishes.

Extend type IMFS_types_union by new type IMFS_generic_t.

Extend enum IMFS_jnode_types_t by IMFS_GENERIC.

Add functions
 o IMFS_make_generic_node(),
 o IMFS_is_imfs_instance(),
 o IMFS_generic_get_context_by_node(),
 o IMFS_generic_get_context_by_location(), and
 o IMFS_generic_get_context_by_iop().

New test fstests/fsimfsgeneric01.
2012-03-13 12:24:16 +01:00
Sebastian Huber
699ac7c08f IMFS: Add and use node control
Add and use structure IMFS_node_control with support functions.  This
helps to make high level functions independent of the node type and
reduces the number of branches in the code.
2012-03-13 12:24:16 +01:00
Sebastian Huber
70927458b7 IMFS: New support functions
Add and use IMFS_type() and IMFS_is_directory().
2012-03-13 12:24:16 +01:00
Sebastian Huber
6661435f84 IMFS: Removed superfluous imfs_dir_open() 2012-03-13 12:24:16 +01:00
Sebastian Huber
1bdff036ac IMFS: Reference counting for nodes
The introduction of reference counting of nodes avoids the removal of
open nodes and potential usage of freed memory.
2012-03-13 12:24:15 +01:00
Sebastian Huber
2e0ce55bf0 IMFS: Use unprotected chain operations
Directory entry add or removal operations are protected by the file
system instance lock.  There is no need for protected chain operations.
2012-03-13 12:24:15 +01:00
Sebastian Huber
316507ab91 IMFS: Lock the file system during directory reads
Other threads may add or remove directory entries during a read of the
directory.  Use the file system instance lock for protection.
2012-03-13 12:24:15 +01:00
Sebastian Huber
e00cca9b74 IMFS: Do not check for unsupported types
Allow creation of nodes with an unsupported type.  Later the usage of
such nodes will return an error status.
2012-03-13 12:24:15 +01:00
Sebastian Huber
2563410019 Filesystem: Rename defines
o Removed RTEMS_LIBIO_PERMS_SEARCH.
 o Renamed RTEMS_LIBIO_PERMS_READ in RTEMS_FS_PERMS_READ.
 o Renamed RTEMS_LIBIO_PERMS_WRITE in RTEMS_FS_PERMS_WRITE.
 o Renamed RTEMS_LIBIO_PERMS_EXEC in RTEMS_FS_PERMS_EXEC.
 o Renamed RTEMS_LIBIO_FOLLOW_HARD_LINK in RTEMS_FS_FOLLOW_HARD_LINK.
 o Renamed RTEMS_LIBIO_FOLLOW_SYM_LINK in RTEMS_FS_FOLLOW_SYM_LINK.
 o Renamed RTEMS_LIBIO_MAKE in RTEMS_FS_MAKE.
 o Renamed RTEMS_LIBIO_EXCLUSIVE in RTEMS_FS_EXCLUSIVE.
 o Renamed RTEMS_LIBIO_ACCEPT_RESIDUAL_DELIMITERS in
   RTEMS_FS_ACCEPT_RESIDUAL_DELIMITERS.
 o Renamed RTEMS_LIBIO_REJECT_TERMINAL_DOT in
 RTEMS_FS_REJECT_TERMINAL_DOT.
2012-03-13 12:24:10 +01:00