thin_metadata_size: fix units
This commit is contained in:
@ -98,8 +98,8 @@ def single_mapping(from, to = 4711)
|
||||
" <single_mapping time=\"0\" origin_block=\"#{from}\" data_block=\"#{to}\"/>\n"
|
||||
end
|
||||
|
||||
def range_mapping(mapping, length)
|
||||
" <range_mapping time=\"0\" origin_begin=\"#{mapping}\" data_begin=.\"1169\" length=\"#{lenght}\"/>\n"
|
||||
def range_mapping(from, to, length)
|
||||
" <range_mapping time=\"0\" origin_begin=\"#{from}\" data_begin=.\"#{to]\" length=\"#{length}\"/>\n"
|
||||
end
|
||||
|
||||
def xml_metadata(opts, units)
|
||||
@ -108,9 +108,14 @@ def xml_metadata(opts, units)
|
||||
puts begin_superblock(opts[:blocksize], blocks)
|
||||
0.step(opts[:thins] - 1) do |devid|
|
||||
puts begin_device(devid, opts[:thinsize])
|
||||
0.step(blocks - 1) do |from|
|
||||
puts single_mapping(from, to)
|
||||
to += 1
|
||||
if opts[:range]
|
||||
puts range_mapping(from, to, blocks)
|
||||
to += blocks
|
||||
else
|
||||
0.step(blocks - 1) do |from|
|
||||
puts single_mapping(from, to)
|
||||
to += 1
|
||||
end
|
||||
end
|
||||
puts end_device
|
||||
end
|
||||
|
Reference in New Issue
Block a user