Go to the source code of this file.
◆ M0_TRACE_SUBSYSTEM
#define M0_TRACE_SUBSYSTEM M0_TRACE_SUBSYS_COB |
◆ fsync_fom_phase
Phase names of an fsync fom
Enumerator |
---|
M0_FOPH_FSYNC_FOM_START | |
M0_FOPH_FSYNC_FOM_WAIT | |
M0_FOPH_FSYNC_DATASYNC | |
Definition at line 60 of file fsync_foms.c.
◆ fsync_fom_fini()
static void fsync_fom_fini |
( |
struct m0_fom * |
fom | ) |
|
|
static |
Finalizes and releases an fsync fom.
- Parameters
-
fom | fsync fom to be released. |
Definition at line 321 of file fsync_foms.c.
◆ fsync_fom_locality_get()
static size_t fsync_fom_locality_get |
( |
const struct m0_fom * |
fom | ) |
|
|
static |
Returns the locality of an fsync fom. This affects the processor where the fom is to be processed.
- Parameters
-
fom | fom whose locality is to be retrieved. |
- Returns
- A locality ID.
Definition at line 308 of file fsync_foms.c.
◆ fsync_fom_tick()
static int fsync_fom_tick |
( |
struct m0_fom * |
fom | ) |
|
|
static |
Controls the simple logic of the fsync fom's state machine. If the target transaction is already logged, the processing of the fsync fop is finished. If, on the contrary, the target transaction has not been logged yet, the fsync fom performs the following actions depending on the phase of the fsync state machine:
- M0_FOPH_FSYNC_FOM_START: If the fop request includes the M0_BT_ACTIVE mode flag, the target transaction gets forced. The fom's phase then changes to M0_FOPH_FSYNC_FOM_WAIT.
- M0_FOPH_FSYNC_FOM_WAIT: The fsync fom registers itself to be notified when the state of the target transaction changes and then waits. Whenever the target transaction gets finally logged, the fsync fom gets woken up so it can complete the processing of the fsync request and send the corresponding fsync reply.
- Parameters
-
fom | fsync fom processing the fsync FOP request. |
- Returns
- Always M0_FSO_WAIT. Note that if the processing of the fsync fop is considered completed, the phase of the fsync fom is set to M0_FOPH_FSYNC_FOM_FINISH. In this later case, a return code is included in the fsync fop reply.
Definition at line 174 of file fsync_foms.c.
◆ fsync_target_tx_get()
static struct m0_be_tx* fsync_target_tx_get |
( |
struct m0_fom * |
fom, |
|
|
uint64_t |
txid |
|
) |
| |
|
static |
Gets the transaction an fsync fop request is targeted to.
- Parameters
-
fom | fom associated to the fsync fop request being processed. |
txid | ID of the target transaction. |
- Returns
- A pointer to the target transaction or NULL if the operation failed.
Definition at line 141 of file fsync_foms.c.
◆ m0_fsync_req_fom_create()
M0_INTERNAL int m0_fsync_req_fom_create |
( |
struct m0_fop * |
fop, |
|
|
struct m0_fom ** |
out, |
|
|
struct m0_reqh * |
reqh |
|
) |
| |
Creates a new fsync fom for a given fsync fop request.
Definition at line 330 of file fsync_foms.c.
◆ fsync_fom_ops
Initial value:= {
}
static void fsync_fom_fini(struct m0_fom *fom)
static size_t fsync_fom_locality_get(const struct m0_fom *fom)
static int fsync_fom_tick(struct m0_fom *fom)
fsync fom operations
Definition at line 51 of file fsync_foms.c.
◆ fsync_fom_phases_trans
Initial value:= {
}
struct m0_sm_trans_descr m0_generic_phases_trans[]
Valid phase transitions for an fsync fom.
Definition at line 94 of file fsync_foms.c.
◆ m0_fsync_fom_conf
Initial value:= {
.scf_name = "fsync",
}
struct m0_sm_state_descr m0_fsync_fom_phases[]
static struct m0_sm_trans_descr fsync_fom_phases_trans[]
This object defines the phases of an fsync fom. It is used when initializing an fsync fom.
An fsync fom has two different phases:
- M0_FOPH_FSYNC_FOM_START: This is the initial state for any fsync fom.
In this phase, the fom knows its tick function has not been invoked
before. Only if the fsync request includes the M0_FSYNC_MODE_ACTIVE
mode, the target transaction is forced. In any case, after the first
tick the machine's phase changes to M0_FOPH_FSYNC_FOM_WAIT.
- M0_FOPH_FSYNC_FOM_WAIT: The fom waits on the target transaction until
its state changes to M0_BTS_LOGGED.
Definition at line 123 of file fsync_foms.c.
◆ m0_fsync_fom_phases
Initial value:= {
.sd_name = "start",
},
.sd_name = "wait",
},
.sd_name = "datasync",
},
}
Phases of an fsync fom
Definition at line 69 of file fsync_foms.c.