···4444 /* The default size of each slab journal, in blocks */4545 DEFAULT_VDO_SLAB_JOURNAL_SIZE = 224,46464747- /* Unit test minimum */4848- MINIMUM_VDO_SLAB_JOURNAL_BLOCKS = 2,4949-5047 /*5148 * The initial size of lbn_operations and pbn_operations, which is based upon the expected5249 * maximum number of outstanding VIOs. This value was chosen to make it highly unlikely
+1-19
drivers/md/dm-vdo/encodings.c
···711711 ref_blocks = vdo_get_saved_reference_count_size(slab_size - slab_journal_blocks);712712 meta_blocks = (ref_blocks + slab_journal_blocks);713713714714- /* Make sure test code hasn't configured slabs to be too small. */714714+ /* Make sure configured slabs are not too small. */715715 if (meta_blocks >= slab_size)716716 return VDO_BAD_CONFIGURATION;717717718718- /*719719- * If the slab size is very small, assume this must be a unit test and override the number720720- * of data blocks to be a power of two (wasting blocks in the slab). Many tests need their721721- * data_blocks fields to be the exact capacity of the configured volume, and that used to722722- * fall out since they use a power of two for the number of data blocks, the slab size was723723- * a power of two, and every block in a slab was a data block.724724- *725725- * TODO: Try to figure out some way of structuring testParameters and unit tests so this726726- * hack isn't needed without having to edit several unit tests every time the metadata size727727- * changes by one block.728728- */729718 data_blocks = slab_size - meta_blocks;730730- if ((slab_size < 1024) && !is_power_of_2(data_blocks))731731- data_blocks = ((block_count_t) 1 << ilog2(data_blocks));732719733720 /*734721 * Configure the slab journal thresholds. The flush threshold is 168 of 224 blocks in···12051218 result = VDO_ASSERT(config->slab_size <= (1 << MAX_VDO_SLAB_BITS),12061219 "slab size must be less than or equal to 2^%d",12071220 MAX_VDO_SLAB_BITS);12081208- if (result != VDO_SUCCESS)12091209- return result;12101210-12111211- result = VDO_ASSERT(config->slab_journal_blocks >= MINIMUM_VDO_SLAB_JOURNAL_BLOCKS,12121212- "slab journal size meets minimum size");12131221 if (result != VDO_SUCCESS)12141222 return result;12151223