Motr  M0
m0_sm Struct Reference

#include <sm.h>

Collaboration diagram for m0_sm:
Collaboration graph

Data Fields

uint32_t sm_state
 
uint64_t sm_id
 
const struct m0_sm_confsm_conf
 
struct m0_sm_groupsm_grp
 
m0_time_t sm_state_epoch
 
struct m0_sm_addb2_statssm_addb2_stats
 
struct m0_chan sm_chan
 
int32_t sm_rc
 
bool sm_invariant_chk_off
 

Detailed Description

state machine.

Abstract state machine. Possibly persistent, possibly replicated.

An instance of m0_sm is embedded in a concrete state machine (e.g., a per-endpoint rpc layer formation state machine, a resource owner state machine (m0_rm_owner), &c.).

m0_sm stores state machine current state in m0_sm::sm_state. The semantics of state are not defined by this module except for classifying states into a few broad classes, see m0_sm_state_descr_flags. The only restriction on states is that maximal state (as a number) should not be too large, because all states are enumerated in a m0_sm::sm_conf::scf_state[] array.

Invariant
m0_sm_invariant() (under mach->sm_grp->s_lock).

Definition at line 301 of file sm.h.

Field Documentation

◆ sm_addb2_stats

struct m0_sm_addb2_stats* sm_addb2_stats

Definition at line 327 of file sm.h.

◆ sm_chan

struct m0_chan sm_chan

Channel on which state transitions are announced.

Definition at line 331 of file sm.h.

◆ sm_conf

const struct m0_sm_conf* sm_conf

State machine configuration.

The configuration enumerates valid state machine states and associates with every state some attributes that are used by m0_sm code to check state transition correctness and to do some generic book-keeping, including addb-based accounting.

Definition at line 320 of file sm.h.

◆ sm_grp

struct m0_sm_group* sm_grp

Definition at line 321 of file sm.h.

◆ sm_id

uint64_t sm_id

State machine identifier

Definition at line 311 of file sm.h.

◆ sm_invariant_chk_off

bool sm_invariant_chk_off

Sm invariant check could be expensive for some state machines.

Definition at line 340 of file sm.h.

◆ sm_rc

int32_t sm_rc

State machine "return code". This is set to a non-zero value when state machine transitions to an M0_SDF_FAILURE state.

Definition at line 336 of file sm.h.

◆ sm_state

uint32_t sm_state

Current state.

Invariant
mach->sm_state < mach->sm_conf->scf_nr_states

Definition at line 307 of file sm.h.

◆ sm_state_epoch

m0_time_t sm_state_epoch

The time entered to current state. Used to calculate how long we were in a state (counted at m0_sm_state_stats::smss_times).

Definition at line 326 of file sm.h.


The documentation for this struct was generated from the following file: