blk_crypto_evict_key(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… 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 β€” a block_device on 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 🌈


✨ 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