Sha256: b9c357fb2d36c551fa3b52a2e5cfcb50b2d7456c8a2ed4704f7eb4c8f0a9e0e6

Contents?: true

Size: 952 Bytes

Versions: 66

Compression:

Stored size: 952 Bytes

Contents

require 'binary_struct'

module Ext4
  # ////////////////////////////////////////////////////////////////////////////
  # // Data definitions.

  EXTENT_INDEX = BinaryStruct.new([
    'L',  'block',      # index covers logical blocks from 'block'
    'L',  'leaf_lo',    # low  32 bits of physical block of the next level. leaf or next index could be there
    'S',  'leaf_hi',    # high 16 bits of physical block
    'S',  'unused',     #
  ])
  SIZEOF_EXTENT_INDEX = EXTENT_INDEX.size

  class ExtentIndex
    attr_reader :block, :leaf

    def initialize(buf)
      raise "Ext4::ExtentIndex.initialize: Nil buffer" if buf.nil?
      @ei = EXTENT_INDEX.decode(buf)

      @block      = @ei['block']
      @leaf       = (@ei['leaf_hi'] << 32) | @ei['leaf_lo']
    end

    def dump
      out = "\#<#{self.class}:0x#{'%08x' % object_id}>\n"
      out += "Block        : #{@block}\n"
      out += "Leaf         : #{@leaf}\n"
      out
    end
  end
end

Version data entries

66 entries across 66 versions & 1 rubygems

Version Path
manageiq-smartstate-0.10.1 lib/fs/ext4/extent_index.rb
manageiq-smartstate-0.10.0 lib/fs/ext4/extent_index.rb
manageiq-smartstate-0.9.0 lib/fs/ext4/extent_index.rb
manageiq-smartstate-0.8.1 lib/fs/ext4/extent_index.rb
manageiq-smartstate-0.8.0 lib/fs/ext4/extent_index.rb
manageiq-smartstate-0.7.0 lib/fs/ext4/extent_index.rb
manageiq-smartstate-0.6.2 lib/fs/ext4/extent_index.rb
manageiq-smartstate-0.5.10 lib/fs/ext4/extent_index.rb
manageiq-smartstate-0.3.10 lib/fs/ext4/extent_index.rb
manageiq-smartstate-0.6.1 lib/fs/ext4/extent_index.rb
manageiq-smartstate-0.3.9 lib/fs/ext4/extent_index.rb
manageiq-smartstate-0.6.0 lib/fs/ext4/extent_index.rb
manageiq-smartstate-0.5.9 lib/fs/ext4/extent_index.rb
manageiq-smartstate-0.5.8 lib/fs/ext4/extent_index.rb
manageiq-smartstate-0.3.8 lib/fs/ext4/extent_index.rb
manageiq-smartstate-0.5.7 lib/fs/ext4/extent_index.rb
manageiq-smartstate-0.3.7 lib/fs/ext4/extent_index.rb
manageiq-smartstate-0.5.6 lib/fs/ext4/extent_index.rb
manageiq-smartstate-0.3.6 lib/fs/ext4/extent_index.rb
manageiq-smartstate-0.5.5 lib/fs/ext4/extent_index.rb