• Home
  • Raw
  • Download

Lines Matching refs:slot

76 	unsigned int slot;  in blk_crypto_profile_init()  local
109 for (slot = 0; slot < num_slots; slot++) { in blk_crypto_profile_init()
110 profile->slots[slot].profile = profile; in blk_crypto_profile_init()
111 list_add_tail(&profile->slots[slot].idle_slot_node, in blk_crypto_profile_init()
182 blk_crypto_remove_slot_from_lru_list(struct blk_crypto_keyslot *slot) in blk_crypto_remove_slot_from_lru_list() argument
184 struct blk_crypto_profile *profile = slot->profile; in blk_crypto_remove_slot_from_lru_list()
188 list_del(&slot->idle_slot_node); in blk_crypto_remove_slot_from_lru_list()
211 struct blk_crypto_keyslot *slot; in blk_crypto_find_and_grab_keyslot() local
213 slot = blk_crypto_find_keyslot(profile, key); in blk_crypto_find_and_grab_keyslot()
214 if (!slot) in blk_crypto_find_and_grab_keyslot()
216 if (atomic_inc_return(&slot->slot_refs) == 1) { in blk_crypto_find_and_grab_keyslot()
218 blk_crypto_remove_slot_from_lru_list(slot); in blk_crypto_find_and_grab_keyslot()
220 return slot; in blk_crypto_find_and_grab_keyslot()
229 unsigned int blk_crypto_keyslot_index(struct blk_crypto_keyslot *slot) in blk_crypto_keyslot_index() argument
231 return slot - slot->profile->slots; in blk_crypto_keyslot_index()
256 struct blk_crypto_keyslot *slot; in blk_crypto_get_keyslot() local
270 slot = blk_crypto_find_and_grab_keyslot(profile, key); in blk_crypto_get_keyslot()
272 if (slot) in blk_crypto_get_keyslot()
277 slot = blk_crypto_find_and_grab_keyslot(profile, key); in blk_crypto_get_keyslot()
278 if (slot) { in blk_crypto_get_keyslot()
295 slot = list_first_entry(&profile->idle_slots, struct blk_crypto_keyslot, in blk_crypto_get_keyslot()
297 slot_idx = blk_crypto_keyslot_index(slot); in blk_crypto_get_keyslot()
307 if (slot->key) in blk_crypto_get_keyslot()
308 hlist_del(&slot->hash_node); in blk_crypto_get_keyslot()
309 slot->key = key; in blk_crypto_get_keyslot()
310 hlist_add_head(&slot->hash_node, in blk_crypto_get_keyslot()
313 atomic_set(&slot->slot_refs, 1); in blk_crypto_get_keyslot()
315 blk_crypto_remove_slot_from_lru_list(slot); in blk_crypto_get_keyslot()
319 *slot_ptr = slot; in blk_crypto_get_keyslot()
329 void blk_crypto_put_keyslot(struct blk_crypto_keyslot *slot) in blk_crypto_put_keyslot() argument
334 if (!slot) in blk_crypto_put_keyslot()
337 profile = slot->profile; in blk_crypto_put_keyslot()
339 if (atomic_dec_and_lock_irqsave(&slot->slot_refs, in blk_crypto_put_keyslot()
341 list_add_tail(&slot->idle_slot_node, &profile->idle_slots); in blk_crypto_put_keyslot()
377 struct blk_crypto_keyslot *slot; in __blk_crypto_evict_key() local
391 slot = blk_crypto_find_keyslot(profile, key); in __blk_crypto_evict_key()
392 if (!slot) { in __blk_crypto_evict_key()
401 if (WARN_ON_ONCE(atomic_read(&slot->slot_refs) != 0)) { in __blk_crypto_evict_key()
407 blk_crypto_keyslot_index(slot)); in __blk_crypto_evict_key()
413 hlist_del(&slot->hash_node); in __blk_crypto_evict_key()
414 slot->key = NULL; in __blk_crypto_evict_key()
431 unsigned int slot; in blk_crypto_reprogram_all_keys() local
438 for (slot = 0; slot < profile->num_slots; slot++) { in blk_crypto_reprogram_all_keys()
439 const struct blk_crypto_key *key = profile->slots[slot].key; in blk_crypto_reprogram_all_keys()
445 err = profile->ll_ops.keyslot_program(profile, key, slot); in blk_crypto_reprogram_all_keys()