Skip to content

Commit

Permalink
incorporated some feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
chessbyte committed Feb 25, 2021
1 parent 26f180b commit f6e9f29
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions lib/disk/modules/VMWareSparseDisk.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit f6e9f29

Please sign in to comment.