Motr  M0
fop.c File Reference
#include "lib/trace.h"
#include "cas/cas.h"
#include "cas/cas_xc.h"
#include "dtm0/fop.h"
#include "dtm0/fop_xc.h"
#include "dtm0/addb2.h"
#include "dtm0/drlink.h"
#include "dtm0/service.h"
#include "be/dtm0_log.h"
#include "be/queue.h"
#include "fop/fom_generic.h"
#include "lib/assert.h"
#include "lib/errno.h"
#include "lib/memory.h"
#include "lib/misc.h"
#include "reqh/reqh.h"
#include "rpc/rpc_opcodes.h"
Include dependency graph for fop.c:

Go to the source code of this file.

Data Structures

struct  dtm0_fom
 

Macros

#define M0_TRACE_SUBSYSTEM   M0_TRACE_SUBSYS_DTM0
 

Enumerations

enum  { M0_FOPH_DTM0_ENTRY = M0_FOPH_TYPE_SPECIFIC, M0_FOPH_DTM0_LOGGING, M0_FOPH_DTM0_TO_CAS, M0_FOPH_DTM0_CAS_DONE }
 

Functions

static int dtm0_emsg_fom_tick (struct m0_fom *fom)
 
static int dtm0_pmsg_fom_tick (struct m0_fom *fom)
 
static int dtm0_rmsg_fom_tick (struct m0_fom *fom)
 
static int dtm0_tmsg_fom_tick (struct m0_fom *fom)
 
static int dtm0_fom_create (struct m0_fop *fop, struct m0_fom **out, struct m0_reqh *reqh)
 
static void dtm0_fom_fini (struct m0_fom *fom)
 
static size_t dtm0_fom_locality (const struct m0_fom *fom)
 
static int dtm0_cas_fop_prepare (struct dtm0_req_fop *req, struct m0_fop_type *cas_fopt, struct m0_fop **cas_fop_out)
 
static int dtm0_cas_fom_spawn (struct dtm0_fom *dfom, struct m0_fop *cas_fop, void(*on_cas_fom_complete)(struct m0_fom_thralldom *, struct m0_fom *))
 
M0_INTERNAL void m0_dtm0_fop_fini (void)
 
M0_INTERNAL int m0_dtm0_fop_init (void)
 
M0_INTERNAL int m0_dtm0_logrec_update (struct m0_be_dtm0_log *log, struct m0_be_tx *tx, struct m0_dtm0_tx_desc *txd, struct m0_buf *payload)
 
M0_INTERNAL int m0_dtm0_on_committed (struct m0_fom *fom, const struct m0_dtm0_tid *id)
 
static void dtm0_cas_done_cb (struct m0_fom_thralldom *thrall, struct m0_fom *serf)
 

Variables

struct m0_fop_type dtm0_req_fop_fopt
 
struct m0_fop_type dtm0_rep_fop_fopt
 
struct m0_fop_type dtm0_redo_fop_fopt
 
static const struct m0_fom_ops dtm0_pmsg_fom_ops
 
static const struct m0_fom_ops dtm0_rmsg_fom_ops
 
static const struct m0_fom_ops dtm0_emsg_fom_ops
 
static const struct m0_fom_ops dtm0_tmsg_fom_ops
 
struct m0_reqh_service_type dtm0_service_type
 
static const struct m0_fom_type_ops dtm0_req_fom_type_ops
 
struct m0_sm_state_descr dtm0_phases []
 
struct m0_sm_trans_descr dtm0_phases_trans []
 
static struct m0_sm_conf dtm0_conf
 

Macro Definition Documentation

◆ M0_TRACE_SUBSYSTEM

#define M0_TRACE_SUBSYSTEM   M0_TRACE_SUBSYS_DTM0

Definition at line 23 of file fop.c.

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
M0_FOPH_DTM0_ENTRY 
M0_FOPH_DTM0_LOGGING 
M0_FOPH_DTM0_TO_CAS 
M0_FOPH_DTM0_CAS_DONE 

Definition at line 108 of file fop.c.

Function Documentation

◆ dtm0_cas_done_cb()

static void dtm0_cas_done_cb ( struct m0_fom_thralldom thrall,
struct m0_fom serf 
)
static

Definition at line 497 of file fop.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ dtm0_cas_fom_spawn()

static int dtm0_cas_fom_spawn ( struct dtm0_fom dfom,
struct m0_fop cas_fop,
void(*)(struct m0_fom_thralldom *, struct m0_fom *)  on_cas_fom_complete 
)
static

Definition at line 518 of file fop.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ dtm0_cas_fop_prepare()

static int dtm0_cas_fop_prepare ( struct dtm0_req_fop req,
struct m0_fop_type cas_fopt,
struct m0_fop **  cas_fop_out 
)
static

Definition at line 533 of file fop.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ dtm0_emsg_fom_tick()

static int dtm0_emsg_fom_tick ( struct m0_fom fom)
static

Definition at line 462 of file fop.c.

Here is the call graph for this function:

◆ dtm0_fom_create()

static int dtm0_fom_create ( struct m0_fop fop,
struct m0_fom **  out,
struct m0_reqh reqh 
)
static

Definition at line 211 of file fop.c.

Here is the call graph for this function:

◆ dtm0_fom_fini()

static void dtm0_fom_fini ( struct m0_fom fom)
static

Definition at line 268 of file fop.c.

Here is the call graph for this function:

◆ dtm0_fom_locality()

static size_t dtm0_fom_locality ( const struct m0_fom fom)
static

Definition at line 276 of file fop.c.

Here is the call graph for this function:

◆ dtm0_pmsg_fom_tick()

static int dtm0_pmsg_fom_tick ( struct m0_fom fom)
static

Definition at line 385 of file fop.c.

Here is the call graph for this function:

◆ dtm0_rmsg_fom_tick()

static int dtm0_rmsg_fom_tick ( struct m0_fom fom)
static

Definition at line 569 of file fop.c.

Here is the call graph for this function:

◆ dtm0_tmsg_fom_tick()

static int dtm0_tmsg_fom_tick ( struct m0_fom fom)
static

This fom is only being used in UTs.

Definition at line 631 of file fop.c.

Here is the call graph for this function:

◆ m0_dtm0_fop_fini()

M0_INTERNAL void m0_dtm0_fop_fini ( void  )

Definition at line 100 of file fop.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ m0_dtm0_fop_init()

M0_INTERNAL int m0_dtm0_fop_init ( void  )

Definition at line 166 of file fop.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ m0_dtm0_logrec_update()

M0_INTERNAL int m0_dtm0_logrec_update ( struct m0_be_dtm0_log log,
struct m0_be_tx tx,
struct m0_dtm0_tx_desc txd,
struct m0_buf payload 
)

Definition at line 284 of file fop.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ m0_dtm0_on_committed()

M0_INTERNAL int m0_dtm0_on_committed ( struct m0_fom fom,
const struct m0_dtm0_tid id 
)

Definition at line 300 of file fop.c.

Here is the call graph for this function:
Here is the caller graph for this function:

Variable Documentation

◆ dtm0_conf

struct m0_sm_conf dtm0_conf
static
Initial value:
= {
.scf_name = "dtm0-fom",
.scf_nr_states = ARRAY_SIZE(dtm0_phases),
.scf_state = dtm0_phases,
.scf_trans_nr = ARRAY_SIZE(dtm0_phases_trans),
.scf_trans = dtm0_phases_trans,
}
struct m0_sm_trans_descr dtm0_phases_trans[]
Definition: fop.c:140
struct m0_sm_state_descr dtm0_phases[]
Definition: fop.c:115
#define ARRAY_SIZE(a)
Definition: misc.h:45

Definition at line 158 of file fop.c.

◆ dtm0_emsg_fom_ops

const struct m0_fom_ops dtm0_emsg_fom_ops
static
Initial value:
= {
.fo_fini = dtm0_fom_fini,
.fo_tick = dtm0_emsg_fom_tick,
.fo_home_locality = dtm0_fom_locality
}
static void dtm0_fom_fini(struct m0_fom *fom)
Definition: fop.c:268
static int dtm0_emsg_fom_tick(struct m0_fom *fom)
Definition: fop.c:462
static size_t dtm0_fom_locality(const struct m0_fom *fom)
Definition: fop.c:276

Definition at line 82 of file fop.c.

◆ dtm0_phases

struct m0_sm_state_descr dtm0_phases[]
Initial value:
= {
.sd_name = "dtm0-entry",
},
.sd_name = "logging",
.sd_allowed = M0_BITS(M0_FOPH_SUCCESS,
},
.sd_name = "dtm0-to-cas",
},
.sd_name = "cas-done",
.sd_allowed = M0_BITS(M0_FOPH_SUCCESS,
},
}
#define M0_BITS(...)
Definition: misc.h:236

Definition at line 115 of file fop.c.

◆ dtm0_phases_trans

struct m0_sm_trans_descr dtm0_phases_trans[]
Initial value:
= {
{"dtm0-entry-fail", M0_FOPH_DTM0_ENTRY, M0_FOPH_FAILURE},
{"dtm0-entry-success", M0_FOPH_DTM0_ENTRY, M0_FOPH_SUCCESS},
{"dtm0-logging-fail", M0_FOPH_DTM0_LOGGING, M0_FOPH_FAILURE},
{"dtm0-logging-success", M0_FOPH_DTM0_LOGGING, M0_FOPH_SUCCESS},
{"dtm0-to-cas-fail", M0_FOPH_DTM0_TO_CAS, M0_FOPH_FAILURE},
{"dtm0-cas-success", M0_FOPH_DTM0_CAS_DONE, M0_FOPH_SUCCESS},
}
struct m0_sm_trans_descr m0_generic_phases_trans[]
Definition: fom_generic.c:765
#define ARRAY_SIZE(a)
Definition: misc.h:45

Definition at line 140 of file fop.c.

◆ dtm0_pmsg_fom_ops

const struct m0_fom_ops dtm0_pmsg_fom_ops
static
Initial value:
= {
.fo_fini = dtm0_fom_fini,
.fo_tick = dtm0_pmsg_fom_tick,
.fo_home_locality = dtm0_fom_locality
}
static void dtm0_fom_fini(struct m0_fom *fom)
Definition: fop.c:268
static int dtm0_pmsg_fom_tick(struct m0_fom *fom)
Definition: fop.c:385
static size_t dtm0_fom_locality(const struct m0_fom *fom)
Definition: fop.c:276

Definition at line 70 of file fop.c.

◆ dtm0_redo_fop_fopt

struct m0_fop_type dtm0_redo_fop_fopt

Definition at line 44 of file fop.c.

◆ dtm0_rep_fop_fopt

struct m0_fop_type dtm0_rep_fop_fopt

Definition at line 43 of file fop.c.

◆ dtm0_req_fom_type_ops

const struct m0_fom_type_ops dtm0_req_fom_type_ops
static
Initial value:
= {
.fto_create = dtm0_fom_create,
}
static int dtm0_fom_create(struct m0_fop *fop, struct m0_fom **out, struct m0_reqh *reqh)
Definition: fop.c:211

Definition at line 96 of file fop.c.

◆ dtm0_req_fop_fopt

struct m0_fop_type dtm0_req_fop_fopt

Definition at line 42 of file fop.c.

◆ dtm0_rmsg_fom_ops

const struct m0_fom_ops dtm0_rmsg_fom_ops
static
Initial value:
= {
.fo_fini = dtm0_fom_fini,
.fo_tick = dtm0_rmsg_fom_tick,
.fo_home_locality = dtm0_fom_locality
}
static int dtm0_rmsg_fom_tick(struct m0_fom *fom)
Definition: fop.c:569
static void dtm0_fom_fini(struct m0_fom *fom)
Definition: fop.c:268
static size_t dtm0_fom_locality(const struct m0_fom *fom)
Definition: fop.c:276

Definition at line 76 of file fop.c.

◆ dtm0_service_type

struct m0_reqh_service_type dtm0_service_type

Definition at line 60 of file service.c.

◆ dtm0_tmsg_fom_ops

const struct m0_fom_ops dtm0_tmsg_fom_ops
static
Initial value:
= {
.fo_fini = dtm0_fom_fini,
.fo_tick = dtm0_tmsg_fom_tick,
.fo_home_locality = dtm0_fom_locality
}
static void dtm0_fom_fini(struct m0_fom *fom)
Definition: fop.c:268
static int dtm0_tmsg_fom_tick(struct m0_fom *fom)
Definition: fop.c:631
static size_t dtm0_fom_locality(const struct m0_fom *fom)
Definition: fop.c:276

Definition at line 88 of file fop.c.