Sha256: 0ec52026f3e8d083225c8393c0ea2fa740c0c7ef51cb3abfa8fbac00c1f32880

Contents?: true

Size: 1011 Bytes

Versions: 66

Compression:

Stored size: 1011 Bytes

Contents

require 'binary_struct'

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

  HASH_TREE_HEADER = BinaryStruct.new([
    'L',  'unused1',    # Unused.
    'C',  'hash_ver',   # Hash version.
    'C',  'length',     # Length of this structure.
    'C',  'leaf_level', # Levels of leaves.
    'C',  'unused2',    # Unused.
  ])
  SIZEOF_HASH_TREE_HEADER = HASH_TREE_HEADER.size

  class HashTreeHeader
    attr_reader :hash_version, :length, :leaf_level

    def initialize(buf)
      raise "Ext4::HashTreeHeader.initialize: Nil buffer" if buf.nil?
      @hth = HASH_TREE_HEADER.decode(buf)

      @hash_version = @hth['hash_ver']
      @length       = @hth['length']
      @leaf_level   = @hth['leaf_level']
    end

    def dump
      out = "\#<#{self.class}:0x#{'%08x' % object_id}>\n"
      out += "Hash Version : #{@hash_version}\n"
      out += "Length       : #{@length}\n"
      out += "Leaf Level   : #{@leaf_level}\n"
    end
  end
end

Version data entries

66 entries across 66 versions & 1 rubygems

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