Lines Matching refs:delta_index

208 void uds_reset_delta_index(const struct delta_index *delta_index)  in uds_reset_delta_index()  argument
217 for (z = 0; z < delta_index->zone_count; z++) { in uds_reset_delta_index()
222 struct delta_zone *zone = &delta_index->delta_zones[z]; in uds_reset_delta_index()
291 void uds_uninitialize_delta_index(struct delta_index *delta_index) in uds_uninitialize_delta_index() argument
295 if (delta_index->delta_zones == NULL) in uds_uninitialize_delta_index()
298 for (z = 0; z < delta_index->zone_count; z++) { in uds_uninitialize_delta_index()
299 vdo_free(vdo_forget(delta_index->delta_zones[z].new_offsets)); in uds_uninitialize_delta_index()
300 vdo_free(vdo_forget(delta_index->delta_zones[z].delta_lists)); in uds_uninitialize_delta_index()
301 vdo_free(vdo_forget(delta_index->delta_zones[z].memory)); in uds_uninitialize_delta_index()
304 vdo_free(delta_index->delta_zones); in uds_uninitialize_delta_index()
305 memset(delta_index, 0, sizeof(struct delta_index)); in uds_uninitialize_delta_index()
347 int uds_initialize_delta_index(struct delta_index *delta_index, unsigned int zone_count, in uds_initialize_delta_index() argument
356 &delta_index->delta_zones); in uds_initialize_delta_index()
360 delta_index->zone_count = zone_count; in uds_initialize_delta_index()
361 delta_index->list_count = list_count; in uds_initialize_delta_index()
362 delta_index->lists_per_zone = DIV_ROUND_UP(list_count, zone_count); in uds_initialize_delta_index()
363 delta_index->memory_size = 0; in uds_initialize_delta_index()
364 delta_index->mutable = true; in uds_initialize_delta_index()
365 delta_index->tag = tag; in uds_initialize_delta_index()
368 u32 lists_in_zone = delta_index->lists_per_zone; in uds_initialize_delta_index()
376 if (delta_index->list_count <= first_list_in_zone) { in uds_initialize_delta_index()
377 uds_uninitialize_delta_index(delta_index); in uds_initialize_delta_index()
382 lists_in_zone = delta_index->list_count - first_list_in_zone; in uds_initialize_delta_index()
386 result = initialize_delta_zone(&delta_index->delta_zones[z], zone_memory, in uds_initialize_delta_index()
390 uds_uninitialize_delta_index(delta_index); in uds_initialize_delta_index()
394 delta_index->memory_size += in uds_initialize_delta_index()
399 uds_reset_delta_index(delta_index); in uds_initialize_delta_index()
530 delta_index_page->delta_index.delta_zones = delta_zone; in uds_initialize_delta_index_page()
531 delta_index_page->delta_index.zone_count = 1; in uds_initialize_delta_index_page()
532 delta_index_page->delta_index.list_count = list_count; in uds_initialize_delta_index_page()
533 delta_index_page->delta_index.lists_per_zone = list_count; in uds_initialize_delta_index_page()
534 delta_index_page->delta_index.mutable = false; in uds_initialize_delta_index_page()
535 delta_index_page->delta_index.tag = 'p'; in uds_initialize_delta_index_page()
707 int uds_pack_delta_index_page(const struct delta_index *delta_index, u64 header_nonce, in uds_pack_delta_index_page() argument
721 delta_zone = &delta_index->delta_zones[0]; in uds_pack_delta_index_page()
723 max_lists = delta_index->list_count - first_list; in uds_pack_delta_index_page()
823 int uds_start_restoring_delta_index(struct delta_index *delta_index, in uds_start_restoring_delta_index() argument
898 if (list_next != delta_index->list_count) { in uds_start_restoring_delta_index()
901 list_next, delta_index->list_count); in uds_start_restoring_delta_index()
911 uds_reset_delta_index(delta_index); in uds_start_restoring_delta_index()
912 delta_index->delta_zones[0].record_count = record_count; in uds_start_restoring_delta_index()
913 delta_index->delta_zones[0].collision_count = collision_count; in uds_start_restoring_delta_index()
919 delta_index->load_lists[z] = 0; in uds_start_restoring_delta_index()
936 delta_index->load_lists[z] += 1; in uds_start_restoring_delta_index()
939 zone_number = list_number / delta_index->lists_per_zone; in uds_start_restoring_delta_index()
940 delta_zone = &delta_index->delta_zones[zone_number]; in uds_start_restoring_delta_index()
947 for (z = 0; z < delta_index->zone_count; z++) in uds_start_restoring_delta_index()
948 rebalance_lists(&delta_index->delta_zones[z]); in uds_start_restoring_delta_index()
989 static int restore_delta_list_data(struct delta_index *delta_index, unsigned int load_zone, in restore_delta_list_data() argument
1017 if (save_info.tag != delta_index->tag) in restore_delta_list_data()
1020 if (save_info.index >= delta_index->list_count) { in restore_delta_list_data()
1024 delta_index->list_count); in restore_delta_list_data()
1034 delta_index->load_lists[load_zone] -= 1; in restore_delta_list_data()
1035 new_zone = save_info.index / delta_index->lists_per_zone; in restore_delta_list_data()
1036 return restore_delta_list_to_zone(&delta_index->delta_zones[new_zone], in restore_delta_list_data()
1041 int uds_finish_restoring_delta_index(struct delta_index *delta_index, in uds_finish_restoring_delta_index() argument
1055 while (delta_index->load_lists[z] > 0) { in uds_finish_restoring_delta_index()
1056 result = restore_delta_list_data(delta_index, z, in uds_finish_restoring_delta_index()
1119 int uds_start_saving_delta_index(const struct delta_index *delta_index, in uds_start_saving_delta_index() argument
1129 delta_zone = &delta_index->delta_zones[zone_number]; in uds_start_saving_delta_index()
1133 encode_u32_le(buffer, &offset, delta_index->zone_count); in uds_start_saving_delta_index()
1167 int uds_finish_saving_delta_index(const struct delta_index *delta_index, in uds_finish_saving_delta_index() argument
1176 delta_zone = &delta_index->delta_zones[zone_number]; in uds_finish_saving_delta_index()
1231 int uds_start_delta_index_search(const struct delta_index *delta_index, u32 list_number, in uds_start_delta_index_search() argument
1239 result = VDO_ASSERT((list_number < delta_index->list_count), in uds_start_delta_index_search()
1241 delta_index->list_count); in uds_start_delta_index_search()
1245 zone_number = list_number / delta_index->lists_per_zone; in uds_start_delta_index_search()
1246 delta_zone = &delta_index->delta_zones[zone_number]; in uds_start_delta_index_search()
1254 if (delta_index->mutable) { in uds_start_delta_index_search()
1439 int uds_get_delta_index_entry(const struct delta_index *delta_index, u32 list_number, in uds_get_delta_index_entry() argument
1445 result = uds_start_delta_index_search(delta_index, list_number, key, in uds_get_delta_index_entry()
1905 void uds_get_delta_index_stats(const struct delta_index *delta_index, in uds_get_delta_index_stats() argument
1912 for (z = 0; z < delta_index->zone_count; z++) { in uds_get_delta_index_stats()
1913 delta_zone = &delta_index->delta_zones[z]; in uds_get_delta_index_stats()