Lines Matching refs:slots
83 * be enough slots to hold all possible variants
99 * @slots: pointer to the structure holding buddy slots
113 struct z3fold_buddy_slots *slots;
197 struct z3fold_buddy_slots *slots = kmem_cache_zalloc(pool->c_handle,
200 if (slots) {
202 kmemleak_not_leak(slots);
203 slots->pool = (unsigned long)pool;
204 rwlock_init(&slots->lock);
207 return slots;
241 struct z3fold_buddy_slots *slots;
246 slots = handle_to_slots(handle);
250 read_lock(&slots->lock);
254 read_unlock(&slots->lock);
281 struct z3fold_buddy_slots *slots;
288 slots = handle_to_slots(handle);
289 write_lock(&slots->lock);
292 if (test_bit(HANDLES_NOFREE, &slots->pool)) {
293 write_unlock(&slots->lock);
297 if (zhdr->slots != slots)
302 if (slots->slot[i]) {
307 write_unlock(&slots->lock);
310 struct z3fold_pool *pool = slots_to_pool(slots);
312 if (zhdr->slots == slots)
313 zhdr->slots = NULL;
314 kmem_cache_free(pool->c_handle, slots);
323 struct z3fold_buddy_slots *slots;
334 slots = alloc_slots(pool, gfp);
335 if (!slots)
342 zhdr->slots = slots;
371 struct z3fold_buddy_slots *slots,
390 write_lock(&slots->lock);
391 slots->slot[idx] = h;
392 write_unlock(&slots->lock);
393 return (unsigned long)&slots->slot[idx];
398 return __encode_handle(zhdr, zhdr->slots, bud);
404 struct z3fold_buddy_slots *slots = handle_to_slots(handle);
407 read_lock(&slots->lock);
409 read_unlock(&slots->lock);
421 struct z3fold_buddy_slots *slots = handle_to_slots(handle);
424 read_lock(&slots->lock);
427 read_unlock(&slots->lock);
607 * No need to protect slots here -- all the slots are "local" and
610 if (zhdr->first_chunks && zhdr->slots->slot[first_idx]) {
613 old_handle = (unsigned long)&zhdr->slots->slot[first_idx];
615 } else if (zhdr->middle_chunks && zhdr->slots->slot[middle_idx]) {
618 old_handle = (unsigned long)&zhdr->slots->slot[middle_idx];
620 } else if (zhdr->last_chunks && zhdr->slots->slot[last_idx]) {
623 old_handle = (unsigned long)&zhdr->slots->slot[last_idx];
661 write_lock(&zhdr->slots->lock);
667 write_unlock(&zhdr->slots->lock);
881 if (zhdr && !zhdr->slots) {
882 zhdr->slots = alloc_slots(pool, GFP_ATOMIC);
883 if (!zhdr->slots)