Lines Matching refs:tree

141 static inline struct rb_node *tree_search(struct btrfs_ordered_inode_tree *tree,  in tree_search()  argument
144 struct rb_root *root = &tree->tree; in tree_search()
149 if (tree->last) { in tree_search()
150 entry = rb_entry(tree->last, struct btrfs_ordered_extent, in tree_search()
153 return tree->last; in tree_search()
159 tree->last = ret; in tree_search()
180 struct btrfs_ordered_inode_tree *tree; in __btrfs_add_ordered_extent() local
184 tree = &BTRFS_I(inode)->ordered_tree; in __btrfs_add_ordered_extent()
218 spin_lock_irq(&tree->lock); in __btrfs_add_ordered_extent()
219 node = tree_insert(&tree->tree, file_offset, in __btrfs_add_ordered_extent()
223 spin_unlock_irq(&tree->lock); in __btrfs_add_ordered_extent()
282 struct btrfs_ordered_inode_tree *tree; in btrfs_add_ordered_sum() local
284 tree = &BTRFS_I(entry->inode)->ordered_tree; in btrfs_add_ordered_sum()
285 spin_lock_irq(&tree->lock); in btrfs_add_ordered_sum()
287 spin_unlock_irq(&tree->lock); in btrfs_add_ordered_sum()
307 struct btrfs_ordered_inode_tree *tree; in btrfs_dec_test_first_ordered_pending() local
316 tree = &BTRFS_I(inode)->ordered_tree; in btrfs_dec_test_first_ordered_pending()
317 spin_lock_irqsave(&tree->lock, flags); in btrfs_dec_test_first_ordered_pending()
318 node = tree_search(tree, *file_offset); in btrfs_dec_test_first_ordered_pending()
360 spin_unlock_irqrestore(&tree->lock, flags); in btrfs_dec_test_first_ordered_pending()
377 struct btrfs_ordered_inode_tree *tree; in btrfs_dec_test_ordered_pending() local
383 tree = &BTRFS_I(inode)->ordered_tree; in btrfs_dec_test_ordered_pending()
384 spin_lock_irqsave(&tree->lock, flags); in btrfs_dec_test_ordered_pending()
390 node = tree_search(tree, file_offset); in btrfs_dec_test_ordered_pending()
424 spin_unlock_irqrestore(&tree->lock, flags); in btrfs_dec_test_ordered_pending()
464 struct btrfs_ordered_inode_tree *tree; in btrfs_remove_ordered_extent() local
480 tree = &btrfs_inode->ordered_tree; in btrfs_remove_ordered_extent()
481 spin_lock_irq(&tree->lock); in btrfs_remove_ordered_extent()
483 rb_erase(node, &tree->tree); in btrfs_remove_ordered_extent()
485 if (tree->last == node) in btrfs_remove_ordered_extent()
486 tree->last = NULL; in btrfs_remove_ordered_extent()
488 spin_unlock_irq(&tree->lock); in btrfs_remove_ordered_extent()
711 struct btrfs_ordered_inode_tree *tree; in btrfs_lookup_ordered_extent() local
715 tree = &BTRFS_I(inode)->ordered_tree; in btrfs_lookup_ordered_extent()
716 spin_lock_irq(&tree->lock); in btrfs_lookup_ordered_extent()
717 node = tree_search(tree, file_offset); in btrfs_lookup_ordered_extent()
727 spin_unlock_irq(&tree->lock); in btrfs_lookup_ordered_extent()
737 struct btrfs_ordered_inode_tree *tree; in btrfs_lookup_ordered_range() local
741 tree = &inode->ordered_tree; in btrfs_lookup_ordered_range()
742 spin_lock_irq(&tree->lock); in btrfs_lookup_ordered_range()
743 node = tree_search(tree, file_offset); in btrfs_lookup_ordered_range()
745 node = tree_search(tree, file_offset + len); in btrfs_lookup_ordered_range()
767 spin_unlock_irq(&tree->lock); in btrfs_lookup_ordered_range()
778 struct btrfs_ordered_inode_tree *tree; in btrfs_lookup_first_ordered_extent() local
782 tree = &BTRFS_I(inode)->ordered_tree; in btrfs_lookup_first_ordered_extent()
783 spin_lock_irq(&tree->lock); in btrfs_lookup_first_ordered_extent()
784 node = tree_search(tree, file_offset); in btrfs_lookup_first_ordered_extent()
791 spin_unlock_irq(&tree->lock); in btrfs_lookup_first_ordered_extent()
802 struct btrfs_ordered_inode_tree *tree = &BTRFS_I(inode)->ordered_tree; in btrfs_ordered_update_i_size() local
812 spin_lock_irq(&tree->lock); in btrfs_ordered_update_i_size()
864 prev = tree_search(tree, offset); in btrfs_ordered_update_i_size()
919 spin_unlock_irq(&tree->lock); in btrfs_ordered_update_i_size()
934 struct btrfs_ordered_inode_tree *tree = &BTRFS_I(inode)->ordered_tree; in btrfs_find_ordered_sum() local
945 spin_lock_irq(&tree->lock); in btrfs_find_ordered_sum()
964 spin_unlock_irq(&tree->lock); in btrfs_find_ordered_sum()
983 void btrfs_lock_and_flush_ordered_range(struct extent_io_tree *tree, in btrfs_lock_and_flush_ordered_range() argument
996 lock_extent_bits(tree, start, end, cachedp); in btrfs_lock_and_flush_ordered_range()
1009 unlock_extent_cached(tree, start, end, cachedp); in btrfs_lock_and_flush_ordered_range()