change log for rtems (2010-10-11)

rtems-vc at rtems.org rtems-vc at rtems.org
Mon Oct 11 22:10:35 UTC 2010


 *ccj* (on branch rtems-4-10-branch):
The patch to the 4.10 branch did not apply correctly. This fixes it.

M 1.4.2.4  cpukit/libfs/src/rfs/rtems-rfs-block.c
M 1.2.2.2  cpukit/libfs/src/rfs/rtems-rfs-buffer.h
M 1.6.2.3  cpukit/libfs/src/rfs/rtems-rfs-dir.c
M 1.5.2.3  cpukit/libfs/src/rfs/rtems-rfs-format.c
M 1.4.2.2  cpukit/libfs/src/rfs/rtems-rfs-group.c
M 1.3.2.2  cpukit/libfs/src/rfs/rtems-rfs-inode.c
M 1.3.2.2  cpukit/libfs/src/rfs/rtems-rfs-rtems-dir.c
M 1.7.2.4  cpukit/libfs/src/rfs/rtems-rfs-shell.c
M 1.1.2.2  cpukit/libfs/src/rfs/rtems-rfs-trace.h
M 1.2.2.1  cpukit/libfs/src/rfs/rtems-rfs-trace.c

diff -u rtems/cpukit/libfs/src/rfs/rtems-rfs-block.c:1.4.2.3 rtems/cpukit/libfs/src/rfs/rtems-rfs-block.c:1.4.2.4
--- rtems/cpukit/libfs/src/rfs/rtems-rfs-block.c:1.4.2.3	Sun Oct 10 23:40:08 2010
+++ rtems/cpukit/libfs/src/rfs/rtems-rfs-block.c	Mon Oct 11 16:12:48 2010
@@ -58,20 +58,7 @@
 rtems_rfs_block_get_pos (rtems_rfs_file_system* fs,
                          rtems_rfs_block_pos*   bpos)
 {
-#if 0
-  rtems_rfs_pos pos = 0;
-  if (bpos->bno)
-  {
-    pos = bpos->boff;
-    if (pos == 0)
-      pos = rtems_rfs_fs_block_size (fs);
-    pos += (bpos->bno - 1) * rtems_rfs_fs_block_size (fs);
-  }
-#else
-  rtems_rfs_pos pos;
-  pos = (bpos->bno * rtems_rfs_fs_block_size (fs)) + bpos->boff;
-#endif
-  return pos;
+  return (bpos->bno * rtems_rfs_fs_block_size (fs)) + bpos->boff;
 }
 
 void
@@ -639,8 +626,6 @@
       int b;
       for (b = 0; b < RTEMS_RFS_INODE_BLOCKS; b++)
         map->blocks[b] = rtems_rfs_block_get_number (buffer, b);
-
-      rtems_rfs_buffer_handle_reset (buffer);
     }
     else
     {

diff -u rtems/cpukit/libfs/src/rfs/rtems-rfs-buffer.h:1.2.2.1 rtems/cpukit/libfs/src/rfs/rtems-rfs-buffer.h:1.2.2.2
--- rtems/cpukit/libfs/src/rfs/rtems-rfs-buffer.h:1.2.2.1	Wed Jun 16 09:40:50 2010
+++ rtems/cpukit/libfs/src/rfs/rtems-rfs-buffer.h	Mon Oct 11 16:12:48 2010
@@ -186,22 +186,6 @@
                                      rtems_rfs_buffer_handle* handle);
 
 /**
- * Reset a handle.
- *
- * @param fs The file system data.
- * @param handle The buffer handle to reset.
- * @return int The error number (errno). No error if 0.
- */
-static inline int
-rtems_rfs_buffer_handle_reset (rtems_rfs_buffer_handle* handle)
-{
-  handle->dirty = false;
-  handle->bnum  = 0; 
-  handle->buffer = NULL;
-  return 0;
-}
-
-/**
  * Open a handle.
  *
  * @param fs The file system data.
@@ -212,7 +196,9 @@
 rtems_rfs_buffer_handle_open (rtems_rfs_file_system*   fs,
                               rtems_rfs_buffer_handle* handle)
 {
-  rtems_rfs_buffer_handle_reset (handle);
+  handle->dirty = false;
+  handle->bnum  = 0; 
+  handle->buffer = NULL;
   return 0;
 }
 
@@ -228,6 +214,9 @@
                                rtems_rfs_buffer_handle* handle)
 {
   rtems_rfs_buffer_handle_release (fs, handle);
+  handle->dirty = false;
+  handle->bnum  = 0; 
+  handle->buffer = NULL;
   return 0;
 }
 

diff -u rtems/cpukit/libfs/src/rfs/rtems-rfs-dir.c:1.6.2.2 rtems/cpukit/libfs/src/rfs/rtems-rfs-dir.c:1.6.2.3
--- rtems/cpukit/libfs/src/rfs/rtems-rfs-dir.c:1.6.2.2	Sun Oct 10 23:40:08 2010
+++ rtems/cpukit/libfs/src/rfs/rtems-rfs-dir.c	Mon Oct 11 16:12:48 2010
@@ -620,10 +620,7 @@
       if (remaining <= RTEMS_RFS_DIR_ENTRY_SIZE)
         *length += remaining;
       
-      if (elength < RTEMS_RFS_DIR_ENTRY_SIZE)
-        elength = 0;
-      else
-        elength -= RTEMS_RFS_DIR_ENTRY_SIZE;
+      elength -= RTEMS_RFS_DIR_ENTRY_SIZE;
       if (elength > NAME_MAX)
         elength = NAME_MAX;
       

diff -u rtems/cpukit/libfs/src/rfs/rtems-rfs-format.c:1.5.2.2 rtems/cpukit/libfs/src/rfs/rtems-rfs-format.c:1.5.2.3
--- rtems/cpukit/libfs/src/rfs/rtems-rfs-format.c:1.5.2.2	Thu Aug 26 01:35:22 2010
+++ rtems/cpukit/libfs/src/rfs/rtems-rfs-format.c	Mon Oct 11 16:12:48 2010
@@ -84,8 +84,7 @@
                                   rtems_rfs_fs_block_size (fs));
   bits_per_block = rtems_rfs_bits_per_block (fs);
   /*
-   * There could be more bits that there are blocks, eg 512K disk with 512
-   * blocks.
+   * There could be more bits than blocks, eg 512K disk with 512 blocks.
    */
   if (bits_per_block > (rtems_rfs_fs_blocks (fs) - RTEMS_RFS_SUPERBLOCK_SIZE))
     bits_per_block = rtems_rfs_fs_blocks (fs) - RTEMS_RFS_SUPERBLOCK_SIZE;
@@ -353,7 +352,7 @@
   rtems_rfs_buffer_mark_dirty (&handle);
 
   /*
-   * Initialise the inode tables if rerquired to do so.
+   * Initialise the inode tables if required to do so.
    */
   if (initialise_inodes)
   {

diff -u rtems/cpukit/libfs/src/rfs/rtems-rfs-group.c:1.4.2.1 rtems/cpukit/libfs/src/rfs/rtems-rfs-group.c:1.4.2.2
--- rtems/cpukit/libfs/src/rfs/rtems-rfs-group.c:1.4.2.1	Wed Jun 16 21:44:55 2010
+++ rtems/cpukit/libfs/src/rfs/rtems-rfs-group.c	Mon Oct 11 16:12:48 2010
@@ -46,6 +46,15 @@
 
   if ((base + size) >= rtems_rfs_fs_blocks (fs))
     size = rtems_rfs_fs_blocks (fs) - base;
+
+  /*
+   * Limit the inodes to the same size as the blocks. This is what the
+   * format does and if this is not done the accounting of inodes does
+   * not work. If we are so pushed for inodes that this makes a difference
+   * the format configuration needs reviewing.
+   */
+  if (inodes > size)
+    inodes = size;
   
   if (rtems_rfs_trace (RTEMS_RFS_TRACE_GROUP_OPEN))
     printf ("rtems-rfs: group-open: base=%" PRId32 ", blocks=%zd inodes=%zd\n",

diff -u rtems/cpukit/libfs/src/rfs/rtems-rfs-inode.c:1.3.2.1 rtems/cpukit/libfs/src/rfs/rtems-rfs-inode.c:1.3.2.2
--- rtems/cpukit/libfs/src/rfs/rtems-rfs-inode.c:1.3.2.1	Wed Jun 16 12:30:51 2010
+++ rtems/cpukit/libfs/src/rfs/rtems-rfs-inode.c	Mon Oct 11 16:12:48 2010
@@ -296,6 +296,12 @@
                         rtems_rfs_inode_handle* handle)
 {
   int rc = 0;
+  
+  if (rtems_rfs_trace (RTEMS_RFS_TRACE_INODE_DELETE))
+    printf("rtems-rfs: inode-delete: ino:%" PRIu32 " loaded:%s\n",
+           rtems_rfs_inode_ino (handle),
+           rtems_rfs_inode_is_loaded (handle) ? "yes" : "no");
+
   if (rtems_rfs_inode_is_loaded (handle))
   {
     rtems_rfs_block_map map;

diff -u rtems/cpukit/libfs/src/rfs/rtems-rfs-rtems-dir.c:1.3.2.1 rtems/cpukit/libfs/src/rfs/rtems-rfs-rtems-dir.c:1.3.2.2
--- rtems/cpukit/libfs/src/rfs/rtems-rfs-rtems-dir.c:1.3.2.1	Wed Jun 16 22:48:39 2010
+++ rtems/cpukit/libfs/src/rfs/rtems-rfs-rtems-dir.c	Mon Oct 11 16:12:48 2010
@@ -26,6 +26,7 @@
 #include <fcntl.h>
 #include <stdlib.h>
 #include <stdio.h>
+#include <unistd.h>
 
 #include <rtems/rfs/rtems-rfs-dir.h>
 #include <rtems/rfs/rtems-rfs-link.h>
@@ -113,7 +114,7 @@
   rtems_rfs_ino          ino = rtems_rfs_rtems_get_iop_ino (iop);
   rtems_rfs_inode_handle inode;
   struct dirent*         dirent;
-  size_t                 bytes_transfered;
+  ssize_t                bytes_transferred;
   int                    d;
   int                    rc;
 
@@ -129,7 +130,7 @@
     return rtems_rfs_rtems_error ("dir_read: read inode", rc);
   }
 
-  bytes_transfered = 0;
+  bytes_transferred = 0;
   
   for (d = 0; d < count; d++, dirent++)
   {
@@ -142,17 +143,17 @@
     }
     if (rc > 0)
     {
-      bytes_transfered = rtems_rfs_rtems_error ("dir_read: dir read", rc);
+      bytes_transferred = rtems_rfs_rtems_error ("dir_read: dir read", rc);
       break;
     }
     iop->offset += size;
-    bytes_transfered += sizeof (struct dirent);
+    bytes_transferred += sizeof (struct dirent);
   }
 
   rtems_rfs_inode_close (fs, &inode);
   rtems_rfs_rtems_unlock (fs);
   
-  return (ssize_t) bytes_transfered;
+  return bytes_transferred;
 }
 
 /**

diff -u rtems/cpukit/libfs/src/rfs/rtems-rfs-shell.c:1.7.2.3 rtems/cpukit/libfs/src/rfs/rtems-rfs-shell.c:1.7.2.4
--- rtems/cpukit/libfs/src/rfs/rtems-rfs-shell.c:1.7.2.3	Thu Jun 24 08:28:54 2010
+++ rtems/cpukit/libfs/src/rfs/rtems-rfs-shell.c	Mon Oct 11 16:12:48 2010
@@ -123,24 +123,24 @@
   printf ("RFS Filesystem Data\n");
   printf ("             flags: %08" PRIx32 "\n", fs->flags);
 #if 0
-  printf ("            device: %08lx\n", rtems_rfs_fs_device (fs));
+  printf ("            device: %08lx\n",         rtems_rfs_fs_device (fs));
 #endif
-  printf ("            blocks: %zu\n",  rtems_rfs_fs_blocks (fs));
-  printf ("        block size: %zu\n",  rtems_rfs_fs_block_size (fs));
-  printf ("              size: %" PRIu64 "\n",  rtems_rfs_fs_size (fs));
-  printf ("  media block size: %" PRIu32 "\n",  rtems_rfs_fs_media_block_size (fs));
-  printf ("        media size: %" PRIu64 "\n", rtems_rfs_fs_media_size (fs));
-  printf ("            inodes: %" PRIu32 "\n",  rtems_rfs_fs_inodes (fs));
-  printf ("        bad blocks: %" PRIu32 "\n",  fs->bad_blocks);
-  printf ("  max. name length: %" PRIu32 "\n",  rtems_rfs_fs_max_name (fs));
-  printf ("            groups: %d\n",   fs->group_count);
-  printf ("      group blocks: %zd\n",  fs->group_blocks);
-  printf ("      group inodes: %zd\n",  fs->group_inodes);
-  printf ("  inodes per block: %zd\n",  fs->inodes_per_block);
-  printf ("  blocks per block: %zd\n",  fs->blocks_per_block);
-  printf ("     singly blocks: %zd\n",  fs->block_map_singly_blocks);
-  printf ("    doublly blocks: %zd\n",  fs->block_map_doubly_blocks);
-  printf (" max. held buffers: %" PRId32 "\n",  fs->max_held_buffers);
+  printf ("            blocks: %zu\n",           rtems_rfs_fs_blocks (fs));
+  printf ("        block size: %zu\n",           rtems_rfs_fs_block_size (fs));
+  printf ("              size: %" PRIu64 "\n",   rtems_rfs_fs_size (fs));
+  printf ("  media block size: %" PRIu32 "\n",   rtems_rfs_fs_media_block_size (fs));
+  printf ("        media size: %" PRIu64 "\n",   rtems_rfs_fs_media_size (fs));
+  printf ("            inodes: %" PRIu32 "\n",   rtems_rfs_fs_inodes (fs));
+  printf ("        bad blocks: %" PRIu32 "\n",   fs->bad_blocks);
+  printf ("  max. name length: %" PRIu32 "\n",   rtems_rfs_fs_max_name (fs));
+  printf ("            groups: %d\n",            fs->group_count);
+  printf ("      group blocks: %zd\n",           fs->group_blocks);
+  printf ("      group inodes: %zd\n",           fs->group_inodes);
+  printf ("  inodes per block: %zd\n",           fs->inodes_per_block);
+  printf ("  blocks per block: %zd\n",           fs->blocks_per_block);
+  printf ("     singly blocks: %zd\n",           fs->block_map_singly_blocks);
+  printf ("    doublly blocks: %zd\n",           fs->block_map_doubly_blocks);
+  printf (" max. held buffers: %" PRId32 "\n",   fs->max_held_buffers);
 
   rtems_rfs_shell_lock_rfs (fs);
 
@@ -302,8 +302,7 @@
     }
   }
 
-  if ((start < 0) || (end < 0) ||
-      (start >= total) || (end >= total))
+  if ((start >= total) || (end >= total))
   {
     printf ("error: inode out of range (0->%" PRId32 ").\n", total - 1);
     return 1;

diff -u rtems/cpukit/libfs/src/rfs/rtems-rfs-trace.h:1.1.2.1 rtems/cpukit/libfs/src/rfs/rtems-rfs-trace.h:1.1.2.2
--- rtems/cpukit/libfs/src/rfs/rtems-rfs-trace.h:1.1.2.1	Sun Oct 10 23:40:08 2010
+++ rtems/cpukit/libfs/src/rfs/rtems-rfs-trace.h	Mon Oct 11 16:12:48 2010
@@ -28,7 +28,9 @@
 /**
  * Is tracing enabled ?
  */
+#if !defined (RTEMS_RFS_TRACE)
 #define RTEMS_RFS_TRACE 1
+#endif
 
 /**
  * The type of the mask.
@@ -62,21 +64,22 @@
 #define RTEMS_RFS_TRACE_INODE_LOAD             (1ULL << 20)
 #define RTEMS_RFS_TRACE_INODE_UNLOAD           (1ULL << 21)
 #define RTEMS_RFS_TRACE_INODE_CREATE           (1ULL << 22)
-#define RTEMS_RFS_TRACE_LINK                   (1ULL << 23)
-#define RTEMS_RFS_TRACE_UNLINK                 (1ULL << 24)
-#define RTEMS_RFS_TRACE_DIR_LOOKUP_INO         (1ULL << 25)
-#define RTEMS_RFS_TRACE_DIR_LOOKUP_INO_CHECK   (1ULL << 26)
-#define RTEMS_RFS_TRACE_DIR_LOOKUP_INO_FOUND   (1ULL << 27)
-#define RTEMS_RFS_TRACE_DIR_ADD_ENTRY          (1ULL << 28)
-#define RTEMS_RFS_TRACE_DIR_DEL_ENTRY          (1ULL << 29)
-#define RTEMS_RFS_TRACE_DIR_READ               (1ULL << 30)
-#define RTEMS_RFS_TRACE_DIR_EMPTY              (1ULL << 31)
-#define RTEMS_RFS_TRACE_SYMLINK                (1ULL << 32)
-#define RTEMS_RFS_TRACE_SYMLINK_READ           (1ULL << 33)
-#define RTEMS_RFS_TRACE_FILE_OPEN              (1ULL << 34)
-#define RTEMS_RFS_TRACE_FILE_CLOSE             (1ULL << 35)
-#define RTEMS_RFS_TRACE_FILE_IO                (1ULL << 36)
-#define RTEMS_RFS_TRACE_FILE_SET               (1ULL << 37)
+#define RTEMS_RFS_TRACE_INODE_DELETE           (1ULL << 23)
+#define RTEMS_RFS_TRACE_LINK                   (1ULL << 24)
+#define RTEMS_RFS_TRACE_UNLINK                 (1ULL << 25)
+#define RTEMS_RFS_TRACE_DIR_LOOKUP_INO         (1ULL << 26)
+#define RTEMS_RFS_TRACE_DIR_LOOKUP_INO_CHECK   (1ULL << 27)
+#define RTEMS_RFS_TRACE_DIR_LOOKUP_INO_FOUND   (1ULL << 28)
+#define RTEMS_RFS_TRACE_DIR_ADD_ENTRY          (1ULL << 29)
+#define RTEMS_RFS_TRACE_DIR_DEL_ENTRY          (1ULL << 30)
+#define RTEMS_RFS_TRACE_DIR_READ               (1ULL << 31)
+#define RTEMS_RFS_TRACE_DIR_EMPTY              (1ULL << 32)
+#define RTEMS_RFS_TRACE_SYMLINK                (1ULL << 33)
+#define RTEMS_RFS_TRACE_SYMLINK_READ           (1ULL << 34)
+#define RTEMS_RFS_TRACE_FILE_OPEN              (1ULL << 35)
+#define RTEMS_RFS_TRACE_FILE_CLOSE             (1ULL << 36)
+#define RTEMS_RFS_TRACE_FILE_IO                (1ULL << 37)
+#define RTEMS_RFS_TRACE_FILE_SET               (1ULL << 38)
 
 /**
  * Call to check if this part is bring traced. If RTEMS_RFS_TRACE is defined to

diff -u rtems/cpukit/libfs/src/rfs/rtems-rfs-trace.c:1.2 rtems/cpukit/libfs/src/rfs/rtems-rfs-trace.c:1.2.2.1
--- rtems/cpukit/libfs/src/rfs/rtems-rfs-trace.c:1.2	Fri Mar 26 23:04:40 2010
+++ rtems/cpukit/libfs/src/rfs/rtems-rfs-trace.c	Mon Oct 11 16:12:48 2010
@@ -78,6 +78,7 @@
     "inode-load",
     "inode-unload",
     "inode-create",
+    "inode-delete",
     "link",
     "unlink",
     "dir-lookup-ino",



--

Generated by Deluxe Loginfo [http://www.codewiz.org/projects/index.html#loginfo] 2.122 by Bernardo Innocenti <bernie at develer.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rtems.org/pipermail/vc/attachments/20101011/d2e898de/attachment-0001.html>


More information about the vc mailing list