mirror of
https://github.com/linux-msm/laptops-kernel.git
synced 2026-08-13 14:19:53 -07:00
blk-crypto: Remove unused function blk_crypto_config_supported()
blk_crypto_config_supported() is no longer called, so remove it. Reviewed-by: Christoph Hellwig <hch@lst.de> Link: https://patch.msgid.link/20260718214655.63186-6-ebiggers@kernel.org Signed-off-by: Eric Biggers <ebiggers@kernel.org>
This commit is contained in:
@@ -185,20 +185,12 @@ blk-crypto-fallback is optional and is controlled by the
|
||||
API presented to users of the block layer
|
||||
=========================================
|
||||
|
||||
``blk_crypto_config_supported()`` allows users to check ahead of time whether
|
||||
inline encryption with particular crypto settings will work on a particular
|
||||
block_device -- either via hardware or via blk-crypto-fallback. This function
|
||||
takes in a ``struct blk_crypto_config`` which is like blk_crypto_key, but omits
|
||||
the actual bytes of the key and instead just contains the algorithm, data unit
|
||||
size, etc. This function can be useful if blk-crypto-fallback is disabled.
|
||||
|
||||
``blk_crypto_init_key()`` allows users to initialize a blk_crypto_key.
|
||||
|
||||
Users must call ``blk_crypto_start_using_key()`` before actually starting to use
|
||||
a blk_crypto_key on a block_device (even if ``blk_crypto_config_supported()``
|
||||
was called earlier). This is needed to initialize blk-crypto-fallback if it
|
||||
will be needed. This must not be called from the data path, as this may have to
|
||||
allocate resources, which may deadlock in that case.
|
||||
a blk_crypto_key on a block_device. This is needed to initialize
|
||||
blk-crypto-fallback if it will be needed. This must not be called from the data
|
||||
path, as this may have to allocate resources, which may deadlock in that case.
|
||||
|
||||
Next, to attach an encryption context to a bio, users should call
|
||||
``bio_crypt_set_ctx()``. This function allocates a bio_crypt_ctx and attaches
|
||||
@@ -220,16 +212,15 @@ any kernel data structures it may be linked into.
|
||||
In summary, for users of the block layer, the lifecycle of a blk_crypto_key is
|
||||
as follows:
|
||||
|
||||
1. ``blk_crypto_config_supported()`` (optional)
|
||||
2. ``blk_crypto_init_key()``
|
||||
3. ``blk_crypto_start_using_key()``
|
||||
4. ``bio_crypt_set_ctx()`` (potentially many times)
|
||||
5. ``blk_crypto_evict_key()`` (after all I/O has completed)
|
||||
6. Zeroize the blk_crypto_key (this has no dedicated function)
|
||||
1. ``blk_crypto_init_key()``
|
||||
2. ``blk_crypto_start_using_key()``
|
||||
3. ``bio_crypt_set_ctx()`` (potentially many times)
|
||||
4. ``blk_crypto_evict_key()`` (after all I/O has completed)
|
||||
5. Zeroize the blk_crypto_key (this has no dedicated function)
|
||||
|
||||
If a blk_crypto_key is being used on multiple block_devices, then
|
||||
``blk_crypto_config_supported()`` (if used), ``blk_crypto_start_using_key()``,
|
||||
and ``blk_crypto_evict_key()`` must be called on each block_device.
|
||||
``blk_crypto_start_using_key()`` and ``blk_crypto_evict_key()`` must be called
|
||||
on each block_device.
|
||||
|
||||
API presented to device drivers
|
||||
===============================
|
||||
|
||||
@@ -386,20 +386,6 @@ bool blk_crypto_config_supported_natively(struct block_device *bdev,
|
||||
return true;
|
||||
}
|
||||
|
||||
/*
|
||||
* Check if bios with @cfg can be en/decrypted by blk-crypto (i.e. either the
|
||||
* block_device it's submitted to supports inline crypto, or the
|
||||
* blk-crypto-fallback is enabled and supports the cfg).
|
||||
*/
|
||||
bool blk_crypto_config_supported(struct block_device *bdev,
|
||||
const struct blk_crypto_config *cfg)
|
||||
{
|
||||
if (IS_ENABLED(CONFIG_BLK_INLINE_ENCRYPTION_FALLBACK) &&
|
||||
cfg->key_type == BLK_CRYPTO_KEY_TYPE_RAW)
|
||||
return true;
|
||||
return blk_crypto_config_supported_natively(bdev, cfg);
|
||||
}
|
||||
|
||||
/**
|
||||
* blk_crypto_start_using_key() - Start using a blk_crypto_key on a device
|
||||
* @bdev: block device to operate on
|
||||
|
||||
@@ -171,8 +171,6 @@ void blk_crypto_evict_key(struct block_device *bdev,
|
||||
|
||||
bool blk_crypto_config_supported_natively(struct block_device *bdev,
|
||||
const struct blk_crypto_config *cfg);
|
||||
bool blk_crypto_config_supported(struct block_device *bdev,
|
||||
const struct blk_crypto_config *cfg);
|
||||
|
||||
int blk_crypto_derive_sw_secret(struct block_device *bdev,
|
||||
const u8 *eph_key, size_t eph_key_size,
|
||||
|
||||
Reference in New Issue
Block a user