Lines Matching refs:index

14 __simple_checks(struct radix_tree_root *tree, unsigned long index, int tag)  in __simple_checks()  argument
19 item_check_absent(tree, index); in __simple_checks()
20 assert(item_tag_get(tree, index, tag) == 0); in __simple_checks()
22 item_insert(tree, index); in __simple_checks()
23 assert(item_tag_get(tree, index, tag) == 0); in __simple_checks()
24 item_tag_set(tree, index, tag); in __simple_checks()
25 ret = item_tag_get(tree, index, tag); in __simple_checks()
29 ret = item_tag_get(tree, index, !tag); in __simple_checks()
31 ret = item_delete(tree, index); in __simple_checks()
33 item_insert(tree, index); in __simple_checks()
34 ret = item_tag_get(tree, index, tag); in __simple_checks()
36 ret = item_delete(tree, index); in __simple_checks()
38 ret = item_delete(tree, index); in __simple_checks()
44 unsigned long index; in simple_checks() local
47 for (index = 0; index < 10000; index++) { in simple_checks()
48 __simple_checks(&tree, index, 0); in simple_checks()
49 __simple_checks(&tree, index, 1); in simple_checks()
136 unsigned long index = 0; in gang_check() local
140 index, BATCH, tag))) { in gang_check()
146 while (last_index < item->index) { in gang_check()
153 index = items[nr_found - 1]->index + 1; in gang_check()
171 unsigned long index; in do_thrash() local
180 index = rand() % THRASH_SIZE; in do_thrash()
181 if (thrash_state[index] != NODE_ABSENT) in do_thrash()
183 item_check_absent(tree, index); in do_thrash()
184 item_insert(tree, index); in do_thrash()
185 assert(thrash_state[index] != NODE_PRESENT); in do_thrash()
186 thrash_state[index] = NODE_PRESENT; in do_thrash()
192 index = rand() % THRASH_SIZE; in do_thrash()
193 if (thrash_state[index] == NODE_ABSENT) in do_thrash()
195 item_check_present(tree, index); in do_thrash()
196 if (item_tag_get(tree, index, tag)) { in do_thrash()
197 assert(thrash_state[index] == NODE_TAGGED); in do_thrash()
200 assert(thrash_state[index] == NODE_PRESENT); in do_thrash()
202 item_delete(tree, index); in do_thrash()
203 assert(thrash_state[index] != NODE_ABSENT); in do_thrash()
204 thrash_state[index] = NODE_ABSENT; in do_thrash()
210 index = rand() % THRASH_SIZE; in do_thrash()
211 if (thrash_state[index] != NODE_PRESENT) { in do_thrash()
212 if (item_lookup(tree, index)) in do_thrash()
213 assert(item_tag_get(tree, index, tag)); in do_thrash()
216 item_tag_set(tree, index, tag); in do_thrash()
217 item_tag_set(tree, index, tag); in do_thrash()
218 assert(thrash_state[index] != NODE_TAGGED); in do_thrash()
219 thrash_state[index] = NODE_TAGGED; in do_thrash()
225 index = rand() % THRASH_SIZE; in do_thrash()
226 if (thrash_state[index] != NODE_TAGGED) in do_thrash()
228 item_check_present(tree, index); in do_thrash()
229 assert(item_tag_get(tree, index, tag)); in do_thrash()
230 item_tag_clear(tree, index, tag); in do_thrash()
231 item_tag_clear(tree, index, tag); in do_thrash()
232 assert(thrash_state[index] != NODE_PRESENT); in do_thrash()
233 thrash_state[index] = NODE_PRESENT; in do_thrash()
240 for (index = 0; index < THRASH_SIZE; index++) { in do_thrash()
241 switch (thrash_state[index]) { in do_thrash()
243 item_check_absent(tree, index); in do_thrash()
246 item_check_present(tree, index); in do_thrash()
247 assert(!item_tag_get(tree, index, tag)); in do_thrash()
251 item_check_present(tree, index); in do_thrash()
252 assert(item_tag_get(tree, index, tag)); in do_thrash()