Lines Matching refs:root
41 static struct rb_node *tree_insert(struct rb_root *root, u64 file_offset, in tree_insert() argument
44 struct rb_node **p = &root->rb_node; in tree_insert()
61 rb_insert_color(node, root); in tree_insert()
77 static struct rb_node *__tree_search(struct rb_root *root, u64 file_offset, in __tree_search() argument
80 struct rb_node *n = root->rb_node; in __tree_search()
154 struct rb_root *root = &tree->tree; in tree_search() local
165 ret = __tree_search(root, file_offset, &prev); in tree_search()
188 struct btrfs_root *root = BTRFS_I(inode)->root; in __btrfs_add_ordered_extent() local
234 spin_lock(&root->ordered_extent_lock); in __btrfs_add_ordered_extent()
236 &root->ordered_extents); in __btrfs_add_ordered_extent()
237 root->nr_ordered_extents++; in __btrfs_add_ordered_extent()
238 if (root->nr_ordered_extents == 1) { in __btrfs_add_ordered_extent()
239 spin_lock(&root->fs_info->ordered_root_lock); in __btrfs_add_ordered_extent()
240 BUG_ON(!list_empty(&root->ordered_root)); in __btrfs_add_ordered_extent()
241 list_add_tail(&root->ordered_root, in __btrfs_add_ordered_extent()
242 &root->fs_info->ordered_roots); in __btrfs_add_ordered_extent()
243 spin_unlock(&root->fs_info->ordered_root_lock); in __btrfs_add_ordered_extent()
245 spin_unlock(&root->ordered_extent_lock); in __btrfs_add_ordered_extent()
340 btrfs_crit(BTRFS_I(inode)->root->fs_info, in btrfs_dec_test_first_ordered_pending()
345 btrfs_crit(BTRFS_I(inode)->root->fs_info, in btrfs_dec_test_first_ordered_pending()
409 btrfs_crit(BTRFS_I(inode)->root->fs_info, in btrfs_dec_test_ordered_pending()
568 struct btrfs_root *root = BTRFS_I(inode)->root; in btrfs_remove_ordered_extent() local
580 spin_lock(&root->ordered_extent_lock); in btrfs_remove_ordered_extent()
582 root->nr_ordered_extents--; in btrfs_remove_ordered_extent()
586 if (!root->nr_ordered_extents) { in btrfs_remove_ordered_extent()
587 spin_lock(&root->fs_info->ordered_root_lock); in btrfs_remove_ordered_extent()
588 BUG_ON(list_empty(&root->ordered_root)); in btrfs_remove_ordered_extent()
589 list_del_init(&root->ordered_root); in btrfs_remove_ordered_extent()
590 spin_unlock(&root->fs_info->ordered_root_lock); in btrfs_remove_ordered_extent()
592 spin_unlock(&root->ordered_extent_lock); in btrfs_remove_ordered_extent()
609 int btrfs_wait_ordered_extents(struct btrfs_root *root, int nr) in btrfs_wait_ordered_extents() argument
618 mutex_lock(&root->ordered_extent_mutex); in btrfs_wait_ordered_extents()
619 spin_lock(&root->ordered_extent_lock); in btrfs_wait_ordered_extents()
620 list_splice_init(&root->ordered_extents, &splice); in btrfs_wait_ordered_extents()
625 &root->ordered_extents); in btrfs_wait_ordered_extents()
627 spin_unlock(&root->ordered_extent_lock); in btrfs_wait_ordered_extents()
633 btrfs_queue_work(root->fs_info->flush_workers, in btrfs_wait_ordered_extents()
637 spin_lock(&root->ordered_extent_lock); in btrfs_wait_ordered_extents()
642 list_splice_tail(&splice, &root->ordered_extents); in btrfs_wait_ordered_extents()
643 spin_unlock(&root->ordered_extent_lock); in btrfs_wait_ordered_extents()
651 mutex_unlock(&root->ordered_extent_mutex); in btrfs_wait_ordered_extents()
658 struct btrfs_root *root; in btrfs_wait_ordered_roots() local
668 root = list_first_entry(&splice, struct btrfs_root, in btrfs_wait_ordered_roots()
670 root = btrfs_grab_fs_root(root); in btrfs_wait_ordered_roots()
671 BUG_ON(!root); in btrfs_wait_ordered_roots()
672 list_move_tail(&root->ordered_root, in btrfs_wait_ordered_roots()
676 done = btrfs_wait_ordered_extents(root, nr); in btrfs_wait_ordered_roots()
677 btrfs_put_fs_root(root); in btrfs_wait_ordered_roots()
895 offset = ALIGN(offset, BTRFS_I(inode)->root->sectorsize); in btrfs_ordered_update_i_size()
1004 u32 sectorsize = BTRFS_I(inode)->root->sectorsize; in btrfs_find_ordered_sum()