change log for rtems (2010-07-30)

rtems-vc at rtems.org rtems-vc at rtems.org
Fri Jul 30 23:10:18 UTC 2010


 *joel*:
2010-07-30	Joel Sherrill <joel.sherrill at oarcorp.com>

	* libcsupport/src/fstat.c, libcsupport/src/rmdir.c,
	libfs/src/imfs/imfs.h, libfs/src/imfs/imfs_creat.c,
	libfs/src/imfs/imfs_debug.c, libfs/src/imfs/imfs_getchild.c,
	libfs/src/imfs/memfile.c: Add IMFS_assert. Clean up and remove all
	checks which are redundant with system call layer. Formatting.

M 1.2539  cpukit/ChangeLog
M   1.14  cpukit/libcsupport/src/fstat.c
M   1.19  cpukit/libcsupport/src/rmdir.c
M   1.47  cpukit/libfs/src/imfs/imfs.h
M   1.19  cpukit/libfs/src/imfs/imfs_creat.c
M   1.17  cpukit/libfs/src/imfs/imfs_debug.c
M   1.12  cpukit/libfs/src/imfs/imfs_getchild.c
M   1.38  cpukit/libfs/src/imfs/memfile.c

diff -u rtems/cpukit/ChangeLog:1.2538 rtems/cpukit/ChangeLog:1.2539
--- rtems/cpukit/ChangeLog:1.2538	Fri Jul 30 13:53:05 2010
+++ rtems/cpukit/ChangeLog	Fri Jul 30 17:36:31 2010
@@ -1,3 +1,11 @@
+2010-07-30	Joel Sherrill <joel.sherrill at oarcorp.com>
+
+	* libcsupport/src/fstat.c, libcsupport/src/rmdir.c,
+	libfs/src/imfs/imfs.h, libfs/src/imfs/imfs_creat.c,
+	libfs/src/imfs/imfs_debug.c, libfs/src/imfs/imfs_getchild.c,
+	libfs/src/imfs/memfile.c: Add IMFS_assert. Clean up and remove all
+	checks which are redundant with system call layer. Formatting.
+
 2010-07-30	Gedare Bloom <giddyup44 at yahoo.com>
 
 	PR 1599/cpukit

diff -u rtems/cpukit/libcsupport/src/fstat.c:1.13 rtems/cpukit/libcsupport/src/fstat.c:1.14
--- rtems/cpukit/libcsupport/src/fstat.c:1.13	Thu Jul 15 03:10:47 2010
+++ rtems/cpukit/libcsupport/src/fstat.c	Fri Jul 30 17:36:32 2010
@@ -32,14 +32,12 @@
   /*
    *  Check to see if we were passed a valid pointer.
    */
-
   if ( !sbuf )
     rtems_set_errno_and_return_minus_one( EFAULT );
 
   /*
    *  Now process the stat() request.
    */
-
   iop = rtems_libio_iop( fd );
   rtems_libio_check_fd( fd );
   rtems_libio_check_is_open(iop);

diff -u rtems/cpukit/libcsupport/src/rmdir.c:1.18 rtems/cpukit/libcsupport/src/rmdir.c:1.19
--- rtems/cpukit/libcsupport/src/rmdir.c:1.18	Thu Jul  1 10:12:37 2010
+++ rtems/cpukit/libcsupport/src/rmdir.c	Fri Jul 30 17:36:32 2010
@@ -74,7 +74,7 @@
   /*
    * Verify you can remove this node as a directory.
    */
-  if (  (*loc.ops->node_type_h)( &loc ) != RTEMS_FILESYSTEM_DIRECTORY ){
+  if ( (*loc.ops->node_type_h)( &loc ) != RTEMS_FILESYSTEM_DIRECTORY ) {
     rtems_filesystem_freenode( &loc );
     if ( free_parentloc )
       rtems_filesystem_freenode( &parentloc );

diff -u rtems/cpukit/libfs/src/imfs/imfs.h:1.46 rtems/cpukit/libfs/src/imfs/imfs.h:1.47
--- rtems/cpukit/libfs/src/imfs/imfs.h:1.46	Thu Jul 15 03:59:46 2010
+++ rtems/cpukit/libfs/src/imfs/imfs.h	Fri Jul 30 17:36:32 2010
@@ -560,6 +560,17 @@
   rtems_filesystem_location_info_t  *pathloc         /* IN */
 );
 
+/*
+ *  Turn on IMFS assertions when RTEMS_DEBUG is defined.
+ */
+#ifdef RTEMS_DEBUG
+  #include <assert.h>
+
+  #define IMFS_assert(_x) assert(_X)
+#else
+  #define IMFS_assert(_x)
+#endif
+
 #ifdef __cplusplus
 }
 #endif

diff -u rtems/cpukit/libfs/src/imfs/imfs_creat.c:1.18 rtems/cpukit/libfs/src/imfs/imfs_creat.c:1.19
--- rtems/cpukit/libfs/src/imfs/imfs_creat.c:1.18	Thu Jul 15 03:46:06 2010
+++ rtems/cpukit/libfs/src/imfs/imfs_creat.c	Fri Jul 30 17:36:32 2010
@@ -17,9 +17,6 @@
 #include "config.h"
 #endif
 
-#if defined(RTEMS_DEBUG)
-  #include <assert.h>
-#endif
 #include <stdlib.h>
 #include <string.h>
 #include "imfs.h"
@@ -101,16 +98,13 @@
       break;
 
     default:
-      #if defined(RTEMS_DEBUG)
-        assert(0);
-      #endif
+      IMFS_assert(0);
       break;
   }
 
   /*
    *  This node MUST have a parent, so put it in that directory list.
    */
-
   node->Parent = parent;
   node->st_ino = ++fs_info->ino_count;
 

diff -u rtems/cpukit/libfs/src/imfs/imfs_debug.c:1.16 rtems/cpukit/libfs/src/imfs/imfs_debug.c:1.17
--- rtems/cpukit/libfs/src/imfs/imfs_debug.c:1.16	Thu Jul 15 03:59:46 2010
+++ rtems/cpukit/libfs/src/imfs/imfs_debug.c	Fri Jul 30 17:36:32 2010
@@ -15,9 +15,6 @@
 #include "config.h"
 #endif
 
-#if defined(RTEMS_DEBUG)
-  #include <assert.h>
-#endif
 #include <string.h>
 #include <fcntl.h>
 #include <errno.h>
@@ -36,14 +33,11 @@
  *
  *  This routine prints the contents of the specified jnode.
  */
-
 void IMFS_print_jnode(
   IMFS_jnode_t *the_jnode
 )
 {
-  #if defined(RTEMS_DEBUG)
-    assert( the_jnode );
-  #endif
+  IMFS_assert( the_jnode );
 
   fprintf(stdout, "%s", the_jnode->name );
   switch( the_jnode->type ) {
@@ -104,7 +98,6 @@
  *  directory is encountered, then this routine will recurse to process
  *  the subdirectory.
  */
-
 void IMFS_dump_directory(
   IMFS_jnode_t  *the_directory,
   int            level
@@ -115,11 +108,9 @@
   IMFS_jnode_t         *the_jnode;
   int                   i;
 
-  #if defined(RTEMS_DEBUG)
-    assert( the_directory );
-    assert( level >= 0 );
-    assert( the_directory->type == IMFS_DIRECTORY );
-  #endif
+  IMFS_assert( the_directory );
+  IMFS_assert( level >= 0 );
+  IMFS_assert( the_directory->type == IMFS_DIRECTORY );
 
   the_chain = &the_directory->info.directory.Entries;
 
@@ -152,7 +143,7 @@
   fprintf(stdout, "*************** Dump of Entire IMFS ***************\n" );
   fprintf(stdout, "/\n" );
   IMFS_dump_directory( rtems_filesystem_root.node_access, 0 );
-  fprintf(stdout, "***************       End of Dump        ***************\n" );
+  fprintf(stdout, "***************      End of Dump       ***************\n" );
 }
 
 /*
@@ -162,7 +153,6 @@
  *  using the IMFS memory file type.
  *
  */
-
 int IMFS_memfile_maximum_size( void )
 {
   return IMFS_MEMFILE_MAXIMUM_SIZE;

diff -u rtems/cpukit/libfs/src/imfs/imfs_getchild.c:1.11 rtems/cpukit/libfs/src/imfs/imfs_getchild.c:1.12
--- rtems/cpukit/libfs/src/imfs/imfs_getchild.c:1.11	Thu Jun 24 16:31:22 2010
+++ rtems/cpukit/libfs/src/imfs/imfs_getchild.c	Fri Jul 30 17:36:32 2010
@@ -17,9 +17,6 @@
 #include "config.h"
 #endif
 
-#if defined(RTEMS_DEBUG)
-  #include <assert.h>
-#endif
 #include <errno.h>
 #include <string.h>
 #include "imfs.h"
@@ -40,16 +37,8 @@
    *  Check for fatal errors.  A NULL directory show a problem in the
    *  the IMFS code.
    */
-
-  #if defined(RTEMS_DEBUG)
-    assert( directory );
-    assert( name );
-  #endif
-  if ( !name )
-    return 0;
-
-  if ( !directory )
-    return 0;
+  IMFS_assert( directory );
+  IMFS_assert( name );
 
   /*
    *  Check for "." and ".."

diff -u rtems/cpukit/libfs/src/imfs/memfile.c:1.37 rtems/cpukit/libfs/src/imfs/memfile.c:1.38
--- rtems/cpukit/libfs/src/imfs/memfile.c:1.37	Thu Jul 15 03:10:48 2010
+++ rtems/cpukit/libfs/src/imfs/memfile.c	Fri Jul 30 17:36:32 2010
@@ -31,16 +31,11 @@
 #include <rtems/libio_.h>
 #include <rtems/seterr.h>
 
-#if defined(RTEMS_DEBUG)
-  #include <assert.h>
-#endif
-
 #define MEMFILE_STATIC
 
 /*
  *  Prototypes of private routines
  */
-
 MEMFILE_STATIC int IMFS_memfile_extend(
    IMFS_jnode_t  *the_jnode,
    off_t          new_length
@@ -88,7 +83,6 @@
  *  This routine processes the open() system call.  Note that there is
  *  nothing special to be done at open() time.
  */
-
 int memfile_open(
   rtems_libio_t *iop,
   const char    *pathname,
@@ -130,7 +124,6 @@
  *  This routine processes the close() system call.  Note that there is
  *  nothing to flush or memory to free at this point.
  */
-
 int memfile_close(
   rtems_libio_t *iop
 )
@@ -152,7 +145,6 @@
  *
  *  This routine processes the read() system call.
  */
-
 ssize_t memfile_read(
   rtems_libio_t *iop,
   void          *buffer,
@@ -171,7 +163,6 @@
  *
  *  This routine processes the write() system call.
  */
-
 ssize_t memfile_write(
   rtems_libio_t *iop,
   const void    *buffer,
@@ -196,7 +187,6 @@
  *
  *  NOTE:  No ioctl()'s are supported for in-memory files.
  */
-
 int memfile_ioctl(
   rtems_libio_t *iop,
   uint32_t       command,
@@ -215,7 +205,6 @@
  *
  *  This routine processes the lseek() system call.
  */
-
 rtems_off64_t memfile_lseek(
   rtems_libio_t   *iop,
   rtems_off64_t    offset,
@@ -250,7 +239,6 @@
  *
  *  This routine processes the ftruncate() system call.
  */
-
 int memfile_ftruncate(
   rtems_libio_t        *iop,
   rtems_off64_t         length
@@ -274,7 +262,6 @@
    *  deleted.  So we leave the previously allocated blocks in place for
    *  future use and just set the length.
    */
-
   the_jnode->info.file.size = length;
   iop->size = the_jnode->info.file.size;
 
@@ -290,7 +277,6 @@
  *  specified.  If necessary, it will allocate memory blocks to
  *  extend the file.
  */
-
 MEMFILE_STATIC int IMFS_memfile_extend(
    IMFS_jnode_t  *the_jnode,
    off_t          new_length
@@ -303,38 +289,34 @@
   /*
    *  Perform internal consistency checks
    */
+  IMFS_assert( the_jnode );
+    IMFS_assert( the_jnode->type == IMFS_MEMORY_FILE );
 
-  #if defined(RTEMS_DEBUG)
-    assert( the_jnode );
-    assert( the_jnode->type == IMFS_MEMORY_FILE );
-  #endif
-  if ( !the_jnode )
-    rtems_set_errno_and_return_minus_one( EIO );
-
-  if ( the_jnode->type != IMFS_MEMORY_FILE )
-    rtems_set_errno_and_return_minus_one( EIO );
-
+  /*
+   *  Verify new file size is supported
+   */
   if ( new_length >= IMFS_MEMFILE_MAXIMUM_SIZE )
     rtems_set_errno_and_return_minus_one( EINVAL );
 
+  /*
+   *  Verify new file size is actually larger than current size
+   */
   if ( new_length <= the_jnode->info.file.size )
     return 0;
 
   /*
    *  Calculate the number of range of blocks to allocate
    */
-
   new_blocks = new_length / IMFS_MEMFILE_BYTES_PER_BLOCK;
   old_blocks = the_jnode->info.file.size / IMFS_MEMFILE_BYTES_PER_BLOCK;
 
   /*
    *  Now allocate each of those blocks.
    */
-
   for ( block=old_blocks ; block<=new_blocks ; block++ ) {
     if ( IMFS_memfile_addblock( the_jnode, block ) ) {
        for ( ; block>=old_blocks ; block-- ) {
-          IMFS_memfile_remove_block( the_jnode, block );
+         IMFS_memfile_remove_block( the_jnode, block );
        }
        rtems_set_errno_and_return_minus_one( ENOSPC );
     }
@@ -343,7 +325,6 @@
   /*
    *  Set the new length of the file.
    */
-
   the_jnode->info.file.size = new_length;
   return 0;
 }
@@ -353,7 +334,6 @@
  *
  *  This routine adds a single block to the specified in-memory file.
  */
-
 MEMFILE_STATIC int IMFS_memfile_addblock(
    IMFS_jnode_t  *the_jnode,
    unsigned int   block
@@ -362,30 +342,24 @@
   block_p  memory;
   block_p *block_entry_ptr;
 
-  #if defined(RTEMS_DEBUG)
-    assert( the_jnode );
-    assert( the_jnode->type == IMFS_MEMORY_FILE );
-  #endif
-  if ( !the_jnode )
-    rtems_set_errno_and_return_minus_one( EIO );
-
-  if ( the_jnode->type != IMFS_MEMORY_FILE )
-    rtems_set_errno_and_return_minus_one( EIO );
+  IMFS_assert( the_jnode );
+  IMFS_assert( the_jnode->type == IMFS_MEMORY_FILE );
 
+  /*
+   * Obtain the pointer for the specified block number
+   */
   block_entry_ptr = IMFS_memfile_get_block_pointer( the_jnode, block, 1 );
   if ( *block_entry_ptr )
     return 0;
 
-#if 0
-  fprintf(stdout, "%d %p", block, block_entry_ptr );
-    fflush(stdout);
-#endif
-
+  /*
+   *  There is no memory for this block number so allocate it.
+   */
   memory = memfile_alloc_block();
   if ( !memory )
     return 1;
-  *block_entry_ptr = memory;
 
+  *block_entry_ptr = memory;
   return 0;
 }
 
@@ -399,7 +373,6 @@
  *         block from the middle of a file would be exceptionally
  *         dangerous and the results unpredictable.
  */
-
 MEMFILE_STATIC int IMFS_memfile_remove_block(
    IMFS_jnode_t  *the_jnode,
    unsigned int   block
@@ -409,14 +382,11 @@
   block_p  ptr;
 
   block_ptr = IMFS_memfile_get_block_pointer( the_jnode, block, 0 );
-  #if defined(RTEMS_DEBUG)
-    assert( block_ptr );
-  #endif
-  if ( block_ptr ) {
-    ptr = *block_ptr;
-    *block_ptr = 0;
-    memfile_free_block( ptr );
-  }
+  IMFS_assert( block_ptr );
+
+  ptr = *block_ptr;
+  *block_ptr = 0;
+  memfile_free_block( ptr );
 
   return 1;
 }
@@ -427,7 +397,6 @@
  *  This is a support routine for IMFS_memfile_remove.  It frees all the
  *  blocks in one of the indirection tables.
  */
-
 void memfile_free_blocks_in_table(
   block_p **block_table,
   int       entries
@@ -439,17 +408,11 @@
   /*
    *  Perform internal consistency checks
    */
-
-  #if defined(RTEMS_DEBUG)
-    assert( block_table );
-  #endif
-  if ( !block_table )
-    return;
+  IMFS_assert( block_table );
 
   /*
    *  Now go through all the slots in the table and free the memory.
    */
-
   b = *block_table;
 
   for ( i=0 ; i<entries ; i++ ) {
@@ -463,7 +426,6 @@
    *  Now that all the blocks in the block table are free, we can
    *  free the block table itself.
    */
-
   memfile_free_block( *block_table );
   *block_table = 0;
 }
@@ -486,7 +448,6 @@
  *         Regardless until the IMFS implementation is proven, it
  *         is better to stick to simple, easy to understand algorithms.
  */
-
 int IMFS_memfile_remove(
  IMFS_jnode_t  *the_jnode
 )
@@ -500,22 +461,13 @@
   /*
    *  Perform internal consistency checks
    */
-
-  #if defined(RTEMS_DEBUG)
-    assert( the_jnode );
-    assert( the_jnode->type == IMFS_MEMORY_FILE );
-  #endif
-  if ( !the_jnode )
-    rtems_set_errno_and_return_minus_one( EIO );
-
-  if ( the_jnode->type != IMFS_MEMORY_FILE )
-    rtems_set_errno_and_return_minus_one( EIO );
+  IMFS_assert( the_jnode );
+  IMFS_assert( the_jnode->type == IMFS_MEMORY_FILE );
 
   /*
    *  Eventually this could be set smarter at each call to
    *  memfile_free_blocks_in_table to greatly speed this up.
    */
-
   to_free = IMFS_MEMFILE_BLOCK_SLOTS;
 
   /*
@@ -524,7 +476,6 @@
    *    + doubly indirect
    *    + triply indirect
    */
-
   info = &the_jnode->info.file;
 
   if ( info->indirect ) {
@@ -532,7 +483,6 @@
   }
 
   if ( info->doubly_indirect ) {
-
     for ( i=0 ; i<IMFS_MEMFILE_BLOCK_SLOTS ; i++ ) {
       if ( info->doubly_indirect[i] ) {
         memfile_free_blocks_in_table(
@@ -574,7 +524,6 @@
  *  reading the data between offset and the end of the file (truncated
  *  read).
  */
-
 MEMFILE_STATIC ssize_t IMFS_memfile_read(
    IMFS_jnode_t    *the_jnode,
    off_t            start,
@@ -596,39 +545,17 @@
   /*
    *  Perform internal consistency checks
    */
-
-  #if defined(RTEMS_DEBUG)
-    assert( the_jnode );
-    assert( the_jnode->type == IMFS_MEMORY_FILE ||
+  IMFS_assert( the_jnode );
+  IMFS_assert( the_jnode->type == IMFS_MEMORY_FILE ||
        the_jnode->type != IMFS_LINEAR_FILE );
-    assert( dest );
-  #endif
-  if ( !the_jnode )
-    rtems_set_errno_and_return_minus_one( EIO );
-
-  if ( the_jnode->type != IMFS_MEMORY_FILE &&
-       the_jnode->type != IMFS_LINEAR_FILE )
-    rtems_set_errno_and_return_minus_one( EIO );
-
-  /*
-   *  Error checks on arguments
-   */
-
-  if ( !dest )
-    rtems_set_errno_and_return_minus_one( EINVAL );
-
-  /*
-   *  If there is nothing to read, then quick exit.
-   */
-
-  my_length = length;
-  if ( !my_length )
-    rtems_set_errno_and_return_minus_one( EINVAL );
+  IMFS_assert( dest );
 
   /*
    *  Linear files (as created from a tar file are easier to handle
    *  than block files).
    */
+  my_length = length;
+
   if (the_jnode->type == IMFS_LINEAR_FILE) {
     unsigned char  *file_ptr;
 
@@ -648,7 +575,6 @@
    *  If the last byte we are supposed to read is past the end of this
    *  in memory file, then shorten the length to read.
    */
-
   last_byte = start + length;
   if ( last_byte > the_jnode->info.file.size )
     my_length = the_jnode->info.file.size - start;
@@ -665,7 +591,6 @@
   /*
    *  Phase 1: possibly the last part of one block
    */
-
   start_offset = start % IMFS_MEMFILE_BYTES_PER_BLOCK;
   block = start / IMFS_MEMFILE_BYTES_PER_BLOCK;
   if ( start_offset )  {
@@ -685,7 +610,6 @@
   /*
    *  Phase 2: all of zero of more blocks
    */
-
   to_copy = IMFS_MEMFILE_BYTES_PER_BLOCK;
   while ( my_length >= IMFS_MEMFILE_BYTES_PER_BLOCK ) {
     block_ptr = IMFS_memfile_get_block_pointer( the_jnode, block, 0 );
@@ -701,10 +625,7 @@
   /*
    *  Phase 3: possibly the first part of one block
    */
-
-  #if defined(RTEMS_DEBUG)
-    assert( my_length < IMFS_MEMFILE_BYTES_PER_BLOCK );
-  #endif
+  IMFS_assert( my_length < IMFS_MEMFILE_BYTES_PER_BLOCK );
 
   if ( my_length ) {
     block_ptr = IMFS_memfile_get_block_pointer( the_jnode, block, 0 );
@@ -725,7 +646,6 @@
  *  This routine writes the specified data buffer into the in memory
  *  file pointed to by the_jnode.  The file is extended as needed.
  */
-
 MEMFILE_STATIC ssize_t IMFS_memfile_write(
    IMFS_jnode_t          *the_jnode,
    off_t                  start,
@@ -748,40 +668,17 @@
   /*
    *  Perform internal consistency checks
    */
-
-  #if defined(RTEMS_DEBUG)
-    assert( source );
-    assert( the_jnode );
-    assert( the_jnode->type == IMFS_MEMORY_FILE );
-  #endif
-  if ( !the_jnode )
-    rtems_set_errno_and_return_minus_one( EIO );
-
-  if ( the_jnode->type != IMFS_MEMORY_FILE )
-    rtems_set_errno_and_return_minus_one( EIO );
-
-  /*
-   *  Error check arguments
-   */
-
-  if ( !source )
-    rtems_set_errno_and_return_minus_one( EINVAL );
-
-
-  /*
-   *  If there is nothing to write, then quick exit.
-   */
+  IMFS_assert( source );
+  IMFS_assert( the_jnode );
+  IMFS_assert( the_jnode->type == IMFS_MEMORY_FILE );
 
   my_length = length;
-  if ( !my_length )
-    rtems_set_errno_and_return_minus_one( EINVAL );
-
   /*
    *  If the last byte we are supposed to write is past the end of this
    *  in memory file, then extend the length.
    */
 
-  last_byte = start + length;
+  last_byte = start + my_length;
   if ( last_byte > the_jnode->info.file.size ) {
     status = IMFS_memfile_extend( the_jnode, last_byte );
     if ( status )
@@ -800,7 +697,6 @@
   /*
    *  Phase 1: possibly the last part of one block
    */
-
   start_offset = start % IMFS_MEMFILE_BYTES_PER_BLOCK;
   block = start / IMFS_MEMFILE_BYTES_PER_BLOCK;
   if ( start_offset )  {
@@ -850,10 +746,7 @@
   /*
    *  Phase 3: possibly the first part of one block
    */
-
-  #if defined(RTEMS_DEBUG)
-    assert( my_length < IMFS_MEMFILE_BYTES_PER_BLOCK );
-  #endif
+  IMFS_assert( my_length < IMFS_MEMFILE_BYTES_PER_BLOCK );
 
   to_copy = my_length;
   if ( my_length ) {
@@ -880,7 +773,6 @@
  *  number.  If that block has not been allocated and "malloc_it" is
  *  TRUE, then the block is allocated.  Otherwise, it is an error.
  */
-
 #if 0
 block_p *IMFS_memfile_get_block_pointer_DEBUG(
    IMFS_jnode_t   *the_jnode,
@@ -922,25 +814,15 @@
   /*
    *  Perform internal consistency checks
    */
-
-  #if defined(RTEMS_DEBUG)
-    assert( the_jnode );
-    assert( the_jnode->type == IMFS_MEMORY_FILE );
-  #endif
-  if ( !the_jnode )
-    return NULL;
-
-  if ( the_jnode->type != IMFS_MEMORY_FILE )
-    return NULL;
+  IMFS_assert( the_jnode );
+  IMFS_assert( the_jnode->type == IMFS_MEMORY_FILE );
 
   info = &the_jnode->info.file;
-
   my_block = block;
 
   /*
    *  Is the block number in the simple indirect portion?
    */
-
   if ( my_block <= LAST_INDIRECT ) {
     p = info->indirect;
 
@@ -966,11 +848,6 @@
    */
 
   if ( my_block <= LAST_DOUBLY_INDIRECT ) {
-#if 0
-fprintf(stdout, "(d %d) ", block );
-fflush(stdout);
-#endif
-
     my_block -= FIRST_DOUBLY_INDIRECT;
 
     singly = my_block % IMFS_MEMFILE_BLOCK_SLOTS;
@@ -1004,22 +881,12 @@
     if ( !p )
       return 0;
 
-#if 0
-fprintf(stdout, "(d %d %d %d %d %p %p) ", block, my_block, doubly,
-                                       singly, p, &p[singly] );
-fflush(stdout);
-#endif
     return (block_p *)&p[ singly ];
   }
 
-#if 0
-fprintf(stdout, "(t %d) ", block );
-fflush(stdout);
-#endif
   /*
    *  Is the block number in the triply indirect portion?
    */
-
   if ( my_block <= LAST_TRIPLY_INDIRECT ) {
     my_block -= FIRST_TRIPLY_INDIRECT;
 
@@ -1059,10 +926,6 @@
     if ( !p )
       return 0;
 
-#if 0
-fprintf(stdout, "(t %d %d %d %d %d) ", block, my_block, triply, doubly, singly );
-fflush(stdout);
-#endif
     p1 = (block_p *) p[ triply ];
     if ( !p1 )
       return 0;
@@ -1077,7 +940,6 @@
   /*
    *  This means the requested block number is out of range.
    */
-
   return 0;
 }
 
@@ -1086,7 +948,6 @@
  *
  *  Allocate a block for an in-memory file.
  */
-
 int memfile_blocks_allocated = 0;
 
 void *memfile_alloc_block(void)
@@ -1105,15 +966,10 @@
  *
  *  Free a block from an in-memory file.
  */
-
 void memfile_free_block(
   void *memory
 )
 {
-#if 0
-fprintf(stdout, "(d %p) ", memory );
-fflush(stdout);
-#endif
   free(memory);
   memfile_blocks_allocated--;
 }



--

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/20100730/c0ebb475/attachment.html>


More information about the vc mailing list