Lines Matching refs:tree

138 static inline struct rb_node *tree_search(struct btrfs_ordered_inode_tree *tree,  in tree_search()  argument
141 struct rb_root *root = &tree->tree; in tree_search()
146 if (tree->last) { in tree_search()
147 entry = rb_entry(tree->last, struct btrfs_ordered_extent, in tree_search()
150 return tree->last; in tree_search()
156 tree->last = ret; in tree_search()
177 struct btrfs_ordered_inode_tree *tree; in __btrfs_add_ordered_extent() local
181 tree = &BTRFS_I(inode)->ordered_tree; in __btrfs_add_ordered_extent()
212 spin_lock_irq(&tree->lock); in __btrfs_add_ordered_extent()
213 node = tree_insert(&tree->tree, file_offset, in __btrfs_add_ordered_extent()
217 spin_unlock_irq(&tree->lock); in __btrfs_add_ordered_extent()
277 struct btrfs_ordered_inode_tree *tree; in btrfs_add_ordered_sum() local
279 tree = &BTRFS_I(inode)->ordered_tree; in btrfs_add_ordered_sum()
280 spin_lock_irq(&tree->lock); in btrfs_add_ordered_sum()
282 spin_unlock_irq(&tree->lock); in btrfs_add_ordered_sum()
302 struct btrfs_ordered_inode_tree *tree; in btrfs_dec_test_first_ordered_pending() local
311 tree = &BTRFS_I(inode)->ordered_tree; in btrfs_dec_test_first_ordered_pending()
312 spin_lock_irqsave(&tree->lock, flags); in btrfs_dec_test_first_ordered_pending()
313 node = tree_search(tree, *file_offset); in btrfs_dec_test_first_ordered_pending()
355 spin_unlock_irqrestore(&tree->lock, flags); in btrfs_dec_test_first_ordered_pending()
372 struct btrfs_ordered_inode_tree *tree; in btrfs_dec_test_ordered_pending() local
378 tree = &BTRFS_I(inode)->ordered_tree; in btrfs_dec_test_ordered_pending()
379 spin_lock_irqsave(&tree->lock, flags); in btrfs_dec_test_ordered_pending()
385 node = tree_search(tree, file_offset); in btrfs_dec_test_ordered_pending()
419 spin_unlock_irqrestore(&tree->lock, flags); in btrfs_dec_test_ordered_pending()
459 struct btrfs_ordered_inode_tree *tree; in btrfs_remove_ordered_extent() local
472 tree = &btrfs_inode->ordered_tree; in btrfs_remove_ordered_extent()
473 spin_lock_irq(&tree->lock); in btrfs_remove_ordered_extent()
475 rb_erase(node, &tree->tree); in btrfs_remove_ordered_extent()
477 if (tree->last == node) in btrfs_remove_ordered_extent()
478 tree->last = NULL; in btrfs_remove_ordered_extent()
482 spin_unlock_irq(&tree->lock); in btrfs_remove_ordered_extent()
732 struct btrfs_ordered_inode_tree *tree; in btrfs_lookup_ordered_extent() local
736 tree = &BTRFS_I(inode)->ordered_tree; in btrfs_lookup_ordered_extent()
737 spin_lock_irq(&tree->lock); in btrfs_lookup_ordered_extent()
738 node = tree_search(tree, file_offset); in btrfs_lookup_ordered_extent()
748 spin_unlock_irq(&tree->lock); in btrfs_lookup_ordered_extent()
758 struct btrfs_ordered_inode_tree *tree; in btrfs_lookup_ordered_range() local
762 tree = &inode->ordered_tree; in btrfs_lookup_ordered_range()
763 spin_lock_irq(&tree->lock); in btrfs_lookup_ordered_range()
764 node = tree_search(tree, file_offset); in btrfs_lookup_ordered_range()
766 node = tree_search(tree, file_offset + len); in btrfs_lookup_ordered_range()
788 spin_unlock_irq(&tree->lock); in btrfs_lookup_ordered_range()
799 struct btrfs_ordered_inode_tree *tree; in btrfs_lookup_first_ordered_extent() local
803 tree = &BTRFS_I(inode)->ordered_tree; in btrfs_lookup_first_ordered_extent()
804 spin_lock_irq(&tree->lock); in btrfs_lookup_first_ordered_extent()
805 node = tree_search(tree, file_offset); in btrfs_lookup_first_ordered_extent()
812 spin_unlock_irq(&tree->lock); in btrfs_lookup_first_ordered_extent()
823 struct btrfs_ordered_inode_tree *tree = &BTRFS_I(inode)->ordered_tree; in btrfs_ordered_update_i_size() local
833 spin_lock_irq(&tree->lock); in btrfs_ordered_update_i_size()
885 prev = tree_search(tree, offset); in btrfs_ordered_update_i_size()
940 spin_unlock_irq(&tree->lock); in btrfs_ordered_update_i_size()
954 struct btrfs_ordered_inode_tree *tree = &BTRFS_I(inode)->ordered_tree; in btrfs_find_ordered_sum() local
964 spin_lock_irq(&tree->lock); in btrfs_find_ordered_sum()
983 spin_unlock_irq(&tree->lock); in btrfs_find_ordered_sum()