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()
710 struct btrfs_ordered_inode_tree *tree; in btrfs_lookup_ordered_extent() local
714 tree = &BTRFS_I(inode)->ordered_tree; in btrfs_lookup_ordered_extent()
715 spin_lock_irq(&tree->lock); in btrfs_lookup_ordered_extent()
716 node = tree_search(tree, file_offset); in btrfs_lookup_ordered_extent()
726 spin_unlock_irq(&tree->lock); in btrfs_lookup_ordered_extent()
736 struct btrfs_ordered_inode_tree *tree; in btrfs_lookup_ordered_range() local
740 tree = &inode->ordered_tree; in btrfs_lookup_ordered_range()
741 spin_lock_irq(&tree->lock); in btrfs_lookup_ordered_range()
742 node = tree_search(tree, file_offset); in btrfs_lookup_ordered_range()
744 node = tree_search(tree, file_offset + len); in btrfs_lookup_ordered_range()
766 spin_unlock_irq(&tree->lock); in btrfs_lookup_ordered_range()
777 struct btrfs_ordered_inode_tree *tree; in btrfs_lookup_first_ordered_extent() local
781 tree = &BTRFS_I(inode)->ordered_tree; in btrfs_lookup_first_ordered_extent()
782 spin_lock_irq(&tree->lock); in btrfs_lookup_first_ordered_extent()
783 node = tree_search(tree, file_offset); in btrfs_lookup_first_ordered_extent()
790 spin_unlock_irq(&tree->lock); in btrfs_lookup_first_ordered_extent()
801 struct btrfs_ordered_inode_tree *tree = &BTRFS_I(inode)->ordered_tree; in btrfs_ordered_update_i_size() local
811 spin_lock_irq(&tree->lock); in btrfs_ordered_update_i_size()
863 prev = tree_search(tree, offset); in btrfs_ordered_update_i_size()
918 spin_unlock_irq(&tree->lock); in btrfs_ordered_update_i_size()
933 struct btrfs_ordered_inode_tree *tree = &BTRFS_I(inode)->ordered_tree; in btrfs_find_ordered_sum() local
944 spin_lock_irq(&tree->lock); in btrfs_find_ordered_sum()
963 spin_unlock_irq(&tree->lock); in btrfs_find_ordered_sum()
982 void btrfs_lock_and_flush_ordered_range(struct extent_io_tree *tree, in btrfs_lock_and_flush_ordered_range() argument
995 lock_extent_bits(tree, start, end, cachedp); in btrfs_lock_and_flush_ordered_range()
1008 unlock_extent_cached(tree, start, end, cachedp); in btrfs_lock_and_flush_ordered_range()