Class: Lvm2Thin::MappingTree

Inherits:
BTree
  • Object
show all
Defined in:
lib/VolumeManager/LVM/thin/mapping_tree.rb

Constant Summary

Constants inherited from BTree

BTree::FLAGS

Instance Attribute Summary

Attributes inherited from BTree

#root_address

Instance Method Summary collapse

Methods inherited from BTree

#[], #entry_for, #internal?, #key_address, #key_base, #keys, #leaf?, #max_entries, #num_entries, #root, #to_h, #value_address, #value_base

Constructor Details

#initialize(superblock, root_address) ⇒ MappingTree

Returns a new instance of MappingTree.



3
4
5
# File 'lib/VolumeManager/LVM/thin/mapping_tree.rb', line 3

def initialize(superblock, root_address)
  super superblock, root_address, MAPPING_DETAILS
end

Instance Method Details

#entriesObject



7
8
9
10
11
12
13
# File 'lib/VolumeManager/LVM/thin/mapping_tree.rb', line 7

def entries
  @mtentries ||= begin
    super.collect do |entry|
      DataMap.new @superblock, @superblock.md_block_address(entry['value'])
    end
  end
end

#map_for(device_id) ⇒ Object



15
16
17
# File 'lib/VolumeManager/LVM/thin/mapping_tree.rb', line 15

def map_for(device_id)
  entry_for(device_id)
end