Module: SMPTool::VirtualVolume::Utils::EmptyVolDataInitializer

Defined in:
lib/smp_tool/virtual_volume/utils/empty_vol_data_initializer.rb

Overview

Initializes empty data for a volume with the given params.

Class Method Summary collapse

Class Method Details

.call(volume_params) ⇒ VolumeData

Initialize empty data.

Parameters:

  • volume_params (Hash{ Symbol => Object })

Returns:



17
18
19
20
21
22
23
24
25
26
27
28
# File 'lib/smp_tool/virtual_volume/utils/empty_vol_data_initializer.rb', line 17

def self.call(volume_params)
  n_data_clusters = volume_params.n_clusters_allocated -
                    N_SYS_CLUSTERS -
                    (volume_params.n_dir_segs * volume_params.n_clusters_per_dir_seg)

  data = VolumeData.new(
    [],
    volume_params.extra_word
  )

  data.push_empty_entry(n_data_clusters)
end