• Home
  • Raw
  • Download

Lines Matching refs:tree

61 	struct hfs_btree *tree;  in hfs_bnode_read_key()  local
64 tree = node->tree; in hfs_bnode_read_key()
66 tree->attributes & HFS_TREE_VARIDXKEYS || in hfs_bnode_read_key()
67 node->tree->cnid == HFSPLUS_ATTR_CNID) in hfs_bnode_read_key()
70 key_len = tree->max_key_len + 2; in hfs_bnode_read_key()
310 off = node->tree->node_size - 2; in hfs_bnode_dump()
317 if (node->tree->attributes & HFS_TREE_VARIDXKEYS || in hfs_bnode_dump()
318 node->tree->cnid == HFSPLUS_ATTR_CNID) in hfs_bnode_dump()
321 tmp = node->tree->max_key_len + 2; in hfs_bnode_dump()
337 struct hfs_btree *tree; in hfs_bnode_unlink() local
341 tree = node->tree; in hfs_bnode_unlink()
343 tmp = hfs_bnode_find(tree, node->prev); in hfs_bnode_unlink()
352 tree->leaf_head = node->next; in hfs_bnode_unlink()
355 tmp = hfs_bnode_find(tree, node->next); in hfs_bnode_unlink()
364 tree->leaf_tail = node->prev; in hfs_bnode_unlink()
370 tree->root = 0; in hfs_bnode_unlink()
371 tree->depth = 0; in hfs_bnode_unlink()
383 struct hfs_bnode *hfs_bnode_findhash(struct hfs_btree *tree, u32 cnid) in hfs_bnode_findhash() argument
387 if (cnid >= tree->node_count) { in hfs_bnode_findhash()
393 for (node = tree->node_hash[hfs_bnode_hash(cnid)]; in hfs_bnode_findhash()
400 static struct hfs_bnode *__hfs_bnode_create(struct hfs_btree *tree, u32 cnid) in __hfs_bnode_create() argument
408 if (cnid >= tree->node_count) { in __hfs_bnode_create()
414 size = sizeof(struct hfs_bnode) + tree->pages_per_bnode * in __hfs_bnode_create()
419 node->tree = tree; in __hfs_bnode_create()
424 node->tree->cnid, node->this); in __hfs_bnode_create()
426 spin_lock(&tree->hash_lock); in __hfs_bnode_create()
427 node2 = hfs_bnode_findhash(tree, cnid); in __hfs_bnode_create()
430 node->next_hash = tree->node_hash[hash]; in __hfs_bnode_create()
431 tree->node_hash[hash] = node; in __hfs_bnode_create()
432 tree->node_hash_cnt++; in __hfs_bnode_create()
434 spin_unlock(&tree->hash_lock); in __hfs_bnode_create()
440 spin_unlock(&tree->hash_lock); in __hfs_bnode_create()
442 mapping = tree->inode->i_mapping; in __hfs_bnode_create()
443 off = (loff_t)cnid << tree->node_size_shift; in __hfs_bnode_create()
446 for (i = 0; i < tree->pages_per_bnode; block++, i++) { in __hfs_bnode_create()
468 node->tree->cnid, node->this, atomic_read(&node->refcnt)); in hfs_bnode_unhash()
469 for (p = &node->tree->node_hash[hfs_bnode_hash(node->this)]; in hfs_bnode_unhash()
474 node->tree->node_hash_cnt--; in hfs_bnode_unhash()
478 struct hfs_bnode *hfs_bnode_find(struct hfs_btree *tree, u32 num) in hfs_bnode_find() argument
485 spin_lock(&tree->hash_lock); in hfs_bnode_find()
486 node = hfs_bnode_findhash(tree, num); in hfs_bnode_find()
489 spin_unlock(&tree->hash_lock); in hfs_bnode_find()
496 spin_unlock(&tree->hash_lock); in hfs_bnode_find()
497 node = __hfs_bnode_create(tree, num); in hfs_bnode_find()
525 if (node->height <= 1 || node->height > tree->depth) in hfs_bnode_find()
532 rec_off = tree->node_size - 2; in hfs_bnode_find()
540 next_off > tree->node_size || in hfs_bnode_find()
567 for (i = 0; i < node->tree->pages_per_bnode; i++) in hfs_bnode_free()
573 struct hfs_bnode *hfs_bnode_create(struct hfs_btree *tree, u32 num) in hfs_bnode_create() argument
579 spin_lock(&tree->hash_lock); in hfs_bnode_create()
580 node = hfs_bnode_findhash(tree, num); in hfs_bnode_create()
581 spin_unlock(&tree->hash_lock); in hfs_bnode_create()
587 node = __hfs_bnode_create(tree, num); in hfs_bnode_create()
597 min_t(int, PAGE_SIZE, tree->node_size)); in hfs_bnode_create()
600 for (i = 1; i < tree->pages_per_bnode; i++) { in hfs_bnode_create()
616 node->tree->cnid, node->this, in hfs_bnode_get()
625 struct hfs_btree *tree = node->tree; in hfs_bnode_put() local
629 node->tree->cnid, node->this, in hfs_bnode_put()
632 if (!atomic_dec_and_lock(&node->refcnt, &tree->hash_lock)) in hfs_bnode_put()
634 for (i = 0; i < tree->pages_per_bnode; i++) { in hfs_bnode_put()
642 spin_unlock(&tree->hash_lock); in hfs_bnode_put()
643 if (hfs_bnode_need_zeroout(tree)) in hfs_bnode_put()
644 hfs_bnode_clear(node, 0, tree->node_size); in hfs_bnode_put()
649 spin_unlock(&tree->hash_lock); in hfs_bnode_put()
657 bool hfs_bnode_need_zeroout(struct hfs_btree *tree) in hfs_bnode_need_zeroout() argument
659 struct super_block *sb = tree->inode->i_sb; in hfs_bnode_need_zeroout()
663 return tree->cnid == HFSPLUS_CAT_CNID && in hfs_bnode_need_zeroout()