diff options
author | Martin Schwenke <martin@meltin.net> | 2013-01-10 16:06:25 +1100 |
---|---|---|
committer | Amitay Isaacs <amitay@gmail.com> | 2013-05-24 14:08:06 +1000 |
commit | 63577c96db3877417030f441268b3ec79bb82c2a (patch) | |
tree | daf62bef0535c6bdbc496591b9276bb2b876b04a /ctdb/include/ctdb_private.h | |
parent | c5bcff6724b85bac1a6343f67034b81ebbb7a2c2 (diff) | |
download | samba-63577c96db3877417030f441268b3ec79bb82c2a.tar.gz samba-63577c96db3877417030f441268b3ec79bb82c2a.tar.xz samba-63577c96db3877417030f441268b3ec79bb82c2a.zip |
ctdbd: Replace ctdb->done_startup with ctdb->runstate
This allows states, including startup and shutdown states, to be
clearly tracked. This doesn't include regular runtime "states", which
are handled by node flags.
Introduce new functions ctdb_set_runstate(), runstate_to_string() and
runstate_from_string().
Signed-off-by: Martin Schwenke <martin@meltin.net>
Pair-programmed-with: Amitay Isaacs <amitay@gmail.com>
(This used to be ctdb commit 8076773a9924dcf8aff16f7d96b2b9ac383ecc28)
Diffstat (limited to 'ctdb/include/ctdb_private.h')
-rw-r--r-- | ctdb/include/ctdb_private.h | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/ctdb/include/ctdb_private.h b/ctdb/include/ctdb_private.h index c47210e1f0a..2698785f0be 100644 --- a/ctdb/include/ctdb_private.h +++ b/ctdb/include/ctdb_private.h @@ -436,6 +436,19 @@ struct ctdb_write_record { enum ctdb_freeze_mode {CTDB_FREEZE_NONE, CTDB_FREEZE_PENDING, CTDB_FREEZE_FROZEN}; +enum ctdb_runstate { + CTDB_RUNSTATE_UNKNOWN, + CTDB_RUNSTATE_INIT, + CTDB_RUNSTATE_SETUP, + CTDB_RUNSTATE_STARTUP, + CTDB_RUNSTATE_RUNNING, + CTDB_RUNSTATE_SHUTDOWN, +}; + +const char *runstate_to_string(enum ctdb_runstate runstate); +enum ctdb_runstate runstate_from_string(const char *label); +void ctdb_set_runstate(struct ctdb_context *ctdb, enum ctdb_runstate runstate); + #define CTDB_MONITORING_ACTIVE 0 #define CTDB_MONITORING_DISABLED 1 @@ -505,7 +518,7 @@ struct ctdb_context { pid_t ctdbd_pid; pid_t recoverd_pid; pid_t syslogd_pid; - bool done_startup; + enum ctdb_runstate runstate; struct ctdb_monitor_state *monitor; struct ctdb_log_state *log; int start_as_disabled; |