Lines Matching refs:log_root_tree

181 		if (!fs_info->log_root_tree) {  in start_log_trans()
2791 ret = btrfs_insert_root(trans, fs_info->log_root_tree, in update_log_root()
2794 ret = btrfs_update_root(trans, fs_info->log_root_tree, in update_log_root()
2932 struct btrfs_root *log_root_tree = fs_info->log_root_tree; in btrfs_sync_log() local
3037 if (!log_root_tree->node) { in btrfs_sync_log()
3038 ret = btrfs_alloc_log_tree_node(trans, log_root_tree); in btrfs_sync_log()
3050 mutex_lock(&log_root_tree->log_mutex); in btrfs_sync_log()
3052 index2 = log_root_tree->log_transid % 2; in btrfs_sync_log()
3053 list_add_tail(&root_log_ctx.list, &log_root_tree->log_ctxs[index2]); in btrfs_sync_log()
3054 root_log_ctx.log_transid = log_root_tree->log_transid; in btrfs_sync_log()
3071 mutex_unlock(&log_root_tree->log_mutex); in btrfs_sync_log()
3075 if (log_root_tree->log_transid_committed >= root_log_ctx.log_transid) { in btrfs_sync_log()
3078 mutex_unlock(&log_root_tree->log_mutex); in btrfs_sync_log()
3083 if (atomic_read(&log_root_tree->log_commit[index2])) { in btrfs_sync_log()
3086 wait_log_commit(log_root_tree, in btrfs_sync_log()
3088 mutex_unlock(&log_root_tree->log_mutex); in btrfs_sync_log()
3093 ASSERT(root_log_ctx.log_transid == log_root_tree->log_transid); in btrfs_sync_log()
3094 atomic_set(&log_root_tree->log_commit[index2], 1); in btrfs_sync_log()
3096 if (atomic_read(&log_root_tree->log_commit[(index2 + 1) % 2])) { in btrfs_sync_log()
3097 wait_log_commit(log_root_tree, in btrfs_sync_log()
3108 mutex_unlock(&log_root_tree->log_mutex); in btrfs_sync_log()
3114 &log_root_tree->dirty_log_pages, in btrfs_sync_log()
3125 mutex_unlock(&log_root_tree->log_mutex); in btrfs_sync_log()
3129 mutex_unlock(&log_root_tree->log_mutex); in btrfs_sync_log()
3134 ret = btrfs_wait_tree_log_extents(log_root_tree, in btrfs_sync_log()
3138 mutex_unlock(&log_root_tree->log_mutex); in btrfs_sync_log()
3142 log_root_start = log_root_tree->node->start; in btrfs_sync_log()
3143 log_root_level = btrfs_header_level(log_root_tree->node); in btrfs_sync_log()
3144 log_root_tree->log_transid++; in btrfs_sync_log()
3145 mutex_unlock(&log_root_tree->log_mutex); in btrfs_sync_log()
3201 mutex_lock(&log_root_tree->log_mutex); in btrfs_sync_log()
3202 btrfs_remove_all_log_ctxs(log_root_tree, index2, ret); in btrfs_sync_log()
3204 log_root_tree->log_transid_committed++; in btrfs_sync_log()
3205 atomic_set(&log_root_tree->log_commit[index2], 0); in btrfs_sync_log()
3206 mutex_unlock(&log_root_tree->log_mutex); in btrfs_sync_log()
3213 cond_wake_up(&log_root_tree->log_commit_wait[index2]); in btrfs_sync_log()
3295 if (fs_info->log_root_tree) { in btrfs_free_log_root_tree()
3296 free_log_tree(trans, fs_info->log_root_tree); in btrfs_free_log_root_tree()
3297 fs_info->log_root_tree = NULL; in btrfs_free_log_root_tree()
7213 int btrfs_recover_log_trees(struct btrfs_root *log_root_tree) in btrfs_recover_log_trees() argument
7221 struct btrfs_fs_info *fs_info = log_root_tree->fs_info; in btrfs_recover_log_trees()
7242 ret = walk_log_tree(trans, log_root_tree, &wc); in btrfs_recover_log_trees()
7254 ret = btrfs_search_slot(NULL, log_root_tree, &key, path, 0, 0); in btrfs_recover_log_trees()
7271 log = btrfs_read_tree_root(log_root_tree, &found_key); in btrfs_recover_log_trees()
7370 log_root_tree->log_root = NULL; in btrfs_recover_log_trees()
7372 btrfs_put_root(log_root_tree); in btrfs_recover_log_trees()