Lines Matching full:tree
36 * in the tree
63 * look for a given offset in the tree, and if it can't be found return the
140 static inline struct rb_node *tree_search(struct btrfs_ordered_inode_tree *tree, in tree_search() argument
143 struct rb_root *root = &tree->tree; in tree_search()
148 if (tree->last) { in tree_search()
149 entry = rb_entry(tree->last, struct btrfs_ordered_extent, in tree_search()
152 return tree->last; in tree_search()
158 tree->last = ret; in tree_search()
162 /* allocate and add a new ordered_extent into the per-inode tree.
166 * extent allocation tree
170 * The tree is given a single reference on the ordered extent that was
177 struct btrfs_ordered_inode_tree *tree; in __btrfs_add_ordered_extent() local
181 tree = &BTRFS_I(inode)->ordered_tree; in __btrfs_add_ordered_extent()
199 /* one ref for the tree */ in __btrfs_add_ordered_extent()
207 spin_lock(&tree->lock); in __btrfs_add_ordered_extent()
208 node = tree_insert(&tree->tree, file_offset, in __btrfs_add_ordered_extent()
211 spin_unlock(&tree->lock); in __btrfs_add_ordered_extent()
256 struct btrfs_ordered_inode_tree *tree; in btrfs_add_ordered_sum() local
258 tree = &BTRFS_I(inode)->ordered_tree; in btrfs_add_ordered_sum()
259 spin_lock(&tree->lock); in btrfs_add_ordered_sum()
261 spin_unlock(&tree->lock); in btrfs_add_ordered_sum()
281 struct btrfs_ordered_inode_tree *tree; in btrfs_dec_test_first_ordered_pending() local
289 tree = &BTRFS_I(inode)->ordered_tree; in btrfs_dec_test_first_ordered_pending()
290 spin_lock(&tree->lock); in btrfs_dec_test_first_ordered_pending()
291 node = tree_search(tree, *file_offset); in btrfs_dec_test_first_ordered_pending()
328 spin_unlock(&tree->lock); in btrfs_dec_test_first_ordered_pending()
345 struct btrfs_ordered_inode_tree *tree; in btrfs_dec_test_ordered_pending() local
350 tree = &BTRFS_I(inode)->ordered_tree; in btrfs_dec_test_ordered_pending()
351 spin_lock(&tree->lock); in btrfs_dec_test_ordered_pending()
352 node = tree_search(tree, file_offset); in btrfs_dec_test_ordered_pending()
379 spin_unlock(&tree->lock); in btrfs_dec_test_ordered_pending()
407 * remove an ordered extent from the tree. No references are dropped
408 * and you must wake_up entry->wait. You must hold the tree lock
414 struct btrfs_ordered_inode_tree *tree; in __btrfs_remove_ordered_extent() local
418 tree = &BTRFS_I(inode)->ordered_tree; in __btrfs_remove_ordered_extent()
420 rb_erase(node, &tree->tree); in __btrfs_remove_ordered_extent()
421 tree->last = NULL; in __btrfs_remove_ordered_extent()
434 if (RB_EMPTY_ROOT(&tree->tree) && in __btrfs_remove_ordered_extent()
444 * remove an ordered extent from the tree. No references are dropped
450 struct btrfs_ordered_inode_tree *tree; in btrfs_remove_ordered_extent() local
453 tree = &BTRFS_I(inode)->ordered_tree; in btrfs_remove_ordered_extent()
454 spin_lock(&tree->lock); in btrfs_remove_ordered_extent()
456 spin_unlock(&tree->lock); in btrfs_remove_ordered_extent()
677 struct btrfs_ordered_inode_tree *tree; in btrfs_lookup_ordered_extent() local
681 tree = &BTRFS_I(inode)->ordered_tree; in btrfs_lookup_ordered_extent()
682 spin_lock(&tree->lock); in btrfs_lookup_ordered_extent()
683 node = tree_search(tree, file_offset); in btrfs_lookup_ordered_extent()
693 spin_unlock(&tree->lock); in btrfs_lookup_ordered_extent()
704 struct btrfs_ordered_inode_tree *tree; in btrfs_lookup_ordered_range() local
708 tree = &BTRFS_I(inode)->ordered_tree; in btrfs_lookup_ordered_range()
709 spin_lock(&tree->lock); in btrfs_lookup_ordered_range()
710 node = tree_search(tree, file_offset); in btrfs_lookup_ordered_range()
712 node = tree_search(tree, file_offset + len); in btrfs_lookup_ordered_range()
734 spin_unlock(&tree->lock); in btrfs_lookup_ordered_range()
745 struct btrfs_ordered_inode_tree *tree; in btrfs_lookup_first_ordered_extent() local
749 tree = &BTRFS_I(inode)->ordered_tree; in btrfs_lookup_first_ordered_extent()
750 spin_lock(&tree->lock); in btrfs_lookup_first_ordered_extent()
751 node = tree_search(tree, file_offset); in btrfs_lookup_first_ordered_extent()
758 spin_unlock(&tree->lock); in btrfs_lookup_first_ordered_extent()
769 struct btrfs_ordered_inode_tree *tree = &BTRFS_I(inode)->ordered_tree; in btrfs_ordered_update_i_size() local
785 spin_lock(&tree->lock); in btrfs_ordered_update_i_size()
819 prev = tree_search(tree, offset); in btrfs_ordered_update_i_size()
855 node = rb_first(&tree->tree); in btrfs_ordered_update_i_size()
885 * we need to remove the ordered extent with the tree lock held in btrfs_ordered_update_i_size()
891 spin_unlock(&tree->lock); in btrfs_ordered_update_i_size()
908 struct btrfs_ordered_inode_tree *tree = &BTRFS_I(inode)->ordered_tree; in btrfs_find_ordered_sum() local
918 spin_lock(&tree->lock); in btrfs_find_ordered_sum()
933 spin_unlock(&tree->lock); in btrfs_find_ordered_sum()