Lines Matching full:tree

30  * in the tree
57 * look for a given offset in the tree, and if it can't be found return the
134 static inline struct rb_node *tree_search(struct btrfs_ordered_inode_tree *tree, in tree_search() argument
137 struct rb_root *root = &tree->tree; in tree_search()
142 if (tree->last) { in tree_search()
143 entry = rb_entry(tree->last, struct btrfs_ordered_extent, in tree_search()
146 return tree->last; in tree_search()
152 tree->last = ret; in tree_search()
157 * Allocate and add a new ordered_extent into the per-inode tree.
159 * The tree is given a single reference on the ordered extent that was
169 struct btrfs_ordered_inode_tree *tree = &inode->ordered_tree; in __btrfs_add_ordered_extent() local
211 /* one ref for the tree */ in __btrfs_add_ordered_extent()
222 spin_lock_irq(&tree->lock); in __btrfs_add_ordered_extent()
223 node = tree_insert(&tree->tree, file_offset, in __btrfs_add_ordered_extent()
227 "inconsistency in ordered tree at offset %llu", in __btrfs_add_ordered_extent()
229 spin_unlock_irq(&tree->lock); in __btrfs_add_ordered_extent()
291 struct btrfs_ordered_inode_tree *tree; in btrfs_add_ordered_sum() local
293 tree = &BTRFS_I(entry->inode)->ordered_tree; in btrfs_add_ordered_sum()
294 spin_lock_irq(&tree->lock); in btrfs_add_ordered_sum()
296 spin_unlock_irq(&tree->lock); in btrfs_add_ordered_sum()
316 struct btrfs_ordered_inode_tree *tree = &inode->ordered_tree; in btrfs_dec_test_first_ordered_pending() local
325 spin_lock_irqsave(&tree->lock, flags); in btrfs_dec_test_first_ordered_pending()
326 node = tree_search(tree, *file_offset); in btrfs_dec_test_first_ordered_pending()
368 spin_unlock_irqrestore(&tree->lock, flags); in btrfs_dec_test_first_ordered_pending()
385 struct btrfs_ordered_inode_tree *tree = &inode->ordered_tree; in btrfs_dec_test_ordered_pending() local
391 spin_lock_irqsave(&tree->lock, flags); in btrfs_dec_test_ordered_pending()
397 node = tree_search(tree, file_offset); in btrfs_dec_test_ordered_pending()
431 spin_unlock_irqrestore(&tree->lock, flags); in btrfs_dec_test_ordered_pending()
463 * remove an ordered extent from the tree. No references are dropped
469 struct btrfs_ordered_inode_tree *tree; in btrfs_remove_ordered_extent() local
487 tree = &btrfs_inode->ordered_tree; in btrfs_remove_ordered_extent()
488 spin_lock_irq(&tree->lock); in btrfs_remove_ordered_extent()
490 rb_erase(node, &tree->tree); in btrfs_remove_ordered_extent()
492 if (tree->last == node) in btrfs_remove_ordered_extent()
493 tree->last = NULL; in btrfs_remove_ordered_extent()
496 spin_unlock_irq(&tree->lock); in btrfs_remove_ordered_extent()
704 * when adding the new ordered extents to the ordered tree. in btrfs_wait_ordered_range()
745 struct btrfs_ordered_inode_tree *tree; in btrfs_lookup_ordered_extent() local
749 tree = &inode->ordered_tree; in btrfs_lookup_ordered_extent()
750 spin_lock_irq(&tree->lock); in btrfs_lookup_ordered_extent()
751 node = tree_search(tree, file_offset); in btrfs_lookup_ordered_extent()
761 spin_unlock_irq(&tree->lock); in btrfs_lookup_ordered_extent()
771 struct btrfs_ordered_inode_tree *tree; in btrfs_lookup_ordered_range() local
775 tree = &inode->ordered_tree; in btrfs_lookup_ordered_range()
776 spin_lock_irq(&tree->lock); in btrfs_lookup_ordered_range()
777 node = tree_search(tree, file_offset); in btrfs_lookup_ordered_range()
779 node = tree_search(tree, file_offset + len); in btrfs_lookup_ordered_range()
801 spin_unlock_irq(&tree->lock); in btrfs_lookup_ordered_range()
812 struct btrfs_ordered_inode_tree *tree = &inode->ordered_tree; in btrfs_get_ordered_extents_for_logging() local
817 spin_lock_irq(&tree->lock); in btrfs_get_ordered_extents_for_logging()
818 for (n = rb_first(&tree->tree); n; n = rb_next(n)) { in btrfs_get_ordered_extents_for_logging()
830 spin_unlock_irq(&tree->lock); in btrfs_get_ordered_extents_for_logging()
840 struct btrfs_ordered_inode_tree *tree; in btrfs_lookup_first_ordered_extent() local
844 tree = &inode->ordered_tree; in btrfs_lookup_first_ordered_extent()
845 spin_lock_irq(&tree->lock); in btrfs_lookup_first_ordered_extent()
846 node = tree_search(tree, file_offset); in btrfs_lookup_first_ordered_extent()
853 spin_unlock_irq(&tree->lock); in btrfs_lookup_first_ordered_extent()
868 struct btrfs_ordered_inode_tree *tree = &inode->ordered_tree; in btrfs_find_ordered_sum() local
880 spin_lock_irq(&tree->lock); in btrfs_find_ordered_sum()
897 spin_unlock_irq(&tree->lock); in btrfs_find_ordered_sum()
906 * @inode: Inode whose ordered tree is to be searched