• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /netgear-R7000-V1.0.7.12_1.2.5/components/opensource/linux/linux-2.6.36/fs/ocfs2/

Lines Matching refs:tree

206 	struct ocfs2_refcount_tree *tree = NULL;
209 tree = rb_entry(n, struct ocfs2_refcount_tree, rf_node);
211 if (blkno < tree->rf_blkno)
213 else if (blkno > tree->rf_blkno)
216 return tree;
253 static void ocfs2_free_refcount_tree(struct ocfs2_refcount_tree *tree)
255 ocfs2_metadata_cache_exit(&tree->rf_ci);
256 ocfs2_simple_drop_lockres(OCFS2_SB(tree->rf_sb), &tree->rf_lockres);
257 ocfs2_lock_res_free(&tree->rf_lockres);
258 kfree(tree);
263 struct ocfs2_refcount_tree *tree)
265 rb_erase(&tree->rf_node, &osb->osb_rf_lock_tree);
266 if (osb->osb_ref_tree_lru && osb->osb_ref_tree_lru == tree)
271 struct ocfs2_refcount_tree *tree)
274 ocfs2_erase_refcount_tree_from_list_no_lock(osb, tree);
280 struct ocfs2_refcount_tree *tree =
283 ocfs2_free_refcount_tree(tree);
287 ocfs2_refcount_tree_get(struct ocfs2_refcount_tree *tree)
289 kref_get(&tree->rf_getcnt);
293 ocfs2_refcount_tree_put(struct ocfs2_refcount_tree *tree)
295 kref_put(&tree->rf_getcnt, ocfs2_kref_remove_refcount_tree);
336 struct ocfs2_refcount_tree *tree, *new = NULL;
343 tree = osb->osb_ref_tree_lru;
345 tree = ocfs2_find_refcount_tree(osb, rf_blkno);
346 if (tree)
358 * We need the generation to create the refcount tree lock and since
359 * it isn't changed during the tree modification, we are safe here to
380 tree = ocfs2_find_refcount_tree(osb, rf_blkno);
381 if (tree)
386 tree = new;
390 *ret_tree = tree;
392 osb->osb_ref_tree_lru = tree;
425 struct ocfs2_refcount_tree *tree, int rw)
429 ret = ocfs2_refcount_lock(tree, rw);
436 down_write(&tree->rf_sem);
438 down_read(&tree->rf_sem);
445 * Lock the refcount tree pointed by ref_blkno and return the tree.
446 * In most case, we lock the tree and read the refcount block.
449 * If the tree has been re-created by other node, it will free the
458 struct ocfs2_refcount_tree *tree = NULL;
463 ret = ocfs2_get_refcount_tree(osb, ref_blkno, &tree);
469 ocfs2_refcount_tree_get(tree);
471 ret = __ocfs2_lock_refcount_tree(osb, tree, rw);
474 ocfs2_refcount_tree_put(tree);
478 ret = ocfs2_read_refcount_block(&tree->rf_ci, tree->rf_blkno,
482 ocfs2_unlock_refcount_tree(osb, tree, rw);
483 ocfs2_refcount_tree_put(tree);
490 * to recreate the refcount tree also.
492 * Here we just remove the tree from the rb-tree, and the last
495 * the new refcount tree for us.
497 if (tree->rf_generation != le32_to_cpu(rb->rf_generation)) {
498 if (!tree->rf_removed) {
499 ocfs2_erase_refcount_tree_from_list(osb, tree);
500 tree->rf_removed = 1;
504 ocfs2_unlock_refcount_tree(osb, tree, rw);
507 * tree, so another put will destroy it.
510 ocfs2_refcount_tree_put(tree);
516 *ret_tree = tree;
527 struct ocfs2_refcount_tree *tree, int rw)
530 up_write(&tree->rf_sem);
532 up_read(&tree->rf_sem);
534 ocfs2_refcount_unlock(tree, rw);
535 ocfs2_refcount_tree_put(tree);
541 struct ocfs2_refcount_tree *tree;
545 tree = rb_entry(node, struct ocfs2_refcount_tree, rf_node);
547 mlog(0, "Purge tree %llu\n",
548 (unsigned long long) tree->rf_blkno);
550 rb_erase(&tree->rf_node, root);
551 ocfs2_free_refcount_tree(tree);
556 * Create a refcount tree for an inode.
570 struct ocfs2_refcount_tree *new_tree = NULL, *tree = NULL;
577 mlog(0, "create tree for inode %lu\n", inode->i_ino);
648 mlog(0, "created tree for inode %lu, refblock %llu\n",
654 * We have to init the tree lock here since it will use
662 tree = ocfs2_find_refcount_tree(osb, first_blkno);
665 * We've just created a new refcount tree in this block. If
666 * we found a refcount tree on the ocfs2_super, it must be
667 * one we just deleted. We free the old tree before
668 * inserting the new tree.
670 BUG_ON(tree && tree->rf_generation == new_tree->rf_generation);
671 if (tree)
672 ocfs2_erase_refcount_tree_from_list_no_lock(osb, tree);
676 if (tree)
677 ocfs2_refcount_tree_put(tree);
922 * Try to remove refcount tree. The mechanism is:
926 * 4) Remove the tree.
997 * the subroot. Otherwise we may corrupt the b-tree.
1101 "refcount tree %llu has non zero tree "
1102 "depth in leaf btree tree block %llu\n",
1413 * But we will use the low 32 bit to be the e_cpos in the b-tree.
1616 * the old root bh hasn't been expanded to a b-tree,
1631 /* Now add a new refcount block into the tree.*/
1642 * Adjust the extent rec in b-tree representing ref_leaf_bh.
1813 * This is much simple than our b-tree code.
2127 mlog(0, "reset refcount tree root %llu to be a record block.\n",
2281 /* Caller must hold refcount tree lock. */
2292 struct ocfs2_refcount_tree *tree;
2302 ret = ocfs2_get_refcount_tree(OCFS2_SB(inode->i_sb), ref_blkno, &tree);
2308 ret = ocfs2_read_refcount_block(&tree->rf_ci, tree->rf_blkno,
2315 ret = __ocfs2_decrease_refcount(handle, &tree->rf_ci, ref_root_bh,
2342 mlog(0, "Inode %lu refcount tree cpos %u, len %u, phys cluster %u\n",
2347 "tree, but the feature bit is not set in the "
2483 * So we may need ref_blocks to insert into the tree.
2484 * That also means we need to change the b-tree and add that number
2510 * For refcount tree, we will decrease some contiguous clusters
2519 * Caller must hold refcount tree lock.
2531 struct ocfs2_refcount_tree *tree;
2536 "tree, but the feature bit is not set in the "
2545 refcount_loc, &tree);
2551 ret = ocfs2_read_refcount_block(&tree->rf_ci, refcount_loc,
2559 &tree->rf_ci,
2631 * get good I/O from the resulting extent tree.
2664 "Inode %lu has non zero tree depth in "
2835 * clusters(starting form p_cluster) in the refcount tree.
2838 * 1. since we may split the old tree, so we at most will need num_clusters + 2
3360 "tree, but the feature bit is not set in the "
3532 * refcount tree change if we truncate it to 0.
3679 * Insert a new extent into refcount tree and mark a extent rec
3680 * as refcounted in the dinode tree.