From 3cfa6368c3211eed83df08850f0af26481f161f6 Mon Sep 17 00:00:00 2001 From: Chris Johns Date: Fri, 26 Feb 2010 05:54:59 +0000 Subject: 010-02-26 Chris Johns * libfs/src/rfs/rtems-rfs-block.c: Reset a buffer handle after moving down an indirection level. * libfs/src/rfs/rtems-rfs-dir.c: Move directory entry validation into a macro and use the macro. Fix the range check on the ino so all inodes can be used. * libfs/src/rfs/rtems-rfs-file-system.c, libfs/src/rfs/rtems-rfs-file-system.h:: Add a version number to the superblock. Use RTEMS_RFS_INODE_SIZE. * libfs/src/rfs/rtems-rfs-file.c: Fix the size offset on partial block lengths. Set the size in the file handle on a truncate to 0. * libfs/src/rfs/rtems-rfs-format.c: Add a version number to the superblock. Use RTEMS_RFS_INODE_SIZE. A better set of defaults for small disks. * libfs/src/rfs/rtems-rfs-inode.c: Use RTEMS_RFS_INODE_SIZE. Free the allocated inode if it cannot be opened. * libfs/src/rfs/rtems-rfs-inode.h: Add RTEMS_RFS_INODE_SIZE. * libfs/src/rfs/rtems-rfs-rtems-file.c: Move some of the iop acceses inside the fs lock. * libfs/src/rfs/rtems-rfs-shell.c: Use RTEMS_RFS_INODE_SIZE. --- cpukit/libfs/src/rfs/rtems-rfs-inode.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'cpukit/libfs/src/rfs/rtems-rfs-inode.c') diff --git a/cpukit/libfs/src/rfs/rtems-rfs-inode.c b/cpukit/libfs/src/rfs/rtems-rfs-inode.c index b23f09994d..7dbb3a805e 100644 --- a/cpukit/libfs/src/rfs/rtems-rfs-inode.c +++ b/cpukit/libfs/src/rfs/rtems-rfs-inode.c @@ -211,8 +211,11 @@ rtems_rfs_inode_create (rtems_rfs_file_system* fs, rc = rtems_rfs_inode_open (fs, *ino, &inode, true); if (rc > 0) + { + rtems_rfs_inode_free (fs, *ino); return rc; - + } + rc = rtems_rfs_inode_initialise (&inode, links, mode, uid, gid); if (rc > 0) { @@ -223,6 +226,8 @@ rtems_rfs_inode_create (rtems_rfs_file_system* fs, /* * Only handle the specifics of a directory. Let caller handle the others. + * + * The inode delete will free the inode. */ if (RTEMS_RFS_S_ISDIR (mode)) { @@ -307,7 +312,7 @@ rtems_rfs_inode_delete (rtems_rfs_file_system* fs, rc = rtems_rfs_block_map_close (fs, &map); if (rc > 0) rrc = rc; - memset (handle->node, 0xff, sizeof (rtems_rfs_inode)); + memset (handle->node, 0xff, RTEMS_RFS_INODE_SIZE); rtems_rfs_buffer_mark_dirty (&handle->buffer); /* * Do the release here to avoid the ctime field being set on a -- cgit v1.2.3