• Home
  • Raw
  • Download

Lines Matching refs:tree

197 	struct ocfs2_refcount_tree *tree = NULL;  in ocfs2_find_refcount_tree()  local
200 tree = rb_entry(n, struct ocfs2_refcount_tree, rf_node); in ocfs2_find_refcount_tree()
202 if (blkno < tree->rf_blkno) in ocfs2_find_refcount_tree()
204 else if (blkno > tree->rf_blkno) in ocfs2_find_refcount_tree()
207 return tree; in ocfs2_find_refcount_tree()
244 static void ocfs2_free_refcount_tree(struct ocfs2_refcount_tree *tree) in ocfs2_free_refcount_tree() argument
246 ocfs2_metadata_cache_exit(&tree->rf_ci); in ocfs2_free_refcount_tree()
247 ocfs2_simple_drop_lockres(OCFS2_SB(tree->rf_sb), &tree->rf_lockres); in ocfs2_free_refcount_tree()
248 ocfs2_lock_res_free(&tree->rf_lockres); in ocfs2_free_refcount_tree()
249 kfree(tree); in ocfs2_free_refcount_tree()
254 struct ocfs2_refcount_tree *tree) in ocfs2_erase_refcount_tree_from_list_no_lock() argument
256 rb_erase(&tree->rf_node, &osb->osb_rf_lock_tree); in ocfs2_erase_refcount_tree_from_list_no_lock()
257 if (osb->osb_ref_tree_lru && osb->osb_ref_tree_lru == tree) in ocfs2_erase_refcount_tree_from_list_no_lock()
262 struct ocfs2_refcount_tree *tree) in ocfs2_erase_refcount_tree_from_list() argument
265 ocfs2_erase_refcount_tree_from_list_no_lock(osb, tree); in ocfs2_erase_refcount_tree_from_list()
271 struct ocfs2_refcount_tree *tree = in ocfs2_kref_remove_refcount_tree() local
274 ocfs2_free_refcount_tree(tree); in ocfs2_kref_remove_refcount_tree()
278 ocfs2_refcount_tree_get(struct ocfs2_refcount_tree *tree) in ocfs2_refcount_tree_get() argument
280 kref_get(&tree->rf_getcnt); in ocfs2_refcount_tree_get()
284 ocfs2_refcount_tree_put(struct ocfs2_refcount_tree *tree) in ocfs2_refcount_tree_put() argument
286 kref_put(&tree->rf_getcnt, ocfs2_kref_remove_refcount_tree); in ocfs2_refcount_tree_put()
327 struct ocfs2_refcount_tree *tree, *new = NULL; in ocfs2_get_refcount_tree() local
334 tree = osb->osb_ref_tree_lru; in ocfs2_get_refcount_tree()
336 tree = ocfs2_find_refcount_tree(osb, rf_blkno); in ocfs2_get_refcount_tree()
337 if (tree) in ocfs2_get_refcount_tree()
371 tree = ocfs2_find_refcount_tree(osb, rf_blkno); in ocfs2_get_refcount_tree()
372 if (tree) in ocfs2_get_refcount_tree()
377 tree = new; in ocfs2_get_refcount_tree()
381 *ret_tree = tree; in ocfs2_get_refcount_tree()
383 osb->osb_ref_tree_lru = tree; in ocfs2_get_refcount_tree()
416 struct ocfs2_refcount_tree *tree, int rw) in __ocfs2_lock_refcount_tree() argument
420 ret = ocfs2_refcount_lock(tree, rw); in __ocfs2_lock_refcount_tree()
427 down_write(&tree->rf_sem); in __ocfs2_lock_refcount_tree()
429 down_read(&tree->rf_sem); in __ocfs2_lock_refcount_tree()
449 struct ocfs2_refcount_tree *tree = NULL; in ocfs2_lock_refcount_tree() local
454 ret = ocfs2_get_refcount_tree(osb, ref_blkno, &tree); in ocfs2_lock_refcount_tree()
460 ocfs2_refcount_tree_get(tree); in ocfs2_lock_refcount_tree()
462 ret = __ocfs2_lock_refcount_tree(osb, tree, rw); in ocfs2_lock_refcount_tree()
465 ocfs2_refcount_tree_put(tree); in ocfs2_lock_refcount_tree()
469 ret = ocfs2_read_refcount_block(&tree->rf_ci, tree->rf_blkno, in ocfs2_lock_refcount_tree()
473 ocfs2_unlock_refcount_tree(osb, tree, rw); in ocfs2_lock_refcount_tree()
487 if (tree->rf_generation != le32_to_cpu(rb->rf_generation)) { in ocfs2_lock_refcount_tree()
488 if (!tree->rf_removed) { in ocfs2_lock_refcount_tree()
489 ocfs2_erase_refcount_tree_from_list(osb, tree); in ocfs2_lock_refcount_tree()
490 tree->rf_removed = 1; in ocfs2_lock_refcount_tree()
494 ocfs2_unlock_refcount_tree(osb, tree, rw); in ocfs2_lock_refcount_tree()
500 ocfs2_refcount_tree_put(tree); in ocfs2_lock_refcount_tree()
506 *ret_tree = tree; in ocfs2_lock_refcount_tree()
517 struct ocfs2_refcount_tree *tree, int rw) in ocfs2_unlock_refcount_tree() argument
520 up_write(&tree->rf_sem); in ocfs2_unlock_refcount_tree()
522 up_read(&tree->rf_sem); in ocfs2_unlock_refcount_tree()
524 ocfs2_refcount_unlock(tree, rw); in ocfs2_unlock_refcount_tree()
525 ocfs2_refcount_tree_put(tree); in ocfs2_unlock_refcount_tree()
531 struct ocfs2_refcount_tree *tree; in ocfs2_purge_refcount_trees() local
535 tree = rb_entry(node, struct ocfs2_refcount_tree, rf_node); in ocfs2_purge_refcount_trees()
538 (unsigned long long) tree->rf_blkno); in ocfs2_purge_refcount_trees()
540 rb_erase(&tree->rf_node, root); in ocfs2_purge_refcount_trees()
541 ocfs2_free_refcount_tree(tree); in ocfs2_purge_refcount_trees()
560 struct ocfs2_refcount_tree *new_tree = NULL, *tree = NULL; in ocfs2_create_refcount_tree() local
657 tree = ocfs2_find_refcount_tree(osb, first_blkno); in ocfs2_create_refcount_tree()
665 BUG_ON(tree && tree->rf_generation == new_tree->rf_generation); in ocfs2_create_refcount_tree()
666 if (tree) in ocfs2_create_refcount_tree()
667 ocfs2_erase_refcount_tree_from_list_no_lock(osb, tree); in ocfs2_create_refcount_tree()
671 if (tree) in ocfs2_create_refcount_tree()
672 ocfs2_refcount_tree_put(tree); in ocfs2_create_refcount_tree()
2295 struct ocfs2_refcount_tree *tree; in ocfs2_decrease_refcount() local
2305 ret = ocfs2_get_refcount_tree(OCFS2_SB(inode->i_sb), ref_blkno, &tree); in ocfs2_decrease_refcount()
2311 ret = ocfs2_read_refcount_block(&tree->rf_ci, tree->rf_blkno, in ocfs2_decrease_refcount()
2318 ret = __ocfs2_decrease_refcount(handle, &tree->rf_ci, ref_root_bh, in ocfs2_decrease_refcount()
2528 struct ocfs2_refcount_tree *tree; in ocfs2_prepare_refcount_change_for_del() local
2540 refcount_loc, &tree); in ocfs2_prepare_refcount_change_for_del()
2546 ret = ocfs2_read_refcount_block(&tree->rf_ci, refcount_loc, in ocfs2_prepare_refcount_change_for_del()
2554 &tree->rf_ci, in ocfs2_prepare_refcount_change_for_del()