Motr  M0
Conf_foms

Functions

 M0_TL_DECLARE (m0_conf_cache, M0_INTERNAL, struct m0_conf_obj)
 
static int conf_flip_fom_tick (struct m0_fom *fom)
 
static void conf_flip_fom_fini (struct m0_fom *fom)
 
static int conf_flip_prepare (struct m0_fom *)
 
static int conf_flip_apply (struct m0_fom *)
 
static size_t conf_flip_fom_home_locality (const struct m0_fom *fom)
 
static bool conf_flip_fom_invariant (const struct m0_conf_flip_fom *fom)
 
M0_INTERNAL int m0_conf_flip_fom_create (struct m0_fop *fop, struct m0_fom **out, struct m0_reqh *reqh)
 
static int conf_flip_confd_config_save (char *filename, char *buffer)
 
static int conf_after_flip_apply (struct m0_reqh *reqh, const char *filename)
 
 M0_TL_DESCR_DECLARE (rpcbulk, M0_EXTERN)
 
static int conf_load_fom_tick (struct m0_fom *fom)
 
static void conf_load_fom_fini (struct m0_fom *fom)
 
static int conf_net_buffer_allocate (struct m0_fom *)
 
static int conf_prepare (struct m0_fom *)
 
static int conf_buffer_free (struct m0_fom *)
 
static int conf_zero_copy_initiate (struct m0_fom *)
 
static int conf_zero_copy_finish (struct m0_fom *)
 
static size_t conf_load_fom_home_locality (const struct m0_fom *fom)
 
static bool conf_load_fom_invariant (const struct m0_conf_load_fom *fom)
 
M0_INTERNAL int m0_conf_load_fom_create (struct m0_fop *fop, struct m0_fom **out, struct m0_reqh *reqh)
 
static int conf_fom_conf_file_save (struct m0_conf_load_fom *conf_fom)
 

Variables

const struct m0_fom_ops conf_flip_fom_ops
 
const struct m0_fom_type_ops conf_flip_fom_type_ops
 
struct m0_sm_state_descr conf_flip_phases []
 
struct m0_sm_conf conf_flip_conf
 
const struct m0_fom_ops conf_load_fom_ops
 
const struct m0_fom_type_ops conf_load_fom_type_ops
 
struct m0_sm_state_descr conf_load_phases []
 
struct m0_sm_conf conf_load_conf
 

Detailed Description

Function Documentation

◆ conf_after_flip_apply()

static int conf_after_flip_apply ( struct m0_reqh reqh,
const char *  filename 
)
static

After successful FLIP completion, rconfc appears retaining an outdated conf cache. To the moment, local conf file is already updated by FLIP action. So it is ultimately possible to do a simple conf reload with the newly saved conf to update the conf cache hosted by rconfc internals.

Definition at line 192 of file flip_fom.c.

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

◆ conf_buffer_free()

static int conf_buffer_free ( struct m0_fom fom)
static

Finalises bufvec and free allocated memory.

Parameters
fominstance file operation machine under execution
Precondition
fom != NULL
fom->fo_fop if Conf Load type
m0_fom_phase(fom) == M0_FOPH_CONF_BUFFER_FREE

Definition at line 418 of file load_fom.c.

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

◆ conf_flip_apply()

static int conf_flip_apply ( struct m0_fom fom)
static

Apply Flip command Change Confd configuration

  1. Used FOP data read confd configure from IO STOB
  2. Try apply data to confd
  3. If OK then replace confd configure file and change current version else restore previous configuration
Parameters
fomfile operation machine.
Precondition
fom != NULL
fop is Flip fop
m0_fom_phase(fom) == M0_FOPH_CONF_APPLY

Definition at line 242 of file flip_fom.c.

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

◆ conf_flip_confd_config_save()

static int conf_flip_confd_config_save ( char *  filename,
char *  buffer 
)
static

Definition at line 161 of file flip_fom.c.

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

◆ conf_flip_fom_fini()

static void conf_flip_fom_fini ( struct m0_fom fom)
static

Finalise of Spiel file operation machine. This is the right place to free all resources acquired by FOM

Parameters
fominstance file operation machine under execution
Precondition
fom != NULL

Definition at line 357 of file flip_fom.c.

Here is the call graph for this function:

◆ conf_flip_fom_home_locality()

static size_t conf_flip_fom_home_locality ( const struct m0_fom fom)
static

Definition at line 370 of file flip_fom.c.

Here is the call graph for this function:

◆ conf_flip_fom_invariant()

static bool conf_flip_fom_invariant ( const struct m0_conf_flip_fom fom)
static

Compare equals Spiel FOP - Spiel FOM

Definition at line 103 of file flip_fom.c.

Here is the caller graph for this function:

◆ conf_flip_fom_tick()

static int conf_flip_fom_tick ( struct m0_fom fom)
static

Phase transition for the Spiel FLIP operation.

Parameters
fominstance file operation machine under execution
Precondition
fom != NULL
fop from fom is Flip fop

Definition at line 312 of file flip_fom.c.

Here is the call graph for this function:

◆ conf_flip_prepare()

static int conf_flip_prepare ( struct m0_fom fom)
static

Definition at line 153 of file flip_fom.c.

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

◆ conf_fom_conf_file_save()

static int conf_fom_conf_file_save ( struct m0_conf_load_fom conf_fom)
static

Copies data from FOM Net buffer field to IO STOB STOB domain is placed to confd configure file folder FID consists to old version, new version and TX id

See also
M0_CONFD_FID
Parameters
conf_fomfile operation machine.

Definition at line 342 of file load_fom.c.

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

◆ conf_load_fom_fini()

static void conf_load_fom_fini ( struct m0_fom fom)
static

Finalises Spiel file operation machine. This is the right place to free all resources acquired by FOM

Parameters
fominstance file operation machine under execution
Precondition
fom != NULL

Definition at line 495 of file load_fom.c.

Here is the call graph for this function:

◆ conf_load_fom_home_locality()

static size_t conf_load_fom_home_locality ( const struct m0_fom fom)
static

Definition at line 508 of file load_fom.c.

Here is the call graph for this function:

◆ conf_load_fom_invariant()

static bool conf_load_fom_invariant ( const struct m0_conf_load_fom fom)
static

Definition at line 102 of file load_fom.c.

Here is the caller graph for this function:

◆ conf_load_fom_tick()

static int conf_load_fom_tick ( struct m0_fom fom)
static

Phase transition for the Spiel Load operation.

Definition at line 449 of file load_fom.c.

Here is the call graph for this function:

◆ conf_net_buffer_allocate()

static int conf_net_buffer_allocate ( struct m0_fom fom)
static

Allocates a network buffer for process bulk request.

Parameters
fomfile operation machine instance.
Precondition
fom != NULL
fom->fo_fop if Conf Load type
fom->fo_service != NULL
m0_fom_phase(fom) == M0_FOPH_CONF_FOM_BUFFER_ALLOCATE

Definition at line 201 of file load_fom.c.

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

◆ conf_prepare()

static int conf_prepare ( struct m0_fom fom)
static

Prepares FOM data. Set current Confd version as FOP report parameter.

Parameters
fomfile operation machine instance.
Precondition
fom != NULL
fom->fo_fop if Conf Load type
fom->fo_service != NULL
m0_fom_phase(fom) == M0_FOPH_CONF_FOM_PREPARE

Definition at line 161 of file load_fom.c.

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

◆ conf_zero_copy_finish()

static int conf_zero_copy_finish ( struct m0_fom fom)
static

Zero-copy Finish Checks for zero-copy result.

Parameters
fomfile operation machine.
Precondition
fom != NULL
fom->fo_fop if Conf Load type
m0_fom_phase(fom) == M0_FOPH_CONF_ZERO_COPY_WAIT

Definition at line 379 of file load_fom.c.

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

◆ conf_zero_copy_initiate()

static int conf_zero_copy_initiate ( struct m0_fom fom)
static

Initiates zero-copy for batch of descriptors. And wait for zero-copy to complete for all descriptors. Network layer signaled on m0_rpc_bulk::rb_chan on completion.

Parameters
fomfile operation machine.
Precondition
fom != NULL
fom->fo_fop if Conf Load type
m0_fom_phase(fom) == M0_FOPH_CONF_ZERO_COPY_INIT

Definition at line 251 of file load_fom.c.

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

◆ m0_conf_flip_fom_create()

M0_INTERNAL int m0_conf_flip_fom_create ( struct m0_fop fop,
struct m0_fom **  out,
struct m0_reqh reqh 
)

Create and initiate Spiel FOM and return generic struct m0_fom Find the corresponding fom_type and associate it with m0_fom. Associate fop with fom type.

Parameters
fopfile operation packet need to process
outfile operation machine need to allocate and initiate
Precondition
fop != NULL
fop is m0_fop_conf_flip
out != NULL
reqh != NULL

Definition at line 121 of file flip_fom.c.

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

◆ m0_conf_load_fom_create()

M0_INTERNAL int m0_conf_load_fom_create ( struct m0_fop fop,
struct m0_fom **  out,
struct m0_reqh reqh 
)

Creates and initiates Spiel FOM and return generic struct m0_fom Find the corresponding fom_type and associate it with m0_fom. Associate fop with fom type.

Parameters
fopfile operation packet need to process
outfile operation machine need to allocate and initiate
Precondition
fop != NULL
fop is m0_fop_conf_load
out != NULL

Definition at line 119 of file load_fom.c.

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

◆ M0_TL_DECLARE()

M0_TL_DECLARE ( m0_conf_cache  ,
M0_INTERNAL  ,
struct m0_conf_obj   
)

◆ M0_TL_DESCR_DECLARE()

M0_TL_DESCR_DECLARE ( rpcbulk  ,
M0_EXTERN   
)

Variable Documentation

◆ conf_flip_conf

struct m0_sm_conf conf_flip_conf
Initial value:
= {
.scf_name = "Conf_Flip_phases",
.scf_nr_states = ARRAY_SIZE(conf_flip_phases),
.scf_state = conf_flip_phases,
}
struct m0_sm_state_descr conf_flip_phases[]
Definition: flip_fom.c:79
#define ARRAY_SIZE(a)
Definition: misc.h:45

Definition at line 94 of file flip_fom.c.

◆ conf_flip_fom_ops

const struct m0_fom_ops conf_flip_fom_ops
Initial value:
= {
.fo_fini = conf_flip_fom_fini,
.fo_tick = conf_flip_fom_tick,
.fo_home_locality = conf_flip_fom_home_locality,
}
static size_t conf_flip_fom_home_locality(const struct m0_fom *fom)
Definition: flip_fom.c:370
static int conf_flip_fom_tick(struct m0_fom *fom)
Definition: flip_fom.c:312
static void conf_flip_fom_fini(struct m0_fom *fom)
Definition: flip_fom.c:357

Spiel Load FOM operation vector.

Definition at line 63 of file flip_fom.c.

◆ conf_flip_fom_type_ops

const struct m0_fom_type_ops conf_flip_fom_type_ops
Initial value:
= {
.fto_create = m0_conf_flip_fom_create,
}
M0_INTERNAL int m0_conf_flip_fom_create(struct m0_fop *fop, struct m0_fom **out, struct m0_reqh *reqh)
Definition: flip_fom.c:121

Spiel Load FOM type operation vector.

Definition at line 72 of file flip_fom.c.

◆ conf_flip_phases

struct m0_sm_state_descr conf_flip_phases[]
Initial value:
= {
.sd_flags = M0_SDF_INITIAL,
.sd_name = "Conf_flip_Prepare",
.sd_allowed = M0_BITS(M0_FOPH_CONF_APPLY,
},
.sd_name = "Conf_Flip_Apply",
.sd_allowed = M0_BITS(M0_FOPH_SUCCESS,
},
}
#define M0_BITS(...)
Definition: misc.h:236

Spiel FOM state transition table.

Definition at line 79 of file flip_fom.c.

◆ conf_load_conf

struct m0_sm_conf conf_load_conf
Initial value:
= {
.scf_name = "Conf_load_phases",
.scf_nr_states = ARRAY_SIZE(conf_load_phases),
.scf_state = conf_load_phases,
}
struct m0_sm_state_descr conf_load_phases[]
Definition: load_fom.c:66
#define ARRAY_SIZE(a)
Definition: misc.h:45

Definition at line 96 of file load_fom.c.

◆ conf_load_fom_ops

const struct m0_fom_ops conf_load_fom_ops
Initial value:
= {
.fo_fini = conf_load_fom_fini,
.fo_tick = conf_load_fom_tick,
.fo_home_locality = conf_load_fom_home_locality,
}
static size_t conf_load_fom_home_locality(const struct m0_fom *fom)
Definition: load_fom.c:508
static int conf_load_fom_tick(struct m0_fom *fom)
Definition: load_fom.c:449
static void conf_load_fom_fini(struct m0_fom *fom)
Definition: load_fom.c:495

Spiel Load FOM operation vector.

Definition at line 50 of file load_fom.c.

◆ conf_load_fom_type_ops

const struct m0_fom_type_ops conf_load_fom_type_ops
Initial value:
= {
.fto_create = m0_conf_load_fom_create,
}
M0_INTERNAL int m0_conf_load_fom_create(struct m0_fop *fop, struct m0_fom **out, struct m0_reqh *reqh)
Definition: load_fom.c:119

Spiel Load FOM type operation vector.

Definition at line 59 of file load_fom.c.

◆ conf_load_phases

struct m0_sm_state_descr conf_load_phases[]
Initial value:
= {
.sd_flags = M0_SDF_INITIAL,
.sd_name = "Conf_load_Prepare",
},
.sd_name = "Network_Buffer_Acquire",
},
.sd_name = "Zero-copy_Initiate",
},
.sd_name = "Zero-copy_Finish",
},
.sd_name = "Conf_load_Finish",
.sd_allowed = M0_BITS(M0_FOPH_SUCCESS,
},
}
#define M0_BITS(...)
Definition: misc.h:236

Spiel FOM state transition table.

Definition at line 66 of file load_fom.c.