Lines Matching refs:root
47 static int btrfs_dev_replace_find_srcdev(struct btrfs_root *root, u64 srcdevid,
308 int btrfs_dev_replace_start(struct btrfs_root *root, in btrfs_dev_replace_start() argument
312 struct btrfs_fs_info *fs_info = root->fs_info; in btrfs_dev_replace_start()
332 ret = btrfs_dev_replace_find_srcdev(root, args->start.srcdevid, in btrfs_dev_replace_start()
340 ret = btrfs_init_dev_replace_tgtdev(root, args->start.tgtdev_name, in btrfs_dev_replace_start()
350 trans = btrfs_attach_transaction(root); in btrfs_dev_replace_start()
352 ret = btrfs_commit_transaction(trans, root); in btrfs_dev_replace_start()
378 btrfs_info_in_rcu(root->fs_info, in btrfs_dev_replace_start()
402 btrfs_err(root->fs_info, "kobj add dev failed %d\n", ret); in btrfs_dev_replace_start()
404 btrfs_wait_ordered_roots(root->fs_info, -1); in btrfs_dev_replace_start()
407 trans = btrfs_start_transaction(root, 0); in btrfs_dev_replace_start()
414 ret = btrfs_commit_transaction(trans, root); in btrfs_dev_replace_start()
422 ret = btrfs_dev_replace_finishing(root->fs_info, ret); in btrfs_dev_replace_start()
466 struct btrfs_root *root = fs_info->tree_root; in btrfs_dev_replace_finishing() local
491 ret = btrfs_start_delalloc_roots(root->fs_info, 0, -1); in btrfs_dev_replace_finishing()
496 btrfs_wait_ordered_roots(root->fs_info, -1); in btrfs_dev_replace_finishing()
498 trans = btrfs_start_transaction(root, 0); in btrfs_dev_replace_finishing()
503 ret = btrfs_commit_transaction(trans, root); in btrfs_dev_replace_finishing()
508 mutex_lock(&root->fs_info->fs_devices->device_list_mutex); in btrfs_dev_replace_finishing()
509 mutex_lock(&root->fs_info->chunk_mutex); in btrfs_dev_replace_finishing()
525 btrfs_err_in_rcu(root->fs_info, in btrfs_dev_replace_finishing()
532 mutex_unlock(&root->fs_info->chunk_mutex); in btrfs_dev_replace_finishing()
533 mutex_unlock(&root->fs_info->fs_devices->device_list_mutex); in btrfs_dev_replace_finishing()
542 btrfs_info_in_rcu(root->fs_info, in btrfs_dev_replace_finishing()
583 mutex_unlock(&root->fs_info->chunk_mutex); in btrfs_dev_replace_finishing()
584 mutex_unlock(&root->fs_info->fs_devices->device_list_mutex); in btrfs_dev_replace_finishing()
592 trans = btrfs_start_transaction(root, 0); in btrfs_dev_replace_finishing()
594 btrfs_commit_transaction(trans, root); in btrfs_dev_replace_finishing()
627 static int btrfs_dev_replace_find_srcdev(struct btrfs_root *root, u64 srcdevid, in btrfs_dev_replace_find_srcdev() argument
635 *device = btrfs_find_device(root->fs_info, srcdevid, NULL, in btrfs_dev_replace_find_srcdev()
640 ret = btrfs_find_device_missing_or_by_path(root, srcdev_name, in btrfs_dev_replace_find_srcdev()
693 struct btrfs_root *root = fs_info->tree_root; in __btrfs_dev_replace_cancel() local
723 trans = btrfs_start_transaction(root, 0); in __btrfs_dev_replace_cancel()
728 ret = btrfs_commit_transaction(trans, root); in __btrfs_dev_replace_cancel()