Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

dm vdo: remove checks that can not fail

Remove checks that can't fail.

Signed-off-by: Matthew Sakai <msakai@redhat.com>
Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>

authored by

Matthew Sakai and committed by
Mikulas Patocka
148a9cec f4e99b84

+1 -22
-3
drivers/md/dm-vdo/constants.h
··· 44 44 /* The default size of each slab journal, in blocks */ 45 45 DEFAULT_VDO_SLAB_JOURNAL_SIZE = 224, 46 46 47 - /* Unit test minimum */ 48 - MINIMUM_VDO_SLAB_JOURNAL_BLOCKS = 2, 49 - 50 47 /* 51 48 * The initial size of lbn_operations and pbn_operations, which is based upon the expected 52 49 * maximum number of outstanding VIOs. This value was chosen to make it highly unlikely
+1 -19
drivers/md/dm-vdo/encodings.c
··· 711 711 ref_blocks = vdo_get_saved_reference_count_size(slab_size - slab_journal_blocks); 712 712 meta_blocks = (ref_blocks + slab_journal_blocks); 713 713 714 - /* Make sure test code hasn't configured slabs to be too small. */ 714 + /* Make sure configured slabs are not too small. */ 715 715 if (meta_blocks >= slab_size) 716 716 return VDO_BAD_CONFIGURATION; 717 717 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 - */ 729 718 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)); 732 719 733 720 /* 734 721 * Configure the slab journal thresholds. The flush threshold is 168 of 224 blocks in ··· 1205 1218 result = VDO_ASSERT(config->slab_size <= (1 << MAX_VDO_SLAB_BITS), 1206 1219 "slab size must be less than or equal to 2^%d", 1207 1220 MAX_VDO_SLAB_BITS); 1208 - if (result != VDO_SUCCESS) 1209 - return result; 1210 - 1211 - result = VDO_ASSERT(config->slab_journal_blocks >= MINIMUM_VDO_SLAB_JOURNAL_BLOCKS, 1212 - "slab journal size meets minimum size"); 1213 1221 if (result != VDO_SUCCESS) 1214 1222 return result; 1215 1223