Lines Matching refs:log_root_tree

164 		if (!fs_info->log_root_tree) {  in start_log_trans()
2805 ret = btrfs_insert_root(trans, fs_info->log_root_tree, in update_log_root()
2808 ret = btrfs_update_root(trans, fs_info->log_root_tree, in update_log_root()
2901 struct btrfs_root *log_root_tree = fs_info->log_root_tree; in btrfs_sync_log() local
3006 if (!log_root_tree->node) { in btrfs_sync_log()
3007 ret = btrfs_alloc_log_tree_node(trans, log_root_tree); in btrfs_sync_log()
3019 mutex_lock(&log_root_tree->log_mutex); in btrfs_sync_log()
3021 index2 = log_root_tree->log_transid % 2; in btrfs_sync_log()
3022 list_add_tail(&root_log_ctx.list, &log_root_tree->log_ctxs[index2]); in btrfs_sync_log()
3023 root_log_ctx.log_transid = log_root_tree->log_transid; in btrfs_sync_log()
3042 mutex_unlock(&log_root_tree->log_mutex); in btrfs_sync_log()
3046 if (log_root_tree->log_transid_committed >= root_log_ctx.log_transid) { in btrfs_sync_log()
3049 mutex_unlock(&log_root_tree->log_mutex); in btrfs_sync_log()
3055 if (atomic_read(&log_root_tree->log_commit[index2])) { in btrfs_sync_log()
3058 wait_log_commit(log_root_tree, in btrfs_sync_log()
3060 mutex_unlock(&log_root_tree->log_mutex); in btrfs_sync_log()
3065 ASSERT(root_log_ctx.log_transid == log_root_tree->log_transid); in btrfs_sync_log()
3066 atomic_set(&log_root_tree->log_commit[index2], 1); in btrfs_sync_log()
3068 if (atomic_read(&log_root_tree->log_commit[(index2 + 1) % 2])) { in btrfs_sync_log()
3069 wait_log_commit(log_root_tree, in btrfs_sync_log()
3080 mutex_unlock(&log_root_tree->log_mutex); in btrfs_sync_log()
3086 &log_root_tree->dirty_log_pages, in btrfs_sync_log()
3097 mutex_unlock(&log_root_tree->log_mutex); in btrfs_sync_log()
3101 mutex_unlock(&log_root_tree->log_mutex); in btrfs_sync_log()
3106 ret = btrfs_wait_tree_log_extents(log_root_tree, in btrfs_sync_log()
3110 mutex_unlock(&log_root_tree->log_mutex); in btrfs_sync_log()
3114 log_root_start = log_root_tree->node->start; in btrfs_sync_log()
3115 log_root_level = btrfs_header_level(log_root_tree->node); in btrfs_sync_log()
3116 log_root_tree->log_transid++; in btrfs_sync_log()
3117 mutex_unlock(&log_root_tree->log_mutex); in btrfs_sync_log()
3173 mutex_lock(&log_root_tree->log_mutex); in btrfs_sync_log()
3174 btrfs_remove_all_log_ctxs(log_root_tree, index2, ret); in btrfs_sync_log()
3176 log_root_tree->log_transid_committed++; in btrfs_sync_log()
3177 atomic_set(&log_root_tree->log_commit[index2], 0); in btrfs_sync_log()
3178 mutex_unlock(&log_root_tree->log_mutex); in btrfs_sync_log()
3185 cond_wake_up(&log_root_tree->log_commit_wait[index2]); in btrfs_sync_log()
3268 if (fs_info->log_root_tree) { in btrfs_free_log_root_tree()
3269 free_log_tree(trans, fs_info->log_root_tree); in btrfs_free_log_root_tree()
3270 fs_info->log_root_tree = NULL; in btrfs_free_log_root_tree()
7132 int btrfs_recover_log_trees(struct btrfs_root *log_root_tree) in btrfs_recover_log_trees() argument
7140 struct btrfs_fs_info *fs_info = log_root_tree->fs_info; in btrfs_recover_log_trees()
7161 ret = walk_log_tree(trans, log_root_tree, &wc); in btrfs_recover_log_trees()
7173 ret = btrfs_search_slot(NULL, log_root_tree, &key, path, 0, 0); in btrfs_recover_log_trees()
7190 log = btrfs_read_tree_root(log_root_tree, &found_key); in btrfs_recover_log_trees()
7291 log_root_tree->log_root = NULL; in btrfs_recover_log_trees()
7293 btrfs_put_root(log_root_tree); in btrfs_recover_log_trees()