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:
Mike Gerdts 2023-01-04 09:23:57 -06:00 committed by Tomasz Zawadzki
parent e70d2adc73
commit 5d41f22d24
2 changed files with 3 additions and 2 deletions

View File

@ -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.
*
* To be called once during module_init or asynchronously after
* an asynchronous operation required for module initialization is completed.
* To be called once after an asynchronous operation required for module initialization is
* completed. If module->async_init is false, the module must not call this function.
*
* \param module Pointer to the module completing the initialization.
*/

View File

@ -1583,6 +1583,7 @@ bdev_module_action_done(struct spdk_bdev_module *module)
void
spdk_bdev_module_init_done(struct spdk_bdev_module *module)
{
assert(module->async_init);
bdev_module_action_done(module);
}