Lines Matching refs:log_root_tree

160 		if (!fs_info->log_root_tree)  in start_log_trans()
2920 ret = btrfs_insert_root(trans, fs_info->log_root_tree, in update_log_root()
2923 ret = btrfs_update_root(trans, fs_info->log_root_tree, in update_log_root()
3021 struct btrfs_root *log_root_tree = fs_info->log_root_tree; in btrfs_sync_log() local
3114 mutex_lock(&log_root_tree->log_mutex); in btrfs_sync_log()
3116 index2 = log_root_tree->log_transid % 2; in btrfs_sync_log()
3117 list_add_tail(&root_log_ctx.list, &log_root_tree->log_ctxs[index2]); in btrfs_sync_log()
3118 root_log_ctx.log_transid = log_root_tree->log_transid; in btrfs_sync_log()
3135 mutex_unlock(&log_root_tree->log_mutex); in btrfs_sync_log()
3139 mutex_unlock(&log_root_tree->log_mutex); in btrfs_sync_log()
3144 if (log_root_tree->log_transid_committed >= root_log_ctx.log_transid) { in btrfs_sync_log()
3147 mutex_unlock(&log_root_tree->log_mutex); in btrfs_sync_log()
3153 if (atomic_read(&log_root_tree->log_commit[index2])) { in btrfs_sync_log()
3156 wait_log_commit(log_root_tree, in btrfs_sync_log()
3158 mutex_unlock(&log_root_tree->log_mutex); in btrfs_sync_log()
3163 ASSERT(root_log_ctx.log_transid == log_root_tree->log_transid); in btrfs_sync_log()
3164 atomic_set(&log_root_tree->log_commit[index2], 1); in btrfs_sync_log()
3166 if (atomic_read(&log_root_tree->log_commit[(index2 + 1) % 2])) { in btrfs_sync_log()
3167 wait_log_commit(log_root_tree, in btrfs_sync_log()
3178 mutex_unlock(&log_root_tree->log_mutex); in btrfs_sync_log()
3184 &log_root_tree->dirty_log_pages, in btrfs_sync_log()
3190 mutex_unlock(&log_root_tree->log_mutex); in btrfs_sync_log()
3195 ret = btrfs_wait_tree_log_extents(log_root_tree, in btrfs_sync_log()
3199 mutex_unlock(&log_root_tree->log_mutex); in btrfs_sync_log()
3204 log_root_tree->node->start); in btrfs_sync_log()
3206 btrfs_header_level(log_root_tree->node)); in btrfs_sync_log()
3208 log_root_tree->log_transid++; in btrfs_sync_log()
3209 mutex_unlock(&log_root_tree->log_mutex); in btrfs_sync_log()
3231 mutex_lock(&log_root_tree->log_mutex); in btrfs_sync_log()
3232 btrfs_remove_all_log_ctxs(log_root_tree, index2, ret); in btrfs_sync_log()
3234 log_root_tree->log_transid_committed++; in btrfs_sync_log()
3235 atomic_set(&log_root_tree->log_commit[index2], 0); in btrfs_sync_log()
3236 mutex_unlock(&log_root_tree->log_mutex); in btrfs_sync_log()
3243 cond_wake_up(&log_root_tree->log_commit_wait[index2]); in btrfs_sync_log()
3300 if (fs_info->log_root_tree) { in btrfs_free_log_root_tree()
3301 free_log_tree(trans, fs_info->log_root_tree); in btrfs_free_log_root_tree()
3302 fs_info->log_root_tree = NULL; in btrfs_free_log_root_tree()
6179 int btrfs_recover_log_trees(struct btrfs_root *log_root_tree) in btrfs_recover_log_trees() argument
6187 struct btrfs_fs_info *fs_info = log_root_tree->fs_info; in btrfs_recover_log_trees()
6208 ret = walk_log_tree(trans, log_root_tree, &wc); in btrfs_recover_log_trees()
6221 ret = btrfs_search_slot(NULL, log_root_tree, &key, path, 0, 0); in btrfs_recover_log_trees()
6239 log = btrfs_read_tree_root(log_root_tree, &found_key); in btrfs_recover_log_trees()
6335 log_root_tree->log_root = NULL; in btrfs_recover_log_trees()
6337 btrfs_put_root(log_root_tree); in btrfs_recover_log_trees()