Sha256: 7ed1d816cd2e65dd870fa83f1c00cfd64e8d540b3ac02aaabde4ff8b55510354
Contents?: true
Size: 1003 Bytes
Versions: 67
Compression:
Stored size: 1003 Bytes
Contents
require 'binary_struct' module Ext4 # //////////////////////////////////////////////////////////////////////////// # // Data definitions. EXTENT = BinaryStruct.new([ 'L', 'block', # first logical block extent covers 'S', 'length', # number of blocks covered by extent 'S', 'start_hi', # high 16 bits of physical block 'L', 'start_lo', # low 32 bits of physical block ]) SIZEOF_EXTENT = EXTENT.size class Extent attr_reader :block, :length, :start def initialize(buf) raise "Ext4::Extent.initialize: Nil buffer" if buf.nil? @extent = EXTENT.decode(buf) @block = @extent['block'] @length = @extent['length'] @start = (@extent['start_hi'] << 32) | @extent['start_lo'] end def dump out = "\#<#{self.class}:0x#{'%08x' % object_id}>\n" out += "Block : #{@block}\n" out += "Length : #{@length}\n" out += "Start : #{@start}\n" out end end end
Version data entries
67 entries across 67 versions & 1 rubygems