Lines Matching refs:assert
91 assert(node_ro); in block_tree_node_is_leaf()
92 assert(node_ro->is_leaf <= 1); in block_tree_node_is_leaf()
114 assert(payload_size < block_size); in block_tree_set_sizes()
115 assert(key_size); in block_tree_set_sizes()
116 assert(key_size <= sizeof(data_block_t)); in block_tree_set_sizes()
117 assert(child_size >= key_size); in block_tree_set_sizes()
118 assert(child_size <= sizeof(struct block_mac)); in block_tree_set_sizes()
119 assert(data_size); in block_tree_set_sizes()
120 assert(data_size <= sizeof(struct block_mac)); in block_tree_set_sizes()
130 assert(tree->key_count[0] >= 2); in block_tree_set_sizes()
131 assert(tree->key_count[1] >= 2); in block_tree_set_sizes()
146 assert(size >= 1); in is_zero()
161 assert(key_count); in block_tree_max_key_count()
162 assert(key_count * tree->key_size < tree->block_size); in block_tree_max_key_count()
232 assert(max_count); in block_tree_node_shift()
233 assert(dest_index <= max_count + !is_leaf + 1); in block_tree_node_shift()
249 assert(!is_leaf); in block_tree_node_shift()
280 assert(is_zero(src, size)); in block_tree_node_shift()
310 assert(new_key); in block_tree_node_shift()
311 assert(new_data); in block_tree_node_shift()
318 assert(src); in block_tree_node_shift()
334 assert(dest_index <= max_count); in block_tree_node_shift()
373 assert(is_zero(dest_key, tree->key_size)); in block_tree_node_merge_entries()
399 assert(dest_index < src_index); in block_tree_node_shift_down()
467 assert(node_ro); in block_tree_node_get_key()
471 assert(sizeof(key) >= key_size); in block_tree_node_get_key()
475 assert(index >= key_count); in block_tree_node_get_key()
498 assert(node_rw); in block_tree_node_set_key()
499 assert(index < key_count); in block_tree_node_set_key()
500 assert(key_size <= sizeof(new_key)); in block_tree_node_set_key()
522 assert(index < max_key_count + !is_leaf); in block_tree_node_get_child_data()
527 assert(child_data > (void*)node_ro->data); in block_tree_node_get_child_data()
528 assert(child_data < (void*)node_ro + tree->block_size); in block_tree_node_get_child_data()
566 assert(!block_tree_node_is_leaf(node_ro)); in block_tree_node_get_child()
576 assert(index > key_count); in block_tree_node_get_child()
606 assert(block_tree_node_is_leaf(node_ro)); in block_tree_node_get_data()
615 assert(index >= max_key_count); in block_tree_node_get_data()
648 assert(!block_tree_node_is_leaf(node_ro)); in block_tree_node_print_internal()
665 assert(!block_tree_node_get_child(tr, tree, node_block, node_ro, i)); in block_tree_node_print_internal()
685 assert(block_tree_node_is_leaf(node_ro)); in block_tree_node_print_leaf()
1064 assert(tr->fs->dev->block_size >= tree->block_size); in block_tree_check()
1227 assert(tree->inserting.block == node_block); in block_tree_node_find_block()
1253 assert(*child); in block_tree_node_find_block()
1254 assert(block_mac_valid(tr, *child)); in block_tree_node_find_block()
1310 assert(tr); in block_tree_walk()
1311 assert(tree); in block_tree_walk()
1312 assert(tree->block_size <= tr->fs->dev->block_size); in block_tree_walk()
1324 assert(path->count < countof(path->entry)); in block_tree_walk()
1328 assert(tr->failed); in block_tree_walk()
1333 assert(node_ro); in block_tree_walk()
1341 assert(!path->entry[path->count - 1].next_key || next_key); in block_tree_walk()
1342 assert(!path->entry[path->count - 1].next_key || in block_tree_walk()
1344 assert(!path->entry[path->count - 1].prev_key || prev_key); in block_tree_walk()
1345 assert(!path->entry[path->count - 1].prev_key || in block_tree_walk()
1352 assert(block_tree_node_is_leaf(node_ro)); in block_tree_walk()
1356 assert(!key_is_max || block_mac_valid(path->tr, &path->data) || in block_tree_walk()
1410 assert(path->tree_update_count == path->tree->update_count); in block_tree_path_next()
1411 assert(path->count); in block_tree_path_next()
1414 assert(path->entry[depth].next_key); in block_tree_path_next()
1427 assert(path->tr->failed); in block_tree_path_next()
1431 assert(node_ro); in block_tree_path_next()
1432 assert(block_tree_node_is_leaf(node_ro)); in block_tree_path_next()
1445 assert(path->entry[depth].next_key == prev_key || !prev_key); in block_tree_path_next()
1448 assert(!next_key || next_key >= prev_key); in block_tree_path_next()
1466 assert(depth > 0); in block_tree_path_next()
1478 assert(path->tr->failed); in block_tree_path_next()
1482 assert(node_ro); in block_tree_path_next()
1483 assert(!block_tree_node_is_leaf(node_ro)); in block_tree_path_next()
1500 assert(prev_key && prev_key == path->entry[depth].next_key); in block_tree_path_next()
1517 assert(next_child); in block_tree_path_next()
1521 assert(path->tr->failed); in block_tree_path_next()
1525 assert(node_ro); in block_tree_path_next()
1526 assert(!block_tree_node_is_leaf(node_ro)); in block_tree_path_next()
1545 assert(path->entry[depth].next_key); in block_tree_path_next()
1546 assert(next_child); in block_tree_path_next()
1549 assert(next_child); in block_tree_path_next()
1552 assert(path->tr->failed); in block_tree_path_next()
1556 assert(node_ro); in block_tree_path_next()
1557 assert(block_tree_node_is_leaf(node_ro)); in block_tree_path_next()
1567 assert(path->entry[depth].next_key); in block_tree_path_next()
1583 assert(path->tr->failed); in block_tree_path_next()
1608 assert(path_index || in block_tree_block_dirty()
1617 assert(path->tree->allow_copy_on_write); in block_tree_block_dirty()
1626 assert(new_block != block_mac_to_block(tr, block_mac)); in block_tree_block_dirty()
1627 assert(!tr->failed); in block_tree_block_dirty()
1698 assert(path_index < (int)countof(path->entry)); in block_tree_path_put_dirty()
1706 assert(!parent_node_rw); in block_tree_path_put_dirty()
1711 assert(parent_node_rw); in block_tree_path_put_dirty()
1714 assert(path_index == (int)path->count - 1 || !parent_is_leaf); in block_tree_path_put_dirty()
1715 assert(path->tree->child_data_size[parent_is_leaf] <= in block_tree_path_put_dirty()
1717 assert(path->tree->child_data_size[parent_is_leaf] >= in block_tree_path_put_dirty()
1723 assert(!block_tree_node_need_copy(tr, path->tree, block_mac) || in block_tree_path_put_dirty()
1728 assert(block_tree_node_need_copy(tr, path->tree, block_mac) || in block_tree_path_put_dirty()
1754 assert(block_mac_eq(tr, block_mac, in block_tree_path_put_dirty()
1757 assert(!block_mac_eq(tr, block_mac, in block_tree_path_put_dirty()
1762 assert(block_mac_eq(tr, block_mac, in block_tree_path_put_dirty()
1769 assert(block_mac_same_block(tr, block_mac, &path->entry[0].block_mac)); in block_tree_path_put_dirty()
1770 assert(block_mac_eq(tr, block_mac, &path->entry[0].block_mac)); in block_tree_path_put_dirty()
1772 assert(!block_mac_eq(tr, block_mac, &path->entry[0].block_mac) || in block_tree_path_put_dirty()
1775 assert(block_mac_eq(tr, block_mac, &path->entry[0].block_mac)); in block_tree_path_put_dirty()
1799 assert(new_key); in block_tree_update_key()
1802 assert(path_index < (int)countof(path->entry)); in block_tree_update_key()
1814 assert(node_rw); in block_tree_update_key()
1825 assert(!block_tree_node_is_leaf(node_rw)); in block_tree_update_key()
1826 assert(index == 1 || new_key >= block_tree_node_get_key( in block_tree_update_key()
1829 assert(index == block_tree_node_max_key_count(path->tree, node_rw) || in block_tree_update_key()
1835 assert(path->entry[path_index].prev_key == in block_tree_update_key()
1839 assert(block_tree_node_check(tr, path->tree, node_rw, in block_tree_update_key()
1897 assert(index < max_key_count); in block_tree_node_leaf_remove_entry()
1898 assert(block_tree_node_is_leaf(node_rw)); in block_tree_node_leaf_remove_entry()
1944 assert(path->count > 0); in block_tree_node_split()
1945 assert(path->tree); in block_tree_node_split()
1956 assert(append_key); in block_tree_node_split()
1958 assert(!path->tree->inserting.block); in block_tree_node_split()
1962 assert(!append_child); in block_tree_node_split()
1966 assert(!append_data); in block_tree_node_split()
1970 assert(!path->tree->copy_on_write || path->tree->allow_copy_on_write); in block_tree_node_split()
1986 assert(block_mac); in block_tree_node_split()
1987 assert(block_mac_valid(tr, block_mac)); in block_tree_node_split()
1988 assert(path->tree->inserting.block == block_mac_to_block(tr, block_mac)); in block_tree_node_split()
1989 assert(path->tree->inserting.key == append_key); in block_tree_node_split()
1990 assert(block_mac_to_block(tr, &path->tree->inserting.data) == in block_tree_node_split()
1992 assert(block_mac_to_block(tr, &path->tree->inserting.child) == in block_tree_node_split()
2005 assert(tr->failed); in block_tree_node_split()
2009 assert(node_left_rw); in block_tree_node_split()
2012 assert(left_block_num != block_mac_to_block(tr, block_mac)); in block_tree_node_split()
2020 assert(node_left_rw); in block_tree_node_split()
2034 assert(left_block_num == block_mac_to_block(tr, block_mac)); in block_tree_node_split()
2043 assert(parent_node_rw); in block_tree_node_split()
2044 assert(!block_tree_node_is_leaf(parent_node_rw)); in block_tree_node_split()
2048 assert(block_mac_to_block(tr, left_block_mac) == left_block_num); in block_tree_node_split()
2049 assert(!tr->failed); in block_tree_node_split()
2057 assert(block_tree_node_is_leaf(node_left_rw) == is_leaf); in block_tree_node_split()
2058 assert(block_tree_node_is_leaf(node_right_rw) == is_leaf); in block_tree_node_split()
2059 assert(is_leaf || (append_key && append_child)); in block_tree_node_split()
2060 assert(!is_leaf || (append_key && append_data)); in block_tree_node_split()
2061 assert(block_tree_node_full(path->tree, node_left_rw)); in block_tree_node_split()
2062 assert(!tr->failed); in block_tree_node_split()
2095 assert(max_key_count == in block_tree_node_split()
2109 assert(!block_tree_node_is_leaf(parent_node_rw)); in block_tree_node_split()
2119 assert(parent_index == in block_tree_node_split()
2125 assert(parent_index == 0 || in block_tree_node_split()
2132 assert(!overflow_key == !block_mac_valid(tr, &overflow_child)); in block_tree_node_split()
2144 assert(block_mac_valid(tr, &overflow_child)); in block_tree_node_split()
2171 assert(path->count); /* new root node should not overflow */ in block_tree_node_split()
2218 assert(path->tree); in block_tree_get_sibling_block()
2219 assert(path->count > 1); in block_tree_get_sibling_block()
2226 assert(tr->failed); in block_tree_get_sibling_block()
2234 assert(block_mac_valid(tr, &block_mac)); in block_tree_get_sibling_block()
2261 assert(path->count > 1); in block_tree_path_set_sibling_block()
2264 assert(!left || parent_index > 0); in block_tree_path_set_sibling_block()
2322 assert(path->count); in block_tree_remove_internal()
2328 assert(tr->failed); in block_tree_remove_internal()
2332 assert(!block_tree_node_is_leaf(node_ro)); in block_tree_remove_internal()
2333 assert(index > 0); in block_tree_remove_internal()
2344 assert(index == 1); in block_tree_remove_internal()
2351 assert(block_mac_valid(tr, new_root)); in block_tree_remove_internal()
2355 assert(!path->tree->copy_on_write || path->tree->allow_copy_on_write); in block_tree_remove_internal()
2413 assert(path->count > 1); in block_tree_node_merge()
2414 assert(path->tree); in block_tree_node_merge()
2427 assert(tr->failed); in block_tree_node_merge()
2431 assert(node_ro); in block_tree_node_merge()
2436 assert(tr->failed); in block_tree_node_merge()
2441 assert(merge_node_ro); in block_tree_node_merge()
2442 assert(is_leaf == block_tree_node_is_leaf(merge_node_ro)); in block_tree_node_merge()
2453 assert(block_tree_below_min_full(path->tree, node_ro)); in block_tree_node_merge()
2454 assert(!block_tree_below_min_full(path->tree, merge_node_ro)); in block_tree_node_merge()
2458 assert(!tr->failed); in block_tree_node_merge()
2463 assert(tr->failed); in block_tree_node_merge()
2469 assert(!block_tree_node_need_copy(tr, path->tree, &merge_block)); in block_tree_node_merge()
2472 assert(!block_tree_node_need_copy(tr, path->tree, block_mac)); in block_tree_node_merge()
2520 assert(key0); in block_tree_node_merge()
2564 assert(tr->failed); in block_tree_node_merge()
2570 assert(!block_tree_node_need_copy(tr, path->tree, left)); in block_tree_node_merge()
2577 assert(*merge_key); in block_tree_node_merge()
2583 assert(block_tree_node_check(tr, path->tree, node_rw, in block_tree_node_merge()
2592 assert(key0); in block_tree_node_merge()
2643 assert(!tr->failed); in block_tree_insert_block_mac()
2644 assert(!tree->updating); in block_tree_insert_block_mac()
2645 assert(key); in block_tree_insert_block_mac()
2646 assert(block_mac_valid(tr, &data)); in block_tree_insert_block_mac()
2651 assert(!tree->copy_on_write || tree->allow_copy_on_write); in block_tree_insert_block_mac()
2662 assert(block_mac_valid(tr, &tree->root)); in block_tree_insert_block_mac()
2676 assert(path.count > 0); in block_tree_insert_block_mac()
2683 assert(tr->failed); in block_tree_insert_block_mac()
2691 assert(node_ro); in block_tree_insert_block_mac()
2696 assert(node_ro); in block_tree_insert_block_mac()
2697 assert(block_tree_node_is_leaf(node_ro)); in block_tree_insert_block_mac()
2698 assert(index || !path.entry[path.count - 1].prev_key || in block_tree_insert_block_mac()
2704 assert(tr->failed); in block_tree_insert_block_mac()
2716 assert(block_mac_valid(tr, &overflow_data)); in block_tree_insert_block_mac()
2776 assert(!tr->failed); in block_tree_remove()
2777 assert(!tree->updating); in block_tree_remove()
2778 assert(block_mac_valid(tr, &tree->root)); in block_tree_remove()
2780 assert(key); in block_tree_remove()
2781 assert(data); in block_tree_remove()
2790 assert(path.count > 0); in block_tree_remove()
2797 assert(block_tree_path_get_key(&path)); in block_tree_remove()
2807 assert(tr->failed); in block_tree_remove()
2811 assert(block_tree_node_is_leaf(node_ro)); in block_tree_remove()
2812 assert(block_tree_node_get_key(tree, DATA_BLOCK_INVALID, node_ro, index) == in block_tree_remove()
2814 assert(!memcmp(block_tree_node_get_child_data(tree, node_ro, index), &data, in block_tree_remove()
2830 assert(node_rw); in block_tree_remove()
2836 assert(new_parent_key || in block_tree_remove()
2893 assert(!tr->failed); in block_tree_update_block_mac()
2894 assert(!tree->updating); in block_tree_update_block_mac()
2895 assert(block_mac_valid(tr, &tree->root)); in block_tree_update_block_mac()
2897 assert(old_key); in block_tree_update_block_mac()
2898 assert(block_mac_valid(tr, &old_data)); in block_tree_update_block_mac()
2899 assert(new_key); in block_tree_update_block_mac()
2900 assert(block_mac_valid(tr, &new_data)); in block_tree_update_block_mac()
2901 assert(old_key == new_key || in block_tree_update_block_mac()
2903 assert(old_key != new_key || in block_tree_update_block_mac()
2921 assert(path.count > 0); in block_tree_update_block_mac()
2928 assert(block_tree_path_get_key(&path)); in block_tree_update_block_mac()
2938 assert(tr->failed); in block_tree_update_block_mac()
2943 assert(block_tree_node_is_leaf(node_ro)); in block_tree_update_block_mac()
2944 assert(block_tree_node_get_key(tree, DATA_BLOCK_INVALID, node_ro, index) == in block_tree_update_block_mac()
2946 assert(block_mac_same_block( in block_tree_update_block_mac()
2973 assert(node_rw); in block_tree_update_block_mac()
2976 assert(tree->child_data_size[1] <= sizeof(new_data)); in block_tree_update_block_mac()
2983 assert(new_key); in block_tree_update_block_mac()
2984 assert(new_key == block_tree_node_get_key(tree, DATA_BLOCK_INVALID, in block_tree_update_block_mac()
2991 assert(0); /* moving entries with block_tree_update is not supported */ in block_tree_update_block_mac()
3066 assert(src->copy_on_write); in block_tree_copy()
3144 assert(tree_min_entry_count >= max_entries_needed); in block_tree_check_config()
3151 assert(block_tree_max_depth_needed); in block_tree_check_config_done()