Lines Matching refs:log_root_tree

164 		if (!fs_info->log_root_tree) {  in start_log_trans()
2775 ret = btrfs_insert_root(trans, fs_info->log_root_tree, in update_log_root()
2778 ret = btrfs_update_root(trans, fs_info->log_root_tree, in update_log_root()
2871 struct btrfs_root *log_root_tree = fs_info->log_root_tree; in btrfs_sync_log() local
2976 if (!log_root_tree->node) { in btrfs_sync_log()
2977 ret = btrfs_alloc_log_tree_node(trans, log_root_tree); in btrfs_sync_log()
2989 mutex_lock(&log_root_tree->log_mutex); in btrfs_sync_log()
2991 index2 = log_root_tree->log_transid % 2; in btrfs_sync_log()
2992 list_add_tail(&root_log_ctx.list, &log_root_tree->log_ctxs[index2]); in btrfs_sync_log()
2993 root_log_ctx.log_transid = log_root_tree->log_transid; in btrfs_sync_log()
3012 mutex_unlock(&log_root_tree->log_mutex); in btrfs_sync_log()
3016 if (log_root_tree->log_transid_committed >= root_log_ctx.log_transid) { in btrfs_sync_log()
3019 mutex_unlock(&log_root_tree->log_mutex); in btrfs_sync_log()
3025 if (atomic_read(&log_root_tree->log_commit[index2])) { in btrfs_sync_log()
3028 wait_log_commit(log_root_tree, in btrfs_sync_log()
3030 mutex_unlock(&log_root_tree->log_mutex); in btrfs_sync_log()
3035 ASSERT(root_log_ctx.log_transid == log_root_tree->log_transid); in btrfs_sync_log()
3036 atomic_set(&log_root_tree->log_commit[index2], 1); in btrfs_sync_log()
3038 if (atomic_read(&log_root_tree->log_commit[(index2 + 1) % 2])) { in btrfs_sync_log()
3039 wait_log_commit(log_root_tree, in btrfs_sync_log()
3050 mutex_unlock(&log_root_tree->log_mutex); in btrfs_sync_log()
3056 &log_root_tree->dirty_log_pages, in btrfs_sync_log()
3067 mutex_unlock(&log_root_tree->log_mutex); in btrfs_sync_log()
3071 mutex_unlock(&log_root_tree->log_mutex); in btrfs_sync_log()
3076 ret = btrfs_wait_tree_log_extents(log_root_tree, in btrfs_sync_log()
3080 mutex_unlock(&log_root_tree->log_mutex); in btrfs_sync_log()
3084 log_root_start = log_root_tree->node->start; in btrfs_sync_log()
3085 log_root_level = btrfs_header_level(log_root_tree->node); in btrfs_sync_log()
3086 log_root_tree->log_transid++; in btrfs_sync_log()
3087 mutex_unlock(&log_root_tree->log_mutex); in btrfs_sync_log()
3143 mutex_lock(&log_root_tree->log_mutex); in btrfs_sync_log()
3144 btrfs_remove_all_log_ctxs(log_root_tree, index2, ret); in btrfs_sync_log()
3146 log_root_tree->log_transid_committed++; in btrfs_sync_log()
3147 atomic_set(&log_root_tree->log_commit[index2], 0); in btrfs_sync_log()
3148 mutex_unlock(&log_root_tree->log_mutex); in btrfs_sync_log()
3155 cond_wake_up(&log_root_tree->log_commit_wait[index2]); in btrfs_sync_log()
3238 if (fs_info->log_root_tree) { in btrfs_free_log_root_tree()
3239 free_log_tree(trans, fs_info->log_root_tree); in btrfs_free_log_root_tree()
3240 fs_info->log_root_tree = NULL; in btrfs_free_log_root_tree()
7125 int btrfs_recover_log_trees(struct btrfs_root *log_root_tree) in btrfs_recover_log_trees() argument
7133 struct btrfs_fs_info *fs_info = log_root_tree->fs_info; in btrfs_recover_log_trees()
7154 ret = walk_log_tree(trans, log_root_tree, &wc); in btrfs_recover_log_trees()
7166 ret = btrfs_search_slot(NULL, log_root_tree, &key, path, 0, 0); in btrfs_recover_log_trees()
7183 log = btrfs_read_tree_root(log_root_tree, &found_key); in btrfs_recover_log_trees()
7284 log_root_tree->log_root = NULL; in btrfs_recover_log_trees()
7286 btrfs_put_root(log_root_tree); in btrfs_recover_log_trees()