#include "admin-state.h"
#include "logger.h"
#include "memory-alloc.h"
#include "permassert.h"
#include "completion.h"
#include "types.h"
static const struct admin_state_code VDO_CODE_NORMAL_OPERATION = …;
const struct admin_state_code *VDO_ADMIN_STATE_NORMAL_OPERATION = …;
static const struct admin_state_code VDO_CODE_OPERATING = …;
const struct admin_state_code *VDO_ADMIN_STATE_OPERATING = …;
static const struct admin_state_code VDO_CODE_FORMATTING = …;
const struct admin_state_code *VDO_ADMIN_STATE_FORMATTING = …;
static const struct admin_state_code VDO_CODE_PRE_LOADING = …;
const struct admin_state_code *VDO_ADMIN_STATE_PRE_LOADING = …;
static const struct admin_state_code VDO_CODE_PRE_LOADED = …;
const struct admin_state_code *VDO_ADMIN_STATE_PRE_LOADED = …;
static const struct admin_state_code VDO_CODE_LOADING = …;
const struct admin_state_code *VDO_ADMIN_STATE_LOADING = …;
static const struct admin_state_code VDO_CODE_LOADING_FOR_RECOVERY = …;
const struct admin_state_code *VDO_ADMIN_STATE_LOADING_FOR_RECOVERY = …;
static const struct admin_state_code VDO_CODE_LOADING_FOR_REBUILD = …;
const struct admin_state_code *VDO_ADMIN_STATE_LOADING_FOR_REBUILD = …;
static const struct admin_state_code VDO_CODE_WAITING_FOR_RECOVERY = …;
const struct admin_state_code *VDO_ADMIN_STATE_WAITING_FOR_RECOVERY = …;
static const struct admin_state_code VDO_CODE_NEW = …;
const struct admin_state_code *VDO_ADMIN_STATE_NEW = …;
static const struct admin_state_code VDO_CODE_INITIALIZED = …;
const struct admin_state_code *VDO_ADMIN_STATE_INITIALIZED = …;
static const struct admin_state_code VDO_CODE_RECOVERING = …;
const struct admin_state_code *VDO_ADMIN_STATE_RECOVERING = …;
static const struct admin_state_code VDO_CODE_REBUILDING = …;
const struct admin_state_code *VDO_ADMIN_STATE_REBUILDING = …;
static const struct admin_state_code VDO_CODE_SAVING = …;
const struct admin_state_code *VDO_ADMIN_STATE_SAVING = …;
static const struct admin_state_code VDO_CODE_SAVED = …;
const struct admin_state_code *VDO_ADMIN_STATE_SAVED = …;
static const struct admin_state_code VDO_CODE_SCRUBBING = …;
const struct admin_state_code *VDO_ADMIN_STATE_SCRUBBING = …;
static const struct admin_state_code VDO_CODE_SAVE_FOR_SCRUBBING = …;
const struct admin_state_code *VDO_ADMIN_STATE_SAVE_FOR_SCRUBBING = …;
static const struct admin_state_code VDO_CODE_STOPPING = …;
const struct admin_state_code *VDO_ADMIN_STATE_STOPPING = …;
static const struct admin_state_code VDO_CODE_STOPPED = …;
const struct admin_state_code *VDO_ADMIN_STATE_STOPPED = …;
static const struct admin_state_code VDO_CODE_SUSPENDING = …;
const struct admin_state_code *VDO_ADMIN_STATE_SUSPENDING = …;
static const struct admin_state_code VDO_CODE_SUSPENDED = …;
const struct admin_state_code *VDO_ADMIN_STATE_SUSPENDED = …;
static const struct admin_state_code VDO_CODE_SUSPENDED_OPERATION = …;
const struct admin_state_code *VDO_ADMIN_STATE_SUSPENDED_OPERATION = …;
static const struct admin_state_code VDO_CODE_RESUMING = …;
const struct admin_state_code *VDO_ADMIN_STATE_RESUMING = …;
static const struct admin_state_code *get_next_state(const struct admin_state *state,
const struct admin_state_code *operation)
{ … }
bool vdo_finish_operation(struct admin_state *state, int result)
{ … }
static int __must_check begin_operation(struct admin_state *state,
const struct admin_state_code *operation,
struct vdo_completion *waiter,
vdo_admin_initiator_fn initiator)
{ … }
static inline bool __must_check start_operation(struct admin_state *state,
const struct admin_state_code *operation,
struct vdo_completion *waiter,
vdo_admin_initiator_fn initiator)
{ … }
static bool check_code(bool valid, const struct admin_state_code *code, const char *what,
struct vdo_completion *waiter)
{ … }
static bool __must_check assert_vdo_drain_operation(const struct admin_state_code *operation,
struct vdo_completion *waiter)
{ … }
bool vdo_start_draining(struct admin_state *state,
const struct admin_state_code *operation,
struct vdo_completion *waiter, vdo_admin_initiator_fn initiator)
{ … }
bool vdo_finish_draining(struct admin_state *state)
{ … }
bool vdo_finish_draining_with_result(struct admin_state *state, int result)
{ … }
bool vdo_assert_load_operation(const struct admin_state_code *operation,
struct vdo_completion *waiter)
{ … }
bool vdo_start_loading(struct admin_state *state,
const struct admin_state_code *operation,
struct vdo_completion *waiter, vdo_admin_initiator_fn initiator)
{ … }
bool vdo_finish_loading(struct admin_state *state)
{ … }
bool vdo_finish_loading_with_result(struct admin_state *state, int result)
{ … }
static bool __must_check assert_vdo_resume_operation(const struct admin_state_code *operation,
struct vdo_completion *waiter)
{ … }
bool vdo_start_resuming(struct admin_state *state,
const struct admin_state_code *operation,
struct vdo_completion *waiter, vdo_admin_initiator_fn initiator)
{ … }
bool vdo_finish_resuming(struct admin_state *state)
{ … }
bool vdo_finish_resuming_with_result(struct admin_state *state, int result)
{ … }
int vdo_resume_if_quiescent(struct admin_state *state)
{ … }
int vdo_start_operation(struct admin_state *state,
const struct admin_state_code *operation)
{ … }
int vdo_start_operation_with_waiter(struct admin_state *state,
const struct admin_state_code *operation,
struct vdo_completion *waiter,
vdo_admin_initiator_fn initiator)
{ … }