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.5.4 lib/fs/ext4/extent_index.rb
manageiq-smartstate-0.3.5 lib/fs/ext4/extent_index.rb
manageiq-smartstate-0.5.3 lib/fs/ext4/extent_index.rb
manageiq-smartstate-0.5.2 lib/fs/ext4/extent_index.rb
manageiq-smartstate-0.5.1 lib/fs/ext4/extent_index.rb
manageiq-smartstate-0.5.0 lib/fs/ext4/extent_index.rb
manageiq-smartstate-0.3.4 lib/fs/ext4/extent_index.rb
manageiq-smartstate-0.4.0 lib/fs/ext4/extent_index.rb
manageiq-smartstate-0.2.18.2 lib/fs/ext4/extent_index.rb
manageiq-smartstate-0.3.3 lib/fs/ext4/extent_index.rb
manageiq-smartstate-0.3.2 lib/fs/ext4/extent_index.rb
manageiq-smartstate-0.3.1 lib/fs/ext4/extent_index.rb
manageiq-smartstate-0.3.0 lib/fs/ext4/extent_index.rb
manageiq-smartstate-0.2.24 lib/fs/ext4/extent_index.rb
manageiq-smartstate-0.2.18.1 lib/fs/ext4/extent_index.rb
manageiq-smartstate-0.2.23 lib/fs/ext4/extent_index.rb
manageiq-smartstate-0.2.22 lib/fs/ext4/extent_index.rb
manageiq-smartstate-0.2.21 lib/fs/ext4/extent_index.rb
manageiq-smartstate-0.2.20 lib/fs/ext4/extent_index.rb
manageiq-smartstate-0.2.19 lib/fs/ext4/extent_index.rb