Lines Matching refs:tree
25 dataoff = node->tree->node_size - (rec + 2) * 2; in hfs_brec_lenoff()
40 !(node->tree->attributes & HFS_TREE_VARIDXKEYS) && in hfs_brec_keylen()
41 (node->tree->cnid != HFSPLUS_ATTR_CNID)) { in hfs_brec_keylen()
42 retval = node->tree->max_key_len + 2; in hfs_brec_keylen()
45 node->tree->node_size - (rec + 1) * 2); in hfs_brec_keylen()
48 if (recoff > node->tree->node_size - 2) { in hfs_brec_keylen()
54 if (retval > node->tree->max_key_len + 2) { in hfs_brec_keylen()
65 struct hfs_btree *tree; in hfs_brec_insert() local
72 tree = fd->tree; in hfs_brec_insert()
74 if (!tree->root) in hfs_brec_insert()
75 hfs_btree_inc_height(tree); in hfs_brec_insert()
76 node = hfs_bnode_find(tree, tree->leaf_head); in hfs_brec_insert()
92 end_rec_off = tree->node_size - (node->num_recs + 1) * 2; in hfs_brec_insert()
106 tree->leaf_count++; in hfs_brec_insert()
107 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()
166 (tree->cnid == HFSPLUS_ATTR_CNID)) in hfs_brec_insert()
170 cpu_to_be16(tree->max_key_len); in hfs_brec_insert()
171 key_len = tree->max_key_len + 2; in hfs_brec_insert()
181 struct hfs_btree *tree; in hfs_brec_remove() local
185 tree = fd->tree; in hfs_brec_remove()
188 rec_off = tree->node_size - (fd->record + 2) * 2; in hfs_brec_remove()
189 end_off = tree->node_size - (node->num_recs + 1) * 2; in hfs_brec_remove()
192 tree->leaf_count--; in hfs_brec_remove()
193 mark_inode_dirty(tree->inode); in hfs_brec_remove()
202 parent = hfs_bnode_find(tree, node->parent); in hfs_brec_remove()
237 struct hfs_btree *tree; in hfs_bnode_split() local
243 tree = fd->tree; in hfs_bnode_split()
245 new_node = hfs_bmap_alloc(tree); in hfs_bnode_split()
258 next_node = hfs_bnode_find(tree, node->next); in hfs_bnode_split()
268 size = tree->node_size / 2 - node->num_recs * 2 - 14; in hfs_bnode_split()
269 old_rec_off = tree->node_size - 4; in hfs_bnode_split()
304 new_rec_off = tree->node_size - 2; in hfs_bnode_split()
343 } else if (node->this == tree->leaf_tail) { in hfs_bnode_split()
345 tree->leaf_tail = new_node->this; in hfs_bnode_split()
346 mark_inode_dirty(tree->inode); in hfs_bnode_split()
358 struct hfs_btree *tree; in hfs_brec_update_parent() local
364 tree = fd->tree; in hfs_brec_update_parent()
371 parent = hfs_bnode_find(tree, node->parent); in hfs_brec_update_parent()
381 if ((tree->attributes & HFS_TREE_VARIDXKEYS) || in hfs_brec_update_parent()
382 (tree->cnid == HFSPLUS_ATTR_CNID)) in hfs_brec_update_parent()
385 fd->keylength = newkeylen = tree->max_key_len + 2; in hfs_brec_update_parent()
389 rec_off = tree->node_size - (rec + 2) * 2; in hfs_brec_update_parent()
390 end_rec_off = tree->node_size - (parent->num_recs + 1) * 2; in hfs_brec_update_parent()
405 rec_off = tree->node_size - (rec + 2) * 2; in hfs_brec_update_parent()
406 end_rec_off = tree->node_size - in hfs_brec_update_parent()
433 hfs_btree_inc_height(tree); in hfs_brec_update_parent()
434 new_node->parent = tree->root; in hfs_brec_update_parent()
436 fd->bnode = hfs_bnode_find(tree, new_node->parent); in hfs_brec_update_parent()
462 static int hfs_btree_inc_height(struct hfs_btree *tree) in hfs_btree_inc_height() argument
470 if (tree->root) { in hfs_btree_inc_height()
471 node = hfs_bnode_find(tree, tree->root); in hfs_btree_inc_height()
475 new_node = hfs_bmap_alloc(tree); in hfs_btree_inc_height()
481 tree->root = new_node->this; in hfs_btree_inc_height()
482 if (!tree->depth) { in hfs_btree_inc_height()
483 tree->leaf_head = tree->leaf_tail = new_node->this; in hfs_btree_inc_height()
493 new_node->height = ++tree->depth; in hfs_btree_inc_height()
503 rec = tree->node_size - 2; in hfs_btree_inc_height()
508 node->parent = tree->root; in hfs_btree_inc_height()
510 tree->attributes & HFS_TREE_VARIDXKEYS || in hfs_btree_inc_height()
511 tree->cnid == HFSPLUS_ATTR_CNID) in hfs_btree_inc_height()
514 key_size = tree->max_key_len + 2; in hfs_btree_inc_height()
517 if (!(tree->attributes & HFS_TREE_VARIDXKEYS) && in hfs_btree_inc_height()
518 (tree->cnid != HFSPLUS_ATTR_CNID)) { in hfs_btree_inc_height()
519 key_size = tree->max_key_len + 2; in hfs_btree_inc_height()
520 hfs_bnode_write_u16(new_node, 14, tree->max_key_len); in hfs_btree_inc_height()
531 mark_inode_dirty(tree->inode); in hfs_btree_inc_height()