Motr  M0
Spiel API public interface

Data Structures

struct  m0_spiel_repreb_status
 
struct  m0_spiel_sns_status
 
struct  m0_spiel
 
struct  m0_spiel_tx
 
struct  m0_spiel_service_info
 
struct  m0_spiel_running_svc
 
struct  m0_spiel_bckey
 
struct  m0_spiel_bcrec
 
struct  m0_proc_counter
 
struct  m0_fs_stats
 

Enumerations

enum  m0_repreb_type { M0_REPREB_TYPE_SNS, M0_REPREB_TYPE_DIX, M0_REPREB_TYPE_NR }
 

Functions

int m0_spiel_init (struct m0_spiel *spiel, struct m0_reqh *reqh)
 
void m0_spiel_fini (struct m0_spiel *spiel)
 
void m0_spiel_tx_open (struct m0_spiel *spiel, struct m0_spiel_tx *tx)
 
void m0_spiel_tx_close (struct m0_spiel_tx *tx)
 
int m0_spiel_tx_commit (struct m0_spiel_tx *tx)
 
int m0_spiel_tx_commit_forced (struct m0_spiel_tx *tx, bool forced, uint64_t ver_forced, uint32_t *rquorum)
 
int m0_spiel_root_add (struct m0_spiel_tx *tx, const struct m0_fid *rootfid, const struct m0_fid *mdpool, const struct m0_fid *imeta_pver, uint32_t mdredundancy, const char **params)
 
int m0_spiel_node_add (struct m0_spiel_tx *tx, const struct m0_fid *fid, uint32_t memsize, uint32_t nr_cpu, uint64_t last_state, uint64_t flags)
 
int m0_spiel_process_add (struct m0_spiel_tx *tx, const struct m0_fid *fid, const struct m0_fid *parent, struct m0_bitmap *cores, uint64_t memlimit_as, uint64_t memlimit_rss, uint64_t memlimit_stack, uint64_t memlimit_memlock, const char *endpoint)
 
int m0_spiel_service_add (struct m0_spiel_tx *tx, const struct m0_fid *fid, const struct m0_fid *parent, const struct m0_spiel_service_info *service_info)
 
int m0_spiel_device_add (struct m0_spiel_tx *tx, const struct m0_fid *fid, const struct m0_fid *parent, const struct m0_fid *drive, uint32_t dev_idx, enum m0_cfg_storage_device_interface_type iface, enum m0_cfg_storage_device_media_type media, uint32_t bsize, uint64_t size, uint64_t last_state, uint64_t flags, const char *filename)
 
int m0_spiel_site_add (struct m0_spiel_tx *tx, const struct m0_fid *fid)
 
int m0_spiel_rack_add (struct m0_spiel_tx *tx, const struct m0_fid *fid, const struct m0_fid *parent)
 
int m0_spiel_enclosure_add (struct m0_spiel_tx *tx, const struct m0_fid *fid, const struct m0_fid *parent, const struct m0_fid *node)
 
int m0_spiel_controller_add (struct m0_spiel_tx *tx, const struct m0_fid *fid, const struct m0_fid *parent)
 
int m0_spiel_drive_add (struct m0_spiel_tx *tx, const struct m0_fid *fid, const struct m0_fid *parent)
 
int m0_spiel_pool_add (struct m0_spiel_tx *tx, const struct m0_fid *fid, uint32_t pver_policy)
 
int m0_spiel_pver_actual_add (struct m0_spiel_tx *tx, const struct m0_fid *fid, const struct m0_fid *parent, const struct m0_pdclust_attr *attrs, uint32_t *tolerance, uint32_t tolerance_len)
 
int m0_spiel_pver_formulaic_add (struct m0_spiel_tx *tx, const struct m0_fid *fid, const struct m0_fid *parent, uint32_t index, const struct m0_fid *base_pver, uint32_t *allowance, uint32_t allowance_len)
 
int m0_spiel_site_v_add (struct m0_spiel_tx *tx, const struct m0_fid *fid, const struct m0_fid *parent, const struct m0_fid *real)
 
int m0_spiel_rack_v_add (struct m0_spiel_tx *tx, const struct m0_fid *fid, const struct m0_fid *parent, const struct m0_fid *real)
 
int m0_spiel_enclosure_v_add (struct m0_spiel_tx *tx, const struct m0_fid *fid, const struct m0_fid *parent, const struct m0_fid *real)
 
int m0_spiel_controller_v_add (struct m0_spiel_tx *tx, const struct m0_fid *fid, const struct m0_fid *parent, const struct m0_fid *real)
 
int m0_spiel_drive_v_add (struct m0_spiel_tx *tx, const struct m0_fid *fid, const struct m0_fid *parent, const struct m0_fid *real)
 
int m0_spiel_pool_version_done (struct m0_spiel_tx *tx, const struct m0_fid *fid)
 
int m0_spiel_profile_add (struct m0_spiel_tx *tx, const struct m0_fid *fid)
 
int m0_spiel_profile_pool_add (struct m0_spiel_tx *tx, const struct m0_fid *profile, const struct m0_fid *pool)
 
int m0_spiel_element_del (struct m0_spiel_tx *tx, const struct m0_fid *fid)
 
int m0_spiel_tx_validate (struct m0_spiel_tx *tx)
 
int m0_spiel_tx_to_str (struct m0_spiel_tx *tx, uint64_t ver_forced, char **str)
 
void m0_spiel_tx_str_free (char *str)
 
int m0_spiel_tx_dump (struct m0_spiel_tx *tx, uint64_t ver_forced, const char *filename)
 
int m0_spiel_tx_dump_debug (struct m0_spiel_tx *tx, uint64_t ver_forced, const char *filename)
 
int m0_spiel_rconfc_start (struct m0_spiel *spiel, m0_rconfc_cb_t expired_cb)
 
void m0_spiel_rconfc_stop (struct m0_spiel *spiel)
 
int m0_spiel_cmd_profile_set (struct m0_spiel *spiel, const char *profile_str)
 
int m0_spiel_service_init (struct m0_spiel *spl, const struct m0_fid *svc_fid)
 
int m0_spiel_service_start (struct m0_spiel *spl, const struct m0_fid *svc_fid)
 
int m0_spiel_service_stop (struct m0_spiel *spl, const struct m0_fid *svc_fid)
 
int m0_spiel_service_health (struct m0_spiel *spl, const struct m0_fid *svc_fid)
 
int m0_spiel_service_status (struct m0_spiel *spl, const struct m0_fid *svc_fid, int *status)
 
int m0_spiel_service_quiesce (struct m0_spiel *spl, const struct m0_fid *svc_fid)
 
int m0_spiel_device_attach (struct m0_spiel *spl, const struct m0_fid *dev_fid)
 
int m0_spiel_device_attach_state (struct m0_spiel *spl, const struct m0_fid *dev_fid, uint32_t *ha_state)
 
int m0_spiel_device_detach (struct m0_spiel *spl, const struct m0_fid *dev_fid)
 
int m0_spiel_device_format (struct m0_spiel *spl, const struct m0_fid *dev_fid)
 
int m0_spiel_process_stop (struct m0_spiel *spl, const struct m0_fid *proc_fid)
 
int m0_spiel_process_reconfig (struct m0_spiel *spl, const struct m0_fid *proc_fid)
 
int m0_spiel_process_health (struct m0_spiel *spl, const struct m0_fid *proc_fid)
 
int m0_spiel_process_quiesce (struct m0_spiel *spl, const struct m0_fid *proc_fid)
 
int m0_spiel_process_list_services (struct m0_spiel *spl, const struct m0_fid *proc_fid, struct m0_spiel_running_svc **services)
 
int m0_spiel_process_lib_load (struct m0_spiel *spl, const struct m0_fid *proc_fid, const char *libname)
 
int m0_spiel_sns_repair_start (struct m0_spiel *spl, const struct m0_fid *pool_fid)
 
int m0_spiel_dix_repair_start (struct m0_spiel *spl, const struct m0_fid *pool_fid)
 
int m0_spiel_pool_repair_start (struct m0_spiel *spl, const struct m0_fid *pool_fid)
 
int m0_spiel_sns_repair_continue (struct m0_spiel *spl, const struct m0_fid *pool_fid)
 
int m0_spiel_dix_repair_continue (struct m0_spiel *spl, const struct m0_fid *pool_fid)
 
int m0_spiel_pool_repair_continue (struct m0_spiel *spl, const struct m0_fid *pool_fid)
 
int m0_spiel_sns_repair_quiesce (struct m0_spiel *spl, const struct m0_fid *pool_fid)
 
int m0_spiel_dix_repair_quiesce (struct m0_spiel *spl, const struct m0_fid *pool_fid)
 
int m0_spiel_pool_repair_quiesce (struct m0_spiel *spl, const struct m0_fid *pool_fid)
 
int m0_spiel_sns_repair_abort (struct m0_spiel *spl, const struct m0_fid *pool_fid)
 
int m0_spiel_dix_repair_abort (struct m0_spiel *spl, const struct m0_fid *pool_fid)
 
int m0_spiel_pool_repair_abort (struct m0_spiel *spl, const struct m0_fid *pool_fid)
 
int m0_spiel_sns_repair_status (struct m0_spiel *spl, const struct m0_fid *pool_fid, struct m0_spiel_repreb_status **statuses)
 
int m0_spiel_dix_repair_status (struct m0_spiel *spl, const struct m0_fid *pool_fid, struct m0_spiel_repreb_status **statuses)
 
int m0_spiel_pool_repair_status (struct m0_spiel *spl, const struct m0_fid *pool_fid, struct m0_spiel_sns_status **statuses)
 
int m0_spiel_sns_rebalance_start (struct m0_spiel *spl, const struct m0_fid *pool_fid)
 
int m0_spiel_dix_rebalance_start (struct m0_spiel *spl, const struct m0_fid *pool_fid)
 
int m0_spiel_pool_rebalance_start (struct m0_spiel *spl, const struct m0_fid *pool_fid)
 
int m0_spiel_node_direct_rebalance_start (struct m0_spiel *spl, const struct m0_fid *node)
 
int m0_spiel_sns_rebalance_continue (struct m0_spiel *spl, const struct m0_fid *pool_fid)
 
int m0_spiel_dix_rebalance_continue (struct m0_spiel *spl, const struct m0_fid *pool_fid)
 
int m0_spiel_pool_rebalance_continue (struct m0_spiel *spl, const struct m0_fid *pool_fid)
 
int m0_spiel_sns_rebalance_quiesce (struct m0_spiel *spl, const struct m0_fid *pool_fid)
 
int m0_spiel_dix_rebalance_quiesce (struct m0_spiel *spl, const struct m0_fid *pool_fid)
 
int m0_spiel_pool_rebalance_quiesce (struct m0_spiel *spl, const struct m0_fid *pool_fid)
 
int m0_spiel_sns_rebalance_status (struct m0_spiel *spl, const struct m0_fid *pool_fid, struct m0_spiel_repreb_status **statuses)
 
int m0_spiel_dix_rebalance_status (struct m0_spiel *spl, const struct m0_fid *pool_fid, struct m0_spiel_repreb_status **statuses)
 
int m0_spiel_pool_rebalance_status (struct m0_spiel *spl, const struct m0_fid *pool_fid, struct m0_spiel_sns_status **statuses)
 
int m0_spiel_sns_rebalance_abort (struct m0_spiel *spl, const struct m0_fid *pool_fid)
 
int m0_spiel_dix_rebalance_abort (struct m0_spiel *spl, const struct m0_fid *pool_fid)
 
int m0_spiel_pool_rebalance_abort (struct m0_spiel *spl, const struct m0_fid *pool_fid)
 
int m0_spiel_proc_counters_fetch (struct m0_spiel *spl, struct m0_fid *proc_fid, struct m0_proc_counter *count_stats)
 
int m0_spiel_filesystem_stats_fetch (struct m0_spiel *spl, struct m0_fs_stats *stats)
 
M0_INTERNAL int m0_spiel__fs_stats_fetch (struct m0_spiel_core *spc, struct m0_fs_stats *stats)
 
int m0_spiel_confstr (struct m0_spiel *spl, char **out)
 
int m0_spiel_conf_pver_status (struct m0_spiel *spl, struct m0_fid *fid, struct m0_conf_pver_info *out_info)
 

Detailed Description

Enumeration Type Documentation

◆ m0_repreb_type

Enumerator
M0_REPREB_TYPE_SNS 
M0_REPREB_TYPE_DIX 
M0_REPREB_TYPE_NR 

Definition at line 183 of file spiel.h.

Function Documentation

◆ m0_spiel__fs_stats_fetch()

M0_INTERNAL int m0_spiel__fs_stats_fetch ( struct m0_spiel_core *  spc,
struct m0_fs_stats stats 
)

A less demanding version of m0_spiel_filesystem_stats_fetch() requiring a properly initialised m0_spiel_core as a "lightweight spiel" instance.

Precondition
spc->spc_rmachine != NULL
spc->spc_confc != NULL
m0_conf_fid_type(&spc->spc_profile) == &M0_CONF_PROFILE_TYPE

Definition at line 2315 of file cmd.c.

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

◆ m0_spiel_cmd_profile_set()

int m0_spiel_cmd_profile_set ( struct m0_spiel spiel,
const char *  profile_str 
)

Set spiel command profile fid from string. Profile string pointer may be NULL, and this results in setting the fid to M0_FID0.

XXX-MULTIPOOLS: DELETEME

Definition at line 100 of file spiel.c.

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

◆ m0_spiel_conf_pver_status()

int m0_spiel_conf_pver_status ( struct m0_spiel spl,
struct m0_fid fid,
struct m0_conf_pver_info out_info 
)

Returns the status of the pool version according to number of failed srecd objects in the pool version.

This is a wrapper over conf/pvers.h m0_conf_pver_status().

Parameters
splspiel instance, must have confc cache initialized and populated.
fidfid of the pool version whose status is queried.
out_infoout parameter which will contain status along with some pdclust attributes of pool version.
Precondition
fid != NULL
m0_confc_is_inited(confc) == true
Returns
rc of the function.

Definition at line 2397 of file cmd.c.

Here is the call graph for this function:

◆ m0_spiel_confstr()

int m0_spiel_confstr ( struct m0_spiel spl,
char **  out 
)

Dumps configuration cache to a string in XC format.

Configuration cache is expected to be fully loaded at this point. (Call m0_spiel_confstr() after m0_spiel_rconfc_start(), and you will be fine.)

Note
If the call succeeds, the user is responsible for freeing allocated memory with free(*out) (not m0_free()).

Definition at line 2380 of file cmd.c.

Here is the call graph for this function:

◆ m0_spiel_controller_add()

int m0_spiel_controller_add ( struct m0_spiel_tx tx,
const struct m0_fid fid,
const struct m0_fid parent 
)

Adds controller to the configuration tree of the transaction

Parameters
txspiel transaction
fidfid of the controller
parentfid of the parent enclosure

Definition at line 1518 of file conf_mgmt.c.

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

◆ m0_spiel_controller_v_add()

int m0_spiel_controller_v_add ( struct m0_spiel_tx tx,
const struct m0_fid fid,
const struct m0_fid parent,
const struct m0_fid real 
)

Adds controller "v-object"

Parameters
txspiel transaction
fidfid of controller-v
parentfid of the parent enclosure-v
realfid of the enclosure this object points to

Definition at line 1864 of file conf_mgmt.c.

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

◆ m0_spiel_device_add()

int m0_spiel_device_add ( struct m0_spiel_tx tx,
const struct m0_fid fid,
const struct m0_fid parent,
const struct m0_fid drive,
uint32_t  dev_idx,
enum m0_cfg_storage_device_interface_type  iface,
enum m0_cfg_storage_device_media_type  media,
uint32_t  bsize,
uint64_t  size,
uint64_t  last_state,
uint64_t  flags,
const char *  filename 
)

Adds service to the configuration tree of the transaction

Parameters
txspiel transaction
fidfid of the device
parentfid of the parent service
drivefid of the corresponding drive
ifacedevice interface type
mediadevice media type
bsizeblock size in bytes
sizesize in bytes
last_statelast known state (bitmask of m0_cfg_state_bit)
flagsdifferent flags (bitmask of m0_cfg_flag_bit)
filenamedevice filename.

Definition at line 1156 of file conf_mgmt.c.

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

◆ m0_spiel_device_attach()

int m0_spiel_device_attach ( struct m0_spiel spl,
const struct m0_fid dev_fid 
)

Attaches device to the motr service

Parameters
splspiel instance
dev_fiddevice fid from configuration DB

Definition at line 641 of file cmd.c.

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

◆ m0_spiel_device_attach_state()

int m0_spiel_device_attach_state ( struct m0_spiel spl,
const struct m0_fid dev_fid,
uint32_t *  ha_state 
)

Attaches device to the motr service and reports device object HA state found during the action on remote side.

Definition at line 647 of file cmd.c.

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

◆ m0_spiel_device_detach()

int m0_spiel_device_detach ( struct m0_spiel spl,
const struct m0_fid dev_fid 
)

Detaches device from the motr service

Parameters
splspiel instance
dev_fiddevice fid from configuration DB

Definition at line 658 of file cmd.c.

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

◆ m0_spiel_device_format()

int m0_spiel_device_format ( struct m0_spiel spl,
const struct m0_fid dev_fid 
)

Format specified device

Parameters
splspiel instance
dev_fiddevice fid from configuration DB

Definition at line 667 of file cmd.c.

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

◆ m0_spiel_dix_rebalance_abort()

int m0_spiel_dix_rebalance_abort ( struct m0_spiel spl,
const struct m0_fid pool_fid 
)

Definition at line 1641 of file cmd.c.

Here is the call graph for this function:

◆ m0_spiel_dix_rebalance_continue()

int m0_spiel_dix_rebalance_continue ( struct m0_spiel spl,
const struct m0_fid pool_fid 
)

Definition at line 1549 of file cmd.c.

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

◆ m0_spiel_dix_rebalance_quiesce()

int m0_spiel_dix_rebalance_quiesce ( struct m0_spiel spl,
const struct m0_fid pool_fid 
)

Definition at line 1576 of file cmd.c.

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

◆ m0_spiel_dix_rebalance_start()

int m0_spiel_dix_rebalance_start ( struct m0_spiel spl,
const struct m0_fid pool_fid 
)

Definition at line 1514 of file cmd.c.

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

◆ m0_spiel_dix_rebalance_status()

int m0_spiel_dix_rebalance_status ( struct m0_spiel spl,
const struct m0_fid pool_fid,
struct m0_spiel_repreb_status **  statuses 
)

Definition at line 1608 of file cmd.c.

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

◆ m0_spiel_dix_repair_abort()

int m0_spiel_dix_repair_abort ( struct m0_spiel spl,
const struct m0_fid pool_fid 
)

Definition at line 1448 of file cmd.c.

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

◆ m0_spiel_dix_repair_continue()

int m0_spiel_dix_repair_continue ( struct m0_spiel spl,
const struct m0_fid pool_fid 
)

Definition at line 1394 of file cmd.c.

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

◆ m0_spiel_dix_repair_quiesce()

int m0_spiel_dix_repair_quiesce ( struct m0_spiel spl,
const struct m0_fid pool_fid 
)

Definition at line 1421 of file cmd.c.

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

◆ m0_spiel_dix_repair_start()

int m0_spiel_dix_repair_start ( struct m0_spiel spl,
const struct m0_fid pool_fid 
)

Definition at line 1367 of file cmd.c.

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

◆ m0_spiel_dix_repair_status()

int m0_spiel_dix_repair_status ( struct m0_spiel spl,
const struct m0_fid pool_fid,
struct m0_spiel_repreb_status **  statuses 
)

Definition at line 1480 of file cmd.c.

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

◆ m0_spiel_drive_add()

int m0_spiel_drive_add ( struct m0_spiel_tx tx,
const struct m0_fid fid,
const struct m0_fid parent 
)

Adds drive to the configuration tree of the transcation

Parameters
txspiel transaction
fidfid of the drive
parentfid of the parent controller

Definition at line 1562 of file conf_mgmt.c.

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

◆ m0_spiel_drive_v_add()

int m0_spiel_drive_v_add ( struct m0_spiel_tx tx,
const struct m0_fid fid,
const struct m0_fid parent,
const struct m0_fid real 
)

Adds drive "v-object"

Parameters
txspiel transaction
fidfid of drive-v
parentfid of the parent controller-v
realfid of the drive this object points to

Definition at line 1912 of file conf_mgmt.c.

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

◆ m0_spiel_element_del()

int m0_spiel_element_del ( struct m0_spiel_tx tx,
const struct m0_fid fid 
)

Deletes element that was previously added to transaction configuration tree.

Parameters
txspiel transaction
fidfid of the object to be deleted

Definition at line 2124 of file conf_mgmt.c.

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

◆ m0_spiel_enclosure_add()

int m0_spiel_enclosure_add ( struct m0_spiel_tx tx,
const struct m0_fid fid,
const struct m0_fid parent,
const struct m0_fid node 
)

Adds enclosure to the configuration tree of the transaction

Parameters
txspiel transaction
fidfid of the enclosure
parentfid of the parent rack
nodethe node this enclosure is associated with

Definition at line 1470 of file conf_mgmt.c.

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

◆ m0_spiel_enclosure_v_add()

int m0_spiel_enclosure_v_add ( struct m0_spiel_tx tx,
const struct m0_fid fid,
const struct m0_fid parent,
const struct m0_fid real 
)

Adds enclosure "v-object"

Parameters
txspiel transaction
fidfid of enclosure-v
parentfid of the parent rack-v
realfid of the enclosure this object points to

Definition at line 1816 of file conf_mgmt.c.

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

◆ m0_spiel_filesystem_stats_fetch()

int m0_spiel_filesystem_stats_fetch ( struct m0_spiel spl,
struct m0_fs_stats stats 
)

Fetches stats for filesystem pools within the profile. Spiel API internally polls all process instances registered in configuration database under the profile.

Parameters
[in]splspiel instance, must have profile fid set up to the moment of the call
[out]statsinstance of m0_fs_stats to be filled with resultant values. The instance counter values are written only in case of success, and must be ignored otherwise.

Definition at line 2374 of file cmd.c.

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

◆ m0_spiel_fini()

void m0_spiel_fini ( struct m0_spiel spiel)

Finalises spiel instance.

Definition at line 59 of file spiel.c.

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

◆ m0_spiel_init()

int m0_spiel_init ( struct m0_spiel spiel,
struct m0_reqh reqh 
)

Initialises spiel instance. Should be invoked before using other spiel functions. If initialisation fails, then spiel instance must not be used.

Parameters
spielspiel instance
reqhrequest handler
Precondition
reqh != NULL

Definition at line 44 of file spiel.c.

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

◆ m0_spiel_node_add()

int m0_spiel_node_add ( struct m0_spiel_tx tx,
const struct m0_fid fid,
uint32_t  memsize,
uint32_t  nr_cpu,
uint64_t  last_state,
uint64_t  flags 
)

Adds node to the configuration tree of the transaction

Parameters
txspiel transaction
fidfid of the node
memsizeamount of available memory on the node
nr_cpunumber of CPUs on the node
last_statelast known state (bitmask of m0_cfg_state_bit)
flagsdifferent flags (bitmask of m0_cfg_flag_bit)

Definition at line 974 of file conf_mgmt.c.

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

◆ m0_spiel_node_direct_rebalance_start()

int m0_spiel_node_direct_rebalance_start ( struct m0_spiel spl,
const struct m0_fid node 
)

Starts direct rebalance for the given node.

Parameters
splspiel instance
nodefid of the node to be rebalanced

Definition at line 1541 of file cmd.c.

◆ m0_spiel_pool_add()

int m0_spiel_pool_add ( struct m0_spiel_tx tx,
const struct m0_fid fid,
uint32_t  pver_policy 
)

Adds pool to the configuration tree of the transaction

Parameters
txspiel transaction
fidfid of the pool
pver_policypool version policy
Note
call this function several times to add the pool to more than one profile.

Definition at line 1339 of file conf_mgmt.c.

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

◆ m0_spiel_pool_rebalance_abort()

int m0_spiel_pool_rebalance_abort ( struct m0_spiel spl,
const struct m0_fid pool_fid 
)
Todo:
Remove once Halon supports m0_spiel_{sns,dix}_rebalance_abort().
Todo:
Remove once Halon supports m0_spiel_{sns,dix}_rebalance_abort().

Definition at line 1652 of file cmd.c.

Here is the call graph for this function:

◆ m0_spiel_pool_rebalance_continue()

int m0_spiel_pool_rebalance_continue ( struct m0_spiel spl,
const struct m0_fid pool_fid 
)
Todo:
Remove once Halon supports m0_spiel_{sns,dix}_rebalance_continue().
Todo:
Remove once Halon supports m0_spiel_{sns,dix}_rebalance_continue().

Definition at line 1560 of file cmd.c.

Here is the call graph for this function:

◆ m0_spiel_pool_rebalance_quiesce()

int m0_spiel_pool_rebalance_quiesce ( struct m0_spiel spl,
const struct m0_fid pool_fid 
)
Todo:
Remove once Halon supports m0_spiel_{sns,dix}_rebalance_quiesce().
Todo:
Remove once Halon supports m0_spiel_{sns,dix}_rebalance_quiesce().

Definition at line 1587 of file cmd.c.

Here is the call graph for this function:

◆ m0_spiel_pool_rebalance_start()

int m0_spiel_pool_rebalance_start ( struct m0_spiel spl,
const struct m0_fid pool_fid 
)
Todo:
Remove once Halon supports m0_spiel_{sns,dix}_rebalance_start().
Todo:
Remove once Halon supports m0_spiel_{sns,dix}_rebalance_start().

Definition at line 1525 of file cmd.c.

Here is the call graph for this function:

◆ m0_spiel_pool_rebalance_status()

int m0_spiel_pool_rebalance_status ( struct m0_spiel spl,
const struct m0_fid pool_fid,
struct m0_spiel_sns_status **  statuses 
)
Todo:
Remove once Halon supports m0_spiel_{sns,dix}_rebalance_status().

Definition at line 1623 of file cmd.c.

Here is the call graph for this function:

◆ m0_spiel_pool_repair_abort()

int m0_spiel_pool_repair_abort ( struct m0_spiel spl,
const struct m0_fid pool_fid 
)
Todo:
Remove once Halon supports m0_spiel_{sns,dix}_repair_abort().
Todo:
Remove once Halon supports m0_spiel_{sns,dix}_repair_abort().

Definition at line 1459 of file cmd.c.

Here is the call graph for this function:

◆ m0_spiel_pool_repair_continue()

int m0_spiel_pool_repair_continue ( struct m0_spiel spl,
const struct m0_fid pool_fid 
)
Todo:
Remove once Halon supports m0_spiel_{sns,dix}_repair_continue().
Todo:
Remove once Halon supports m0_spiel_{sns,dix}_repair_continue().

Definition at line 1405 of file cmd.c.

Here is the call graph for this function:

◆ m0_spiel_pool_repair_quiesce()

int m0_spiel_pool_repair_quiesce ( struct m0_spiel spl,
const struct m0_fid pool_fid 
)
Todo:
Remove once Halon supports m0_spiel_{sns,dix}_repair_quiesce().
Todo:
Remove once Halon supports m0_spiel_{sns,dix}_repair_quiesce().

Definition at line 1432 of file cmd.c.

Here is the call graph for this function:

◆ m0_spiel_pool_repair_start()

int m0_spiel_pool_repair_start ( struct m0_spiel spl,
const struct m0_fid pool_fid 
)
Todo:
Remove once Halon supports m0_spiel_{sns,dix}_repair_start().
Todo:
Remove once Halon supports m0_spiel_{sns,dix}_repair_start().

Definition at line 1378 of file cmd.c.

Here is the call graph for this function:

◆ m0_spiel_pool_repair_status()

int m0_spiel_pool_repair_status ( struct m0_spiel spl,
const struct m0_fid pool_fid,
struct m0_spiel_sns_status **  statuses 
)
Todo:
Remove once Halon supports m0_spiel_{sns,dix}_repair_status().
Todo:
Remove once Halon supports m0_spiel_{sns,dix}_repair_status().

Definition at line 1496 of file cmd.c.

Here is the call graph for this function:

◆ m0_spiel_pool_version_done()

int m0_spiel_pool_version_done ( struct m0_spiel_tx tx,
const struct m0_fid fid 
)

Signals that constructing pool version tree is finished

Parameters
txspiel transaction
fidfid of the pool version

Definition at line 2075 of file conf_mgmt.c.

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

◆ m0_spiel_proc_counters_fetch()

int m0_spiel_proc_counters_fetch ( struct m0_spiel spl,
struct m0_fid proc_fid,
struct m0_proc_counter count_stats 
)

Fetches byte counts and object counts per pool version written by all end users from a target ioservice. All entries in the byte count btree present in the ioservice is fetched by a call of this API.

Parameters
[in]splspiel instance used for executing spiel command.
[in]proc_fidfid of the target ioservice.
[out]count_statsinstance of m0_proc_counter to be filled with resultant values. Check m0_proc_counter::pc_rc for successful execution, ignore rest of the values otherwise.
Returns
rc -EPERM if process is offline. -EAGAIN if confc is not initialized.

Definition at line 2211 of file cmd.c.

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

◆ m0_spiel_process_add()

int m0_spiel_process_add ( struct m0_spiel_tx tx,
const struct m0_fid fid,
const struct m0_fid parent,
struct m0_bitmap cores,
uint64_t  memlimit_as,
uint64_t  memlimit_rss,
uint64_t  memlimit_stack,
uint64_t  memlimit_memlock,
const char *  endpoint 
)

Adds process to the configuration tree of the transaction

Parameters
txspiel transaction
fidfid of the process
parentfid of the parent node
coreslimit on the number of used cores
memlimit_*memory limit for the process
endpointprocess endpoint

Definition at line 1033 of file conf_mgmt.c.

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

◆ m0_spiel_process_health()

int m0_spiel_process_health ( struct m0_spiel spl,
const struct m0_fid proc_fid 
)

Checks health status of the motr process

Parameters
splspiel instance
Returns
value from ::m0_health if operation successful
negative value if error occurred

Definition at line 814 of file cmd.c.

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

◆ m0_spiel_process_lib_load()

int m0_spiel_process_lib_load ( struct m0_spiel spl,
const struct m0_fid proc_fid,
const char *  libname 
)

Loads a library in the process address space.

Library loading is supported only in user space at the moment. The library must be loadable by dlopen(3).

When the library is loaded, motr_lib_init() function in it (if present) is invoked without parameters. This funciton is called in a fom tick context, so it shouldn't block.

Parameters
splspiel instance
proc_fidprocess fid from configuration DB
libnamefull path to the library in the server file system.

Definition at line 892 of file cmd.c.

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

◆ m0_spiel_process_list_services()

int m0_spiel_process_list_services ( struct m0_spiel spl,
const struct m0_fid proc_fid,
struct m0_spiel_running_svc **  services 
)

Lists currently running services inside the motr process. Can be used to monitor services and detect service failures.

Returns
number of filled elements in services array on success, error code otherwise.
Parameters
splspiel instance
proc_fidprocess fid from configuration DB
servicesarray to store running services fid and name, see m0_spiel_running_svc

Definition at line 858 of file cmd.c.

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

◆ m0_spiel_process_quiesce()

int m0_spiel_process_quiesce ( struct m0_spiel spl,
const struct m0_fid proc_fid 
)

Prepares motr process for stopping

Parameters
splspiel instance
proc_fidprocess fid from configuration DB

Definition at line 821 of file cmd.c.

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

◆ m0_spiel_process_reconfig()

int m0_spiel_process_reconfig ( struct m0_spiel spl,
const struct m0_fid proc_fid 
)

Re-configures process running on motr node (for example set nicety, memory usage limit, etc.)

Parameters
splspiel instance
proc_fidprocess fid from configuration DB

Definition at line 788 of file cmd.c.

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

◆ m0_spiel_process_stop()

int m0_spiel_process_stop ( struct m0_spiel spl,
const struct m0_fid proc_fid 
)

Stop process on motr node

Parameters
splspiel instance
proc_fidprocess fid from configuration DB

Definition at line 781 of file cmd.c.

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

◆ m0_spiel_profile_add()

int m0_spiel_profile_add ( struct m0_spiel_tx tx,
const struct m0_fid fid 
)

Adds profile to the configuration tree of the transaction

Parameters
txspiel transaction
fidfid of the profile

Definition at line 1236 of file conf_mgmt.c.

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

◆ m0_spiel_profile_pool_add()

int m0_spiel_profile_pool_add ( struct m0_spiel_tx tx,
const struct m0_fid profile,
const struct m0_fid pool 
)

Adds pool into the profile

To add several pools into the profile - call this routine several times with a new argument each time.

Definition at line 1304 of file conf_mgmt.c.

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

◆ m0_spiel_pver_actual_add()

int m0_spiel_pver_actual_add ( struct m0_spiel_tx tx,
const struct m0_fid fid,
const struct m0_fid parent,
const struct m0_pdclust_attr attrs,
uint32_t *  tolerance,
uint32_t  tolerance_len 
)

Adds an actual pool version.

Pool version is represented as a tree of "v-objects". "V-objects" can be added to the pool version using calls like m0_spiel_site_v_add(), m0_spiel_rack_v_add(), etc. After all "V-objects" are added, function m0_spiel_pool_version_done() should be called.

Parameter tolerance is number of allowed HW failures in each failure domain. Currently there are 5 failure domains: sites, racks, enclosures, controllers, and drives.

Parameters
txspiel transaction
fidfid of the pool version
parentfid of the parent pool
attrsattributes specific to layout type
toleranceallowed failures for each failure domain
tolerance_lennumber of elements in tolerance array
Precondition
tolerance_len == M0_CONF_PVER_HEIGHT
See also
conf_pvers (conf/pvers.h) to learn about different kinds (actual/formulaic/virtual) of pool version objects.

Definition at line 1601 of file conf_mgmt.c.

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

◆ m0_spiel_pver_formulaic_add()

int m0_spiel_pver_formulaic_add ( struct m0_spiel_tx tx,
const struct m0_fid fid,
const struct m0_fid parent,
uint32_t  index,
const struct m0_fid base_pver,
uint32_t *  allowance,
uint32_t  allowance_len 
)

Adds a formulaic pool version.

Parameters
txSpiel transaction.
fidPool version fid.
parentParent pool fid.
indexCluster-unique identifier of this formulaic pver.
base_pverActual pver, the subtree of which is used as a base for virtual pver creation/restoration.
allowanceNumber of allowed failures for each level of pver subtree.
allowance_lenNumber of elements in the ‘allowance’ array.
Precondition
allowance_len == M0_CONF_PVER_HEIGHT
See also
conf_pvers (conf/pvers.h) to learn about different kinds (actual/formulaic/virtual) of pool version objects.

Definition at line 1659 of file conf_mgmt.c.

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

◆ m0_spiel_rack_add()

int m0_spiel_rack_add ( struct m0_spiel_tx tx,
const struct m0_fid fid,
const struct m0_fid parent 
)

Adds rack to the configuration tree of the transaction

Parameters
txspiel transaction
fidfid of the rack
parentfid of the parent site

Definition at line 1426 of file conf_mgmt.c.

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

◆ m0_spiel_rack_v_add()

int m0_spiel_rack_v_add ( struct m0_spiel_tx tx,
const struct m0_fid fid,
const struct m0_fid parent,
const struct m0_fid real 
)

Adds rack "v-object"

Parameters
txspiel transaction
fidfid of rack-v
parentfid of the parent site-v
realfid of the rack this object points to

Definition at line 1768 of file conf_mgmt.c.

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

◆ m0_spiel_rconfc_start()

int m0_spiel_rconfc_start ( struct m0_spiel spiel,
m0_rconfc_cb_t  expired_cb 
)

Starts spiel instance.

Schematic code to start spiel using standard motr setup procedure:

Parameters
spielspiel instance
m0_rconfc_cb_trconfc expiration callback

Definition at line 66 of file spiel.c.

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

◆ m0_spiel_rconfc_stop()

void m0_spiel_rconfc_stop ( struct m0_spiel spiel)

Stops spiel instance.

Definition at line 91 of file spiel.c.

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

◆ m0_spiel_root_add()

int m0_spiel_root_add ( struct m0_spiel_tx tx,
const struct m0_fid rootfid,
const struct m0_fid mdpool,
const struct m0_fid imeta_pver,
uint32_t  mdredundancy,
const char **  params 
)

Adds the configuration tree of the transaction

Parameters
txspiel transaction
rootfidAny fid. Reserved for future use.
mdpoolmeta-data pool
imeta_pver

Distributed index meta-data pool version. It contains storage devices controlled by CAS services — no IOS storage devices are allowed. If there are no CAS services in configuration then the value should be M0_FID0.

Index meta-data is created (analogue of m0mkfs for distributed indices) during cluster provisioning via m0_dix_meta_create() or via special utility like m0dixinit. m0_dix_meta_create() will refuse to create meta-data if it already exists. In this case user may destroy meta-data via m0_dix_meta_destroy() or just zero corresponding devices. For more detailed information see dix/client.h, "Index meta-data" section.

Note
For now, storage devices specified in configuration are not actually used by CAS services, so they can be faked (even don't really exist as devices in operating system).
Parameters
mdredundancymeta-data redundancy
paramsNULL-terminated array of extra parameters. Parameters are copied, so caller can safely free them.

Definition at line 902 of file conf_mgmt.c.

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

◆ m0_spiel_service_add()

int m0_spiel_service_add ( struct m0_spiel_tx tx,
const struct m0_fid fid,
const struct m0_fid parent,
const struct m0_spiel_service_info service_info 
)

Adds service to the configuration tree of the transaction

Parameters
txspiel transaction
fidfid of the service
parentfid of the parent process
service_infoservice info

Definition at line 1101 of file conf_mgmt.c.

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

◆ m0_spiel_service_health()

int m0_spiel_service_health ( struct m0_spiel spl,
const struct m0_fid svc_fid 
)

Checks health status of the motr service

Parameters
splspiel instance
svc_fidservice fid from configuration DB
Returns
value from m0_service_health if operation successful
negative value if error occurred

Definition at line 537 of file cmd.c.

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

◆ m0_spiel_service_init()

int m0_spiel_service_init ( struct m0_spiel spl,
const struct m0_fid svc_fid 
)

Initialises motr service

Parameters
splspiel instance
svc_fidservice fid from configuration DB

Definition at line 507 of file cmd.c.

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

◆ m0_spiel_service_quiesce()

int m0_spiel_service_quiesce ( struct m0_spiel spl,
const struct m0_fid svc_fid 
)

Instructs motr service to stop accepting incoming requests

Parameters
splspiel instance
svc_fidservice fid from configuration DB

Definition at line 546 of file cmd.c.

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

◆ m0_spiel_service_start()

int m0_spiel_service_start ( struct m0_spiel spl,
const struct m0_fid svc_fid 
)

Starts motr service

Parameters
splspiel instance
svc_fidservice fid from configuration DB

Definition at line 516 of file cmd.c.

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

◆ m0_spiel_service_status()

int m0_spiel_service_status ( struct m0_spiel spl,
const struct m0_fid svc_fid,
int *  status 
)

Returns status of the motr service

Parameters
splspiel instance
svc_fidservice fid from configuration DB
Returns
0 and state of the service if operation was successful negative value if error occurred

Definition at line 556 of file cmd.c.

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

◆ m0_spiel_service_stop()

int m0_spiel_service_stop ( struct m0_spiel spl,
const struct m0_fid svc_fid 
)

Stops motr service. Stopping of Top Level RM is disallowed, the function returns -EPERM result code in this case.

Parameters
splspiel instance
svc_fidservice fid from configuration DB

Definition at line 525 of file cmd.c.

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

◆ m0_spiel_site_add()

int m0_spiel_site_add ( struct m0_spiel_tx tx,
const struct m0_fid fid 
)

Adds site to the configuration tree of the transaction

Parameters
txspiel transaction
fidfid of the site

Definition at line 1382 of file conf_mgmt.c.

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

◆ m0_spiel_site_v_add()

int m0_spiel_site_v_add ( struct m0_spiel_tx tx,
const struct m0_fid fid,
const struct m0_fid parent,
const struct m0_fid real 
)

Adds site "v-object"

Parameters
txspiel transaction
fidfid of site-v
parentfid of the parent pool version
realfid of the site this object points to

Definition at line 1716 of file conf_mgmt.c.

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

◆ m0_spiel_sns_rebalance_abort()

int m0_spiel_sns_rebalance_abort ( struct m0_spiel spl,
const struct m0_fid pool_fid 
)

Aborts pool SNS or DIX rebalance operation.

Aborts ongoing pool SNS or DIX rebalance operation. Waits until all the sns services notify completion.

Note
Blocks until operation is copleted.
Parameters
splspiel instance
pool_fidpool identifier

Definition at line 1631 of file cmd.c.

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

◆ m0_spiel_sns_rebalance_continue()

int m0_spiel_sns_rebalance_continue ( struct m0_spiel spl,
const struct m0_fid pool_fid 
)

Continues pool rebalance.

The command is synchronous. It waits replies from all SNS or DIX services that each one receives fop and resumes rebalance which was paused. 0 is returned if each service replies with success result code. Spiel client is able to check status of the current rebalance process by calling of m0_spiel_sns_rebalance_status() or m0_spiel_dix_rebalance_status() command.

Parameters
splspiel instance
pool_fidpool fid from configuration DB
Returns
0 if all services reply with success result code, otherwise an error code from the first failed service (it replies with error) or confc (an error occurred during read of the configuration database)
See also
m0_spiel_sns_rebalance_status
m0_spiel_sns_rebalance_quiesce
m0_spiel_dix_rebalance_status
m0_spiel_dix_rebalance_quiesce

Definition at line 1531 of file cmd.c.

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

◆ m0_spiel_sns_rebalance_quiesce()

int m0_spiel_sns_rebalance_quiesce ( struct m0_spiel spl,
const struct m0_fid pool_fid 
)

Quiesces pool rebalance.

The command is synchronous. It waits replies from all SNS or DIX services that each one receives fop and pauses rebalance. 0 is returned if each service replies with success result code (rebalance process is in PAUSED state). Spiel client is able to check status of the current rebalance process by calling of m0_spiel_sns_rebalance_status() or m0_spiel_dix_rebalance_status() command.

Parameters
splspiel instance
pool_fidpool fid from configuration DB
Returns
0 if all services reply with success result code, otherwise an error code from the first failed service (it replies with error) or confc (an error occurred during read of the configuration database)
See also
m0_spiel_sns_rebalance_status
m0_spiel_dix_rebalance_status

Definition at line 1566 of file cmd.c.

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

◆ m0_spiel_sns_rebalance_start()

int m0_spiel_sns_rebalance_start ( struct m0_spiel spl,
const struct m0_fid pool_fid 
)

Starts pool rebalance.

The command is synchronous. It waits replies from all SNS or DIX services that each one receives fop and starts rebalance. 0 is returned if each service replies with success result code. Spiel client is able to check status of the current rebalance process by calling of m0_spiel_sns_rebalance_status() or m0_spiel_dix_rebalance_status() command.

Parameters
splspiel instance
pool_fidpool fid from configuration DB
Returns
0 if all services reply with success result code, otherwise an error code from the first failed service (it replies with error) or confc (an error occurred during read of the configuration database)
See also
m0_spiel_sns_rebalance_status
m0_spiel_dix_rebalance_status

Definition at line 1504 of file cmd.c.

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

◆ m0_spiel_sns_rebalance_status()

int m0_spiel_sns_rebalance_status ( struct m0_spiel spl,
const struct m0_fid pool_fid,
struct m0_spiel_repreb_status **  statuses 
)

Gets status of pool rebalance.

The command is synchronous. It waits replies from all SNS or DIX services.

Parameters
splspiel instance
pool_fidpool fid from configuration DB
statusespointer where statuses of services will be stored
Returns
number of the servies if all services reply with success result code, otherwise an error code from the first failed service (it replies with error) or confc (an error occurred during read of the configuration database)
Note
If the call succeeds, the user is responsible for freeing allocated memory with m0_free(*statuses).

Definition at line 1593 of file cmd.c.

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

◆ m0_spiel_sns_repair_abort()

int m0_spiel_sns_repair_abort ( struct m0_spiel spl,
const struct m0_fid pool_fid 
)

Aborts pool repair.

The command is synchronous. It waits replies from all SNS or DIX services that each one receives fop and aborts repair. 0 is returned if each service replies with success result code (repair process is successfully aborted). Spiel client is able to check status of the current repair process by calling of m0_spiel_sns_repair_status() or m0_spiel_dix_repair_status() command.

Parameters
splspiel instance
pool_fidpool fid from configuration DB
Returns
0 if all services reply with success result code, otherwise an error code from the first failed service (it replies with error) or confc (an error occurred during read of the configuration database)
See also
m0_spiel_sns_repair_status
m0_spiel_dix_repair_status

Definition at line 1438 of file cmd.c.

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

◆ m0_spiel_sns_repair_continue()

int m0_spiel_sns_repair_continue ( struct m0_spiel spl,
const struct m0_fid pool_fid 
)

Continues pool repair.

The command is synchronous. It waits replies from all SNS or DIX services that each one receives fop and resumes repair which was paused by m0_spiel_sns_repair_quiesce() or m0_spiel_dix_repair_quiesce(). 0 is returned if each service replies with success result code. Spiel client is able to check status of the current repair process by calling of m0_spiel_sns_repair_status() or m0_spiel_dix_repair_status() command.

Parameters
splspiel instance
pool_fidpool fid from configuration DB
Returns
number of the services if all services reply with success result code, otherwise an error code from the first failed service (it replies with error) or confc (an error occurred during read of the configuration database)
See also
m0_spiel_sns_repair_status
m0_spiel_sns_repair_quiesce
m0_spiel_dix_repair_status
m0_spiel_dix_repair_quiesce

Definition at line 1384 of file cmd.c.

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

◆ m0_spiel_sns_repair_quiesce()

int m0_spiel_sns_repair_quiesce ( struct m0_spiel spl,
const struct m0_fid pool_fid 
)

Quiesces pool repair.

The command is synchronous. It waits replies from all SNS or DIX services that each one receives fop and pauses repair. 0 is returned if each service replies with success result code (repair process is in PAUSED state). Spiel client is able to check status of the current repair process by calling of m0_spiel_sns_repair_status() or m0_spiel_dix_repair_status() command.

Parameters
splspiel instance
pool_fidpool fid from configuration DB
Returns
0 if all services reply with success result code, otherwise an error code from the first failed service (it replies with error) or confc (an error occurred during read of the configuration database)
See also
m0_spiel_sns_repair_status
m0_spiel_dix_repair_status

Definition at line 1411 of file cmd.c.

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

◆ m0_spiel_sns_repair_start()

int m0_spiel_sns_repair_start ( struct m0_spiel spl,
const struct m0_fid pool_fid 
)

Starts pool repair.

The command is synchronous. It waits replies from all SNS or DIX services that each one receives fop and starts repair. 0 is returned if each service replies with success result code. Spiel client is able to check status of the current repair process by calling of m0_spiel_sns_repair_status() or m0_spiel_dix_repair_status() command.

Parameters
splspiel instance
pool_fidpool fid from configuration DB
Returns
0 if all services reply with success result code, otherwise an error code from the first failed service (it replies with error) or confc (an error occurred during read of the configuration database)
See also
m0_spiel_sns_repair_status
m0_spiel_dix_repair_status

Definition at line 1357 of file cmd.c.

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

◆ m0_spiel_sns_repair_status()

int m0_spiel_sns_repair_status ( struct m0_spiel spl,
const struct m0_fid pool_fid,
struct m0_spiel_repreb_status **  statuses 
)

Gets status of pool repair.

The command is synchronous. It waits replies from all SNS or DIX services.

Parameters
splspiel instance
pool_fidpool fid from configuration DB
statusespointer where statuses of services will be stored
Returns
number of services if all services reply with success result code, otherwise an error code from the first failed service (it replies with error) or confc (an error occurred during read of the configuration database)
Note
If the call succeeds, the user is responsible for freeing allocated memory with m0_free(*statuses).

Definition at line 1465 of file cmd.c.

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

◆ m0_spiel_tx_close()

void m0_spiel_tx_close ( struct m0_spiel_tx tx)

Closes spiel transaction.

Once function is called spiel transaction can't be used anymore.

Parameters
txspiel transaction

Frees Spiel context without completing the transaction.

Definition at line 171 of file conf_mgmt.c.

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

◆ m0_spiel_tx_commit()

int m0_spiel_tx_commit ( struct m0_spiel_tx tx)

Commits filled-in spiel transaction. The call performs normal committing when reaching quorum is mandatory for uploading new configuration to confd servers and putting it in effect. Endpoints of confd and rm services will be resolved internally by rconfc which gets them from HA service.

Once function succeeded, the spiel transaction must not be committed anymore. When failed, forced committing with m0_spiel_tx_commit_forced() still remains as an option.

Parameters
txspiel transaction
Note
In case normal transaction committing is required, but resultant quorum number reached is to be controlled as well, the action has to be done using m0_spiel_tx_commit_forced(), specifying non-forced committing as follows:
uint32_t rquorum = 0;
&rquorum);

Definition at line 723 of file conf_mgmt.c.

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

◆ m0_spiel_tx_commit_forced()

int m0_spiel_tx_commit_forced ( struct m0_spiel_tx tx,
bool  forced,
uint64_t  ver_forced,
uint32_t *  rquorum 
)

Commits filled-in spiel transaction forcing as many loads and flips as possible, no matter if quorum reached or not. The call allows version number be overridden compared to the version number obtained at m0_spiel_start(). In this case ver_forced must be of the value other than M0_CONF_VER_UNKNOWN, otherwise the version number value remains what it initially was.

The spiel transaction may be forcibly committed as many times as required completing previously failed uploads to confd servers.

Parameters
txspiel transaction
forcedcommitting with forcing any possible LOAD/FLIP enabled
ver_forcedversion number the initial value to be overridden with
rquorumresultant quorum value reached, NULL value allowed
Note
Parameters forced and ver_forced may be used independent of each other, i.e. forced committing with unchanged version number is possible as well as non-forced committing with version number overridden.

Definition at line 591 of file conf_mgmt.c.

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

◆ m0_spiel_tx_dump()

int m0_spiel_tx_dump ( struct m0_spiel_tx tx,
uint64_t  ver_forced,
const char *  filename 
)

Saves spiel transaction dump to file.

Note
Sets transaction's root version number to ver_forced.
Precondition
ver_forced != M0_CONF_VER_UNKNOWN

Definition at line 2205 of file conf_mgmt.c.

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

◆ m0_spiel_tx_dump_debug()

int m0_spiel_tx_dump_debug ( struct m0_spiel_tx tx,
uint64_t  ver_forced,
const char *  filename 
)

Saves spiel transaction dump to file with error and stub object too.

Note
Sets transaction's root version number to ver_forced.
Precondition
ver_forced != M0_CONF_VER_UNKNOWN

Definition at line 2212 of file conf_mgmt.c.

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

◆ m0_spiel_tx_open()

void m0_spiel_tx_open ( struct m0_spiel spiel,
struct m0_spiel_tx tx 
)

Initialises and opens spiel transaction.

In case transaction is created for the sole purpose of dumping conf data, to string or file, ‘spiel’ parameter may be NULL:

spiel_tx__conf_str_create() {
struct m0_spiel_tx tx;
const int ver_forced = 10;
char *local_conf;
int rc;
. . . add configuration items to tx . . .
rc = m0_spiel_tx_to_str(&tx, ver_forced, &local_conf);
. . . make use of local_conf . . .
}

In case (spiel == NULL), the transaction must not be m0_spiel_tx_commit()ted.

Precondition
tx != NULL

Definition at line 105 of file conf_mgmt.c.

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

◆ m0_spiel_tx_str_free()

void m0_spiel_tx_str_free ( char *  str)

Definition at line 2182 of file conf_mgmt.c.

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

◆ m0_spiel_tx_to_str()

int m0_spiel_tx_to_str ( struct m0_spiel_tx tx,
uint64_t  ver_forced,
char **  str 
)

Saves spiel transaction dump to string. Caller is responsible for freeing the string with m0_spiel_tx_str_free().

Note
Sets transaction's root version number to ver_forced.
Precondition
ver_forced != M0_CONF_VER_UNKNOWN

Definition at line 2174 of file conf_mgmt.c.

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

◆ m0_spiel_tx_validate()

int m0_spiel_tx_validate ( struct m0_spiel_tx tx)

Checks configuration tree contained in transaction. It is valid if each configuration object has state M0_CS_READY and has real parent (if any is required). Valid transaction is ready for dump or commit.

See also
m0_spiel_tx_dump
m0_spiel_tx_commit
Parameters
txspiel transaction
Returns
-EBUSY if an object is not in M0_CS_READY state.
-ENOENT if an object hasn't real parent.

Check cache for completeness: each element has state M0_CS_READY and has real parent (if last need by obj type)

Definition at line 136 of file conf_mgmt.c.

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