Lines Matching refs:tree

124 static inline struct rb_node *tree_search(struct btrfs_ordered_inode_tree *tree,  in tree_search()  argument
127 struct rb_root *root = &tree->tree; in tree_search()
132 if (tree->last) { in tree_search()
133 entry = rb_entry(tree->last, struct btrfs_ordered_extent, in tree_search()
136 return tree->last; in tree_search()
142 tree->last = ret; in tree_search()
171 struct btrfs_ordered_inode_tree *tree = &inode->ordered_tree; in btrfs_add_ordered_extent() local
226 spin_lock_irq(&tree->lock); in btrfs_add_ordered_extent()
227 node = tree_insert(&tree->tree, file_offset, in btrfs_add_ordered_extent()
233 spin_unlock_irq(&tree->lock); in btrfs_add_ordered_extent()
267 struct btrfs_ordered_inode_tree *tree; in btrfs_add_ordered_sum() local
269 tree = &BTRFS_I(entry->inode)->ordered_tree; in btrfs_add_ordered_sum()
270 spin_lock_irq(&tree->lock); in btrfs_add_ordered_sum()
272 spin_unlock_irq(&tree->lock); in btrfs_add_ordered_sum()
300 struct btrfs_ordered_inode_tree *tree = &inode->ordered_tree; in btrfs_mark_ordered_io_finished() local
317 spin_lock_irqsave(&tree->lock, flags); in btrfs_mark_ordered_io_finished()
323 node = tree_search(tree, cur); in btrfs_mark_ordered_io_finished()
410 spin_unlock_irqrestore(&tree->lock, flags); in btrfs_mark_ordered_io_finished()
413 spin_lock_irqsave(&tree->lock, flags); in btrfs_mark_ordered_io_finished()
417 spin_unlock_irqrestore(&tree->lock, flags); in btrfs_mark_ordered_io_finished()
441 struct btrfs_ordered_inode_tree *tree = &inode->ordered_tree; in btrfs_dec_test_ordered_pending() local
447 spin_lock_irqsave(&tree->lock, flags); in btrfs_dec_test_ordered_pending()
453 node = tree_search(tree, file_offset); in btrfs_dec_test_ordered_pending()
484 spin_unlock_irqrestore(&tree->lock, flags); in btrfs_dec_test_ordered_pending()
522 struct btrfs_ordered_inode_tree *tree; in btrfs_remove_ordered_extent() local
553 tree = &btrfs_inode->ordered_tree; in btrfs_remove_ordered_extent()
554 spin_lock_irq(&tree->lock); in btrfs_remove_ordered_extent()
556 rb_erase(node, &tree->tree); in btrfs_remove_ordered_extent()
558 if (tree->last == node) in btrfs_remove_ordered_extent()
559 tree->last = NULL; in btrfs_remove_ordered_extent()
562 spin_unlock_irq(&tree->lock); in btrfs_remove_ordered_extent()
824 struct btrfs_ordered_inode_tree *tree; in btrfs_lookup_ordered_extent() local
829 tree = &inode->ordered_tree; in btrfs_lookup_ordered_extent()
830 spin_lock_irqsave(&tree->lock, flags); in btrfs_lookup_ordered_extent()
831 node = tree_search(tree, file_offset); in btrfs_lookup_ordered_extent()
843 spin_unlock_irqrestore(&tree->lock, flags); in btrfs_lookup_ordered_extent()
853 struct btrfs_ordered_inode_tree *tree; in btrfs_lookup_ordered_range() local
857 tree = &inode->ordered_tree; in btrfs_lookup_ordered_range()
858 spin_lock_irq(&tree->lock); in btrfs_lookup_ordered_range()
859 node = tree_search(tree, file_offset); in btrfs_lookup_ordered_range()
861 node = tree_search(tree, file_offset + len); in btrfs_lookup_ordered_range()
885 spin_unlock_irq(&tree->lock); in btrfs_lookup_ordered_range()
896 struct btrfs_ordered_inode_tree *tree = &inode->ordered_tree; in btrfs_get_ordered_extents_for_logging() local
901 spin_lock_irq(&tree->lock); in btrfs_get_ordered_extents_for_logging()
902 for (n = rb_first(&tree->tree); n; n = rb_next(n)) { in btrfs_get_ordered_extents_for_logging()
915 spin_unlock_irq(&tree->lock); in btrfs_get_ordered_extents_for_logging()
925 struct btrfs_ordered_inode_tree *tree; in btrfs_lookup_first_ordered_extent() local
929 tree = &inode->ordered_tree; in btrfs_lookup_first_ordered_extent()
930 spin_lock_irq(&tree->lock); in btrfs_lookup_first_ordered_extent()
931 node = tree_search(tree, file_offset); in btrfs_lookup_first_ordered_extent()
939 spin_unlock_irq(&tree->lock); in btrfs_lookup_first_ordered_extent()
955 struct btrfs_ordered_inode_tree *tree = &inode->ordered_tree; in btrfs_lookup_first_ordered_range() local
962 spin_lock_irq(&tree->lock); in btrfs_lookup_first_ordered_range()
963 node = tree->tree.rb_node; in btrfs_lookup_first_ordered_range()
1017 spin_unlock_irq(&tree->lock); in btrfs_lookup_first_ordered_range()
1115 struct btrfs_ordered_inode_tree *tree = &BTRFS_I(inode)->ordered_tree; in btrfs_split_ordered_extent() local
1122 spin_lock_irq(&tree->lock); in btrfs_split_ordered_extent()
1125 rb_erase(node, &tree->tree); in btrfs_split_ordered_extent()
1127 if (tree->last == node) in btrfs_split_ordered_extent()
1128 tree->last = NULL; in btrfs_split_ordered_extent()
1137 node = tree_insert(&tree->tree, ordered->file_offset, &ordered->rb_node); in btrfs_split_ordered_extent()
1143 spin_unlock_irq(&tree->lock); in btrfs_split_ordered_extent()