Skip to content
Commit 5851d3b0 authored by Eric Biggers's avatar Eric Biggers Committed by Ulf Hansson
Browse files

block/keyslot-manager: introduce devm_blk_ksm_init()



Add a resource-managed variant of blk_ksm_init() so that drivers don't
have to worry about calling blk_ksm_destroy().

Note that the implementation uses a custom devres action to call
blk_ksm_destroy() rather than switching the two allocations to be
directly devres-managed, e.g. with devm_kmalloc().  This is because we
need to keep zeroing the memory containing the keyslots when it is
freed, and also because we want to continue using kvmalloc() (and there
is no devm_kvmalloc()).

Signed-off-by: default avatarEric Biggers <ebiggers@google.com>
Reviewed-by: default avatarSatya Tangirala <satyat@google.com>
Acked-by: default avatarJens Axboe <axboe@kernel.dk>
Link: https://lore.kernel.org/r/20210121082155.111333-2-ebiggers@kernel.org


Signed-off-by: default avatarUlf Hansson <ulf.hansson@linaro.org>
parent 4af307f5
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment