Re: [PATCH v2 1/4] block: keyslot-manager: Introduce passthrough keyslot manager
From: Eric Biggers <ebiggers@kernel.org>
Date: 2020-10-27 20:05:05
Also in:
dm-devel, lkml
From: Eric Biggers <ebiggers@kernel.org>
Date: 2020-10-27 20:05:05
Also in:
dm-devel, lkml
On Thu, Oct 15, 2020 at 09:46:29PM +0000, Satya Tangirala wrote:
+/**
+ * blk_ksm_init_passthrough() - Init a passthrough keyslot manager
+ * @ksm: The keyslot manager to init
+ *
+ * Initialize a passthrough keyslot manager.
+ * Called by e.g. storage drivers to set up a keyslot manager in their
+ * request_queue, when the storage driver wants to manage its keys by itself.
+ * This is useful for inline encryption hardware that doesn't have the concept
+ * of keyslots, and for layered devices.
+ *
+ * See blk_ksm_init() for more details about the parameters.
+ */
+void blk_ksm_init_passthrough(struct blk_keyslot_manager *ksm)
+{
+ memset(ksm, 0, sizeof(*ksm));
+ init_rwsem(&ksm->lock);
+}
+EXPORT_SYMBOL_GPL(blk_ksm_init_passthrough);
The last paragraph of the comment ("See blk_ksm_init() for more details about
the parameters.") isn't useful and should be removed.
Otherwise this patch looks fine. You can add:
Reviewed-by: Eric Biggers <redacted>
- Eric