Lines Matching refs:log_root_tree
154 if (!fs_info->log_root_tree) in start_log_trans()
2854 ret = btrfs_insert_root(trans, fs_info->log_root_tree, in update_log_root()
2857 ret = btrfs_update_root(trans, fs_info->log_root_tree, in update_log_root()
2955 struct btrfs_root *log_root_tree = fs_info->log_root_tree; in btrfs_sync_log() local
3033 mutex_lock(&log_root_tree->log_mutex); in btrfs_sync_log()
3034 atomic_inc(&log_root_tree->log_batch); in btrfs_sync_log()
3035 atomic_inc(&log_root_tree->log_writers); in btrfs_sync_log()
3037 index2 = log_root_tree->log_transid % 2; in btrfs_sync_log()
3038 list_add_tail(&root_log_ctx.list, &log_root_tree->log_ctxs[index2]); in btrfs_sync_log()
3039 root_log_ctx.log_transid = log_root_tree->log_transid; in btrfs_sync_log()
3041 mutex_unlock(&log_root_tree->log_mutex); in btrfs_sync_log()
3045 mutex_lock(&log_root_tree->log_mutex); in btrfs_sync_log()
3046 if (atomic_dec_and_test(&log_root_tree->log_writers)) { in btrfs_sync_log()
3048 cond_wake_up_nomb(&log_root_tree->log_writer_wait); in btrfs_sync_log()
3060 mutex_unlock(&log_root_tree->log_mutex); in btrfs_sync_log()
3064 mutex_unlock(&log_root_tree->log_mutex); in btrfs_sync_log()
3069 if (log_root_tree->log_transid_committed >= root_log_ctx.log_transid) { in btrfs_sync_log()
3072 mutex_unlock(&log_root_tree->log_mutex); in btrfs_sync_log()
3078 if (atomic_read(&log_root_tree->log_commit[index2])) { in btrfs_sync_log()
3081 wait_log_commit(log_root_tree, in btrfs_sync_log()
3083 mutex_unlock(&log_root_tree->log_mutex); in btrfs_sync_log()
3088 ASSERT(root_log_ctx.log_transid == log_root_tree->log_transid); in btrfs_sync_log()
3089 atomic_set(&log_root_tree->log_commit[index2], 1); in btrfs_sync_log()
3091 if (atomic_read(&log_root_tree->log_commit[(index2 + 1) % 2])) { in btrfs_sync_log()
3092 wait_log_commit(log_root_tree, in btrfs_sync_log()
3096 wait_for_writer(log_root_tree); in btrfs_sync_log()
3105 mutex_unlock(&log_root_tree->log_mutex); in btrfs_sync_log()
3111 &log_root_tree->dirty_log_pages, in btrfs_sync_log()
3117 mutex_unlock(&log_root_tree->log_mutex); in btrfs_sync_log()
3122 ret = btrfs_wait_tree_log_extents(log_root_tree, in btrfs_sync_log()
3126 mutex_unlock(&log_root_tree->log_mutex); in btrfs_sync_log()
3131 log_root_tree->node->start); in btrfs_sync_log()
3133 btrfs_header_level(log_root_tree->node)); in btrfs_sync_log()
3135 log_root_tree->log_transid++; in btrfs_sync_log()
3136 mutex_unlock(&log_root_tree->log_mutex); in btrfs_sync_log()
3158 mutex_lock(&log_root_tree->log_mutex); in btrfs_sync_log()
3159 btrfs_remove_all_log_ctxs(log_root_tree, index2, ret); in btrfs_sync_log()
3161 log_root_tree->log_transid_committed++; in btrfs_sync_log()
3162 atomic_set(&log_root_tree->log_commit[index2], 0); in btrfs_sync_log()
3163 mutex_unlock(&log_root_tree->log_mutex); in btrfs_sync_log()
3170 cond_wake_up(&log_root_tree->log_commit_wait[index2]); in btrfs_sync_log()
3235 if (fs_info->log_root_tree) { in btrfs_free_log_root_tree()
3236 free_log_tree(trans, fs_info->log_root_tree); in btrfs_free_log_root_tree()
3237 fs_info->log_root_tree = NULL; in btrfs_free_log_root_tree()
5784 int btrfs_recover_log_trees(struct btrfs_root *log_root_tree) in btrfs_recover_log_trees() argument
5793 struct btrfs_fs_info *fs_info = log_root_tree->fs_info; in btrfs_recover_log_trees()
5814 ret = walk_log_tree(trans, log_root_tree, &wc); in btrfs_recover_log_trees()
5827 ret = btrfs_search_slot(NULL, log_root_tree, &key, path, 0, 0); in btrfs_recover_log_trees()
5845 log = btrfs_read_fs_root(log_root_tree, &found_key); in btrfs_recover_log_trees()
5928 free_extent_buffer(log_root_tree->node); in btrfs_recover_log_trees()
5929 log_root_tree->log_root = NULL; in btrfs_recover_log_trees()
5931 kfree(log_root_tree); in btrfs_recover_log_trees()