Lines Matching defs:tree

34  * in the tree
61 * look for a given offset in the tree, and if it can't be found return the
127 static inline struct rb_node *tree_search(struct btrfs_ordered_inode_tree *tree,
130 struct rb_root *root = &tree->tree;
135 if (tree->last) {
136 entry = rb_entry(tree->last, struct btrfs_ordered_extent,
139 return tree->last;
145 tree->last = ret;
212 struct btrfs_ordered_inode_tree *tree = &inode->ordered_tree;
222 /* One ref for the tree. */
225 spin_lock_irq(&tree->lock);
226 node = tree_insert(&tree->tree, entry->file_offset, &entry->rb_node);
229 "inconsistency in ordered tree at offset %llu",
231 spin_unlock_irq(&tree->lock);
247 * Add an ordered extent to the per-inode tree.
260 * tree is given a single reference on the ordered extent that was inserted, and
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);
408 struct btrfs_ordered_inode_tree *tree = &inode->ordered_tree;
418 spin_lock_irqsave(&tree->lock, flags);
424 node = tree_search(tree, cur);
471 spin_unlock_irqrestore(&tree->lock, flags);
473 spin_lock_irqsave(&tree->lock, flags);
477 spin_unlock_irqrestore(&tree->lock, flags);
484 * @cached: The cached ordered extent. If not NULL, we can skip the tree
501 struct btrfs_ordered_inode_tree *tree = &inode->ordered_tree;
507 spin_lock_irqsave(&tree->lock, flags);
513 node = tree_search(tree, file_offset);
544 spin_unlock_irqrestore(&tree->lock, flags);
576 * remove an ordered extent from the tree. No references are dropped
582 struct btrfs_ordered_inode_tree *tree;
615 tree = &btrfs_inode->ordered_tree;
616 spin_lock_irq(&tree->lock);
618 rb_erase(node, &tree->tree);
620 if (tree->last == node)
621 tree->last = NULL;
624 spin_unlock_irq(&tree->lock);
840 * when adding the new ordered extents to the ordered tree.
881 struct btrfs_ordered_inode_tree *tree;
886 tree = &inode->ordered_tree;
887 spin_lock_irqsave(&tree->lock, flags);
888 node = tree_search(tree, file_offset);
900 spin_unlock_irqrestore(&tree->lock, flags);
910 struct btrfs_ordered_inode_tree *tree;
914 tree = &inode->ordered_tree;
915 spin_lock_irq(&tree->lock);
916 node = tree_search(tree, file_offset);
918 node = tree_search(tree, file_offset + len);
942 spin_unlock_irq(&tree->lock);
953 struct btrfs_ordered_inode_tree *tree = &inode->ordered_tree;
958 spin_lock_irq(&tree->lock);
959 for (n = rb_first(&tree->tree); n; n = rb_next(n)) {
972 spin_unlock_irq(&tree->lock);
982 struct btrfs_ordered_inode_tree *tree;
986 tree = &inode->ordered_tree;
987 spin_lock_irq(&tree->lock);
988 node = tree_search(tree, file_offset);
996 spin_unlock_irq(&tree->lock);
1012 struct btrfs_ordered_inode_tree *tree = &inode->ordered_tree;
1019 spin_lock_irq(&tree->lock);
1020 node = tree->tree.rb_node;
1022 * Here we don't want to use tree_search() which will use tree->last
1043 /* Empty tree */
1074 spin_unlock_irq(&tree->lock);
1082 * @inode: Inode whose ordered tree is to be searched
1153 struct btrfs_ordered_inode_tree *tree = &inode->ordered_tree;
1189 /* One ref for the tree. */
1193 spin_lock(&tree->lock);
1194 /* Remove from tree once */
1196 rb_erase(node, &tree->tree);
1198 if (tree->last == node)
1199 tree->last = NULL;
1230 node = tree_insert(&tree->tree, ordered->file_offset, &ordered->rb_node);
1233 "zoned: inconsistency in ordered tree at offset %llu",
1236 node = tree_insert(&tree->tree, new->file_offset, &new->rb_node);
1239 "zoned: inconsistency in ordered tree at offset %llu",
1241 spin_unlock(&tree->lock);