Lines Matching refs:tree

124 static inline struct rb_node *tree_search(struct btrfs_ordered_inode_tree *tree,  in tree_search()  argument
127 struct rb_root *root = &tree->tree; in tree_search()
132 if (tree->last) { in tree_search()
133 entry = rb_entry(tree->last, struct btrfs_ordered_extent, in tree_search()
136 return tree->last; in tree_search()
142 tree->last = ret; in tree_search()
159 struct btrfs_ordered_inode_tree *tree = &inode->ordered_tree; in __btrfs_add_ordered_extent() local
217 spin_lock_irq(&tree->lock); in __btrfs_add_ordered_extent()
218 node = tree_insert(&tree->tree, file_offset, in __btrfs_add_ordered_extent()
224 spin_unlock_irq(&tree->lock); in __btrfs_add_ordered_extent()
293 struct btrfs_ordered_inode_tree *tree; in btrfs_add_ordered_sum() local
295 tree = &BTRFS_I(entry->inode)->ordered_tree; in btrfs_add_ordered_sum()
296 spin_lock_irq(&tree->lock); in btrfs_add_ordered_sum()
298 spin_unlock_irq(&tree->lock); in btrfs_add_ordered_sum()
321 struct btrfs_ordered_inode_tree *tree = &inode->ordered_tree; in btrfs_mark_ordered_io_finished() local
338 spin_lock_irqsave(&tree->lock, flags); in btrfs_mark_ordered_io_finished()
344 node = tree_search(tree, cur); in btrfs_mark_ordered_io_finished()
430 spin_unlock_irqrestore(&tree->lock, flags); in btrfs_mark_ordered_io_finished()
433 spin_lock_irqsave(&tree->lock, flags); in btrfs_mark_ordered_io_finished()
437 spin_unlock_irqrestore(&tree->lock, flags); in btrfs_mark_ordered_io_finished()
461 struct btrfs_ordered_inode_tree *tree = &inode->ordered_tree; in btrfs_dec_test_ordered_pending() local
467 spin_lock_irqsave(&tree->lock, flags); in btrfs_dec_test_ordered_pending()
473 node = tree_search(tree, file_offset); in btrfs_dec_test_ordered_pending()
503 spin_unlock_irqrestore(&tree->lock, flags); in btrfs_dec_test_ordered_pending()
541 struct btrfs_ordered_inode_tree *tree; in btrfs_remove_ordered_extent() local
558 tree = &btrfs_inode->ordered_tree; in btrfs_remove_ordered_extent()
559 spin_lock_irq(&tree->lock); in btrfs_remove_ordered_extent()
561 rb_erase(node, &tree->tree); in btrfs_remove_ordered_extent()
563 if (tree->last == node) in btrfs_remove_ordered_extent()
564 tree->last = NULL; in btrfs_remove_ordered_extent()
567 spin_unlock_irq(&tree->lock); in btrfs_remove_ordered_extent()
816 struct btrfs_ordered_inode_tree *tree; in btrfs_lookup_ordered_extent() local
821 tree = &inode->ordered_tree; in btrfs_lookup_ordered_extent()
822 spin_lock_irqsave(&tree->lock, flags); in btrfs_lookup_ordered_extent()
823 node = tree_search(tree, file_offset); in btrfs_lookup_ordered_extent()
833 spin_unlock_irqrestore(&tree->lock, flags); in btrfs_lookup_ordered_extent()
843 struct btrfs_ordered_inode_tree *tree; in btrfs_lookup_ordered_range() local
847 tree = &inode->ordered_tree; in btrfs_lookup_ordered_range()
848 spin_lock_irq(&tree->lock); in btrfs_lookup_ordered_range()
849 node = tree_search(tree, file_offset); in btrfs_lookup_ordered_range()
851 node = tree_search(tree, file_offset + len); in btrfs_lookup_ordered_range()
873 spin_unlock_irq(&tree->lock); in btrfs_lookup_ordered_range()
884 struct btrfs_ordered_inode_tree *tree = &inode->ordered_tree; in btrfs_get_ordered_extents_for_logging() local
889 spin_lock_irq(&tree->lock); in btrfs_get_ordered_extents_for_logging()
890 for (n = rb_first(&tree->tree); n; n = rb_next(n)) { in btrfs_get_ordered_extents_for_logging()
902 spin_unlock_irq(&tree->lock); in btrfs_get_ordered_extents_for_logging()
912 struct btrfs_ordered_inode_tree *tree; in btrfs_lookup_first_ordered_extent() local
916 tree = &inode->ordered_tree; in btrfs_lookup_first_ordered_extent()
917 spin_lock_irq(&tree->lock); in btrfs_lookup_first_ordered_extent()
918 node = tree_search(tree, file_offset); in btrfs_lookup_first_ordered_extent()
925 spin_unlock_irq(&tree->lock); in btrfs_lookup_first_ordered_extent()
941 struct btrfs_ordered_inode_tree *tree = &inode->ordered_tree; in btrfs_lookup_first_ordered_range() local
948 spin_lock_irq(&tree->lock); in btrfs_lookup_first_ordered_range()
949 node = tree->tree.rb_node; in btrfs_lookup_first_ordered_range()
1000 spin_unlock_irq(&tree->lock); in btrfs_lookup_first_ordered_range()
1097 struct btrfs_ordered_inode_tree *tree = &BTRFS_I(inode)->ordered_tree; in btrfs_split_ordered_extent() local
1102 spin_lock_irq(&tree->lock); in btrfs_split_ordered_extent()
1105 rb_erase(node, &tree->tree); in btrfs_split_ordered_extent()
1107 if (tree->last == node) in btrfs_split_ordered_extent()
1108 tree->last = NULL; in btrfs_split_ordered_extent()
1117 node = tree_insert(&tree->tree, ordered->file_offset, &ordered->rb_node); in btrfs_split_ordered_extent()
1123 spin_unlock_irq(&tree->lock); in btrfs_split_ordered_extent()