Lines Matching refs:result
179 int result; in vdo_validate_header() local
188 result = validate_version(expected_header->version, actual_header->version, in vdo_validate_header()
190 if (result != VDO_SUCCESS) in vdo_validate_header()
191 return result; in vdo_validate_header()
304 int result; in vdo_parse_geometry_block() local
312 result = vdo_validate_header(&GEOMETRY_BLOCK_HEADER_4_0, &header, in vdo_parse_geometry_block()
315 result = vdo_validate_header(&GEOMETRY_BLOCK_HEADER_5_0, &header, in vdo_parse_geometry_block()
318 if (result != VDO_SUCCESS) in vdo_parse_geometry_block()
319 return result; in vdo_parse_geometry_block()
323 result = VDO_ASSERT(header.size == offset + sizeof(u32), in vdo_parse_geometry_block()
325 if (result != VDO_SUCCESS) in vdo_parse_geometry_block()
326 return result; in vdo_parse_geometry_block()
373 int result; in decode_block_map_state_2_0() local
376 result = vdo_validate_header(&VDO_BLOCK_MAP_HEADER_2_0, &header, true, __func__); in decode_block_map_state_2_0()
377 if (result != VDO_SUCCESS) in decode_block_map_state_2_0()
378 return result; in decode_block_map_state_2_0()
383 result = VDO_ASSERT(flat_page_origin == VDO_BLOCK_MAP_FLAT_PAGE_ORIGIN, in decode_block_map_state_2_0()
387 if (result != VDO_SUCCESS) in decode_block_map_state_2_0()
388 return result; in decode_block_map_state_2_0()
391 result = VDO_ASSERT(flat_page_count == 0, in decode_block_map_state_2_0()
394 if (result != VDO_SUCCESS) in decode_block_map_state_2_0()
395 return result; in decode_block_map_state_2_0()
400 result = VDO_ASSERT(VDO_BLOCK_MAP_HEADER_2_0.size == *offset - initial_offset, in decode_block_map_state_2_0()
402 if (result != VDO_SUCCESS) in decode_block_map_state_2_0()
403 return result; in decode_block_map_state_2_0()
495 int result; in decode_recovery_journal_state_7_0() local
501 result = vdo_validate_header(&VDO_RECOVERY_JOURNAL_HEADER_7_0, &header, true, in decode_recovery_journal_state_7_0()
503 if (result != VDO_SUCCESS) in decode_recovery_journal_state_7_0()
504 return result; in decode_recovery_journal_state_7_0()
511 result = VDO_ASSERT(VDO_RECOVERY_JOURNAL_HEADER_7_0.size == *offset - initial_offset, in decode_recovery_journal_state_7_0()
513 if (result != VDO_SUCCESS) in decode_recovery_journal_state_7_0()
514 return result; in decode_recovery_journal_state_7_0()
580 int result; in decode_slab_depot_state_2_0() local
588 result = vdo_validate_header(&VDO_SLAB_DEPOT_HEADER_2_0, &header, true, in decode_slab_depot_state_2_0()
590 if (result != VDO_SUCCESS) in decode_slab_depot_state_2_0()
591 return result; in decode_slab_depot_state_2_0()
619 result = VDO_ASSERT(VDO_SLAB_DEPOT_HEADER_2_0.size == *offset - initial_offset, in decode_slab_depot_state_2_0()
621 if (result != VDO_SUCCESS) in decode_slab_depot_state_2_0()
622 return result; in decode_slab_depot_state_2_0()
798 int result; in allocate_partition() local
800 result = vdo_allocate(1, struct partition, __func__, &partition); in allocate_partition()
801 if (result != VDO_SUCCESS) in allocate_partition()
802 return result; in allocate_partition()
827 int result; in make_partition() local
839 result = vdo_get_partition(layout, id, NULL); in make_partition()
840 if (result != VDO_UNKNOWN_PARTITION) in make_partition()
845 result = allocate_partition(layout, id, offset, size); in make_partition()
846 if (result != VDO_SUCCESS) in make_partition()
847 return result; in make_partition()
873 int result; in vdo_initialize_layout() local
890 result = make_partition(layout, VDO_BLOCK_MAP_PARTITION, block_map_blocks, true); in vdo_initialize_layout()
891 if (result != VDO_SUCCESS) { in vdo_initialize_layout()
893 return result; in vdo_initialize_layout()
896 result = make_partition(layout, VDO_SLAB_SUMMARY_PARTITION, summary_blocks, in vdo_initialize_layout()
898 if (result != VDO_SUCCESS) { in vdo_initialize_layout()
900 return result; in vdo_initialize_layout()
903 result = make_partition(layout, VDO_RECOVERY_JOURNAL_PARTITION, journal_blocks, in vdo_initialize_layout()
905 if (result != VDO_SUCCESS) { in vdo_initialize_layout()
907 return result; in vdo_initialize_layout()
910 result = make_partition(layout, VDO_SLAB_DEPOT_PARTITION, 0, true); in vdo_initialize_layout()
911 if (result != VDO_SUCCESS) in vdo_initialize_layout()
914 return result; in vdo_initialize_layout()
969 int result = vdo_get_partition(layout, id, &partition); in vdo_get_known_partition() local
971 VDO_ASSERT_LOG_ONLY(result == VDO_SUCCESS, "layout has expected partition: %u", id); in vdo_get_known_partition()
1018 int result; in decode_layout() local
1022 result = vdo_validate_header(&VDO_LAYOUT_HEADER_3_0, &header, false, __func__); in decode_layout()
1023 if (result != VDO_SUCCESS) in decode_layout()
1024 return result; in decode_layout()
1036 result = VDO_ASSERT(sizeof(struct layout_3_0) == *offset - initial_offset, in decode_layout()
1038 if (result != VDO_SUCCESS) in decode_layout()
1039 return result; in decode_layout()
1061 result = allocate_partition(layout, id, partition_offset, count); in decode_layout()
1062 if (result != VDO_SUCCESS) { in decode_layout()
1064 return result; in decode_layout()
1070 result = vdo_get_partition(layout, REQUIRED_PARTITIONS[i], &partition); in decode_layout()
1071 if (result != VDO_SUCCESS) { in decode_layout()
1073 return vdo_log_error_strerror(result, in decode_layout()
1179 int result; in decode_vdo_component() local
1182 result = validate_version(version, VDO_COMPONENT_DATA_41_0, in decode_vdo_component()
1184 if (result != VDO_SUCCESS) in decode_vdo_component()
1185 return result; in decode_vdo_component()
1207 int result; in vdo_validate_config() local
1209 result = VDO_ASSERT(config->slab_size > 0, "slab size unspecified"); in vdo_validate_config()
1210 if (result != VDO_SUCCESS) in vdo_validate_config()
1211 return result; in vdo_validate_config()
1213 result = VDO_ASSERT(is_power_of_2(config->slab_size), in vdo_validate_config()
1215 if (result != VDO_SUCCESS) in vdo_validate_config()
1216 return result; in vdo_validate_config()
1218 result = VDO_ASSERT(config->slab_size <= (1 << MAX_VDO_SLAB_BITS), in vdo_validate_config()
1221 if (result != VDO_SUCCESS) in vdo_validate_config()
1222 return result; in vdo_validate_config()
1224 result = VDO_ASSERT(config->slab_journal_blocks >= MINIMUM_VDO_SLAB_JOURNAL_BLOCKS, in vdo_validate_config()
1226 if (result != VDO_SUCCESS) in vdo_validate_config()
1227 return result; in vdo_validate_config()
1229 result = VDO_ASSERT(config->slab_journal_blocks <= config->slab_size, in vdo_validate_config()
1231 if (result != VDO_SUCCESS) in vdo_validate_config()
1232 return result; in vdo_validate_config()
1234 result = vdo_configure_slab(config->slab_size, config->slab_journal_blocks, in vdo_validate_config()
1236 if (result != VDO_SUCCESS) in vdo_validate_config()
1237 return result; in vdo_validate_config()
1239 result = VDO_ASSERT((slab_config.data_blocks >= 1), in vdo_validate_config()
1241 if (result != VDO_SUCCESS) in vdo_validate_config()
1242 return result; in vdo_validate_config()
1244 result = VDO_ASSERT(config->physical_blocks > 0, "physical blocks unspecified"); in vdo_validate_config()
1245 if (result != VDO_SUCCESS) in vdo_validate_config()
1246 return result; in vdo_validate_config()
1248 result = VDO_ASSERT(config->physical_blocks <= MAXIMUM_VDO_PHYSICAL_BLOCKS, in vdo_validate_config()
1252 if (result != VDO_SUCCESS) in vdo_validate_config()
1263 result = VDO_ASSERT((config->logical_blocks > 0), in vdo_validate_config()
1265 if (result != VDO_SUCCESS) in vdo_validate_config()
1266 return result; in vdo_validate_config()
1276 result = VDO_ASSERT(config->logical_blocks <= MAXIMUM_VDO_LOGICAL_BLOCKS, in vdo_validate_config()
1278 if (result != VDO_SUCCESS) in vdo_validate_config()
1279 return result; in vdo_validate_config()
1281 result = VDO_ASSERT(config->recovery_journal_size > 0, in vdo_validate_config()
1283 if (result != VDO_SUCCESS) in vdo_validate_config()
1284 return result; in vdo_validate_config()
1286 result = VDO_ASSERT(is_power_of_2(config->recovery_journal_size), in vdo_validate_config()
1288 if (result != VDO_SUCCESS) in vdo_validate_config()
1289 return result; in vdo_validate_config()
1291 return result; in vdo_validate_config()
1320 int result; in decode_components() local
1324 result = decode_layout(buffer, offset, vdo_get_data_region_start(*geometry) + 1, in decode_components()
1326 if (result != VDO_SUCCESS) in decode_components()
1327 return result; in decode_components()
1329 result = decode_recovery_journal_state_7_0(buffer, offset, in decode_components()
1331 if (result != VDO_SUCCESS) in decode_components()
1332 return result; in decode_components()
1334 result = decode_slab_depot_state_2_0(buffer, offset, &states->slab_depot); in decode_components()
1335 if (result != VDO_SUCCESS) in decode_components()
1336 return result; in decode_components()
1338 result = decode_block_map_state_2_0(buffer, offset, &states->block_map); in decode_components()
1339 if (result != VDO_SUCCESS) in decode_components()
1340 return result; in decode_components()
1358 int result; in vdo_decode_component_states() local
1366 result = validate_version(VDO_VOLUME_VERSION_67_0, states->volume_version, in vdo_decode_component_states()
1368 if (result != VDO_SUCCESS) in vdo_decode_component_states()
1369 return result; in vdo_decode_component_states()
1371 result = decode_components(buffer, &offset, geometry, states); in vdo_decode_component_states()
1372 if (result != VDO_SUCCESS) in vdo_decode_component_states()
1375 return result; in vdo_decode_component_states()
1451 int result; in vdo_decode_super_block() local
1457 result = vdo_validate_header(&SUPER_BLOCK_HEADER_12_0, &header, false, __func__); in vdo_decode_super_block()
1458 if (result != VDO_SUCCESS) in vdo_decode_super_block()
1459 return result; in vdo_decode_super_block()
1477 result = VDO_ASSERT(offset == VDO_SUPER_BLOCK_FIXED_SIZE + VDO_COMPONENT_DATA_SIZE, in vdo_decode_super_block()
1479 if (result != VDO_SUCCESS) in vdo_decode_super_block()
1480 return result; in vdo_decode_super_block()