Lines Matching refs:check_state
1937 struct btree_check_state *check_state = info->state; in bch_btree_check_thread() local
1938 struct cache_set *c = check_state->c; in bch_btree_check_thread()
1959 spin_lock(&check_state->idx_lock); in bch_btree_check_thread()
1960 cur_idx = check_state->key_idx; in bch_btree_check_thread()
1961 check_state->key_idx++; in bch_btree_check_thread()
1962 spin_unlock(&check_state->idx_lock); in bch_btree_check_thread()
1978 atomic_set(&check_state->enough, 1); in bch_btree_check_thread()
2015 if (atomic_dec_and_test(&check_state->started)) in bch_btree_check_thread()
2016 wake_up(&check_state->wait); in bch_btree_check_thread()
2041 struct btree_check_state check_state; in bch_btree_check() local
2052 memset(&check_state, 0, sizeof(struct btree_check_state)); in bch_btree_check()
2053 check_state.c = c; in bch_btree_check()
2054 check_state.total_threads = bch_btree_chkthread_nr(); in bch_btree_check()
2055 check_state.key_idx = 0; in bch_btree_check()
2056 spin_lock_init(&check_state.idx_lock); in bch_btree_check()
2057 atomic_set(&check_state.started, 0); in bch_btree_check()
2058 atomic_set(&check_state.enough, 0); in bch_btree_check()
2059 init_waitqueue_head(&check_state.wait); in bch_btree_check()
2068 for (i = 0; i < check_state.total_threads; i++) { in bch_btree_check()
2071 if (atomic_read(&check_state.enough)) in bch_btree_check()
2074 check_state.infos[i].result = 0; in bch_btree_check()
2075 check_state.infos[i].state = &check_state; in bch_btree_check()
2077 check_state.infos[i].thread = in bch_btree_check()
2079 &check_state.infos[i], in bch_btree_check()
2081 if (IS_ERR(check_state.infos[i].thread)) { in bch_btree_check()
2084 kthread_stop(check_state.infos[i].thread); in bch_btree_check()
2088 atomic_inc(&check_state.started); in bch_btree_check()
2094 wait_event(check_state.wait, atomic_read(&check_state.started) == 0); in bch_btree_check()
2096 for (i = 0; i < check_state.total_threads; i++) { in bch_btree_check()
2097 if (check_state.infos[i].result) { in bch_btree_check()
2098 ret = check_state.infos[i].result; in bch_btree_check()