Lines Matching defs: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,
137 struct rb_root *root = &tree->tree;
142 if (tree->last) {
143 entry = rb_entry(tree->last, struct btrfs_ordered_extent,
146 return tree->last;
152 tree->last = ret;
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;
211 /* one ref for the tree */
222 spin_lock_irq(&tree->lock);
223 node = tree_insert(&tree->tree, file_offset,
227 "inconsistency in ordered tree at offset %llu",
229 spin_unlock_irq(&tree->lock);
291 struct btrfs_ordered_inode_tree *tree;
293 tree = &BTRFS_I(entry->inode)->ordered_tree;
294 spin_lock_irq(&tree->lock);
296 spin_unlock_irq(&tree->lock);
316 struct btrfs_ordered_inode_tree *tree = &inode->ordered_tree;
325 spin_lock_irqsave(&tree->lock, flags);
326 node = tree_search(tree, *file_offset);
368 spin_unlock_irqrestore(&tree->lock, flags);
385 struct btrfs_ordered_inode_tree *tree = &inode->ordered_tree;
391 spin_lock_irqsave(&tree->lock, flags);
397 node = tree_search(tree, file_offset);
431 spin_unlock_irqrestore(&tree->lock, flags);
463 * remove an ordered extent from the tree. No references are dropped
469 struct btrfs_ordered_inode_tree *tree;
487 tree = &btrfs_inode->ordered_tree;
488 spin_lock_irq(&tree->lock);
490 rb_erase(node, &tree->tree);
492 if (tree->last == node)
493 tree->last = NULL;
496 spin_unlock_irq(&tree->lock);
704 * when adding the new ordered extents to the ordered tree.
745 struct btrfs_ordered_inode_tree *tree;
749 tree = &inode->ordered_tree;
750 spin_lock_irq(&tree->lock);
751 node = tree_search(tree, file_offset);
761 spin_unlock_irq(&tree->lock);
771 struct btrfs_ordered_inode_tree *tree;
775 tree = &inode->ordered_tree;
776 spin_lock_irq(&tree->lock);
777 node = tree_search(tree, file_offset);
779 node = tree_search(tree, file_offset + len);
801 spin_unlock_irq(&tree->lock);
812 struct btrfs_ordered_inode_tree *tree = &inode->ordered_tree;
817 spin_lock_irq(&tree->lock);
818 for (n = rb_first(&tree->tree); n; n = rb_next(n)) {
830 spin_unlock_irq(&tree->lock);
840 struct btrfs_ordered_inode_tree *tree;
844 tree = &inode->ordered_tree;
845 spin_lock_irq(&tree->lock);
846 node = tree_search(tree, file_offset);
853 spin_unlock_irq(&tree->lock);
868 struct btrfs_ordered_inode_tree *tree = &inode->ordered_tree;
880 spin_lock_irq(&tree->lock);
897 spin_unlock_irq(&tree->lock);
906 * @inode: Inode whose ordered tree is to be searched