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()
224 spin_lock_irq(&tree->lock); in __btrfs_add_ordered_extent()
225 node = tree_insert(&tree->tree, file_offset, in __btrfs_add_ordered_extent()
229 spin_unlock_irq(&tree->lock); in __btrfs_add_ordered_extent()
281 struct btrfs_ordered_inode_tree *tree; in btrfs_add_ordered_sum() local
283 tree = &BTRFS_I(inode)->ordered_tree; in btrfs_add_ordered_sum()
284 spin_lock_irq(&tree->lock); in btrfs_add_ordered_sum()
286 spin_unlock_irq(&tree->lock); in btrfs_add_ordered_sum()
305 struct btrfs_ordered_inode_tree *tree; in btrfs_dec_test_first_ordered_pending() local
314 tree = &BTRFS_I(inode)->ordered_tree; in btrfs_dec_test_first_ordered_pending()
315 spin_lock_irqsave(&tree->lock, flags); in btrfs_dec_test_first_ordered_pending()
316 node = tree_search(tree, *file_offset); in btrfs_dec_test_first_ordered_pending()
361 spin_unlock_irqrestore(&tree->lock, flags); in btrfs_dec_test_first_ordered_pending()
378 struct btrfs_ordered_inode_tree *tree; in btrfs_dec_test_ordered_pending() local
384 tree = &BTRFS_I(inode)->ordered_tree; in btrfs_dec_test_ordered_pending()
385 spin_lock_irqsave(&tree->lock, flags); in btrfs_dec_test_ordered_pending()
391 node = tree_search(tree, file_offset); in btrfs_dec_test_ordered_pending()
428 spin_unlock_irqrestore(&tree->lock, flags); in btrfs_dec_test_ordered_pending()
438 struct btrfs_ordered_inode_tree *tree; in btrfs_get_logged_extents() local
443 tree = &BTRFS_I(inode)->ordered_tree; in btrfs_get_logged_extents()
444 spin_lock_irq(&tree->lock); in btrfs_get_logged_extents()
445 n = __tree_search(&tree->tree, end, &prev); in btrfs_get_logged_extents()
459 spin_unlock_irq(&tree->lock); in btrfs_get_logged_extents()
521 struct btrfs_ordered_inode_tree *tree; in btrfs_wait_logged_extents() local
523 tree = &BTRFS_I(inode)->ordered_tree; in btrfs_wait_logged_extents()
524 spin_lock_irq(&tree->lock); in btrfs_wait_logged_extents()
529 spin_unlock_irq(&tree->lock); in btrfs_wait_logged_extents()
590 struct btrfs_ordered_inode_tree *tree; in btrfs_remove_ordered_extent() local
595 tree = &BTRFS_I(inode)->ordered_tree; in btrfs_remove_ordered_extent()
596 spin_lock_irq(&tree->lock); in btrfs_remove_ordered_extent()
598 rb_erase(node, &tree->tree); in btrfs_remove_ordered_extent()
600 if (tree->last == node) in btrfs_remove_ordered_extent()
601 tree->last = NULL; in btrfs_remove_ordered_extent()
605 spin_unlock_irq(&tree->lock); in btrfs_remove_ordered_extent()
840 struct btrfs_ordered_inode_tree *tree; in btrfs_lookup_ordered_extent() local
844 tree = &BTRFS_I(inode)->ordered_tree; in btrfs_lookup_ordered_extent()
845 spin_lock_irq(&tree->lock); in btrfs_lookup_ordered_extent()
846 node = tree_search(tree, file_offset); in btrfs_lookup_ordered_extent()
856 spin_unlock_irq(&tree->lock); in btrfs_lookup_ordered_extent()
867 struct btrfs_ordered_inode_tree *tree; in btrfs_lookup_ordered_range() local
871 tree = &BTRFS_I(inode)->ordered_tree; in btrfs_lookup_ordered_range()
872 spin_lock_irq(&tree->lock); in btrfs_lookup_ordered_range()
873 node = tree_search(tree, file_offset); in btrfs_lookup_ordered_range()
875 node = tree_search(tree, file_offset + len); in btrfs_lookup_ordered_range()
897 spin_unlock_irq(&tree->lock); in btrfs_lookup_ordered_range()
922 struct btrfs_ordered_inode_tree *tree; in btrfs_lookup_first_ordered_extent() local
926 tree = &BTRFS_I(inode)->ordered_tree; in btrfs_lookup_first_ordered_extent()
927 spin_lock_irq(&tree->lock); in btrfs_lookup_first_ordered_extent()
928 node = tree_search(tree, file_offset); in btrfs_lookup_first_ordered_extent()
935 spin_unlock_irq(&tree->lock); in btrfs_lookup_first_ordered_extent()
946 struct btrfs_ordered_inode_tree *tree = &BTRFS_I(inode)->ordered_tree; in btrfs_ordered_update_i_size() local
955 spin_lock_irq(&tree->lock); in btrfs_ordered_update_i_size()
997 prev = tree_search(tree, offset); in btrfs_ordered_update_i_size()
1055 spin_unlock_irq(&tree->lock); in btrfs_ordered_update_i_size()
1069 struct btrfs_ordered_inode_tree *tree = &BTRFS_I(inode)->ordered_tree; in btrfs_find_ordered_sum() local
1079 spin_lock_irq(&tree->lock); in btrfs_find_ordered_sum()
1098 spin_unlock_irq(&tree->lock); in btrfs_find_ordered_sum()