Spdk/lib/ftl/mngt/ftl_mngt_shutdown.c
Kozlowski Mateusz 5022d8f372 FTL: Add first startup basic initialization flow
Scrubbing nv cache region and finalizing initialization

Signed-off-by: Kozlowski Mateusz <mateusz.kozlowski@intel.com>
Signed-off-by: Artur Paszkiewicz <artur.paszkiewicz@intel.com>
Change-Id: I654b9a92004042c773c3672a5f27b0f66200469d
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/13295
Community-CI: Mellanox Build Bot
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Konrad Sztyber <konrad.sztyber@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2022-07-21 10:53:01 +00:00

31 lines
759 B
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 = "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);
}