Lines Matching refs:slot

77 	unsigned int slot;  in blk_crypto_profile_init()  local
106 for (slot = 0; slot < num_slots; slot++) { in blk_crypto_profile_init()
107 profile->slots[slot].profile = profile; in blk_crypto_profile_init()
108 list_add_tail(&profile->slots[slot].idle_slot_node, in blk_crypto_profile_init()
179 blk_crypto_remove_slot_from_lru_list(struct blk_crypto_keyslot *slot) in blk_crypto_remove_slot_from_lru_list() argument
181 struct blk_crypto_profile *profile = slot->profile; in blk_crypto_remove_slot_from_lru_list()
185 list_del(&slot->idle_slot_node); in blk_crypto_remove_slot_from_lru_list()
208 struct blk_crypto_keyslot *slot; in blk_crypto_find_and_grab_keyslot() local
210 slot = blk_crypto_find_keyslot(profile, key); in blk_crypto_find_and_grab_keyslot()
211 if (!slot) in blk_crypto_find_and_grab_keyslot()
213 if (atomic_inc_return(&slot->slot_refs) == 1) { in blk_crypto_find_and_grab_keyslot()
215 blk_crypto_remove_slot_from_lru_list(slot); in blk_crypto_find_and_grab_keyslot()
217 return slot; in blk_crypto_find_and_grab_keyslot()
226 unsigned int blk_crypto_keyslot_index(struct blk_crypto_keyslot *slot) in blk_crypto_keyslot_index() argument
228 return slot - slot->profile->slots; in blk_crypto_keyslot_index()
252 struct blk_crypto_keyslot *slot; in blk_crypto_get_keyslot() local
266 slot = blk_crypto_find_and_grab_keyslot(profile, key); in blk_crypto_get_keyslot()
268 if (slot) in blk_crypto_get_keyslot()
273 slot = blk_crypto_find_and_grab_keyslot(profile, key); in blk_crypto_get_keyslot()
274 if (slot) { in blk_crypto_get_keyslot()
291 slot = list_first_entry(&profile->idle_slots, struct blk_crypto_keyslot, in blk_crypto_get_keyslot()
293 slot_idx = blk_crypto_keyslot_index(slot); in blk_crypto_get_keyslot()
303 if (slot->key) in blk_crypto_get_keyslot()
304 hlist_del(&slot->hash_node); in blk_crypto_get_keyslot()
305 slot->key = key; in blk_crypto_get_keyslot()
306 hlist_add_head(&slot->hash_node, in blk_crypto_get_keyslot()
309 atomic_set(&slot->slot_refs, 1); in blk_crypto_get_keyslot()
311 blk_crypto_remove_slot_from_lru_list(slot); in blk_crypto_get_keyslot()
315 *slot_ptr = slot; in blk_crypto_get_keyslot()
325 void blk_crypto_put_keyslot(struct blk_crypto_keyslot *slot) in blk_crypto_put_keyslot() argument
327 struct blk_crypto_profile *profile = slot->profile; in blk_crypto_put_keyslot()
330 if (atomic_dec_and_lock_irqsave(&slot->slot_refs, in blk_crypto_put_keyslot()
332 list_add_tail(&slot->idle_slot_node, &profile->idle_slots); in blk_crypto_put_keyslot()
366 struct blk_crypto_keyslot *slot; in __blk_crypto_evict_key() local
380 slot = blk_crypto_find_keyslot(profile, key); in __blk_crypto_evict_key()
381 if (!slot) { in __blk_crypto_evict_key()
390 if (WARN_ON_ONCE(atomic_read(&slot->slot_refs) != 0)) { in __blk_crypto_evict_key()
396 blk_crypto_keyslot_index(slot)); in __blk_crypto_evict_key()
402 hlist_del(&slot->hash_node); in __blk_crypto_evict_key()
403 slot->key = NULL; in __blk_crypto_evict_key()
420 unsigned int slot; in blk_crypto_reprogram_all_keys() local
427 for (slot = 0; slot < profile->num_slots; slot++) { in blk_crypto_reprogram_all_keys()
428 const struct blk_crypto_key *key = profile->slots[slot].key; in blk_crypto_reprogram_all_keys()
434 err = profile->ll_ops.keyslot_program(profile, key, slot); in blk_crypto_reprogram_all_keys()