Changeset b10f6e1 in rtems


Ignore:
Timestamp:
Mar 8, 1999, 9:39:39 PM (23 years ago)
Author:
Joel Sherrill <joel.sherrill@…>
Branches:
4.10, 4.11, 4.8, 4.9, 5, master
Children:
5b3632e
Parents:
3195d9c
Message:

Corrected bug where pointer to doubly linked blocks was being incorrectly
calculated.

Files:
4 edited

Legend:

Unmodified
Added
Removed
  • c/src/exec/libfs/src/imfs/memfile.c

    r3195d9c rb10f6e1  
    735735    if ( !block_ptr )
    736736      return copied;
     737#if 0
     738printf( "write %d at %d in %d: %*s\n", to_copy, start_offset, block, to_copy, src );
     739#endif
    737740    memcpy( &(*block_ptr)[ start_offset ], src, to_copy );
    738741    src += to_copy;
     
    752755    if ( !block_ptr )
    753756      return copied;
     757#if 0
     758printf( "write %d in %d: %*s\n", to_copy, block, to_copy, src );
     759#endif
    754760    memcpy( &(*block_ptr)[ 0 ], src, to_copy );
    755761    src += to_copy;
     
    771777    if ( !block_ptr )
    772778      return copied;
     779#if 0
     780printf( "write %d in %d: %*s\n", to_copy, block, to_copy, src );
     781#endif
    773782    memcpy( &(*block_ptr)[ 0 ], src, my_length );
    774783    my_length = 0;
     
    789798 */
    790799
     800#if 0
     801block_p *IMFS_memfile_get_block_pointer_DEBUG(
     802   IMFS_jnode_t   *the_jnode,
     803   unsigned int    block,
     804   int             malloc_it
     805);
     806
    791807block_p *IMFS_memfile_get_block_pointer(
     808   IMFS_jnode_t   *the_jnode,
     809   unsigned int    block,
     810   int             malloc_it
     811)
     812{
     813  block_p *p;
     814
     815  p = IMFS_memfile_get_block_pointer_DEBUG( the_jnode, block, malloc_it );
     816  printf( "(%d -> %p) ", block, p );
     817  return p;
     818}
     819
     820block_p *IMFS_memfile_get_block_pointer_DEBUG(
     821#else
     822block_p *IMFS_memfile_get_block_pointer(
     823#endif
    792824   IMFS_jnode_t   *the_jnode,
    793825   unsigned int    block,
     
    881913      }
    882914
    883       return (block_p *)&p[ singly ];
     915      return (block_p *)&p1[ singly ];
    884916    }
    885917
     
    9881020
    9891021/*
    990  *  memfile_free_blocK
     1022 *  memfile_free_block
    9911023 *
    9921024 *  Free a block from an in-memory file.
  • c/src/lib/libc/memfile.c

    r3195d9c rb10f6e1  
    735735    if ( !block_ptr )
    736736      return copied;
     737#if 0
     738printf( "write %d at %d in %d: %*s\n", to_copy, start_offset, block, to_copy, src );
     739#endif
    737740    memcpy( &(*block_ptr)[ start_offset ], src, to_copy );
    738741    src += to_copy;
     
    752755    if ( !block_ptr )
    753756      return copied;
     757#if 0
     758printf( "write %d in %d: %*s\n", to_copy, block, to_copy, src );
     759#endif
    754760    memcpy( &(*block_ptr)[ 0 ], src, to_copy );
    755761    src += to_copy;
     
    771777    if ( !block_ptr )
    772778      return copied;
     779#if 0
     780printf( "write %d in %d: %*s\n", to_copy, block, to_copy, src );
     781#endif
    773782    memcpy( &(*block_ptr)[ 0 ], src, my_length );
    774783    my_length = 0;
     
    789798 */
    790799
     800#if 0
     801block_p *IMFS_memfile_get_block_pointer_DEBUG(
     802   IMFS_jnode_t   *the_jnode,
     803   unsigned int    block,
     804   int             malloc_it
     805);
     806
    791807block_p *IMFS_memfile_get_block_pointer(
     808   IMFS_jnode_t   *the_jnode,
     809   unsigned int    block,
     810   int             malloc_it
     811)
     812{
     813  block_p *p;
     814
     815  p = IMFS_memfile_get_block_pointer_DEBUG( the_jnode, block, malloc_it );
     816  printf( "(%d -> %p) ", block, p );
     817  return p;
     818}
     819
     820block_p *IMFS_memfile_get_block_pointer_DEBUG(
     821#else
     822block_p *IMFS_memfile_get_block_pointer(
     823#endif
    792824   IMFS_jnode_t   *the_jnode,
    793825   unsigned int    block,
     
    881913      }
    882914
    883       return (block_p *)&p[ singly ];
     915      return (block_p *)&p1[ singly ];
    884916    }
    885917
     
    9881020
    9891021/*
    990  *  memfile_free_blocK
     1022 *  memfile_free_block
    9911023 *
    9921024 *  Free a block from an in-memory file.
  • c/src/libfs/src/imfs/memfile.c

    r3195d9c rb10f6e1  
    735735    if ( !block_ptr )
    736736      return copied;
     737#if 0
     738printf( "write %d at %d in %d: %*s\n", to_copy, start_offset, block, to_copy, src );
     739#endif
    737740    memcpy( &(*block_ptr)[ start_offset ], src, to_copy );
    738741    src += to_copy;
     
    752755    if ( !block_ptr )
    753756      return copied;
     757#if 0
     758printf( "write %d in %d: %*s\n", to_copy, block, to_copy, src );
     759#endif
    754760    memcpy( &(*block_ptr)[ 0 ], src, to_copy );
    755761    src += to_copy;
     
    771777    if ( !block_ptr )
    772778      return copied;
     779#if 0
     780printf( "write %d in %d: %*s\n", to_copy, block, to_copy, src );
     781#endif
    773782    memcpy( &(*block_ptr)[ 0 ], src, my_length );
    774783    my_length = 0;
     
    789798 */
    790799
     800#if 0
     801block_p *IMFS_memfile_get_block_pointer_DEBUG(
     802   IMFS_jnode_t   *the_jnode,
     803   unsigned int    block,
     804   int             malloc_it
     805);
     806
    791807block_p *IMFS_memfile_get_block_pointer(
     808   IMFS_jnode_t   *the_jnode,
     809   unsigned int    block,
     810   int             malloc_it
     811)
     812{
     813  block_p *p;
     814
     815  p = IMFS_memfile_get_block_pointer_DEBUG( the_jnode, block, malloc_it );
     816  printf( "(%d -> %p) ", block, p );
     817  return p;
     818}
     819
     820block_p *IMFS_memfile_get_block_pointer_DEBUG(
     821#else
     822block_p *IMFS_memfile_get_block_pointer(
     823#endif
    792824   IMFS_jnode_t   *the_jnode,
    793825   unsigned int    block,
     
    881913      }
    882914
    883       return (block_p *)&p[ singly ];
     915      return (block_p *)&p1[ singly ];
    884916    }
    885917
     
    9881020
    9891021/*
    990  *  memfile_free_blocK
     1022 *  memfile_free_block
    9911023 *
    9921024 *  Free a block from an in-memory file.
  • cpukit/libfs/src/imfs/memfile.c

    r3195d9c rb10f6e1  
    735735    if ( !block_ptr )
    736736      return copied;
     737#if 0
     738printf( "write %d at %d in %d: %*s\n", to_copy, start_offset, block, to_copy, src );
     739#endif
    737740    memcpy( &(*block_ptr)[ start_offset ], src, to_copy );
    738741    src += to_copy;
     
    752755    if ( !block_ptr )
    753756      return copied;
     757#if 0
     758printf( "write %d in %d: %*s\n", to_copy, block, to_copy, src );
     759#endif
    754760    memcpy( &(*block_ptr)[ 0 ], src, to_copy );
    755761    src += to_copy;
     
    771777    if ( !block_ptr )
    772778      return copied;
     779#if 0
     780printf( "write %d in %d: %*s\n", to_copy, block, to_copy, src );
     781#endif
    773782    memcpy( &(*block_ptr)[ 0 ], src, my_length );
    774783    my_length = 0;
     
    789798 */
    790799
     800#if 0
     801block_p *IMFS_memfile_get_block_pointer_DEBUG(
     802   IMFS_jnode_t   *the_jnode,
     803   unsigned int    block,
     804   int             malloc_it
     805);
     806
    791807block_p *IMFS_memfile_get_block_pointer(
     808   IMFS_jnode_t   *the_jnode,
     809   unsigned int    block,
     810   int             malloc_it
     811)
     812{
     813  block_p *p;
     814
     815  p = IMFS_memfile_get_block_pointer_DEBUG( the_jnode, block, malloc_it );
     816  printf( "(%d -> %p) ", block, p );
     817  return p;
     818}
     819
     820block_p *IMFS_memfile_get_block_pointer_DEBUG(
     821#else
     822block_p *IMFS_memfile_get_block_pointer(
     823#endif
    792824   IMFS_jnode_t   *the_jnode,
    793825   unsigned int    block,
     
    881913      }
    882914
    883       return (block_p *)&p[ singly ];
     915      return (block_p *)&p1[ singly ];
    884916    }
    885917
     
    9881020
    9891021/*
    990  *  memfile_free_blocK
     1022 *  memfile_free_block
    9911023 *
    9921024 *  Free a block from an in-memory file.
Note: See TracChangeset for help on using the changeset viewer.