Lines Matching refs:log_root_tree
181 if (!fs_info->log_root_tree) { in start_log_trans()
2792 ret = btrfs_insert_root(trans, fs_info->log_root_tree, in update_log_root()
2795 ret = btrfs_update_root(trans, fs_info->log_root_tree, in update_log_root()
2933 struct btrfs_root *log_root_tree = fs_info->log_root_tree; in btrfs_sync_log() local
3038 if (!log_root_tree->node) { in btrfs_sync_log()
3039 ret = btrfs_alloc_log_tree_node(trans, log_root_tree); in btrfs_sync_log()
3051 mutex_lock(&log_root_tree->log_mutex); in btrfs_sync_log()
3053 index2 = log_root_tree->log_transid % 2; in btrfs_sync_log()
3054 list_add_tail(&root_log_ctx.list, &log_root_tree->log_ctxs[index2]); in btrfs_sync_log()
3055 root_log_ctx.log_transid = log_root_tree->log_transid; in btrfs_sync_log()
3072 mutex_unlock(&log_root_tree->log_mutex); in btrfs_sync_log()
3076 if (log_root_tree->log_transid_committed >= root_log_ctx.log_transid) { in btrfs_sync_log()
3079 mutex_unlock(&log_root_tree->log_mutex); in btrfs_sync_log()
3084 if (atomic_read(&log_root_tree->log_commit[index2])) { in btrfs_sync_log()
3087 wait_log_commit(log_root_tree, in btrfs_sync_log()
3089 mutex_unlock(&log_root_tree->log_mutex); in btrfs_sync_log()
3094 ASSERT(root_log_ctx.log_transid == log_root_tree->log_transid); in btrfs_sync_log()
3095 atomic_set(&log_root_tree->log_commit[index2], 1); in btrfs_sync_log()
3097 if (atomic_read(&log_root_tree->log_commit[(index2 + 1) % 2])) { in btrfs_sync_log()
3098 wait_log_commit(log_root_tree, in btrfs_sync_log()
3109 mutex_unlock(&log_root_tree->log_mutex); in btrfs_sync_log()
3115 &log_root_tree->dirty_log_pages, in btrfs_sync_log()
3126 mutex_unlock(&log_root_tree->log_mutex); in btrfs_sync_log()
3130 mutex_unlock(&log_root_tree->log_mutex); in btrfs_sync_log()
3135 ret = btrfs_wait_tree_log_extents(log_root_tree, in btrfs_sync_log()
3139 mutex_unlock(&log_root_tree->log_mutex); in btrfs_sync_log()
3143 log_root_start = log_root_tree->node->start; in btrfs_sync_log()
3144 log_root_level = btrfs_header_level(log_root_tree->node); in btrfs_sync_log()
3145 log_root_tree->log_transid++; in btrfs_sync_log()
3146 mutex_unlock(&log_root_tree->log_mutex); in btrfs_sync_log()
3202 mutex_lock(&log_root_tree->log_mutex); in btrfs_sync_log()
3203 btrfs_remove_all_log_ctxs(log_root_tree, index2, ret); in btrfs_sync_log()
3205 log_root_tree->log_transid_committed++; in btrfs_sync_log()
3206 atomic_set(&log_root_tree->log_commit[index2], 0); in btrfs_sync_log()
3207 mutex_unlock(&log_root_tree->log_mutex); in btrfs_sync_log()
3214 cond_wake_up(&log_root_tree->log_commit_wait[index2]); in btrfs_sync_log()
3296 if (fs_info->log_root_tree) { in btrfs_free_log_root_tree()
3297 free_log_tree(trans, fs_info->log_root_tree); in btrfs_free_log_root_tree()
3298 fs_info->log_root_tree = NULL; in btrfs_free_log_root_tree()
7218 int btrfs_recover_log_trees(struct btrfs_root *log_root_tree) in btrfs_recover_log_trees() argument
7226 struct btrfs_fs_info *fs_info = log_root_tree->fs_info; in btrfs_recover_log_trees()
7247 ret = walk_log_tree(trans, log_root_tree, &wc); in btrfs_recover_log_trees()
7259 ret = btrfs_search_slot(NULL, log_root_tree, &key, path, 0, 0); in btrfs_recover_log_trees()
7276 log = btrfs_read_tree_root(log_root_tree, &found_key); in btrfs_recover_log_trees()
7375 log_root_tree->log_root = NULL; in btrfs_recover_log_trees()
7377 btrfs_put_root(log_root_tree); in btrfs_recover_log_trees()