lib/virtfs/ext3/superblock.rb
# Ignore allocation is for testing only.
Ignore allocation is for testing only.
Ignore allocation is for testing only .
def block(blk, _ignore_alloc = false)
      raise "block is nil" if blk.nil?
      return @block_cache[blk] if @block_cache.key?(blk)
      if blk == 0
        @block_cache[blk] = MemoryBuffer.create(@block_size)
      else
        group, offset = block_num_to_group_num(blk)
        gde = gdt[group]
        address = block_to_address(blk)  
        @stream.seek(address)
        @block_cache[blk] = @stream.read(@block_size)
      end
    end
def block ( blk , _ignore_alloc = false ) raise "block is nil" if blk . nil? return @block_cache [ blk ] if @block_cache . key? ( blk ) if blk == 0 @block_cache [ blk ] = MemoryBuffer . create ( @block_size ) else group , offset = block_num_to_group_num ( blk ) gde = gdt [ group ] address = block_to_address ( blk ) @stream . seek ( address ) @block_cache [ blk ] = @stream . read ( @block_size ) end end
Ignore allocation is for testing only.
Ignore allocation is for testing only .
# This function will read the block into our cache
blk
<not_specific>
_ignore_alloc
<not_specific>