summaryrefslogtreecommitdiffstats
path: root/cpukit
diff options
context:
space:
mode:
authorChris Johns <chrisj@rtems.org>2010-08-26 06:31:15 +0000
committerChris Johns <chrisj@rtems.org>2010-08-26 06:31:15 +0000
commit6ed22abde23dda9584fe4de804d4f7b2c9b607ca (patch)
tree6d337cfdbaf997c4487b38814323138d4aaf5bf6 /cpukit
parent2010-08-26 Chris Johns <chrisj@rtems.org> (diff)
downloadrtems-6ed22abde23dda9584fe4de804d4f7b2c9b607ca.tar.bz2
2010-08-26 Chris Johns <chrisj@rtems.org>
* libfs/src/defaults/default_evaluate_link.c: Remove assignment. * libfs/src/rfs/rtems-rfs-file.c: Check then load the inode is not present on the close. * libfs/src/rfs/rtems-rfs-format.c: Initialise the buffer chain.
Diffstat (limited to 'cpukit')
-rw-r--r--cpukit/ChangeLog9
-rw-r--r--cpukit/libfs/src/rfs/rtems-rfs-file.c28
-rw-r--r--cpukit/libfs/src/rfs/rtems-rfs-format.c1
3 files changed, 27 insertions, 11 deletions
diff --git a/cpukit/ChangeLog b/cpukit/ChangeLog
index e7002d1789..6944eb1d5d 100644
--- a/cpukit/ChangeLog
+++ b/cpukit/ChangeLog
@@ -1,3 +1,12 @@
+2010-08-26 Chris Johns <chrisj@rtems.org>
+
+ * libfs/src/defaults/default_evaluate_link.c: Remove assignment.
+
+ * libfs/src/rfs/rtems-rfs-file.c: Check then load the inode is not
+ present on the close.
+
+ * libfs/src/rfs/rtems-rfs-format.c: Initialise the buffer chain.
+
2010-08-25 Joel Sherrill <joel.sherrill@oarcorp.com>
Coverity Id 93/NO_EFFECT
diff --git a/cpukit/libfs/src/rfs/rtems-rfs-file.c b/cpukit/libfs/src/rfs/rtems-rfs-file.c
index a93cb17003..e17c705c8c 100644
--- a/cpukit/libfs/src/rfs/rtems-rfs-file.c
+++ b/cpukit/libfs/src/rfs/rtems-rfs-file.c
@@ -158,18 +158,24 @@ rtems_rfs_file_close (rtems_rfs_file_system* fs,
if (handle->shared->references == 0)
{
- /*
- * @todo This could be clever and only update if different.
- */
- rtems_rfs_inode_set_atime (&handle->shared->inode,
- handle->shared->atime);
- rtems_rfs_inode_set_mtime (&handle->shared->inode,
- handle->shared->mtime);
- rtems_rfs_inode_set_ctime (&handle->shared->inode,
- handle->shared->ctime);
- handle->shared->map.size.count = handle->shared->size.count;
- handle->shared->map.size.offset = handle->shared->size.offset;
+ if (!rtems_rfs_inode_is_loaded (&handle->shared->inode))
+ rrc = rtems_rfs_inode_load (fs, &handle->shared->inode);
+ if (rrc == 0)
+ {
+ /*
+ * @todo This could be clever and only update if different.
+ */
+ rtems_rfs_inode_set_atime (&handle->shared->inode,
+ handle->shared->atime);
+ rtems_rfs_inode_set_mtime (&handle->shared->inode,
+ handle->shared->mtime);
+ rtems_rfs_inode_set_ctime (&handle->shared->inode,
+ handle->shared->ctime);
+ handle->shared->map.size.count = handle->shared->size.count;
+ handle->shared->map.size.offset = handle->shared->size.offset;
+ }
+
rc = rtems_rfs_block_map_close (fs, &handle->shared->map);
if (rc > 0)
{
diff --git a/cpukit/libfs/src/rfs/rtems-rfs-format.c b/cpukit/libfs/src/rfs/rtems-rfs-format.c
index a11fd71488..e92228f4da 100644
--- a/cpukit/libfs/src/rfs/rtems-rfs-format.c
+++ b/cpukit/libfs/src/rfs/rtems-rfs-format.c
@@ -538,6 +538,7 @@ rtems_rfs_format (const char* name, const rtems_rfs_format_config* config)
memset (&fs, 0, sizeof (rtems_rfs_file_system));
+ rtems_chain_initialize_empty (&fs.buffers);
rtems_chain_initialize_empty (&fs.release);
rtems_chain_initialize_empty (&fs.release_modified);
rtems_chain_initialize_empty (&fs.file_shares);