Lines Matching full:slots
90 * be enough slots to hold all possible variants
106 * @slots: pointer to the structure holding buddy slots
120 struct z3fold_buddy_slots *slots; member
215 struct z3fold_buddy_slots *slots; in alloc_slots() local
217 slots = kmem_cache_zalloc(pool->c_handle, in alloc_slots()
220 if (slots) { in alloc_slots()
222 kmemleak_not_leak(slots); in alloc_slots()
223 slots->pool = (unsigned long)pool; in alloc_slots()
224 rwlock_init(&slots->lock); in alloc_slots()
227 return slots; in alloc_slots()
261 struct z3fold_buddy_slots *slots; in get_z3fold_header() local
266 slots = handle_to_slots(handle); in get_z3fold_header()
270 read_lock(&slots->lock); in get_z3fold_header()
274 read_unlock(&slots->lock); in get_z3fold_header()
296 struct z3fold_buddy_slots *slots; in free_handle() local
306 slots = handle_to_slots(handle); in free_handle()
307 write_lock(&slots->lock); in free_handle()
310 if (test_bit(HANDLES_NOFREE, &slots->pool)) { in free_handle()
311 write_unlock(&slots->lock); in free_handle()
315 if (zhdr->slots != slots) in free_handle()
320 if (slots->slot[i]) { in free_handle()
325 write_unlock(&slots->lock); in free_handle()
328 struct z3fold_pool *pool = slots_to_pool(slots); in free_handle()
330 if (zhdr->slots == slots) in free_handle()
331 zhdr->slots = NULL; in free_handle()
332 kmem_cache_free(pool->c_handle, slots); in free_handle()
389 struct z3fold_buddy_slots *slots; in init_z3fold_page() local
400 slots = alloc_slots(pool, gfp); in init_z3fold_page()
401 if (!slots) in init_z3fold_page()
408 zhdr->slots = slots; in init_z3fold_page()
438 struct z3fold_buddy_slots *slots, in __encode_handle() argument
457 write_lock(&slots->lock); in __encode_handle()
458 slots->slot[idx] = h; in __encode_handle()
459 write_unlock(&slots->lock); in __encode_handle()
460 return (unsigned long)&slots->slot[idx]; in __encode_handle()
465 return __encode_handle(zhdr, zhdr->slots, bud); in encode_handle()
471 struct z3fold_buddy_slots *slots = handle_to_slots(handle); in handle_to_chunks() local
474 read_lock(&slots->lock); in handle_to_chunks()
476 read_unlock(&slots->lock); in handle_to_chunks()
488 struct z3fold_buddy_slots *slots = handle_to_slots(handle); in handle_to_buddy() local
491 read_lock(&slots->lock); in handle_to_buddy()
494 read_unlock(&slots->lock); in handle_to_buddy()
671 * No need to protect slots here -- all the slots are "local" and in compact_single_buddy()
674 if (zhdr->first_chunks && zhdr->slots->slot[first_idx]) { in compact_single_buddy()
677 old_handle = (unsigned long)&zhdr->slots->slot[first_idx]; in compact_single_buddy()
679 } else if (zhdr->middle_chunks && zhdr->slots->slot[middle_idx]) { in compact_single_buddy()
682 old_handle = (unsigned long)&zhdr->slots->slot[middle_idx]; in compact_single_buddy()
684 } else if (zhdr->last_chunks && zhdr->slots->slot[last_idx]) { in compact_single_buddy()
687 old_handle = (unsigned long)&zhdr->slots->slot[last_idx]; in compact_single_buddy()
725 write_lock(&zhdr->slots->lock); in compact_single_buddy()
731 write_unlock(&zhdr->slots->lock); in compact_single_buddy()
954 if (zhdr && !zhdr->slots) in __z3fold_alloc()
955 zhdr->slots = alloc_slots(pool, in __z3fold_alloc()
1320 struct z3fold_buddy_slots slots __attribute__((aligned(SLOTS_ALIGN))); in z3fold_reclaim_page() local
1322 rwlock_init(&slots.lock); in z3fold_reclaim_page()
1323 slots.pool = (unsigned long)pool | (1 << HANDLES_NOFREE); in z3fold_reclaim_page()
1396 * use our local slots structure because z3fold_free in z3fold_reclaim_page()
1397 * can zero out zhdr->slots and we can't do much in z3fold_reclaim_page()
1403 memset(slots.slot, 0, sizeof(slots.slot)); in z3fold_reclaim_page()
1405 first_handle = __encode_handle(zhdr, &slots, in z3fold_reclaim_page()
1408 middle_handle = __encode_handle(zhdr, &slots, in z3fold_reclaim_page()
1411 last_handle = __encode_handle(zhdr, &slots, in z3fold_reclaim_page()
1450 struct z3fold_buddy_slots *slots = zhdr->slots; in z3fold_reclaim_page() local
1454 kmem_cache_free(pool->c_handle, slots); in z3fold_reclaim_page()