Lines Matching refs:index

118 		int              index,  in ba_alloc_helper()  argument
122 int loc = ba_ffs(storage[index]); in ba_alloc_helper()
135 index * 32 + loc, in ba_alloc_helper()
138 r = index * 32 + loc; in ba_alloc_helper()
144 storage[index] &= ~(1 << loc); in ba_alloc_helper()
145 *clear = (storage[index] == 0); in ba_alloc_helper()
191 int index, in ba_alloc_reverse_helper() argument
195 int loc = ba_fls(storage[index]); in ba_alloc_reverse_helper()
208 index * 32 + loc, in ba_alloc_reverse_helper()
211 r = index * 32 + loc; in ba_alloc_reverse_helper()
217 storage[index] &= ~(1 << loc); in ba_alloc_reverse_helper()
218 *clear = (storage[index] == 0); in ba_alloc_reverse_helper()
237 int *index, in ba_alloc_index_helper() argument
249 index, in ba_alloc_index_helper()
254 loc = (*index % 32); in ba_alloc_index_helper()
255 *index = *index / 32; in ba_alloc_index_helper()
258 r = (storage[*index] & (1 << loc)) ? 0 : -1; in ba_alloc_index_helper()
266 storage[*index] &= ~(1 << loc); in ba_alloc_index_helper()
267 *clear = (storage[*index] == 0); in ba_alloc_index_helper()
274 ba_alloc_index(struct bitalloc *pool, int index) in ba_alloc_index() argument
277 int index_copy = index; in ba_alloc_index()
279 if (index < 0 || index >= (int)pool->size) in ba_alloc_index()
283 return index; in ba_alloc_index()
293 int *index) in ba_inuse_helper() argument
304 index); in ba_inuse_helper()
308 loc = (*index % 32); in ba_inuse_helper()
309 *index = *index / 32; in ba_inuse_helper()
312 r = (storage[*index] & (1 << loc)) ? -1 : 0; in ba_inuse_helper()
318 ba_inuse(struct bitalloc *pool, int index) in ba_inuse() argument
320 if (index < 0 || index >= (int)pool->size) in ba_inuse()
323 return ba_inuse_helper(pool, 0, 1, 32, &index) == 0; in ba_inuse()
331 int *index) in ba_free_helper() argument
342 index); in ba_free_helper()
346 loc = (*index % 32); in ba_free_helper()
347 *index = *index / 32; in ba_free_helper()
350 r = (storage[*index] & (1 << loc)) ? -1 : 0; in ba_free_helper()
356 storage[*index] |= (1 << loc); in ba_free_helper()
362 ba_free(struct bitalloc *pool, int index) in ba_free() argument
364 if (index < 0 || index >= (int)pool->size) in ba_free()
367 return ba_free_helper(pool, 0, 1, 32, &index); in ba_free()
371 ba_inuse_free(struct bitalloc *pool, int index) in ba_inuse_free() argument
373 if (index < 0 || index >= (int)pool->size) in ba_inuse_free()
376 return ba_free_helper(pool, 0, 1, 32, &index) + 1; in ba_inuse_free()
395 int *index, in ba_find_next_helper() argument
406 index, in ba_find_next_helper()
411 loc = (*index % 32); in ba_find_next_helper()
412 *index = *index / 32; in ba_find_next_helper()
415 int bit_index = *index * 32; in ba_find_next_helper()
417 loc = ba_ffs(~storage[*index] & ((bitalloc_word_t)-1 << loc)); in ba_find_next_helper()
427 *index = *index + 1; in ba_find_next_helper()
429 loc = ba_ffs(~storage[*index]); in ba_find_next_helper()
439 *index = *index + 1; in ba_find_next_helper()
447 storage[*index] |= (1 << loc); in ba_find_next_helper()
454 ba_find_next_inuse(struct bitalloc *pool, int index) in ba_find_next_inuse() argument
456 if (index < 0 || in ba_find_next_inuse()
457 index >= (int)pool->size || in ba_find_next_inuse()
461 return ba_find_next_helper(pool, 0, 1, 32, &index, 0); in ba_find_next_inuse()
465 ba_find_next_inuse_free(struct bitalloc *pool, int index) in ba_find_next_inuse_free() argument
467 if (index < 0 || in ba_find_next_inuse_free()
468 index >= (int)pool->size || in ba_find_next_inuse_free()
472 return ba_find_next_helper(pool, 0, 1, 32, &index, 1); in ba_find_next_inuse_free()