Spdk/lib/ftl/mngt/ftl_mngt_shutdown.c
Artur Paszkiewicz d9a631ad4c FTL: Add io channel logic
Signed-off-by: Kozlowski Mateusz <mateusz.kozlowski@intel.com>
Signed-off-by: Artur Paszkiewicz <artur.paszkiewicz@intel.com>
Change-Id: Ibf6bfbabc03c43e7938531c4fe08fde01ce02a3f
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/13307
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2022-08-02 19:00:42 +00:00

47 lines
1.1 KiB
C

/* SPDX-License-Identifier: BSD-3-Clause
* Copyright (c) Intel Corporation.
* All rights reserved.
*/
#include "ftl_core.h"
#include "ftl_mngt.h"
#include "ftl_mngt_steps.h"
/*
* Steps executed during clean shutdown - includes persisting metadata and rolling
* back any setup steps executed during startup (closing bdevs, io channels, etc)
*/
static const struct ftl_mngt_process_desc desc_shutdown = {
.name = "FTL shutdown",
.error_handler = ftl_mngt_rollback_device,
.steps = {
{
.name = "Deinit core IO channel",
.action = ftl_mngt_deinit_io_channel
},
{
.name = "Unregister IO device",
.action = ftl_mngt_unregister_io_device
},
{
.name = "Stop core poller",
.action = ftl_mngt_stop_core_poller
},
{
.name = "Dump statistics",
.action = ftl_mngt_dump_stats
},
{
.name = "Rollback FTL device",
.action = ftl_mngt_rollback_device
},
{}
}
};
int
ftl_mngt_call_dev_shutdown(struct spdk_ftl_dev *dev, ftl_mngt_completion cb, void *cb_cntx)
{
return ftl_mngt_process_execute(dev, &desc_shutdown, cb, cb_cntx);
}