bdev: spdk_bdev_module_init_done with async init
spdk_bdev_module_init() must only be called if the module sets async_init to true. This patch fixes the doc string to match the implementation and adds an assert() to catch API usage errors early. Change-Id: I677345de028c8f7597ecf81ff9b9b855867bbf01 Signed-off-by: Mike Gerdts <mgerdts@nvidia.com> Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/16133 Tested-by: SPDK CI Jenkins <sys_sgci@intel.com> Community-CI: Mellanox Build Bot Reviewed-by: Jim Harris <james.r.harris@intel.com> Reviewed-by: Shuhei Matsumoto <smatsumoto@nvidia.com>
This commit is contained in:
parent
e70d2adc73
commit
5d41f22d24
@ -951,8 +951,8 @@ void spdk_bdev_module_examine_done(struct spdk_bdev_module *module);
|
|||||||
/**
|
/**
|
||||||
* Indicate to the bdev layer that the module is done initializing.
|
* Indicate to the bdev layer that the module is done initializing.
|
||||||
*
|
*
|
||||||
* To be called once during module_init or asynchronously after
|
* To be called once after an asynchronous operation required for module initialization is
|
||||||
* an asynchronous operation required for module initialization is completed.
|
* completed. If module->async_init is false, the module must not call this function.
|
||||||
*
|
*
|
||||||
* \param module Pointer to the module completing the initialization.
|
* \param module Pointer to the module completing the initialization.
|
||||||
*/
|
*/
|
||||||
|
@ -1583,6 +1583,7 @@ bdev_module_action_done(struct spdk_bdev_module *module)
|
|||||||
void
|
void
|
||||||
spdk_bdev_module_init_done(struct spdk_bdev_module *module)
|
spdk_bdev_module_init_done(struct spdk_bdev_module *module)
|
||||||
{
|
{
|
||||||
|
assert(module->async_init);
|
||||||
bdev_module_action_done(module);
|
bdev_module_action_done(module);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user