Lines Matching refs:root

36 static struct rb_node *tree_insert(struct rb_root *root, u64 file_offset,  in tree_insert()  argument
39 struct rb_node **p = &root->rb_node; in tree_insert()
56 rb_insert_color(node, root); in tree_insert()
64 static struct rb_node *__tree_search(struct rb_root *root, u64 file_offset, in __tree_search() argument
67 struct rb_node *n = root->rb_node; in __tree_search()
218 btrfs_qgroup_free_refroot(inode->root->fs_info, in alloc_ordered_extent()
219 btrfs_root_id(inode->root), in alloc_ordered_extent()
228 struct btrfs_root *root = inode->root; in insert_ordered_extent() local
229 struct btrfs_fs_info *fs_info = root->fs_info; in insert_ordered_extent()
249 spin_lock(&root->ordered_extent_lock); in insert_ordered_extent()
251 &root->ordered_extents); in insert_ordered_extent()
252 root->nr_ordered_extents++; in insert_ordered_extent()
253 if (root->nr_ordered_extents == 1) { in insert_ordered_extent()
255 BUG_ON(!list_empty(&root->ordered_root)); in insert_ordered_extent()
256 list_add_tail(&root->ordered_root, &fs_info->ordered_roots); in insert_ordered_extent()
259 spin_unlock(&root->ordered_extent_lock); in insert_ordered_extent()
355 struct btrfs_fs_info *fs_info = inode->root->fs_info; in can_finish_ordered_extent()
379 btrfs_root_id(inode->root), btrfs_ino(inode), in can_finish_ordered_extent()
407 struct btrfs_fs_info *fs_info = inode->root->fs_info; in btrfs_queue_ordered_fn()
595 btrfs_crit(inode->root->fs_info, in btrfs_dec_test_ordered_pending()
649 struct btrfs_root *root = btrfs_inode->root; in btrfs_remove_ordered_extent() local
650 struct btrfs_fs_info *fs_info = root->fs_info; in btrfs_remove_ordered_extent()
666 if (root != fs_info->tree_root) { in btrfs_remove_ordered_extent()
720 spin_lock(&root->ordered_extent_lock); in btrfs_remove_ordered_extent()
722 root->nr_ordered_extents--; in btrfs_remove_ordered_extent()
726 if (!root->nr_ordered_extents) { in btrfs_remove_ordered_extent()
728 BUG_ON(list_empty(&root->ordered_root)); in btrfs_remove_ordered_extent()
729 list_del_init(&root->ordered_root); in btrfs_remove_ordered_extent()
732 spin_unlock(&root->ordered_extent_lock); in btrfs_remove_ordered_extent()
751 u64 btrfs_wait_ordered_extents(struct btrfs_root *root, u64 nr, in btrfs_wait_ordered_extents() argument
754 struct btrfs_fs_info *fs_info = root->fs_info; in btrfs_wait_ordered_extents()
772 mutex_lock(&root->ordered_extent_mutex); in btrfs_wait_ordered_extents()
773 spin_lock(&root->ordered_extent_lock); in btrfs_wait_ordered_extents()
774 list_splice_init(&root->ordered_extents, &splice); in btrfs_wait_ordered_extents()
782 cond_resched_lock(&root->ordered_extent_lock); in btrfs_wait_ordered_extents()
787 &root->ordered_extents); in btrfs_wait_ordered_extents()
789 spin_unlock(&root->ordered_extent_lock); in btrfs_wait_ordered_extents()
800 spin_lock(&root->ordered_extent_lock); in btrfs_wait_ordered_extents()
802 list_splice_tail(&skipped, &root->ordered_extents); in btrfs_wait_ordered_extents()
803 list_splice_tail(&splice, &root->ordered_extents); in btrfs_wait_ordered_extents()
804 spin_unlock(&root->ordered_extent_lock); in btrfs_wait_ordered_extents()
812 mutex_unlock(&root->ordered_extent_mutex); in btrfs_wait_ordered_extents()
824 struct btrfs_root *root; in btrfs_wait_ordered_roots() local
832 root = list_first_entry(&splice, struct btrfs_root, in btrfs_wait_ordered_roots()
834 root = btrfs_grab_root(root); in btrfs_wait_ordered_roots()
835 BUG_ON(!root); in btrfs_wait_ordered_roots()
836 list_move_tail(&root->ordered_root, in btrfs_wait_ordered_roots()
840 done = btrfs_wait_ordered_extents(root, nr, bg); in btrfs_wait_ordered_roots()
841 btrfs_put_root(root); in btrfs_wait_ordered_roots()
896 btrfs_might_wait_for_event(inode->root->fs_info, btrfs_ordered_extent); in btrfs_start_ordered_extent_nowriteback()
1236 struct btrfs_root *root = inode->root; in btrfs_split_ordered_extent() local
1237 struct btrfs_fs_info *fs_info = root->fs_info; in btrfs_split_ordered_extent()
1303 spin_lock_irq(&root->ordered_extent_lock); in btrfs_split_ordered_extent()
1348 list_add_tail(&new->root_extent_list, &root->ordered_extents); in btrfs_split_ordered_extent()
1349 root->nr_ordered_extents++; in btrfs_split_ordered_extent()
1350 spin_unlock_irq(&root->ordered_extent_lock); in btrfs_split_ordered_extent()