|
Packit Service |
d40955 |
/*
|
|
Packit Service |
d40955 |
* Copyright (c) 2020 Red Hat, Inc.
|
|
Packit Service |
d40955 |
*
|
|
Packit Service |
d40955 |
* This program is free software; you can redistribute it and/or
|
|
Packit Service |
d40955 |
* modify it under the terms of the GNU General Public License
|
|
Packit Service |
d40955 |
* as published by the Free Software Foundation; either version 2
|
|
Packit Service |
d40955 |
* of the License, or (at your option) any later version.
|
|
Packit Service |
d40955 |
*
|
|
Packit Service |
d40955 |
* This program is distributed in the hope that it will be useful,
|
|
Packit Service |
d40955 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
Packit Service |
d40955 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
Packit Service |
d40955 |
* GNU General Public License for more details.
|
|
Packit Service |
d40955 |
*
|
|
Packit Service |
d40955 |
* You should have received a copy of the GNU General Public License
|
|
Packit Service |
d40955 |
* along with this program; if not, write to the Free Software
|
|
Packit Service |
d40955 |
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
|
|
Packit Service |
d40955 |
* 02110-1301, USA.
|
|
Packit Service |
d40955 |
*
|
|
Packit Service |
d40955 |
* $Id: //eng/vdo-releases/aluminum/src/c++/vdo/base/vdoState.h#2 $
|
|
Packit Service |
d40955 |
*/
|
|
Packit Service |
d40955 |
|
|
Packit Service |
d40955 |
#ifndef VDO_STATE_H
|
|
Packit Service |
d40955 |
#define VDO_STATE_H
|
|
Packit Service |
d40955 |
|
|
Packit Service |
d40955 |
/**
|
|
Packit Service |
d40955 |
* The current operating mode of the VDO. These are persistent on disk
|
|
Packit Service |
d40955 |
* so the values must not change.
|
|
Packit Service |
d40955 |
**/
|
|
Packit Service |
d40955 |
typedef enum {
|
|
Packit Service |
d40955 |
VDO_DIRTY = 0,
|
|
Packit Service |
d40955 |
VDO_NEW = 1,
|
|
Packit Service |
d40955 |
VDO_CLEAN = 2,
|
|
Packit Service |
d40955 |
VDO_READ_ONLY_MODE = 3,
|
|
Packit Service |
d40955 |
VDO_FORCE_REBUILD = 4,
|
|
Packit Service |
d40955 |
VDO_RECOVERING = 5,
|
|
Packit Service |
d40955 |
VDO_REPLAYING = 6,
|
|
Packit Service |
d40955 |
VDO_REBUILD_FOR_UPGRADE = 7,
|
|
Packit Service |
d40955 |
|
|
Packit Service |
d40955 |
// Keep VDO_STATE_COUNT at the bottom.
|
|
Packit Service |
d40955 |
VDO_STATE_COUNT
|
|
Packit Service |
d40955 |
} VDOState;
|
|
Packit Service |
d40955 |
|
|
Packit Service |
d40955 |
/**
|
|
Packit Service |
d40955 |
* Get the name of a VDO state code for logging purposes.
|
|
Packit Service |
d40955 |
*
|
|
Packit Service |
d40955 |
* @param state The state code
|
|
Packit Service |
d40955 |
*
|
|
Packit Service |
d40955 |
* @return The name of the state code
|
|
Packit Service |
d40955 |
**/
|
|
Packit Service |
d40955 |
const char *getVDOStateName(VDOState state)
|
|
Packit Service |
d40955 |
__attribute__((warn_unused_result));
|
|
Packit Service |
d40955 |
|
|
Packit Service |
d40955 |
/**
|
|
Packit Service |
d40955 |
* Return a user-visible string describing the current VDO state.
|
|
Packit Service |
d40955 |
*
|
|
Packit Service |
d40955 |
* @param state The VDO state to describe
|
|
Packit Service |
d40955 |
*
|
|
Packit Service |
d40955 |
* @return A string constant describing the state
|
|
Packit Service |
d40955 |
**/
|
|
Packit Service |
d40955 |
const char *describeVDOState(VDOState state)
|
|
Packit Service |
d40955 |
__attribute__((warn_unused_result));
|
|
Packit Service |
d40955 |
|
|
Packit Service |
d40955 |
#endif // VDO_STATE_H
|