blk_crypto_evict_key(9)
π blk_crypto_evict_key(9) β a Kernel API Manual moment β¨
okay so bestie, welcome to the Kernel API Manual, and today's main character is blk_crypto_evict_key π lowkey a little function with big "clean up your room before you leave" energy.
πΈ NAME πΈ
blk_crypto_evict_key β evict a blk_crypto_key from a block_device π¦
β¨ SYNOPSIS β¨
void blk_crypto_evict_key (struct block_device *bdev , const struct
blk_crypto_key *key );
literally that's the whole signature, no cap.
π«Ά ARGUMENTS π«Ά
bdevβ ablock_deviceon which I/O using the key may have been done π like, the device where this key was actually out here living its life.keyβ the key to evict ποΈ bye bestie, your time is up.
π DESCRIPTION π
So for a given block_device, this function removes the given blk_crypto_key from the keyslot management structures, and evicts it from any underlying hardware keyslot(s) or blk-crypto-fallback keyslot it may have been programmed into. it's giving "spring cleaning but for cryptographic key slots" π§Ήβ¨
Upper layers must call this before freeing the blk_crypto_key. not optional, not a suggestion, it's a must fr fr. π
It must be called for every block_device the key may have been used on β like, all of them, not just the one you remember. π₯
And the key must no longer be in use by any I/O when this function is called. periodt. π
β οΈ warning bestie: key still doing I/O? do NOT call this. free the key without calling this? also do not. the vibes will be rancid and that's on you π
π CONTEXT π
May sleep. π΄ so like, don't hit it from a context where sleeping is illegal, you know the drill.
π SEE ALSO π
- Kernel file
./block/blk-crypto.cπ blk_crypto_init_key(9)blk_crypto_config_supported_natively(9)blk_crypto_start_using_key(9)
β¨ that's the whole page, you ate that β¨ π
source: ./block Β· date: October 2026 Β· blk_crypto_evict_key(9) β mwah, go evict those keys responsibly ππ§π
π¦ where this page comes from
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms