From f6e9f2962c1197fc8b90574f281b181b07fe6282 Mon Sep 17 00:00:00 2001 From: Oleg Barenboim Date: Thu, 25 Feb 2021 10:34:00 -0500 Subject: [PATCH] incorporated some feedback --- lib/disk/modules/VMWareSparseDisk.rb | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/lib/disk/modules/VMWareSparseDisk.rb b/lib/disk/modules/VMWareSparseDisk.rb index 3c4df81d..dfe33153 100644 --- a/lib/disk/modules/VMWareSparseDisk.rb +++ b/lib/disk/modules/VMWareSparseDisk.rb @@ -200,11 +200,7 @@ def initialize_without_markers # the grain tables. # buf = @vmwareSparseDisk_file.read(BYTES_PER_SECTOR) - @grainDirectory = [] - - GDES_PER_GD.times do |index| - @grainDirectory[index] = buf[index, GDE_SIZE].unpack1('L') - end + @grainDirectory = GDES_PER_GD.times.map { |index| buf[index, GDE_SIZE].unpack1('L') } # # In a Hosted Sparse Extent, all the grain tables are created when the sparse extent is created, @@ -320,10 +316,10 @@ def read_grain(grain_number, offset, length, parent_offset) gte = getGTE(grain_number) # + # when GTE > 1 - all reads: from the sparse disk # when GTE is 0 - reads with no parent: return 0s # - reads with parent: read from parent # when GTE is 1 - all reads: return 0s - # when GTE > 1 - all reads: from the sparse disk # if gte > 1 read_grain_from_disk(gte, offset, length)