Lines Matching refs:check_state
1914 struct btree_check_state *check_state = info->state; in bch_btree_check_thread() local
1915 struct cache_set *c = check_state->c; in bch_btree_check_thread()
1936 spin_lock(&check_state->idx_lock); in bch_btree_check_thread()
1937 cur_idx = check_state->key_idx; in bch_btree_check_thread()
1938 check_state->key_idx++; in bch_btree_check_thread()
1939 spin_unlock(&check_state->idx_lock); in bch_btree_check_thread()
1955 atomic_set(&check_state->enough, 1); in bch_btree_check_thread()
1983 if (atomic_dec_and_test(&check_state->started)) in bch_btree_check_thread()
1984 wake_up(&check_state->wait); in bch_btree_check_thread()
2009 struct btree_check_state check_state; in bch_btree_check() local
2020 memset(&check_state, 0, sizeof(struct btree_check_state)); in bch_btree_check()
2021 check_state.c = c; in bch_btree_check()
2022 check_state.total_threads = bch_btree_chkthread_nr(); in bch_btree_check()
2023 check_state.key_idx = 0; in bch_btree_check()
2024 spin_lock_init(&check_state.idx_lock); in bch_btree_check()
2025 atomic_set(&check_state.started, 0); in bch_btree_check()
2026 atomic_set(&check_state.enough, 0); in bch_btree_check()
2027 init_waitqueue_head(&check_state.wait); in bch_btree_check()
2036 for (i = 0; i < check_state.total_threads; i++) { in bch_btree_check()
2039 if (atomic_read(&check_state.enough)) in bch_btree_check()
2042 check_state.infos[i].result = 0; in bch_btree_check()
2043 check_state.infos[i].state = &check_state; in bch_btree_check()
2045 check_state.infos[i].thread = in bch_btree_check()
2047 &check_state.infos[i], in bch_btree_check()
2049 if (IS_ERR(check_state.infos[i].thread)) { in bch_btree_check()
2052 kthread_stop(check_state.infos[i].thread); in bch_btree_check()
2056 atomic_inc(&check_state.started); in bch_btree_check()
2062 wait_event(check_state.wait, atomic_read(&check_state.started) == 0); in bch_btree_check()
2064 for (i = 0; i < check_state.total_threads; i++) { in bch_btree_check()
2065 if (check_state.infos[i].result) { in bch_btree_check()
2066 ret = check_state.infos[i].result; in bch_btree_check()