Motr  M0
Conf_validation

Data Structures

struct  conf_io_stats
 
struct  conf_pver_width_st
 
struct  m0_conf_rule
 
struct  m0_conf_ruleset
 

Macros

#define M0_TRACE_SUBSYSTEM   M0_TRACE_SUBSYS_CONF
 

Enumerations

enum  { CONF_GLOB_BATCH = 16 }
 
enum  { M0_CONF_RULES_MAX = 32 }
 

Functions

char * m0_conf_validation_error (struct m0_conf_cache *cache, char *buf, size_t buflen)
 
M0_INTERNAL char * m0_conf_validation_error_locked (const struct m0_conf_cache *cache, char *buf, size_t buflen)
 
static char * conf_orphans_error (const struct m0_conf_cache *cache, char *buf, size_t buflen)
 
static char * conf_io_stats_get (const struct m0_conf_cache *cache, struct conf_io_stats *stats, char *buf, size_t buflen)
 
static bool conf_oostore_mode (const struct m0_conf_root *r)
 
static char * _conf_root_error (const struct m0_conf_root *root, char *buf, size_t buflen, struct conf_io_stats *stats)
 
static char * conf_root_error (const struct m0_conf_cache *cache, char *buf, size_t buflen)
 
static const struct m0_conf_nodeconf_node_from_sdev (const struct m0_conf_sdev *sdev)
 
static char * conf_iodev_error (const struct m0_conf_sdev *sdev, const struct m0_conf_sdev **iodevs, uint32_t nr_iodevs, char *buf, size_t buflen)
 
static int conf_pver_width_measure__dir (const struct m0_conf_obj *obj, struct conf_pver_width_st *st)
 
static int conf_pver_width_measure_w (struct m0_conf_obj *obj, void *args)
 
static char * conf_pver_width_error (const struct m0_conf_pver *pver, uint32_t *pver_width, size_t pver_width_nr, char *buf, size_t buflen)
 
static char * conf_pver_formulaic_base_error (const struct m0_conf_pver *fpver, const struct m0_conf_pver **out, char *buf, size_t buflen)
 
static char * conf_pver_formulaic_error (const struct m0_conf_pver *fpver, char *buf, size_t buflen)
 
static char * conf_pver_actual_error (const struct m0_conf_pver *pver, const struct m0_conf_sdev **iodevs, uint32_t nr_iodevs, char *buf, size_t buflen)
 
static char * conf_pvers_error (const struct m0_conf_cache *cache, char *buf, size_t buflen)
 
static char * conf_process_endpoint_error (const struct m0_conf_process *proc, char *buf, size_t buflen)
 
static char * conf_endpoint_error (const struct m0_conf_cache *cache, char *buf, size_t buflen)
 
static char * conf_service_type_error (const struct m0_conf_cache *cache, char *buf, size_t buflen)
 
static char * _conf_service_sdevs_error (const struct m0_conf_service *svc, char *buf, size_t buflen)
 
static char * conf_service_sdevs_error (const struct m0_conf_cache *cache, char *buf, size_t buflen)
 

Variables

static const struct m0_conf_ruleset conf_rules
 
static const struct m0_conf_rulesetconf_validity_checks []
 

Detailed Description

Motr subsystems that use confc API (m0t1fs, m0d, ioservice, &c.) have certain expectations of the configuration objects they work with. Subsystem developers specify these expectations in the form of "rules", which valid configuration data should conform to.

Macro Definition Documentation

◆ M0_TRACE_SUBSYSTEM

#define M0_TRACE_SUBSYSTEM   M0_TRACE_SUBSYS_CONF

Definition at line 28 of file validation.c.

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
CONF_GLOB_BATCH 

Definition at line 41 of file validation.c.

◆ anonymous enum

anonymous enum

Maximal number of rules in a m0_conf_ruleset.

Enumerator
M0_CONF_RULES_MAX 

Definition at line 90 of file validation.h.

Function Documentation

◆ _conf_root_error()

static char* _conf_root_error ( const struct m0_conf_root root,
char *  buf,
size_t  buflen,
struct conf_io_stats stats 
)
static

Definition at line 169 of file validation.c.

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

◆ _conf_service_sdevs_error()

static char* _conf_service_sdevs_error ( const struct m0_conf_service svc,
char *  buf,
size_t  buflen 
)
static

Definition at line 652 of file validation.c.

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

◆ conf_endpoint_error()

static char* conf_endpoint_error ( const struct m0_conf_cache cache,
char *  buf,
size_t  buflen 
)
static

Definition at line 593 of file validation.c.

Here is the call graph for this function:

◆ conf_io_stats_get()

static char* conf_io_stats_get ( const struct m0_conf_cache cache,
struct conf_io_stats stats,
char *  buf,
size_t  buflen 
)
static

Definition at line 130 of file validation.c.

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

◆ conf_iodev_error()

static char* conf_iodev_error ( const struct m0_conf_sdev sdev,
const struct m0_conf_sdev **  iodevs,
uint32_t  nr_iodevs,
char *  buf,
size_t  buflen 
)
static

Definition at line 240 of file validation.c.

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

◆ conf_node_from_sdev()

static const struct m0_conf_node* conf_node_from_sdev ( const struct m0_conf_sdev sdev)
static

Definition at line 231 of file validation.c.

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

◆ conf_oostore_mode()

static bool conf_oostore_mode ( const struct m0_conf_root r)
static

Definition at line 160 of file validation.c.

Here is the caller graph for this function:

◆ conf_orphans_error()

static char* conf_orphans_error ( const struct m0_conf_cache cache,
char *  buf,
size_t  buflen 
)
static

Definition at line 107 of file validation.c.

Here is the call graph for this function:

◆ conf_process_endpoint_error()

static char* conf_process_endpoint_error ( const struct m0_conf_process proc,
char *  buf,
size_t  buflen 
)
static

Definition at line 559 of file validation.c.

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

◆ conf_pver_actual_error()

static char* conf_pver_actual_error ( const struct m0_conf_pver pver,
const struct m0_conf_sdev **  iodevs,
uint32_t  nr_iodevs,
char *  buf,
size_t  buflen 
)
static

Definition at line 447 of file validation.c.

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

◆ conf_pver_formulaic_base_error()

static char* conf_pver_formulaic_base_error ( const struct m0_conf_pver fpver,
const struct m0_conf_pver **  out,
char *  buf,
size_t  buflen 
)
static

Tries to find base pver of given formulaic pver.

See also
conf_pver_formulaic_base()

Definition at line 377 of file validation.c.

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

◆ conf_pver_formulaic_error()

static char* conf_pver_formulaic_error ( const struct m0_conf_pver fpver,
char *  buf,
size_t  buflen 
)
static

Definition at line 400 of file validation.c.

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

◆ conf_pver_width_error()

static char* conf_pver_width_error ( const struct m0_conf_pver pver,
uint32_t *  pver_width,
size_t  pver_width_nr,
char *  buf,
size_t  buflen 
)
static

Computes the number of objvs at each level of pver subtree.

Puts result into ‘pver_width’ array, which should have capacity of at least M0_CONF_PVER_HEIGHT elements.

Definition at line 350 of file validation.c.

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

◆ conf_pver_width_measure__dir()

static int conf_pver_width_measure__dir ( const struct m0_conf_obj obj,
struct conf_pver_width_st st 
)
static

Definition at line 286 of file validation.c.

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

◆ conf_pver_width_measure_w()

static int conf_pver_width_measure_w ( struct m0_conf_obj obj,
void *  args 
)
static

Definition at line 319 of file validation.c.

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

◆ conf_pvers_error()

static char* conf_pvers_error ( const struct m0_conf_cache cache,
char *  buf,
size_t  buflen 
)
static

Definition at line 511 of file validation.c.

Here is the call graph for this function:

◆ conf_root_error()

static char* conf_root_error ( const struct m0_conf_cache cache,
char *  buf,
size_t  buflen 
)
static

Definition at line 203 of file validation.c.

Here is the call graph for this function:

◆ conf_service_sdevs_error()

static char* conf_service_sdevs_error ( const struct m0_conf_cache cache,
char *  buf,
size_t  buflen 
)
static

Definition at line 669 of file validation.c.

Here is the call graph for this function:

◆ conf_service_type_error()

static char* conf_service_type_error ( const struct m0_conf_cache cache,
char *  buf,
size_t  buflen 
)
static

Definition at line 617 of file validation.c.

Here is the call graph for this function:

◆ m0_conf_validation_error()

char * m0_conf_validation_error ( struct m0_conf_cache cache,
char *  buf,
size_t  buflen 
)

Performs semantic validation of the DAG of configuration objects.

If m0_conf_validation_error() finds a problem with configuration data, it returns a pointer to a string that describes the problem. This may be either a pointer to a string that the function stores in ‘buf’, or a pointer to some (imutable) static string (in which case ‘buf’ is unused). If the function stores a string in ‘buf’, then at most ‘buflen’ bytes are stored (the string may be truncated if ‘buflen’ is too small). The string always includes a terminating null byte ('\0').

If no issues with configuration data are found, m0_conf_validation_error() returns NULL.

Precondition
buf != NULL && buflen != 0

Definition at line 60 of file validation.c.

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

◆ m0_conf_validation_error_locked()

M0_INTERNAL char * m0_conf_validation_error_locked ( const struct m0_conf_cache cache,
char *  buf,
size_t  buflen 
)

Similar to m0_conf_validation_error(), but requires conf cache to be locked.

Precondition
buf != NULL && buflen != 0
m0_conf_cache_is_locked(cache)

Definition at line 72 of file validation.c.

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

Variable Documentation

◆ conf_rules

static const struct m0_conf_ruleset conf_rules
static
Initial value:
= {
.cv_name = "m0_conf_rules",
.cv_rules = {
#define _ENTRY(name)
{ NULL, NULL }
}
}
#define NULL
Definition: misc.h:38
static char * conf_service_sdevs_error(const struct m0_conf_cache *cache, char *buf, size_t buflen)
Definition: validation.c:669
static char * conf_root_error(const struct m0_conf_cache *cache, char *buf, size_t buflen)
Definition: validation.c:203
#define _ENTRY(name)
static char * conf_endpoint_error(const struct m0_conf_cache *cache, char *buf, size_t buflen)
Definition: validation.c:593
static char * conf_pvers_error(const struct m0_conf_cache *cache, char *buf, size_t buflen)
Definition: validation.c:511
static char * conf_orphans_error(const struct m0_conf_cache *cache, char *buf, size_t buflen)
Definition: validation.c:107
static char * conf_service_type_error(const struct m0_conf_cache *cache, char *buf, size_t buflen)
Definition: validation.c:617

Definition at line 49 of file validation.c.

◆ conf_validity_checks

const struct m0_conf_ruleset* conf_validity_checks[]
static
Initial value:
= {
}
static const struct m0_conf_ruleset conf_rules
Definition: validation.c:49

Definition at line 51 of file validation.c.