Lines Matching refs:tree

60 	struct hfs_btree *tree;  in hfs_bnode_read_key()  local
63 tree = node->tree; in hfs_bnode_read_key()
65 tree->attributes & HFS_TREE_VARIDXKEYS || in hfs_bnode_read_key()
66 node->tree->cnid == HFSPLUS_ATTR_CNID) in hfs_bnode_read_key()
69 key_len = tree->max_key_len + 2; in hfs_bnode_read_key()
129 struct hfs_btree *tree; in hfs_bnode_copy() local
136 tree = src_node->tree; in hfs_bnode_copy()
311 off = node->tree->node_size - 2; in hfs_bnode_dump()
318 if (node->tree->attributes & HFS_TREE_VARIDXKEYS || in hfs_bnode_dump()
319 node->tree->cnid == HFSPLUS_ATTR_CNID) in hfs_bnode_dump()
322 tmp = node->tree->max_key_len + 2; in hfs_bnode_dump()
338 struct hfs_btree *tree; in hfs_bnode_unlink() local
342 tree = node->tree; in hfs_bnode_unlink()
344 tmp = hfs_bnode_find(tree, node->prev); in hfs_bnode_unlink()
353 tree->leaf_head = node->next; in hfs_bnode_unlink()
356 tmp = hfs_bnode_find(tree, node->next); in hfs_bnode_unlink()
365 tree->leaf_tail = node->prev; in hfs_bnode_unlink()
371 tree->root = 0; in hfs_bnode_unlink()
372 tree->depth = 0; in hfs_bnode_unlink()
384 struct hfs_bnode *hfs_bnode_findhash(struct hfs_btree *tree, u32 cnid) in hfs_bnode_findhash() argument
388 if (cnid >= tree->node_count) { in hfs_bnode_findhash()
394 for (node = tree->node_hash[hfs_bnode_hash(cnid)]; in hfs_bnode_findhash()
401 static struct hfs_bnode *__hfs_bnode_create(struct hfs_btree *tree, u32 cnid) in __hfs_bnode_create() argument
410 if (cnid >= tree->node_count) { in __hfs_bnode_create()
416 sb = tree->inode->i_sb; in __hfs_bnode_create()
417 size = sizeof(struct hfs_bnode) + tree->pages_per_bnode * in __hfs_bnode_create()
422 node->tree = tree; in __hfs_bnode_create()
427 node->tree->cnid, node->this); in __hfs_bnode_create()
429 spin_lock(&tree->hash_lock); in __hfs_bnode_create()
430 node2 = hfs_bnode_findhash(tree, cnid); in __hfs_bnode_create()
433 node->next_hash = tree->node_hash[hash]; in __hfs_bnode_create()
434 tree->node_hash[hash] = node; in __hfs_bnode_create()
435 tree->node_hash_cnt++; in __hfs_bnode_create()
437 spin_unlock(&tree->hash_lock); in __hfs_bnode_create()
443 spin_unlock(&tree->hash_lock); in __hfs_bnode_create()
445 mapping = tree->inode->i_mapping; in __hfs_bnode_create()
446 off = (loff_t)cnid << tree->node_size_shift; in __hfs_bnode_create()
449 for (i = 0; i < tree->pages_per_bnode; block++, i++) { in __hfs_bnode_create()
471 node->tree->cnid, node->this, atomic_read(&node->refcnt)); in hfs_bnode_unhash()
472 for (p = &node->tree->node_hash[hfs_bnode_hash(node->this)]; in hfs_bnode_unhash()
477 node->tree->node_hash_cnt--; in hfs_bnode_unhash()
481 struct hfs_bnode *hfs_bnode_find(struct hfs_btree *tree, u32 num) in hfs_bnode_find() argument
488 spin_lock(&tree->hash_lock); in hfs_bnode_find()
489 node = hfs_bnode_findhash(tree, num); in hfs_bnode_find()
492 spin_unlock(&tree->hash_lock); in hfs_bnode_find()
499 spin_unlock(&tree->hash_lock); in hfs_bnode_find()
500 node = __hfs_bnode_create(tree, num); in hfs_bnode_find()
528 if (node->height <= 1 || node->height > tree->depth) in hfs_bnode_find()
535 rec_off = tree->node_size - 2; in hfs_bnode_find()
543 next_off > tree->node_size || in hfs_bnode_find()
570 for (i = 0; i < node->tree->pages_per_bnode; i++) in hfs_bnode_free()
576 struct hfs_bnode *hfs_bnode_create(struct hfs_btree *tree, u32 num) in hfs_bnode_create() argument
582 spin_lock(&tree->hash_lock); in hfs_bnode_create()
583 node = hfs_bnode_findhash(tree, num); in hfs_bnode_create()
584 spin_unlock(&tree->hash_lock); in hfs_bnode_create()
590 node = __hfs_bnode_create(tree, num); in hfs_bnode_create()
600 min_t(int, PAGE_CACHE_SIZE, tree->node_size)); in hfs_bnode_create()
603 for (i = 1; i < tree->pages_per_bnode; i++) { in hfs_bnode_create()
619 node->tree->cnid, node->this, in hfs_bnode_get()
628 struct hfs_btree *tree = node->tree; in hfs_bnode_put() local
632 node->tree->cnid, node->this, in hfs_bnode_put()
635 if (!atomic_dec_and_lock(&node->refcnt, &tree->hash_lock)) in hfs_bnode_put()
637 for (i = 0; i < tree->pages_per_bnode; i++) { in hfs_bnode_put()
645 spin_unlock(&tree->hash_lock); in hfs_bnode_put()
646 if (hfs_bnode_need_zeroout(tree)) in hfs_bnode_put()
647 hfs_bnode_clear(node, 0, tree->node_size); in hfs_bnode_put()
652 spin_unlock(&tree->hash_lock); in hfs_bnode_put()
660 bool hfs_bnode_need_zeroout(struct hfs_btree *tree) in hfs_bnode_need_zeroout() argument
662 struct super_block *sb = tree->inode->i_sb; in hfs_bnode_need_zeroout()
666 return tree->cnid == HFSPLUS_CAT_CNID && in hfs_bnode_need_zeroout()