@@ -711,24 +711,11 @@ int vdo_configure_slab(block_count_t slab_size, block_count_t slab_journal_block
711711 ref_blocks = vdo_get_saved_reference_count_size (slab_size - slab_journal_blocks );
712712 meta_blocks = (ref_blocks + slab_journal_blocks );
713713
714- /* Make sure test code hasn't configured slabs to be too small. */
714+ /* Make sure configured slabs are not too small. */
715715 if (meta_blocks >= slab_size )
716716 return VDO_BAD_CONFIGURATION ;
717717
718- /*
719- * If the slab size is very small, assume this must be a unit test and override the number
720- * of data blocks to be a power of two (wasting blocks in the slab). Many tests need their
721- * data_blocks fields to be the exact capacity of the configured volume, and that used to
722- * fall out since they use a power of two for the number of data blocks, the slab size was
723- * a power of two, and every block in a slab was a data block.
724- *
725- * TODO: Try to figure out some way of structuring testParameters and unit tests so this
726- * hack isn't needed without having to edit several unit tests every time the metadata size
727- * changes by one block.
728- */
729718 data_blocks = slab_size - meta_blocks ;
730- if ((slab_size < 1024 ) && !is_power_of_2 (data_blocks ))
731- data_blocks = ((block_count_t ) 1 << ilog2 (data_blocks ));
732719
733720 /*
734721 * Configure the slab journal thresholds. The flush threshold is 168 of 224 blocks in
@@ -1221,11 +1208,6 @@ int vdo_validate_config(const struct vdo_config *config,
12211208 if (result != VDO_SUCCESS )
12221209 return result ;
12231210
1224- result = VDO_ASSERT (config -> slab_journal_blocks >= MINIMUM_VDO_SLAB_JOURNAL_BLOCKS ,
1225- "slab journal size meets minimum size" );
1226- if (result != VDO_SUCCESS )
1227- return result ;
1228-
12291211 result = VDO_ASSERT (config -> slab_journal_blocks <= config -> slab_size ,
12301212 "slab journal size is within expected bound" );
12311213 if (result != VDO_SUCCESS )
0 commit comments