Lines Matching refs:result

223 	int result;  in compute_sizes()  local
231 result = uds_compute_volume_index_save_blocks(config, sls->block_size, in compute_sizes()
233 if (result != UDS_SUCCESS) in compute_sizes()
234 return vdo_log_error_strerror(result, "cannot compute index save size"); in compute_sizes()
253 int result; in uds_compute_index_size() local
262 result = uds_make_configuration(parameters, &index_config); in uds_compute_index_size()
263 if (result != UDS_SUCCESS) { in uds_compute_index_size()
264 vdo_log_error_strerror(result, "cannot compute index size"); in uds_compute_index_size()
265 return uds_status_to_errno(result); in uds_compute_index_size()
268 result = compute_sizes(index_config, &sizes); in uds_compute_index_size()
270 if (result != UDS_SUCCESS) in uds_compute_index_size()
271 return uds_status_to_errno(result); in uds_compute_index_size()
461 int result; in make_index_save_region_table() local
487 result = vdo_allocate_extended(struct region_table, region_count, in make_index_save_region_table()
490 if (result != VDO_SUCCESS) in make_index_save_region_table()
491 return result; in make_index_save_region_table()
544 int result; in write_index_save_header() local
548 result = vdo_allocate(table->encoded_size, u8, "index save data", &buffer); in write_index_save_header()
549 if (result != VDO_SUCCESS) in write_index_save_header()
550 return result; in write_index_save_header()
566 result = uds_write_to_buffered_writer(writer, buffer, offset); in write_index_save_header()
568 if (result != UDS_SUCCESS) in write_index_save_header()
569 return result; in write_index_save_header()
577 int result; in write_index_save_layout() local
581 result = make_index_save_region_table(isl, &table); in write_index_save_layout()
582 if (result != UDS_SUCCESS) in write_index_save_layout()
583 return result; in write_index_save_layout()
585 result = open_region_writer(layout, &isl->header, &writer); in write_index_save_layout()
586 if (result != UDS_SUCCESS) { in write_index_save_layout()
588 return result; in write_index_save_layout()
591 result = write_index_save_header(isl, table, writer); in write_index_save_layout()
595 return result; in write_index_save_layout()
640 int result; in discard_index_state_data() local
645 result = invalidate_old_save(layout, &layout->index.saves[i]); in discard_index_state_data()
646 if (result != UDS_SUCCESS) in discard_index_state_data()
647 saved_result = result; in discard_index_state_data()
651 return vdo_log_error_strerror(result, in discard_index_state_data()
662 int result; in make_layout_region_table() local
670 result = vdo_allocate_extended(struct region_table, region_count, in make_layout_region_table()
673 if (result != VDO_SUCCESS) in make_layout_region_table()
674 return result; in make_layout_region_table()
714 int result; in write_layout_header() local
718 result = vdo_allocate(table->encoded_size, u8, "layout data", &buffer); in write_layout_header()
719 if (result != VDO_SUCCESS) in write_layout_header()
720 return result; in write_layout_header()
741 result = uds_write_to_buffered_writer(writer, buffer, offset); in write_layout_header()
743 if (result != UDS_SUCCESS) in write_layout_header()
744 return result; in write_layout_header()
753 int result; in write_uds_index_config() local
756 result = open_layout_writer(layout, &layout->config, offset, &writer); in write_uds_index_config()
757 if (result != UDS_SUCCESS) in write_uds_index_config()
758 return vdo_log_error_strerror(result, "failed to open config region"); in write_uds_index_config()
760 result = uds_write_config_contents(writer, config, layout->super.version); in write_uds_index_config()
761 if (result != UDS_SUCCESS) { in write_uds_index_config()
763 return vdo_log_error_strerror(result, "failed to write config region"); in write_uds_index_config()
766 result = uds_flush_buffered_writer(writer); in write_uds_index_config()
767 if (result != UDS_SUCCESS) { in write_uds_index_config()
769 return vdo_log_error_strerror(result, "cannot flush config writer"); in write_uds_index_config()
778 int result; in save_layout() local
782 result = make_layout_region_table(layout, &table); in save_layout()
783 if (result != UDS_SUCCESS) in save_layout()
784 return result; in save_layout()
786 result = open_layout_writer(layout, &layout->header, offset, &writer); in save_layout()
787 if (result != UDS_SUCCESS) { in save_layout()
789 return result; in save_layout()
792 result = write_layout_header(layout, table, writer); in save_layout()
796 return result; in save_layout()
801 int result; in create_index_layout() local
804 result = compute_sizes(config, &sizes); in create_index_layout()
805 if (result != UDS_SUCCESS) in create_index_layout()
806 return result; in create_index_layout()
808 result = vdo_allocate(sizes.save_count, struct index_save_layout, __func__, in create_index_layout()
810 if (result != VDO_SUCCESS) in create_index_layout()
811 return result; in create_index_layout()
815 result = discard_index_state_data(layout); in create_index_layout()
816 if (result != UDS_SUCCESS) in create_index_layout()
817 return result; in create_index_layout()
819 result = write_uds_index_config(layout, config, 0); in create_index_layout()
820 if (result != UDS_SUCCESS) in create_index_layout()
821 return result; in create_index_layout()
886 int result; in uds_discard_open_chapter() local
890 result = find_latest_uds_index_save_slot(layout, &isl); in uds_discard_open_chapter()
891 if (result != UDS_SUCCESS) in uds_discard_open_chapter()
892 return result; in uds_discard_open_chapter()
894 result = open_region_writer(layout, &isl->open_chapter, &writer); in uds_discard_open_chapter()
895 if (result != UDS_SUCCESS) in uds_discard_open_chapter()
896 return result; in uds_discard_open_chapter()
898 result = uds_write_to_buffered_writer(writer, NULL, UDS_BLOCK_SIZE); in uds_discard_open_chapter()
899 if (result != UDS_SUCCESS) { in uds_discard_open_chapter()
901 return result; in uds_discard_open_chapter()
904 result = uds_flush_buffered_writer(writer); in uds_discard_open_chapter()
906 return result; in uds_discard_open_chapter()
911 int result; in uds_load_index_state() local
916 result = find_latest_uds_index_save_slot(layout, &isl); in uds_load_index_state()
917 if (result != UDS_SUCCESS) in uds_load_index_state()
918 return result; in uds_load_index_state()
924 result = open_region_reader(layout, &isl->open_chapter, &readers[0]); in uds_load_index_state()
925 if (result != UDS_SUCCESS) in uds_load_index_state()
926 return result; in uds_load_index_state()
928 result = uds_load_open_chapter(index, readers[0]); in uds_load_index_state()
930 if (result != UDS_SUCCESS) in uds_load_index_state()
931 return result; in uds_load_index_state()
934 result = open_region_reader(layout, &isl->volume_index_zones[zone], in uds_load_index_state()
936 if (result != UDS_SUCCESS) { in uds_load_index_state()
940 return result; in uds_load_index_state()
944 result = uds_load_volume_index(index->volume_index, readers, isl->zone_count); in uds_load_index_state()
947 if (result != UDS_SUCCESS) in uds_load_index_state()
948 return result; in uds_load_index_state()
950 result = open_region_reader(layout, &isl->index_page_map, &readers[0]); in uds_load_index_state()
951 if (result != UDS_SUCCESS) in uds_load_index_state()
952 return result; in uds_load_index_state()
954 result = uds_read_index_page_map(index->volume->index_page_map, readers[0]); in uds_load_index_state()
957 return result; in uds_load_index_state()
1048 int result; in setup_uds_index_save_slot() local
1052 result = invalidate_old_save(layout, isl); in setup_uds_index_save_slot()
1053 if (result != UDS_SUCCESS) in setup_uds_index_save_slot()
1054 return result; in setup_uds_index_save_slot()
1072 int result; in uds_save_index_state() local
1077 result = setup_uds_index_save_slot(layout, index->zone_count, &isl); in uds_save_index_state()
1078 if (result != UDS_SUCCESS) in uds_save_index_state()
1079 return result; in uds_save_index_state()
1087 result = open_region_writer(layout, &isl->open_chapter, &writers[0]); in uds_save_index_state()
1088 if (result != UDS_SUCCESS) { in uds_save_index_state()
1090 return result; in uds_save_index_state()
1093 result = uds_save_open_chapter(index, writers[0]); in uds_save_index_state()
1095 if (result != UDS_SUCCESS) { in uds_save_index_state()
1097 return result; in uds_save_index_state()
1101 result = open_region_writer(layout, &isl->volume_index_zones[zone], in uds_save_index_state()
1103 if (result != UDS_SUCCESS) { in uds_save_index_state()
1108 return result; in uds_save_index_state()
1112 result = uds_save_volume_index(index->volume_index, writers, index->zone_count); in uds_save_index_state()
1115 if (result != UDS_SUCCESS) { in uds_save_index_state()
1117 return result; in uds_save_index_state()
1120 result = open_region_writer(layout, &isl->index_page_map, &writers[0]); in uds_save_index_state()
1121 if (result != UDS_SUCCESS) { in uds_save_index_state()
1123 return result; in uds_save_index_state()
1126 result = uds_write_index_page_map(index->volume->index_page_map, writers[0]); in uds_save_index_state()
1128 if (result != UDS_SUCCESS) { in uds_save_index_state()
1130 return result; in uds_save_index_state()
1139 int result; in load_region_table() local
1146 result = uds_read_from_buffered_reader(reader, buffer, sizeof(buffer)); in load_region_table()
1147 if (result != UDS_SUCCESS) in load_region_table()
1148 return vdo_log_error_strerror(result, "cannot read region table header"); in load_region_table()
1166 result = vdo_allocate_extended(struct region_table, header.region_count, in load_region_table()
1169 if (result != VDO_SUCCESS) in load_region_table()
1170 return result; in load_region_table()
1177 result = uds_read_from_buffered_reader(reader, region_buffer, in load_region_table()
1179 if (result != UDS_SUCCESS) { in load_region_table()
1200 int result; in read_super_block_data() local
1205 result = vdo_allocate(saved_size, u8, "super block data", &buffer); in read_super_block_data()
1206 if (result != VDO_SUCCESS) in read_super_block_data()
1207 return result; in read_super_block_data()
1209 result = uds_read_from_buffered_reader(reader, buffer, saved_size); in read_super_block_data()
1210 if (result != UDS_SUCCESS) { in read_super_block_data()
1212 return vdo_log_error_strerror(result, "cannot read region table header"); in read_super_block_data()
1294 int result; in verify_sub_index() local
1300 result = verify_region(&sil->sub_index, next_block, RL_KIND_INDEX, 0); in verify_sub_index()
1301 if (result != UDS_SUCCESS) in verify_sub_index()
1302 return result; in verify_sub_index()
1307 result = verify_region(&sil->volume, next_block, RL_KIND_VOLUME, in verify_sub_index()
1309 if (result != UDS_SUCCESS) in verify_sub_index()
1310 return result; in verify_sub_index()
1316 result = verify_region(&sil->saves[i].index_save, next_block, in verify_sub_index()
1318 if (result != UDS_SUCCESS) in verify_sub_index()
1319 return result; in verify_sub_index()
1336 int result; in reconstitute_layout() local
1339 result = vdo_allocate(layout->super.max_saves, struct index_save_layout, in reconstitute_layout()
1341 if (result != VDO_SUCCESS) in reconstitute_layout()
1342 return result; in reconstitute_layout()
1347 result = verify_region(&layout->header, next_block++, RL_KIND_HEADER, in reconstitute_layout()
1349 if (result != UDS_SUCCESS) in reconstitute_layout()
1350 return result; in reconstitute_layout()
1353 result = verify_region(&layout->config, next_block++, RL_KIND_CONFIG, in reconstitute_layout()
1355 if (result != UDS_SUCCESS) in reconstitute_layout()
1356 return result; in reconstitute_layout()
1358 result = verify_sub_index(layout, next_block, table); in reconstitute_layout()
1359 if (result != UDS_SUCCESS) in reconstitute_layout()
1360 return result; in reconstitute_layout()
1365 result = verify_region(&layout->seal, next_block + layout->super.volume_offset, in reconstitute_layout()
1367 if (result != UDS_SUCCESS) in reconstitute_layout()
1368 return result; in reconstitute_layout()
1381 int result; in load_super_block() local
1385 result = load_region_table(reader, &table); in load_super_block()
1386 if (result != UDS_SUCCESS) in load_super_block()
1387 return result; in load_super_block()
1395 result = read_super_block_data(reader, layout, table->header.payload); in load_super_block()
1396 if (result != UDS_SUCCESS) { in load_super_block()
1398 return vdo_log_error_strerror(result, "unknown superblock format"); in load_super_block()
1409 result = reconstitute_layout(layout, table, first_block); in load_super_block()
1411 return result; in load_super_block()
1418 int result; in read_index_save_data() local
1429 result = uds_read_from_buffered_reader(reader, buffer, sizeof(buffer)); in read_index_save_data()
1430 if (result != UDS_SUCCESS) in read_index_save_data()
1431 return vdo_log_error_strerror(result, "cannot read index save data"); in read_index_save_data()
1466 int result; in reconstruct_index_save() local
1488 result = verify_region(&isl->header, next_block++, RL_KIND_HEADER, in reconstruct_index_save()
1490 if (result != UDS_SUCCESS) in reconstruct_index_save()
1491 return result; in reconstruct_index_save()
1494 result = verify_region(&isl->index_page_map, next_block, RL_KIND_INDEX_PAGE_MAP, in reconstruct_index_save()
1496 if (result != UDS_SUCCESS) in reconstruct_index_save()
1497 return result; in reconstruct_index_save()
1503 result = verify_region(&isl->volume_index_zones[z], next_block, in reconstruct_index_save()
1505 if (result != UDS_SUCCESS) in reconstruct_index_save()
1506 return result; in reconstruct_index_save()
1512 result = verify_region(&isl->open_chapter, next_block, RL_KIND_OPEN_CHAPTER, in reconstruct_index_save()
1514 if (result != UDS_SUCCESS) in reconstruct_index_save()
1515 return result; in reconstruct_index_save()
1519 result = verify_region(&isl->free_space, next_block, RL_KIND_EMPTY, in reconstruct_index_save()
1521 if (result != UDS_SUCCESS) in reconstruct_index_save()
1522 return result; in reconstruct_index_save()
1537 int result; in load_index_save() local
1540 result = load_region_table(reader, &table); in load_index_save()
1541 if (result != UDS_SUCCESS) { in load_index_save()
1542 return vdo_log_error_strerror(result, "cannot read index save %u header", in load_index_save()
1571 result = read_index_save_data(reader, isl, table->header.payload); in load_index_save()
1572 if (result != UDS_SUCCESS) { in load_index_save()
1574 return vdo_log_error_strerror(result, in load_index_save()
1579 result = reconstruct_index_save(isl, table); in load_index_save()
1581 if (result != UDS_SUCCESS) { in load_index_save()
1582 return vdo_log_error_strerror(result, "cannot reconstruct index save %u", in load_index_save()
1591 int result; in load_sub_index_regions() local
1598 result = open_region_reader(layout, &isl->index_save, &reader); in load_sub_index_regions()
1600 if (result != UDS_SUCCESS) { in load_sub_index_regions()
1601 vdo_log_error_strerror(result, in load_sub_index_regions()
1604 return result; in load_sub_index_regions()
1607 result = load_index_save(isl, reader, j); in load_sub_index_regions()
1609 if (result != UDS_SUCCESS) { in load_sub_index_regions()
1622 int result; in verify_uds_index_config() local
1627 result = open_layout_reader(layout, &layout->config, offset, &reader); in verify_uds_index_config()
1628 if (result != UDS_SUCCESS) in verify_uds_index_config()
1629 return vdo_log_error_strerror(result, "failed to open config reader"); in verify_uds_index_config()
1631 result = uds_validate_config_contents(reader, config); in verify_uds_index_config()
1632 if (result != UDS_SUCCESS) { in verify_uds_index_config()
1634 return vdo_log_error_strerror(result, "failed to read config region"); in verify_uds_index_config()
1643 int result; in load_index_layout() local
1646 result = uds_make_buffered_reader(layout->factory, in load_index_layout()
1648 if (result != UDS_SUCCESS) in load_index_layout()
1649 return vdo_log_error_strerror(result, "unable to read superblock"); in load_index_layout()
1651 result = load_super_block(layout, UDS_BLOCK_SIZE, in load_index_layout()
1654 if (result != UDS_SUCCESS) in load_index_layout()
1655 return result; in load_index_layout()
1657 result = verify_uds_index_config(layout, config); in load_index_layout()
1658 if (result != UDS_SUCCESS) in load_index_layout()
1659 return result; in load_index_layout()
1667 int result; in create_layout_factory() local
1671 result = uds_make_io_factory(config->bdev, &factory); in create_layout_factory()
1672 if (result != UDS_SUCCESS) in create_layout_factory()
1673 return result; in create_layout_factory()
1692 int result; in uds_make_index_layout() local
1696 result = compute_sizes(config, &sizes); in uds_make_index_layout()
1697 if (result != UDS_SUCCESS) in uds_make_index_layout()
1698 return result; in uds_make_index_layout()
1700 result = vdo_allocate(1, struct index_layout, __func__, &layout); in uds_make_index_layout()
1701 if (result != VDO_SUCCESS) in uds_make_index_layout()
1702 return result; in uds_make_index_layout()
1704 result = create_layout_factory(layout, config); in uds_make_index_layout()
1705 if (result != UDS_SUCCESS) { in uds_make_index_layout()
1707 return result; in uds_make_index_layout()
1719 result = create_index_layout(layout, config); in uds_make_index_layout()
1721 result = load_index_layout(layout, config); in uds_make_index_layout()
1722 if (result != UDS_SUCCESS) { in uds_make_index_layout()
1724 return result; in uds_make_index_layout()