Lines Matching refs:tree

127 static inline struct rb_node *tree_search(struct btrfs_ordered_inode_tree *tree,  in tree_search()  argument
130 struct rb_root *root = &tree->tree; in tree_search()
135 if (tree->last) { in tree_search()
136 entry = rb_entry(tree->last, struct btrfs_ordered_extent, in tree_search()
139 return tree->last; in tree_search()
145 tree->last = ret; in tree_search()
211 struct btrfs_ordered_inode_tree *tree = &inode->ordered_tree; in insert_ordered_extent() local
224 spin_lock_irq(&tree->lock); in insert_ordered_extent()
225 node = tree_insert(&tree->tree, entry->file_offset, &entry->rb_node); in insert_ordered_extent()
230 spin_unlock_irq(&tree->lock); in insert_ordered_extent()
290 struct btrfs_ordered_inode_tree *tree; in btrfs_add_ordered_sum() local
292 tree = &BTRFS_I(entry->inode)->ordered_tree; in btrfs_add_ordered_sum()
293 spin_lock_irq(&tree->lock); in btrfs_add_ordered_sum()
295 spin_unlock_irq(&tree->lock); in btrfs_add_ordered_sum()
407 struct btrfs_ordered_inode_tree *tree = &inode->ordered_tree; in btrfs_mark_ordered_io_finished() local
417 spin_lock_irqsave(&tree->lock, flags); in btrfs_mark_ordered_io_finished()
423 node = tree_search(tree, cur); in btrfs_mark_ordered_io_finished()
470 spin_unlock_irqrestore(&tree->lock, flags); in btrfs_mark_ordered_io_finished()
472 spin_lock_irqsave(&tree->lock, flags); in btrfs_mark_ordered_io_finished()
476 spin_unlock_irqrestore(&tree->lock, flags); in btrfs_mark_ordered_io_finished()
500 struct btrfs_ordered_inode_tree *tree = &inode->ordered_tree; in btrfs_dec_test_ordered_pending() local
506 spin_lock_irqsave(&tree->lock, flags); in btrfs_dec_test_ordered_pending()
512 node = tree_search(tree, file_offset); in btrfs_dec_test_ordered_pending()
543 spin_unlock_irqrestore(&tree->lock, flags); in btrfs_dec_test_ordered_pending()
581 struct btrfs_ordered_inode_tree *tree; in btrfs_remove_ordered_extent() local
612 tree = &btrfs_inode->ordered_tree; in btrfs_remove_ordered_extent()
613 spin_lock_irq(&tree->lock); in btrfs_remove_ordered_extent()
615 rb_erase(node, &tree->tree); in btrfs_remove_ordered_extent()
617 if (tree->last == node) in btrfs_remove_ordered_extent()
618 tree->last = NULL; in btrfs_remove_ordered_extent()
621 spin_unlock_irq(&tree->lock); in btrfs_remove_ordered_extent()
878 struct btrfs_ordered_inode_tree *tree; in btrfs_lookup_ordered_extent() local
883 tree = &inode->ordered_tree; in btrfs_lookup_ordered_extent()
884 spin_lock_irqsave(&tree->lock, flags); in btrfs_lookup_ordered_extent()
885 node = tree_search(tree, file_offset); in btrfs_lookup_ordered_extent()
897 spin_unlock_irqrestore(&tree->lock, flags); in btrfs_lookup_ordered_extent()
907 struct btrfs_ordered_inode_tree *tree; in btrfs_lookup_ordered_range() local
911 tree = &inode->ordered_tree; in btrfs_lookup_ordered_range()
912 spin_lock_irq(&tree->lock); in btrfs_lookup_ordered_range()
913 node = tree_search(tree, file_offset); in btrfs_lookup_ordered_range()
915 node = tree_search(tree, file_offset + len); in btrfs_lookup_ordered_range()
939 spin_unlock_irq(&tree->lock); in btrfs_lookup_ordered_range()
950 struct btrfs_ordered_inode_tree *tree = &inode->ordered_tree; in btrfs_get_ordered_extents_for_logging() local
955 spin_lock_irq(&tree->lock); in btrfs_get_ordered_extents_for_logging()
956 for (n = rb_first(&tree->tree); n; n = rb_next(n)) { in btrfs_get_ordered_extents_for_logging()
969 spin_unlock_irq(&tree->lock); in btrfs_get_ordered_extents_for_logging()
979 struct btrfs_ordered_inode_tree *tree; in btrfs_lookup_first_ordered_extent() local
983 tree = &inode->ordered_tree; in btrfs_lookup_first_ordered_extent()
984 spin_lock_irq(&tree->lock); in btrfs_lookup_first_ordered_extent()
985 node = tree_search(tree, file_offset); in btrfs_lookup_first_ordered_extent()
993 spin_unlock_irq(&tree->lock); in btrfs_lookup_first_ordered_extent()
1009 struct btrfs_ordered_inode_tree *tree = &inode->ordered_tree; in btrfs_lookup_first_ordered_range() local
1016 spin_lock_irq(&tree->lock); in btrfs_lookup_first_ordered_range()
1017 node = tree->tree.rb_node; in btrfs_lookup_first_ordered_range()
1071 spin_unlock_irq(&tree->lock); in btrfs_lookup_first_ordered_range()
1150 struct btrfs_ordered_inode_tree *tree = &inode->ordered_tree; in btrfs_split_ordered_extent() local
1190 spin_lock(&tree->lock); in btrfs_split_ordered_extent()
1193 rb_erase(node, &tree->tree); in btrfs_split_ordered_extent()
1195 if (tree->last == node) in btrfs_split_ordered_extent()
1196 tree->last = NULL; in btrfs_split_ordered_extent()
1227 node = tree_insert(&tree->tree, ordered->file_offset, &ordered->rb_node); in btrfs_split_ordered_extent()
1233 node = tree_insert(&tree->tree, new->file_offset, &new->rb_node); in btrfs_split_ordered_extent()
1238 spin_unlock(&tree->lock); in btrfs_split_ordered_extent()