• Home
  • Raw
  • Download

Lines Matching refs:slot

83 	unsigned int slot;  in blk_ksm_init()  local
103 for (slot = 0; slot < num_slots; slot++) { in blk_ksm_init()
104 ksm->slots[slot].ksm = ksm; in blk_ksm_init()
105 list_add_tail(&ksm->slots[slot].idle_slot_node, in blk_ksm_init()
171 static void blk_ksm_remove_slot_from_lru_list(struct blk_ksm_keyslot *slot) in blk_ksm_remove_slot_from_lru_list() argument
173 struct blk_keyslot_manager *ksm = slot->ksm; in blk_ksm_remove_slot_from_lru_list()
177 list_del(&slot->idle_slot_node); in blk_ksm_remove_slot_from_lru_list()
199 struct blk_ksm_keyslot *slot; in blk_ksm_find_and_grab_keyslot() local
201 slot = blk_ksm_find_keyslot(ksm, key); in blk_ksm_find_and_grab_keyslot()
202 if (!slot) in blk_ksm_find_and_grab_keyslot()
204 if (atomic_inc_return(&slot->slot_refs) == 1) { in blk_ksm_find_and_grab_keyslot()
206 blk_ksm_remove_slot_from_lru_list(slot); in blk_ksm_find_and_grab_keyslot()
208 return slot; in blk_ksm_find_and_grab_keyslot()
211 unsigned int blk_ksm_get_slot_idx(struct blk_ksm_keyslot *slot) in blk_ksm_get_slot_idx() argument
213 return slot - slot->ksm->slots; in blk_ksm_get_slot_idx()
237 struct blk_ksm_keyslot *slot; in blk_ksm_get_slot_for_key() local
247 slot = blk_ksm_find_and_grab_keyslot(ksm, key); in blk_ksm_get_slot_for_key()
249 if (slot) in blk_ksm_get_slot_for_key()
254 slot = blk_ksm_find_and_grab_keyslot(ksm, key); in blk_ksm_get_slot_for_key()
255 if (slot) { in blk_ksm_get_slot_for_key()
272 slot = list_first_entry(&ksm->idle_slots, struct blk_ksm_keyslot, in blk_ksm_get_slot_for_key()
274 slot_idx = blk_ksm_get_slot_idx(slot); in blk_ksm_get_slot_for_key()
284 if (slot->key) in blk_ksm_get_slot_for_key()
285 hlist_del(&slot->hash_node); in blk_ksm_get_slot_for_key()
286 slot->key = key; in blk_ksm_get_slot_for_key()
287 hlist_add_head(&slot->hash_node, blk_ksm_hash_bucket_for_key(ksm, key)); in blk_ksm_get_slot_for_key()
289 atomic_set(&slot->slot_refs, 1); in blk_ksm_get_slot_for_key()
291 blk_ksm_remove_slot_from_lru_list(slot); in blk_ksm_get_slot_for_key()
295 *slot_ptr = slot; in blk_ksm_get_slot_for_key()
305 void blk_ksm_put_slot(struct blk_ksm_keyslot *slot) in blk_ksm_put_slot() argument
310 if (!slot) in blk_ksm_put_slot()
313 ksm = slot->ksm; in blk_ksm_put_slot()
315 if (atomic_dec_and_lock_irqsave(&slot->slot_refs, in blk_ksm_put_slot()
317 list_add_tail(&slot->idle_slot_node, &ksm->idle_slots); in blk_ksm_put_slot()
354 struct blk_ksm_keyslot *slot; in blk_ksm_evict_key() local
368 slot = blk_ksm_find_keyslot(ksm, key); in blk_ksm_evict_key()
369 if (!slot) { in blk_ksm_evict_key()
378 if (WARN_ON_ONCE(atomic_read(&slot->slot_refs) != 0)) { in blk_ksm_evict_key()
384 blk_ksm_get_slot_idx(slot)); in blk_ksm_evict_key()
390 hlist_del(&slot->hash_node); in blk_ksm_evict_key()
391 slot->key = NULL; in blk_ksm_evict_key()
408 unsigned int slot; in blk_ksm_reprogram_all_keys() local
415 for (slot = 0; slot < ksm->num_slots; slot++) { in blk_ksm_reprogram_all_keys()
416 const struct blk_crypto_key *key = ksm->slots[slot].key; in blk_ksm_reprogram_all_keys()
422 err = ksm->ksm_ll_ops.keyslot_program(ksm, key, slot); in blk_ksm_reprogram_all_keys()