Class: Ext4::GroupDescriptorEntry

Inherits:
Object
  • Object
show all
Defined in:
lib/fs/ext4/group_descriptor_entry.rb

Overview

//////////////////////////////////////////////////////////////////////////// // Class.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(buf) ⇒ GroupDescriptorEntry

Returns a new instance of GroupDescriptorEntry.



28
29
30
31
32
33
# File 'lib/fs/ext4/group_descriptor_entry.rb', line 28

def initialize(buf)
  raise "Ext4::GroupDescriptorEntry.initialize: Nil buffer" if buf.nil?

  # Decode the group descriptor table entry.
  @gde = GDE.decode(buf)
end

Instance Attribute Details

#blockAllocBmpObject

Returns the value of attribute blockAllocBmp.



26
27
28
# File 'lib/fs/ext4/group_descriptor_entry.rb', line 26

def blockAllocBmp
  @blockAllocBmp
end

#inodeAllocBmpObject

Returns the value of attribute inodeAllocBmp.



26
27
28
# File 'lib/fs/ext4/group_descriptor_entry.rb', line 26

def inodeAllocBmp
  @inodeAllocBmp
end

Instance Method Details

#blockBmpObject

//////////////////////////////////////////////////////////////////////////// // Class helpers & accessors.



38
39
40
# File 'lib/fs/ext4/group_descriptor_entry.rb', line 38

def blockBmp
  @gde['blk_bmp']
end

#dumpObject

Dump object.



58
59
60
61
62
63
64
65
66
67
# File 'lib/fs/ext4/group_descriptor_entry.rb', line 58

def dump
  out = "\#<#{self.class}:0x#{'%08x' % object_id}>\n"
  out += "Block bitmap      : 0x#{'%08x' % @gde['blk_bmp']}\n"
  out += "Inode bitmap      : 0x#{'%08x' % @gde['inode_bmp']}\n"
  out += "Inode table       : 0x#{'%08x' % @gde['inode_table']}\n"
  out += "Unallocated blocks: 0x#{'%04x' % @gde['unalloc_blks']}\n"
  out += "Unallocated inodes: 0x#{'%04x' % @gde['unalloc_inodes']}\n"
  out += "Num directories   : 0x#{'%04x' % @gde['num_dirs']}\n"
  out
end

#inodeBmpObject



42
43
44
# File 'lib/fs/ext4/group_descriptor_entry.rb', line 42

def inodeBmp
  @gde['inode_bmp']
end

#inodeTableObject



46
47
48
# File 'lib/fs/ext4/group_descriptor_entry.rb', line 46

def inodeTable
  @gde['inode_table']
end

#numDirsObject



50
51
52
# File 'lib/fs/ext4/group_descriptor_entry.rb', line 50

def numDirs
  @gde['num_dirs']
end