Lines Matching refs:tree

151 static inline struct rb_node *tree_search(struct btrfs_ordered_inode_tree *tree,  in tree_search()  argument
154 struct rb_root *root = &tree->tree; in tree_search()
159 if (tree->last) { in tree_search()
160 entry = rb_entry(tree->last, struct btrfs_ordered_extent, in tree_search()
163 return tree->last; in tree_search()
169 tree->last = ret; in tree_search()
189 struct btrfs_ordered_inode_tree *tree; in __btrfs_add_ordered_extent() local
193 tree = &BTRFS_I(inode)->ordered_tree; in __btrfs_add_ordered_extent()
227 spin_lock_irq(&tree->lock); in __btrfs_add_ordered_extent()
228 node = tree_insert(&tree->tree, file_offset, in __btrfs_add_ordered_extent()
232 spin_unlock_irq(&tree->lock); in __btrfs_add_ordered_extent()
284 struct btrfs_ordered_inode_tree *tree; in btrfs_add_ordered_sum() local
286 tree = &BTRFS_I(inode)->ordered_tree; in btrfs_add_ordered_sum()
287 spin_lock_irq(&tree->lock); in btrfs_add_ordered_sum()
293 spin_unlock_irq(&tree->lock); in btrfs_add_ordered_sum()
312 struct btrfs_ordered_inode_tree *tree; in btrfs_dec_test_first_ordered_pending() local
321 tree = &BTRFS_I(inode)->ordered_tree; in btrfs_dec_test_first_ordered_pending()
322 spin_lock_irqsave(&tree->lock, flags); in btrfs_dec_test_first_ordered_pending()
323 node = tree_search(tree, *file_offset); in btrfs_dec_test_first_ordered_pending()
365 spin_unlock_irqrestore(&tree->lock, flags); in btrfs_dec_test_first_ordered_pending()
382 struct btrfs_ordered_inode_tree *tree; in btrfs_dec_test_ordered_pending() local
388 tree = &BTRFS_I(inode)->ordered_tree; in btrfs_dec_test_ordered_pending()
389 spin_lock_irqsave(&tree->lock, flags); in btrfs_dec_test_ordered_pending()
395 node = tree_search(tree, file_offset); in btrfs_dec_test_ordered_pending()
429 spin_unlock_irqrestore(&tree->lock, flags); in btrfs_dec_test_ordered_pending()
439 struct btrfs_ordered_inode_tree *tree; in btrfs_get_logged_extents() local
444 tree = &BTRFS_I(inode)->ordered_tree; in btrfs_get_logged_extents()
445 spin_lock_irq(&tree->lock); in btrfs_get_logged_extents()
446 n = __tree_search(&tree->tree, end, &prev); in btrfs_get_logged_extents()
460 spin_unlock_irq(&tree->lock); in btrfs_get_logged_extents()
567 struct btrfs_ordered_inode_tree *tree; in btrfs_remove_ordered_extent() local
571 tree = &BTRFS_I(inode)->ordered_tree; in btrfs_remove_ordered_extent()
572 spin_lock_irq(&tree->lock); in btrfs_remove_ordered_extent()
574 rb_erase(node, &tree->tree); in btrfs_remove_ordered_extent()
575 if (tree->last == node) in btrfs_remove_ordered_extent()
576 tree->last = NULL; in btrfs_remove_ordered_extent()
578 spin_unlock_irq(&tree->lock); in btrfs_remove_ordered_extent()
786 struct btrfs_ordered_inode_tree *tree; in btrfs_lookup_ordered_extent() local
790 tree = &BTRFS_I(inode)->ordered_tree; in btrfs_lookup_ordered_extent()
791 spin_lock_irq(&tree->lock); in btrfs_lookup_ordered_extent()
792 node = tree_search(tree, file_offset); in btrfs_lookup_ordered_extent()
802 spin_unlock_irq(&tree->lock); in btrfs_lookup_ordered_extent()
813 struct btrfs_ordered_inode_tree *tree; in btrfs_lookup_ordered_range() local
817 tree = &BTRFS_I(inode)->ordered_tree; in btrfs_lookup_ordered_range()
818 spin_lock_irq(&tree->lock); in btrfs_lookup_ordered_range()
819 node = tree_search(tree, file_offset); in btrfs_lookup_ordered_range()
821 node = tree_search(tree, file_offset + len); in btrfs_lookup_ordered_range()
843 spin_unlock_irq(&tree->lock); in btrfs_lookup_ordered_range()
854 struct btrfs_ordered_inode_tree *tree; in btrfs_lookup_first_ordered_extent() local
858 tree = &BTRFS_I(inode)->ordered_tree; in btrfs_lookup_first_ordered_extent()
859 spin_lock_irq(&tree->lock); in btrfs_lookup_first_ordered_extent()
860 node = tree_search(tree, file_offset); in btrfs_lookup_first_ordered_extent()
867 spin_unlock_irq(&tree->lock); in btrfs_lookup_first_ordered_extent()
878 struct btrfs_ordered_inode_tree *tree = &BTRFS_I(inode)->ordered_tree; in btrfs_ordered_update_i_size() local
887 spin_lock_irq(&tree->lock); in btrfs_ordered_update_i_size()
929 prev = tree_search(tree, offset); in btrfs_ordered_update_i_size()
987 spin_unlock_irq(&tree->lock); in btrfs_ordered_update_i_size()
1001 struct btrfs_ordered_inode_tree *tree = &BTRFS_I(inode)->ordered_tree; in btrfs_find_ordered_sum() local
1011 spin_lock_irq(&tree->lock); in btrfs_find_ordered_sum()
1030 spin_unlock_irq(&tree->lock); in btrfs_find_ordered_sum()