Lines Matching refs:slots

113 	struct z3fold_buddy_slots *slots;  member
204 struct z3fold_buddy_slots *slots = kmem_cache_zalloc(pool->c_handle, in alloc_slots() local
207 if (slots) { in alloc_slots()
209 kmemleak_not_leak(slots); in alloc_slots()
210 slots->pool = (unsigned long)pool; in alloc_slots()
211 rwlock_init(&slots->lock); in alloc_slots()
214 return slots; in alloc_slots()
248 struct z3fold_buddy_slots *slots; in get_z3fold_header() local
253 slots = handle_to_slots(handle); in get_z3fold_header()
257 read_lock(&slots->lock); in get_z3fold_header()
261 read_unlock(&slots->lock); in get_z3fold_header()
288 struct z3fold_buddy_slots *slots; in free_handle() local
295 slots = handle_to_slots(handle); in free_handle()
296 write_lock(&slots->lock); in free_handle()
299 if (test_bit(HANDLES_NOFREE, &slots->pool)) { in free_handle()
300 write_unlock(&slots->lock); in free_handle()
304 if (zhdr->slots != slots) in free_handle()
309 if (slots->slot[i]) { in free_handle()
314 write_unlock(&slots->lock); in free_handle()
317 struct z3fold_pool *pool = slots_to_pool(slots); in free_handle()
319 if (zhdr->slots == slots) in free_handle()
320 zhdr->slots = NULL; in free_handle()
321 kmem_cache_free(pool->c_handle, slots); in free_handle()
330 struct z3fold_buddy_slots *slots; in init_z3fold_page() local
342 slots = alloc_slots(pool, gfp); in init_z3fold_page()
343 if (!slots) in init_z3fold_page()
350 zhdr->slots = slots; in init_z3fold_page()
379 struct z3fold_buddy_slots *slots, in __encode_handle() argument
398 write_lock(&slots->lock); in __encode_handle()
399 slots->slot[idx] = h; in __encode_handle()
400 write_unlock(&slots->lock); in __encode_handle()
401 return (unsigned long)&slots->slot[idx]; in __encode_handle()
406 return __encode_handle(zhdr, zhdr->slots, bud); in encode_handle()
412 struct z3fold_buddy_slots *slots = handle_to_slots(handle); in handle_to_chunks() local
415 read_lock(&slots->lock); in handle_to_chunks()
417 read_unlock(&slots->lock); in handle_to_chunks()
429 struct z3fold_buddy_slots *slots = handle_to_slots(handle); in handle_to_buddy() local
432 read_lock(&slots->lock); in handle_to_buddy()
435 read_unlock(&slots->lock); in handle_to_buddy()
610 if (zhdr->first_chunks && zhdr->slots->slot[first_idx]) { in compact_single_buddy()
613 old_handle = (unsigned long)&zhdr->slots->slot[first_idx]; in compact_single_buddy()
615 } else if (zhdr->middle_chunks && zhdr->slots->slot[middle_idx]) { in compact_single_buddy()
618 old_handle = (unsigned long)&zhdr->slots->slot[middle_idx]; in compact_single_buddy()
620 } else if (zhdr->last_chunks && zhdr->slots->slot[last_idx]) { in compact_single_buddy()
623 old_handle = (unsigned long)&zhdr->slots->slot[last_idx]; in compact_single_buddy()
661 write_lock(&zhdr->slots->lock); in compact_single_buddy()
667 write_unlock(&zhdr->slots->lock); in compact_single_buddy()
881 if (zhdr && !zhdr->slots) { in __z3fold_alloc()
882 zhdr->slots = alloc_slots(pool, GFP_ATOMIC); in __z3fold_alloc()
883 if (!zhdr->slots) in __z3fold_alloc()
1218 struct z3fold_buddy_slots slots __attribute__((aligned(SLOTS_ALIGN))); in z3fold_reclaim_page() local
1220 rwlock_init(&slots.lock); in z3fold_reclaim_page()
1221 slots.pool = (unsigned long)pool | (1 << HANDLES_NOFREE); in z3fold_reclaim_page()
1288 memset(slots.slot, 0, sizeof(slots.slot)); in z3fold_reclaim_page()
1290 first_handle = __encode_handle(zhdr, &slots, in z3fold_reclaim_page()
1293 middle_handle = __encode_handle(zhdr, &slots, in z3fold_reclaim_page()
1296 last_handle = __encode_handle(zhdr, &slots, in z3fold_reclaim_page()
1335 struct z3fold_buddy_slots *slots = zhdr->slots; in z3fold_reclaim_page() local
1339 kmem_cache_free(pool->c_handle, slots); in z3fold_reclaim_page()