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
231 spin_lock(&root->ordered_extent_lock); in __btrfs_add_ordered_extent()
233 &root->ordered_extents); in __btrfs_add_ordered_extent()
234 root->nr_ordered_extents++; in __btrfs_add_ordered_extent()
235 if (root->nr_ordered_extents == 1) { in __btrfs_add_ordered_extent()
236 spin_lock(&root->fs_info->ordered_root_lock); in __btrfs_add_ordered_extent()
237 BUG_ON(!list_empty(&root->ordered_root)); in __btrfs_add_ordered_extent()
238 list_add_tail(&root->ordered_root, in __btrfs_add_ordered_extent()
239 &root->fs_info->ordered_roots); in __btrfs_add_ordered_extent()
240 spin_unlock(&root->fs_info->ordered_root_lock); in __btrfs_add_ordered_extent()
242 spin_unlock(&root->ordered_extent_lock); in __btrfs_add_ordered_extent()
333 btrfs_crit(BTRFS_I(inode)->root->fs_info, in btrfs_dec_test_first_ordered_pending()
338 btrfs_crit(BTRFS_I(inode)->root->fs_info, in btrfs_dec_test_first_ordered_pending()
405 btrfs_crit(BTRFS_I(inode)->root->fs_info, in btrfs_dec_test_ordered_pending()
591 struct btrfs_root *root = BTRFS_I(inode)->root; in btrfs_remove_ordered_extent() local
620 spin_lock(&root->fs_info->trans_lock); in btrfs_remove_ordered_extent()
621 trans = root->fs_info->running_transaction; in btrfs_remove_ordered_extent()
624 spin_unlock(&root->fs_info->trans_lock); in btrfs_remove_ordered_extent()
634 spin_lock(&root->ordered_extent_lock); in btrfs_remove_ordered_extent()
636 root->nr_ordered_extents--; in btrfs_remove_ordered_extent()
640 if (!root->nr_ordered_extents) { in btrfs_remove_ordered_extent()
641 spin_lock(&root->fs_info->ordered_root_lock); in btrfs_remove_ordered_extent()
642 BUG_ON(list_empty(&root->ordered_root)); in btrfs_remove_ordered_extent()
643 list_del_init(&root->ordered_root); in btrfs_remove_ordered_extent()
644 spin_unlock(&root->fs_info->ordered_root_lock); in btrfs_remove_ordered_extent()
646 spin_unlock(&root->ordered_extent_lock); in btrfs_remove_ordered_extent()
663 int btrfs_wait_ordered_extents(struct btrfs_root *root, int nr) in btrfs_wait_ordered_extents() argument
672 mutex_lock(&root->ordered_extent_mutex); in btrfs_wait_ordered_extents()
673 spin_lock(&root->ordered_extent_lock); in btrfs_wait_ordered_extents()
674 list_splice_init(&root->ordered_extents, &splice); in btrfs_wait_ordered_extents()
679 &root->ordered_extents); in btrfs_wait_ordered_extents()
681 spin_unlock(&root->ordered_extent_lock); in btrfs_wait_ordered_extents()
687 btrfs_queue_work(root->fs_info->flush_workers, in btrfs_wait_ordered_extents()
691 spin_lock(&root->ordered_extent_lock); in btrfs_wait_ordered_extents()
696 list_splice_tail(&splice, &root->ordered_extents); in btrfs_wait_ordered_extents()
697 spin_unlock(&root->ordered_extent_lock); in btrfs_wait_ordered_extents()
705 mutex_unlock(&root->ordered_extent_mutex); in btrfs_wait_ordered_extents()
712 struct btrfs_root *root; in btrfs_wait_ordered_roots() local
722 root = list_first_entry(&splice, struct btrfs_root, in btrfs_wait_ordered_roots()
724 root = btrfs_grab_fs_root(root); in btrfs_wait_ordered_roots()
725 BUG_ON(!root); in btrfs_wait_ordered_roots()
726 list_move_tail(&root->ordered_root, in btrfs_wait_ordered_roots()
730 done = btrfs_wait_ordered_extents(root, nr); in btrfs_wait_ordered_roots()
731 btrfs_put_fs_root(root); in btrfs_wait_ordered_roots()
963 offset = ALIGN(offset, BTRFS_I(inode)->root->sectorsize); in btrfs_ordered_update_i_size()
1072 u32 sectorsize = BTRFS_I(inode)->root->sectorsize; in btrfs_find_ordered_sum()