Motr
M0
|
![]() |
Modules | |
Copy Packet | |
Copy machine aggregation group | |
DIX copy machine | |
SNS copy machine | |
copy machine proxy | |
copy machine sliding window | |
copy machine store | |
Data Structures | |
struct | m0_cm_type |
struct | m0_cm_ast_run |
struct | m0_cm |
struct | m0_cm_ops |
struct | m0_fom_trigger_ops |
struct | m0_trigger_fom |
struct | failure_data |
struct | trigger_fop |
struct | trigger_rep_fop |
struct | m0_status_rep_fop |
Macros | |
#define | M0_CM_TYPE_DECLARE(cmtype, id, ops, name, typecode) |
#define | M0_TRACE_SUBSYSTEM M0_TRACE_SUBSYS_CM |
Enumerations | |
enum | m0_cm_state { M0_CMS_INIT, M0_CMS_IDLE, M0_CMS_PREPARE, M0_CMS_READY, M0_CMS_ACTIVE, M0_CMS_FAIL, M0_CMS_STOP, M0_CMS_FINI, M0_CMS_NR } |
enum | { CM_RPC_TIMEOUT = 20, CM_MAX_NR_RPC_IN_FLIGHT = 100 } |
enum | cm_cp_pump_fom_phase { CPP_ALLOC = M0_FOM_PHASE_INIT, CPP_FINI = M0_FOM_PHASE_FINISH, CPP_DATA_NEXT, CPP_COMPLETE, CPP_STOP, CPP_FAIL, CPP_NR } |
enum | { CM_PUMP_MAGIX = 0x330FF1CE0FF1CE77 } |
enum | m0_trigger_phases { M0_TPH_PREPARE = M0_FOPH_NR + 1, M0_TPH_READY, M0_TPH_START, M0_TPH_FINI = M0_FOM_PHASE_FINISH } |
Functions | |
M0_TL_DESCR_DEFINE (cmtypes, "copy machine types", static, struct m0_cm_type, ct_linkage, ct_magix, CM_TYPE_LINK_MAGIX, CM_TYPE_HEAD_MAGIX) | |
M0_TL_DEFINE (cmtypes, static, struct m0_cm_type) | |
M0_BOB_DEFINE (static, &cmtypes_bob, m0_cm_type) | |
M0_INTERNAL struct m0_cm * | m0_cmsvc2cm (struct m0_reqh_service *cmsvc) |
M0_INTERNAL int | m0_ha_cm_err_send (struct m0_cm *cm, int rc) |
M0_INTERNAL void | m0_cm_fail (struct m0_cm *cm, int rc) |
M0_INTERNAL void | m0_cm_lock (struct m0_cm *cm) |
M0_INTERNAL void | m0_cm_unlock (struct m0_cm *cm) |
M0_INTERNAL int | m0_cm_trylock (struct m0_cm *cm) |
M0_INTERNAL bool | m0_cm_is_locked (const struct m0_cm *cm) |
M0_INTERNAL enum m0_cm_state | m0_cm_state_get (const struct m0_cm *cm) |
M0_INTERNAL void | m0_cm_state_set (struct m0_cm *cm, enum m0_cm_state state) |
static int | cm_rc (struct m0_cm *cm) |
M0_INTERNAL bool | m0_cm_invariant (const struct m0_cm *cm) |
M0_INTERNAL int | m0_cm_setup (struct m0_cm *cm) |
static int | cm_replicas_connect (struct m0_cm *cm, struct m0_rpc_machine *rmach, struct m0_reqh *reqh) |
static void | cm_replicas_destroy (struct m0_cm *cm) |
static int | cm_pre_start_cleanup (struct m0_cm *cm) |
M0_INTERNAL struct m0_rpc_machine * | m0_cm_rpc_machine_find (struct m0_reqh *reqh) |
M0_INTERNAL int | m0_cm_prepare (struct m0_cm *cm) |
M0_INTERNAL int | m0_cm_ready (struct m0_cm *cm) |
M0_INTERNAL bool | m0_cm_is_ready (struct m0_cm *cm) |
M0_INTERNAL bool | m0_cm_is_active (struct m0_cm *cm) |
M0_INTERNAL int | m0_cm_start (struct m0_cm *cm) |
M0_INTERNAL int | m0_cm_proxies_fini (struct m0_cm *cm) |
M0_INTERNAL int | m0_cm_stop (struct m0_cm *cm) |
M0_INTERNAL int | m0_cm_module_init (void) |
M0_INTERNAL void | m0_cm_module_fini (void) |
static uint64_t | cm_id_generate (void) |
M0_INTERNAL int | m0_cm_init (struct m0_cm *cm, struct m0_cm_type *cm_type, const struct m0_cm_ops *cm_ops) |
M0_INTERNAL void | m0_cm_fini (struct m0_cm *cm) |
M0_INTERNAL int | m0_cm_type_register (struct m0_cm_type *cmtype) |
M0_INTERNAL void | m0_cm_type_deregister (struct m0_cm_type *cmtype) |
M0_INTERNAL int | m0_cm_data_next (struct m0_cm *cm, struct m0_cm_cp *cp) |
M0_INTERNAL bool | m0_cm_has_more_data (const struct m0_cm *cm) |
M0_INTERNAL struct m0_net_buffer * | m0_cm_buffer_get (struct m0_net_buffer_pool *bp, uint64_t colour) |
M0_INTERNAL void | m0_cm_buffer_put (struct m0_net_buffer_pool *bp, struct m0_net_buffer *buf, uint64_t colour) |
M0_INTERNAL void | m0_cm_notify (struct m0_cm *cm) |
M0_INTERNAL void | m0_cm_wait (struct m0_cm *cm, struct m0_fom *fom) |
M0_INTERNAL void | m0_cm_wait_cancel (struct m0_cm *cm, struct m0_fom *fom) |
M0_INTERNAL int | m0_cm_complete (struct m0_cm *cm) |
M0_INTERNAL void | m0_cm_complete_notify (struct m0_cm *cm) |
M0_INTERNAL void | m0_cm_proxies_init_wait (struct m0_cm *cm, struct m0_fom *fom) |
M0_INTERNAL void | m0_cm_frozen_ag_cleanup (struct m0_cm *cm, struct m0_cm_proxy *proxy) |
M0_INTERNAL void | m0_cm_proxy_failed_cleanup (struct m0_cm *cm) |
M0_INTERNAL void | m0_cm_abort (struct m0_cm *cm, int rc) |
M0_INTERNAL bool | m0_cm_is_dirty (struct m0_cm *cm) |
M0_INTERNAL bool | m0_cm_proxies_updated (struct m0_cm *cm) |
static void | cm_ast_run_thread (struct m0_cm *cm) |
M0_INTERNAL int | m0_cm_ast_run_thread_init (struct m0_cm *cm) |
M0_INTERNAL void | m0_cm_ast_run_thread_fini (struct m0_cm *cm) |
M0_INTERNAL int | m0_cm_configure (struct m0_cm *cm, struct m0_fop *fop) |
M0_INTERNAL void | m0_cm_continue (struct m0_cm *cm) |
M0_BOB_DEFINE (static, &pump_bob, m0_cm_cp_pump) | |
static struct m0_cm * | pump2cm (const struct m0_cm_cp_pump *cp_pump) |
static bool | cm_cp_pump_invariant (const struct m0_cm_cp_pump *cp_pump) |
static void | pump_move (struct m0_cm_cp_pump *cp_fom, int rc, int phase) |
static int | cpp_alloc (struct m0_cm_cp_pump *cp_pump) |
static int | cpp_data_next (struct m0_cm_cp_pump *cp_pump) |
static int | cpp_complete (struct m0_cm_cp_pump *cp_pump) |
static int | cpp_stop (struct m0_cm_cp_pump *cp_pump) |
static int | cpp_fail (struct m0_cm_cp_pump *cp_pump) |
static uint64_t | cm_cp_pump_fom_locality (const struct m0_fom *fom) |
static int | cm_cp_pump_fom_tick (struct m0_fom *fom) |
static void | cm_cp_pump_fom_fini (struct m0_fom *fom) |
bool | m0_cm_cp_pump_is_complete (const struct m0_cm_cp_pump *cp_pump) |
M0_INTERNAL void | m0_cm_cp_pump_init (struct m0_cm_type *cmtype) |
M0_INTERNAL void | m0_cm_cp_pump_prepare (struct m0_cm *cm) |
M0_INTERNAL void | m0_cm_cp_pump_destroy (struct m0_cm *cm) |
static void | complete_wakeup (struct m0_sm_group *grp, struct m0_sm_ast *ast) |
static bool | pump_cb (struct m0_clink *link) |
M0_INTERNAL void | m0_cm_cp_pump_start (struct m0_cm *cm) |
static int | trigger_fom_tick (struct m0_fom *fom) |
static void | trigger_fom_fini (struct m0_fom *fom) |
static size_t | trigger_fom_home_locality (const struct m0_fom *fom) |
static int | prepare (struct m0_fom *fom) |
static int | ready (struct m0_fom *fom) |
static int | start (struct m0_fom *fom) |
M0_INTERNAL int | m0_trigger_fom_create (struct m0_trigger_fom *tfom, struct m0_fop *fop, struct m0_reqh *reqh) |
static struct m0_cm * | trig2cm (const struct m0_fom *fom) |
static struct m0_trigger_fom * | trig2tfom (const struct m0_fom *fom) |
static void | trigger_rep_set (struct m0_fom *fom) |
M0_INTERNAL void | m0_cm_trigger_fop_fini (struct m0_fop_type *ft) |
M0_INTERNAL void | m0_cm_trigger_fop_init (struct m0_fop_type *ft, enum M0_RPC_OPCODES op, const char *name, const struct m0_xcode_type *xt, uint64_t rpc_flags, struct m0_cm_type *cmt, const struct m0_fom_type_ops *ops) |
struct failure_data | M0_XCA_DOMAIN (rpc) |
Variables | |
static struct m0_tl | cmtypes |
static struct m0_mutex | cmtypes_mutex |
static struct m0_bob_type | cmtypes_bob |
static struct m0_sm_state_descr | cm_state_descr [M0_CMS_NR] |
static const struct m0_sm_conf | cm_sm_conf |
static const struct m0_bob_type | pump_bob |
static const struct m0_fom_type_ops | cm_cp_pump_fom_type_ops |
static struct m0_sm_state_descr | cm_cp_pump_sd [CPP_NR] |
struct m0_sm_trans_descr | cm_cp_pump_td [] |
struct m0_sm_conf | cm_cp_pump_conf |
static int(* | pump_action [])(struct m0_cm_cp_pump *cp_pump) |
static const struct m0_fom_ops | cm_cp_pump_fom_ops |
static const struct m0_fom_ops | trigger_fom_ops |
struct m0_sm_state_descr | m0_trigger_phases [] |
const struct m0_sm_conf | m0_trigger_conf |
static int(* | trig_action [])(struct m0_fom *) |
struct m0_fom_trigger_ops | M0_XCA_DOMAIN |
Copy machine is a replicated state machine to restructure data in various ways (e.g. copying, moving, re-striping, reconstructing, encrypting, compressing, reintegrating, etc.).
#define M0_TRACE_SUBSYSTEM M0_TRACE_SUBSYS_CM |
Definition at line 30 of file trigger_fom.c.
anonymous enum |
enum cm_cp_pump_fom_phase |
Enumerator | |
---|---|
CPP_ALLOC | New copy packets are allocated in this phase. m0_cm_cp_pump::p_fom is in CPP_ALLOC phase when it is initialised by m0_cm_cp_pump_start() and when m0_cm_sw_fill() is invoked from a copy packet FOM, during latter's finalisation, which sets the m0_cm_cp_pump::p_fom phase to CPP_ALLOC and calls m0_fom_wakeup(). |
CPP_FINI | |
CPP_DATA_NEXT | Copy packets allocated in CPP_ALLOC phase are configured in this phase. |
CPP_COMPLETE | m0_cm_cp_pump::p_fom is transitioned to CPP_COMPLETE phase, once m0_cm_data_next() returns -ENODATA (i.e. there's no more data to process for the iterator). |
CPP_STOP | |
CPP_FAIL | Copy machine is notified about the failure, and m0_cm_cp_pump::p_fom remains in CPP_FAIL state. Once copy machine handles the failure pump FOM is resumed, else stopped if the copy machine operation is to be terminated. |
CPP_NR |
enum m0_cm_state |
Copy machine states.
Enumerator | |
---|---|
M0_CMS_INIT | |
M0_CMS_IDLE | |
M0_CMS_PREPARE | |
M0_CMS_READY | |
M0_CMS_ACTIVE | |
M0_CMS_FAIL | |
M0_CMS_STOP | |
M0_CMS_FINI | |
M0_CMS_NR |
enum struct m0_sm_state_descr m0_trigger_phases |
Enumerator | |
---|---|
M0_TPH_PREPARE | |
M0_TPH_READY | |
M0_TPH_START | |
M0_TPH_FINI |
Definition at line 52 of file trigger_fom.h.
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
M0_BOB_DEFINE | ( | static | , |
& | pump_bob, | ||
m0_cm_cp_pump | |||
) |
M0_BOB_DEFINE | ( | static | , |
& | cmtypes_bob, | ||
m0_cm_type | |||
) |
M0_INTERNAL void m0_cm_abort | ( | struct m0_cm * | cm, |
int | rc | ||
) |
M0_INTERNAL void m0_cm_ast_run_thread_fini | ( | struct m0_cm * | cm | ) |
M0_INTERNAL int m0_cm_ast_run_thread_init | ( | struct m0_cm * | cm | ) |
M0_INTERNAL struct m0_net_buffer * m0_cm_buffer_get | ( | struct m0_net_buffer_pool * | bp, |
uint64_t | colour | ||
) |
M0_INTERNAL void m0_cm_buffer_put | ( | struct m0_net_buffer_pool * | bp, |
struct m0_net_buffer * | buf, | ||
uint64_t | colour | ||
) |
M0_INTERNAL int m0_cm_complete | ( | struct m0_cm * | cm | ) |
M0_INTERNAL void m0_cm_complete_notify | ( | struct m0_cm * | cm | ) |
Configures a copy machine replica.
M0_INTERNAL void m0_cm_continue | ( | struct m0_cm * | cm | ) |
Creates copy packets and adds aggregation groups to m0_cm::cm_aggr_grps, if required.
M0_INTERNAL void m0_cm_cp_pump_destroy | ( | struct m0_cm * | cm | ) |
M0_INTERNAL void m0_cm_cp_pump_init | ( | struct m0_cm_type * | cmtype | ) |
bool m0_cm_cp_pump_is_complete | ( | const struct m0_cm_cp_pump * | cp_pump | ) |
M0_INTERNAL void m0_cm_cp_pump_prepare | ( | struct m0_cm * | cm | ) |
M0_INTERNAL void m0_cm_cp_pump_start | ( | struct m0_cm * | cm | ) |
Initialises pump FOM and submits it to reqh for processing. This is invoked from m0_cm_start()
Definition at line 479 of file pump.c.
M0_INTERNAL void m0_cm_fail | ( | struct m0_cm * | cm, |
int | rc | ||
) |
Handles various type of copy machine failures based on the failure code and errno.
cm | Failed copy machine. |
failure | Copy machine failure code. |
rc | errno to which sm rc will be set to. |
Definition at line 527 of file cm.c.
M0_INTERNAL void m0_cm_fini | ( | struct m0_cm * | cm | ) |
Finalises a copy machine. This is invoked from copy machine specific service fini routine.
Definition at line 964 of file cm.c.
M0_INTERNAL void m0_cm_frozen_ag_cleanup | ( | struct m0_cm * | cm, |
struct m0_cm_proxy * | proxy | ||
) |
Finds and destroys aggregation groups that are unable to progress further. SNS operation (repair/rebalance) specific implementation of struct m0_cm_aggr_group_ops::cago_is_frozen_on() helps check relevant parameters and identify if an aggregation group is frozen or not.
cm | Copy machine with frozen aggregation groups. |
proxy | Remote copy machine on which an aggregation group could be frozen on (in case expected incoming copy packets will not be arriving). Proxy can be NULL in case cleanup is invoked for local copy machine, this may be the case of single node setup, with no remote copy machines. |
Definition at line 1148 of file cm.c.
M0_INTERNAL bool m0_cm_has_more_data | ( | const struct m0_cm * | cm | ) |
Checks if copy machine pump FOM will be creating more copy packets or if its done. Once pump FOM is done creating copy packets, it sets m0_cm_cp_pump::p_fom.fo_sm_phase.sm_rc = -ENODATA, the same is checked by this function.
Definition at line 1052 of file cm.c.
M0_INTERNAL int m0_cm_init | ( | struct m0_cm * | cm, |
struct m0_cm_type * | cm_type, | ||
const struct m0_cm_ops * | cm_ops | ||
) |
Initialises a copy machine. This is invoked from copy machine specific service init routine. Transitions copy machine into M0_CMS_INIT state if the initialisation completes without any errors.
Definition at line 925 of file cm.c.
M0_INTERNAL bool m0_cm_invariant | ( | const struct m0_cm * | cm | ) |
M0_INTERNAL bool m0_cm_is_active | ( | struct m0_cm * | cm | ) |
M0_INTERNAL bool m0_cm_is_dirty | ( | struct m0_cm * | cm | ) |
M0_INTERNAL bool m0_cm_is_locked | ( | const struct m0_cm * | cm | ) |
M0_INTERNAL bool m0_cm_is_ready | ( | struct m0_cm * | cm | ) |
M0_INTERNAL void m0_cm_lock | ( | struct m0_cm * | cm | ) |
M0_INTERNAL void m0_cm_module_fini | ( | void | ) |
M0_INTERNAL int m0_cm_module_init | ( | void | ) |
M0_INTERNAL void m0_cm_notify | ( | struct m0_cm * | cm | ) |
M0_INTERNAL int m0_cm_prepare | ( | struct m0_cm * | cm | ) |
M0_INTERNAL int m0_cm_proxies_fini | ( | struct m0_cm * | cm | ) |
Finalising a proxy can be a blocking operation as we wait until the correspoding remote replica has completed its operations.
0 | On success. |
-EAGAIN | When proxy is not ready to be finalised. |
Definition at line 840 of file cm.c.
M0_INTERNAL bool m0_cm_proxies_updated | ( | struct m0_cm * | cm | ) |
M0_INTERNAL void m0_cm_proxy_failed_cleanup | ( | struct m0_cm * | cm | ) |
M0_INTERNAL int m0_cm_ready | ( | struct m0_cm * | cm | ) |
M0_INTERNAL struct m0_rpc_machine * m0_cm_rpc_machine_find | ( | struct m0_reqh * | reqh | ) |
M0_INTERNAL int m0_cm_setup | ( | struct m0_cm * | cm | ) |
Perfoms copy machine setup tasks by calling copy machine specific setup routine. This is invoked from copy machine specific service start routine. On successful completion of the setup, a copy machine transitions to "IDLE" state where it waits for a data restructuring request.
Definition at line 595 of file cm.c.
M0_INTERNAL int m0_cm_start | ( | struct m0_cm * | cm | ) |
Starts the copy machine data restructuring process on receiving the "POST" fop. Internally invokes copy machine specific start routine. Starts pump FOM.
Definition at line 805 of file cm.c.
M0_INTERNAL enum m0_cm_state m0_cm_state_get | ( | const struct m0_cm * | cm | ) |
M0_INTERNAL void m0_cm_state_set | ( | struct m0_cm * | cm, |
enum m0_cm_state | state | ||
) |
M0_INTERNAL int m0_cm_stop | ( | struct m0_cm * | cm | ) |
Stops copy machine operation. Once operation completes successfully, copy machine performs required tasks, (e.g. updating layouts, cleanup, etc.) by invoking m0_cm_stop(), this transitions copy machine back to M0_CMS_IDLE state. Copy machine invokes m0_cm_stop() also in case of operational failure to broadcast STOP FOPs to its other replicas in the pool, indicating failure. This is handled specific to the copy machine type.
Definition at line 866 of file cm.c.
M0_INTERNAL void m0_cm_trigger_fop_fini | ( | struct m0_fop_type * | ft | ) |
Finalises copy machine trigger FOP type.
Definition at line 353 of file trigger_fom.c.
M0_INTERNAL void m0_cm_trigger_fop_init | ( | struct m0_fop_type * | ft, |
enum M0_RPC_OPCODES | op, | ||
const char * | name, | ||
const struct m0_xcode_type * | xt, | ||
uint64_t | rpc_flags, | ||
struct m0_cm_type * | cmt, | ||
const struct m0_fom_type_ops * | ops | ||
) |
Initialises copy machine trigger FOP type.
Definition at line 358 of file trigger_fom.c.
M0_INTERNAL int m0_cm_trylock | ( | struct m0_cm * | cm | ) |
M0_INTERNAL void m0_cm_type_deregister | ( | struct m0_cm_type * | cmtype | ) |
M0_INTERNAL int m0_cm_type_register | ( | struct m0_cm_type * | cmtype | ) |
M0_INTERNAL void m0_cm_unlock | ( | struct m0_cm * | cm | ) |
M0_INTERNAL struct m0_cm * m0_cmsvc2cm | ( | struct m0_reqh_service * | cmsvc | ) |
M0_INTERNAL int m0_ha_cm_err_send | ( | struct m0_cm * | cm, |
int | rc | ||
) |
M0_TL_DEFINE | ( | cmtypes | , |
static | , | ||
struct m0_cm_type | |||
) |
M0_TL_DESCR_DEFINE | ( | cmtypes | , |
"copy machine types" | , | ||
static | , | ||
struct m0_cm_type | , | ||
ct_linkage | , | ||
ct_magix | , | ||
CM_TYPE_LINK_MAGIX | , | ||
CM_TYPE_HEAD_MAGIX | |||
) |
M0_INTERNAL int m0_trigger_fom_create | ( | struct m0_trigger_fom * | tfom, |
struct m0_fop * | fop, | ||
struct m0_reqh * | reqh | ||
) |
Definition at line 84 of file trigger_fom.c.
struct failure_data M0_XCA_DOMAIN | ( | rpc | ) |
|
static |
Definition at line 185 of file trigger_fom.c.
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
Definition at line 129 of file trigger_fom.c.
struct m0_sm_conf cm_cp_pump_conf |
|
static |
|
static |
|
static |
struct m0_sm_trans_descr cm_cp_pump_td[] |
|
static |
|
static |
|
static |
|
static |
|
static |
const struct m0_sm_conf m0_trigger_conf |
Definition at line 72 of file trigger_fom.c.
struct m0_sm_state_descr m0_trigger_phases[] |
Definition at line 55 of file trigger_fom.c.
struct m0_fom_trigger_ops M0_XCA_DOMAIN |
|
static |
|
static |
|
static |
Definition at line 78 of file trigger_fom.c.
|
static |
Definition at line 49 of file trigger_fom.c.