lib/bdev: refactor out checking for module actions
This patch moves out check for all module actions to finish. It will be used further down in the series for new RPC and as new bdev API. Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com> Change-Id: I24ff40de70f5ed1c8582e60dc23146d7bf9380fd Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/5212 Community-CI: Broadcom CI Community-CI: Mellanox Build Bot Tested-by: SPDK CI Jenkins <sys_sgci@intel.com> Reviewed-by: <dongx.yi@intel.com> Reviewed-by: Jim Harris <james.r.harris@intel.com> Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com> Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
This commit is contained in:
parent
89a922221d
commit
cc8e4443e5
@ -1192,11 +1192,22 @@ bdev_init_complete(int rc)
|
|||||||
cb_fn(cb_arg, rc);
|
cb_fn(cb_arg, rc);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static bool
|
||||||
bdev_module_action_complete(void)
|
bdev_module_all_actions_completed(void)
|
||||||
{
|
{
|
||||||
struct spdk_bdev_module *m;
|
struct spdk_bdev_module *m;
|
||||||
|
|
||||||
|
TAILQ_FOREACH(m, &g_bdev_mgr.bdev_modules, internal.tailq) {
|
||||||
|
if (m->internal.action_in_progress > 0) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
bdev_module_action_complete(void)
|
||||||
|
{
|
||||||
/*
|
/*
|
||||||
* Don't finish bdev subsystem initialization if
|
* Don't finish bdev subsystem initialization if
|
||||||
* module pre-initialization is still in progress, or
|
* module pre-initialization is still in progress, or
|
||||||
@ -1211,11 +1222,9 @@ bdev_module_action_complete(void)
|
|||||||
* exist, return immediately since we cannot finish bdev subsystem
|
* exist, return immediately since we cannot finish bdev subsystem
|
||||||
* initialization until all are completed.
|
* initialization until all are completed.
|
||||||
*/
|
*/
|
||||||
TAILQ_FOREACH(m, &g_bdev_mgr.bdev_modules, internal.tailq) {
|
if (!bdev_module_all_actions_completed()) {
|
||||||
if (m->internal.action_in_progress > 0) {
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Modules already finished initialization - now that all
|
* Modules already finished initialization - now that all
|
||||||
|
Loading…
Reference in New Issue
Block a user