Lines Matching defs:key

11  * with a slot number to specify the key to use for en/decryption.
14 * many inline encryption hardware, we don't want to program the same key into
15 * multiple slots - if multiple requests are using the same key, we want to
16 * program just one slot with that key and use that slot for all requests.
26 * key into some slot in the inline encryption hardware.
42 const struct blk_crypto_key *key;
68 * @num_slots: The number of key slots to manage.
132 const struct blk_crypto_key *key)
134 return &ksm->slot_hashtable[hash_ptr(key, ksm->log_slot_ht_size)];
149 const struct blk_crypto_key *key)
151 const struct hlist_head *head = blk_ksm_hash_bucket_for_key(ksm, key);
155 if (slotp->key == key)
163 const struct blk_crypto_key *key)
167 slot = blk_ksm_find_keyslot(ksm, key);
184 * blk_ksm_get_slot_for_key() - Program a key into a keyslot.
185 * @ksm: The keyslot manager to program the key into.
186 * @key: Pointer to the key object to program, including the raw key, crypto
190 * Get a keyslot that's been programmed with the specified key. If one already
200 const struct blk_crypto_key *key,
209 slot = blk_ksm_find_and_grab_keyslot(ksm, key);
216 slot = blk_ksm_find_and_grab_keyslot(ksm, key);
224 * already programmed with the key. So try to program it.
238 err = ksm->ksm_ll_ops.keyslot_program(ksm, key, slot_idx);
245 /* Move this slot to the hash list for the new key. */
246 if (slot->key)
248 slot->key = key;
249 hlist_add_head(&slot->hash_node, blk_ksm_hash_bucket_for_key(ksm, key));
309 * This is an internal function that evicts a key from an inline encryption
314 const struct blk_crypto_key *key)
320 slot = blk_ksm_find_keyslot(ksm, key);
323 * Not an error, since a key not in use by I/O is not guaranteed
331 /* BUG: key is still in use by I/O */
335 err = ksm->ksm_ll_ops.keyslot_evict(ksm, key,
339 * Callers free the key even on error, so unlink the key from the hash
340 * table and clear slot->key even on error.
343 slot->key = NULL;
353 * Re-program all keyslots that are supposed to have a key programmed. This is
365 const struct blk_crypto_key *key = ksm->slots[slot].key;
368 if (!key)
371 err = ksm->ksm_ll_ops.keyslot_program(ksm, key, slot);