Lines Matching refs:tree

16 static int hfs_btree_inc_height(struct hfs_btree *tree);
24 dataoff = node->tree->node_size - (rec + 2) * 2; in hfs_brec_lenoff()
39 !(node->tree->attributes & HFS_TREE_VARIDXKEYS)) { in hfs_brec_keylen()
40 if (node->tree->attributes & HFS_TREE_BIGKEYS) in hfs_brec_keylen()
41 retval = node->tree->max_key_len + 2; in hfs_brec_keylen()
43 retval = node->tree->max_key_len + 1; in hfs_brec_keylen()
45 recoff = hfs_bnode_read_u16(node, node->tree->node_size - (rec + 1) * 2); in hfs_brec_keylen()
48 if (node->tree->attributes & HFS_TREE_BIGKEYS) { in hfs_brec_keylen()
50 if (retval > node->tree->max_key_len + 2) { in hfs_brec_keylen()
56 if (retval > node->tree->max_key_len + 1) { in hfs_brec_keylen()
67 struct hfs_btree *tree; in hfs_brec_insert() local
74 tree = fd->tree; in hfs_brec_insert()
76 if (!tree->root) in hfs_brec_insert()
77 hfs_btree_inc_height(tree); in hfs_brec_insert()
78 node = hfs_bnode_find(tree, tree->leaf_head); in hfs_brec_insert()
94 end_rec_off = tree->node_size - (node->num_recs + 1) * 2; in hfs_brec_insert()
108 tree->leaf_count++; in hfs_brec_insert()
109 mark_inode_dirty(tree->inode); in hfs_brec_insert()
117 idx_rec_off = tree->node_size - (rec + 1) * 2; in hfs_brec_insert()
148 hfs_btree_inc_height(tree); in hfs_brec_insert()
149 new_node->parent = tree->root; in hfs_brec_insert()
151 fd->bnode = hfs_bnode_find(tree, new_node->parent); in hfs_brec_insert()
165 if (tree->attributes & HFS_TREE_VARIDXKEYS) in hfs_brec_insert()
168 fd->search_key->key_len = tree->max_key_len; in hfs_brec_insert()
169 key_len = tree->max_key_len + 1; in hfs_brec_insert()
179 struct hfs_btree *tree; in hfs_brec_remove() local
183 tree = fd->tree; in hfs_brec_remove()
186 rec_off = tree->node_size - (fd->record + 2) * 2; in hfs_brec_remove()
187 end_off = tree->node_size - (node->num_recs + 1) * 2; in hfs_brec_remove()
190 tree->leaf_count--; in hfs_brec_remove()
191 mark_inode_dirty(tree->inode); in hfs_brec_remove()
200 parent = hfs_bnode_find(tree, node->parent); in hfs_brec_remove()
233 struct hfs_btree *tree; in hfs_bnode_split() local
239 tree = fd->tree; in hfs_bnode_split()
241 new_node = hfs_bmap_alloc(tree); in hfs_bnode_split()
254 next_node = hfs_bnode_find(tree, node->next); in hfs_bnode_split()
264 size = tree->node_size / 2 - node->num_recs * 2 - 14; in hfs_bnode_split()
265 old_rec_off = tree->node_size - 4; in hfs_bnode_split()
300 new_rec_off = tree->node_size - 2; in hfs_bnode_split()
339 } else if (node->this == tree->leaf_tail) { in hfs_bnode_split()
341 tree->leaf_tail = new_node->this; in hfs_bnode_split()
342 mark_inode_dirty(tree->inode); in hfs_bnode_split()
354 struct hfs_btree *tree; in hfs_brec_update_parent() local
360 tree = fd->tree; in hfs_brec_update_parent()
367 parent = hfs_bnode_find(tree, node->parent); in hfs_brec_update_parent()
377 if (tree->attributes & HFS_TREE_VARIDXKEYS) in hfs_brec_update_parent()
380 fd->keylength = newkeylen = tree->max_key_len + 1; in hfs_brec_update_parent()
384 rec_off = tree->node_size - (rec + 2) * 2; in hfs_brec_update_parent()
385 end_rec_off = tree->node_size - (parent->num_recs + 1) * 2; in hfs_brec_update_parent()
400 rec_off = tree->node_size - (rec + 2) * 2; in hfs_brec_update_parent()
401 end_rec_off = tree->node_size - (parent->num_recs + 1) * 2; in hfs_brec_update_parent()
418 if (!(tree->attributes & HFS_TREE_VARIDXKEYS)) in hfs_brec_update_parent()
429 hfs_btree_inc_height(tree); in hfs_brec_update_parent()
430 new_node->parent = tree->root; in hfs_brec_update_parent()
432 fd->bnode = hfs_bnode_find(tree, new_node->parent); in hfs_brec_update_parent()
458 static int hfs_btree_inc_height(struct hfs_btree *tree) in hfs_btree_inc_height() argument
466 if (tree->root) { in hfs_btree_inc_height()
467 node = hfs_bnode_find(tree, tree->root); in hfs_btree_inc_height()
471 new_node = hfs_bmap_alloc(tree); in hfs_btree_inc_height()
477 tree->root = new_node->this; in hfs_btree_inc_height()
478 if (!tree->depth) { in hfs_btree_inc_height()
479 tree->leaf_head = tree->leaf_tail = new_node->this; in hfs_btree_inc_height()
489 new_node->height = ++tree->depth; in hfs_btree_inc_height()
499 rec = tree->node_size - 2; in hfs_btree_inc_height()
504 node->parent = tree->root; in hfs_btree_inc_height()
506 tree->attributes & HFS_TREE_VARIDXKEYS) in hfs_btree_inc_height()
509 key_size = tree->max_key_len + 1; in hfs_btree_inc_height()
512 if (!(tree->attributes & HFS_TREE_VARIDXKEYS)) { in hfs_btree_inc_height()
513 key_size = tree->max_key_len + 1; in hfs_btree_inc_height()
514 hfs_bnode_write_u8(new_node, 14, tree->max_key_len); in hfs_btree_inc_height()
526 mark_inode_dirty(tree->inode); in hfs_btree_inc_height()