Lines Matching refs:slots

120 	struct z3fold_buddy_slots *slots;  member
213 struct z3fold_buddy_slots *slots; in alloc_slots() local
215 slots = kmem_cache_zalloc(pool->c_handle, in alloc_slots()
218 if (slots) { in alloc_slots()
220 kmemleak_not_leak(slots); in alloc_slots()
221 slots->pool = (unsigned long)pool; in alloc_slots()
222 rwlock_init(&slots->lock); in alloc_slots()
225 return slots; in alloc_slots()
260 struct z3fold_buddy_slots *slots; in __get_z3fold_header() local
265 slots = handle_to_slots(handle); in __get_z3fold_header()
269 read_lock(&slots->lock); in __get_z3fold_header()
274 read_unlock(&slots->lock); in __get_z3fold_header()
308 struct z3fold_buddy_slots *slots; in free_handle() local
320 slots = handle_to_slots(handle); in free_handle()
321 write_lock(&slots->lock); in free_handle()
323 if (zhdr->slots == slots) { in free_handle()
324 write_unlock(&slots->lock); in free_handle()
331 if (!test_bit(HANDLES_ORPHANED, &slots->pool)) { in free_handle()
332 write_unlock(&slots->lock); in free_handle()
336 if (slots->slot[i]) { in free_handle()
341 write_unlock(&slots->lock); in free_handle()
344 struct z3fold_pool *pool = slots_to_pool(slots); in free_handle()
346 kmem_cache_free(pool->c_handle, slots); in free_handle()
403 struct z3fold_buddy_slots *slots; in init_z3fold_page() local
414 slots = alloc_slots(pool, gfp); in init_z3fold_page()
415 if (!slots) in init_z3fold_page()
428 zhdr->slots = slots; in init_z3fold_page()
458 struct z3fold_buddy_slots *slots, in __encode_handle() argument
477 write_lock(&slots->lock); in __encode_handle()
478 slots->slot[idx] = h; in __encode_handle()
479 write_unlock(&slots->lock); in __encode_handle()
480 return (unsigned long)&slots->slot[idx]; in __encode_handle()
485 return __encode_handle(zhdr, zhdr->slots, bud); in encode_handle()
491 struct z3fold_buddy_slots *slots = handle_to_slots(handle); in handle_to_chunks() local
494 read_lock(&slots->lock); in handle_to_chunks()
496 read_unlock(&slots->lock); in handle_to_chunks()
508 struct z3fold_buddy_slots *slots = handle_to_slots(handle); in handle_to_buddy() local
511 read_lock(&slots->lock); in handle_to_buddy()
514 read_unlock(&slots->lock); in handle_to_buddy()
540 read_lock(&zhdr->slots->lock); in __release_z3fold_page()
542 if (zhdr->slots->slot[i]) { in __release_z3fold_page()
548 set_bit(HANDLES_ORPHANED, &zhdr->slots->pool); in __release_z3fold_page()
549 read_unlock(&zhdr->slots->lock); in __release_z3fold_page()
552 kmem_cache_free(pool->c_handle, zhdr->slots); in __release_z3fold_page()
688 if (zhdr->first_chunks && zhdr->slots->slot[first_idx]) { in compact_single_buddy()
691 old_handle = (unsigned long)&zhdr->slots->slot[first_idx]; in compact_single_buddy()
693 } else if (zhdr->middle_chunks && zhdr->slots->slot[middle_idx]) { in compact_single_buddy()
696 old_handle = (unsigned long)&zhdr->slots->slot[middle_idx]; in compact_single_buddy()
698 } else if (zhdr->last_chunks && zhdr->slots->slot[last_idx]) { in compact_single_buddy()
701 old_handle = (unsigned long)&zhdr->slots->slot[last_idx]; in compact_single_buddy()
750 write_lock(&zhdr->slots->lock); in compact_single_buddy()
756 write_unlock(&zhdr->slots->lock); in compact_single_buddy()