Motr  M0
Configuration Objects

Detailed Functional Specification. More...

Data Structures

struct  m0_conf_obj
 
struct  m0_conf_obj_type
 
struct  m0_conf_dir
 
struct  m0_conf_root
 
struct  m0_conf_profile
 
struct  m0_conf_pool
 
struct  m0_conf_pver_subtree
 
struct  m0_conf_pver_formulaic
 
struct  m0_conf_pver
 
struct  m0_conf_objv
 
struct  m0_conf_node
 
struct  m0_conf_process
 
struct  m0_conf_service
 
struct  m0_conf_sdev
 
struct  m0_conf_site
 
struct  m0_conf_rack
 
struct  m0_conf_enclosure
 
struct  m0_conf_controller
 
struct  m0_conf_drive
 
struct  m0_conf_fdmi_flt_grp
 
struct  m0_conf_fdmi_filter
 

Macros

#define M0_CONF_CAST(ptr, type)   bob_of(ptr, struct type, type ## _cast_field, &type ## _bob)
 
#define m0_conf_dir_cast_field   cd_obj
 
#define m0_conf_root_cast_field   rt_obj
 
#define m0_conf_profile_cast_field   cp_obj
 
#define m0_conf_pool_cast_field   pl_obj
 
#define m0_conf_pver_cast_field   pv_obj
 
#define m0_conf_objv_cast_field   cv_obj
 
#define m0_conf_node_cast_field   cn_obj
 
#define m0_conf_process_cast_field   pc_obj
 
#define m0_conf_service_cast_field   cs_obj
 
#define m0_conf_sdev_cast_field   sd_obj
 
#define m0_conf_site_cast_field   ct_obj
 
#define m0_conf_rack_cast_field   cr_obj
 
#define m0_conf_enclosure_cast_field   ce_obj
 
#define m0_conf_controller_cast_field   cc_obj
 
#define m0_conf_drive_cast_field   ck_obj
 
#define m0_conf_fdmi_filter_cast_field   ff_obj
 
#define m0_conf_fdmi_flt_grp_cast_field   ffg_obj
 
#define M0_CONF_OBJ_TYPES
 
#define X_CONF(name, NAME, _)
 
#define X_CONF(name, _)   extern const struct m0_fid M0_CONF_ ## name ## _FID;
 
#define M0_CONF_REL_FIDS
 

Enumerations

enum  m0_conf_status { M0_CS_MISSING, M0_CS_LOADING, M0_CS_READY }
 
enum  { M0_CONF_OBJ_TYPE_MAX = 256 }
 
enum  {
  M0_CONF_PVER_LVL_SITES = 0, M0_CONF_PVER_LVL_RACKS, M0_CONF_PVER_LVL_ENCLS, M0_CONF_PVER_LVL_CTRLS,
  M0_CONF_PVER_LVL_DRIVES, M0_CONF_PVER_HEIGHT
}
 
enum  m0_conf_pver_kind { M0_CONF_PVER_ACTUAL, M0_CONF_PVER_FORMULAIC, M0_CONF_PVER_VIRTUAL }
 

Functions

void m0_conf_obj_type_register (const struct m0_conf_obj_type *otype)
 
void m0_conf_obj_type_unregister (const struct m0_conf_obj_type *otype)
 
const struct m0_conf_obj_typem0_conf_obj_type (const struct m0_conf_obj *obj)
 
const struct m0_conf_obj_typem0_conf_fid_type (const struct m0_fid *id)
 
const struct m0_fidm0_conf_objx_fid (const struct m0_confx_obj *obj)
 
const struct m0_conf_obj_typem0_conf_objx_type (const struct m0_confx_obj *obj)
 
bool m0_conf_fid_is_valid (const struct m0_fid *fid)
 
M0_INTERNAL bool m0_conf_obj_is_stub (const struct m0_conf_obj *obj)
 
struct m0_conf_objm0_conf_obj_grandparent (const struct m0_conf_obj *obj)
 
M0_INTERNAL const struct m0_conf_obj_typem0_conf_obj_type_next (const struct m0_conf_obj_type *otype)
 
M0_INTERNAL int m0_conf_obj_init (void)
 
M0_INTERNAL void m0_conf_obj_fini (void)
 
M0_INTERNAL void m0_conf_child_adopt (struct m0_conf_obj *parent, struct m0_conf_obj *child)
 

Variables

enum m0_conf_status M0_XCA_DOMAIN
 
M0_CONF_REL_FIDS const struct m0_fid_type M0_CONF_RELFID_TYPE
 
const struct m0_fid M0_CONF_ROOT_FID
 

Detailed Description

Detailed Functional Specification.

See also
DLD of configuration caching, Functional Specification

Macro Definition Documentation

◆ M0_CONF_CAST

#define M0_CONF_CAST (   ptr,
  type 
)    bob_of(ptr, struct type, type ## _cast_field, &type ## _bob)

Casts m0_conf_obj to the ambient concrete configuration object.

Parameters
ptrPointer to m0_conf_obj member.
typeType of concrete configuration object (without ‘struct’).

Example:

Definition at line 780 of file obj.h.

◆ m0_conf_controller_cast_field

#define m0_conf_controller_cast_field   cc_obj

Definition at line 796 of file obj.h.

◆ m0_conf_dir_cast_field

#define m0_conf_dir_cast_field   cd_obj

Definition at line 783 of file obj.h.

◆ m0_conf_drive_cast_field

#define m0_conf_drive_cast_field   ck_obj

Definition at line 797 of file obj.h.

◆ m0_conf_enclosure_cast_field

#define m0_conf_enclosure_cast_field   ce_obj

Definition at line 795 of file obj.h.

◆ m0_conf_fdmi_filter_cast_field

#define m0_conf_fdmi_filter_cast_field   ff_obj

Definition at line 798 of file obj.h.

◆ m0_conf_fdmi_flt_grp_cast_field

#define m0_conf_fdmi_flt_grp_cast_field   ffg_obj

Definition at line 799 of file obj.h.

◆ m0_conf_node_cast_field

#define m0_conf_node_cast_field   cn_obj

Definition at line 789 of file obj.h.

◆ M0_CONF_OBJ_TYPES

#define M0_CONF_OBJ_TYPES
Value:
X_CONF(root, ROOT, 't') \
X_CONF(dir, DIR, 'D') \
X_CONF(profile, PROFILE, 'p') \
X_CONF(pool, POOL, 'o') \
X_CONF(pver, PVER, 'v') \
X_CONF(objv, OBJV, 'j') \
X_CONF(node, NODE, 'n') \
X_CONF(process, PROCESS, 'r') \
X_CONF(service, SERVICE, 's') \
X_CONF(sdev, SDEV, 'd') \
X_CONF(site, SITE, 'S') \
X_CONF(rack, RACK, 'a') \
X_CONF(enclosure, ENCLOSURE, 'e') \
X_CONF(controller, CONTROLLER, 'c') \
X_CONF(drive, DRIVE, 'k') \
X_CONF(fdmi_flt_grp, FDMI_FLT_GRP, 'g') \
X_CONF(fdmi_filter, FDMI_FILTER, 'l')
static struct net_test_cmd_node * node
Definition: commands.c:72
struct m0_conf_root * root
Definition: note.c:50
#define X_CONF(name, NAME, _)
Definition: obj.h:857
struct m0_fid pver
Definition: idx_dix.c:74
Definition: diter.c:64
static struct m0_pool pool
Definition: iter_ut.c:58
static struct m0_fid profile
Definition: rconfc.c:49
Definition: diter.c:55
Definition: diter.c:39
struct inode * dir
Definition: dir.c:1028
static struct m0_reqh_service * service[REQH_IN_UT_MAX]
Definition: long_lock_ut.c:46
Definition: diter.c:63

Definition at line 801 of file obj.h.

◆ m0_conf_objv_cast_field

#define m0_conf_objv_cast_field   cv_obj

Definition at line 788 of file obj.h.

◆ m0_conf_pool_cast_field

#define m0_conf_pool_cast_field   pl_obj

Definition at line 786 of file obj.h.

◆ m0_conf_process_cast_field

#define m0_conf_process_cast_field   pc_obj

Definition at line 790 of file obj.h.

◆ m0_conf_profile_cast_field

#define m0_conf_profile_cast_field   cp_obj

Definition at line 785 of file obj.h.

◆ m0_conf_pver_cast_field

#define m0_conf_pver_cast_field   pv_obj

Definition at line 787 of file obj.h.

◆ m0_conf_rack_cast_field

#define m0_conf_rack_cast_field   cr_obj

Definition at line 794 of file obj.h.

◆ M0_CONF_REL_FIDS

#define M0_CONF_REL_FIDS
Value:
X_CONF(ANY, -1) \
X_CONF(ROOT_NODES, 1) \
X_CONF(ROOT_SITES, 2) \
X_CONF(ROOT_POOLS, 3) \
X_CONF(ROOT_PROFILES, 4) \
X_CONF(ROOT_FDMI_FLT_GRPS, 5) \
X_CONF(FDMI_FGRP_FILTERS, 6) \
X_CONF(POOL_PVERS, 7) \
X_CONF(PVER_SITEVS, 8) \
X_CONF(SITEV_RACKVS, 9) \
X_CONF(RACKV_ENCLVS, 10) \
X_CONF(ENCLV_CTRLVS, 11) \
X_CONF(CTRLV_DRIVEVS, 12) \
X_CONF(NODE_PROCESSES, 13) \
X_CONF(PROCESS_SERVICES, 14) \
X_CONF(SERVICE_SDEVS, 15) \
X_CONF(SITE_RACKS, 16) \
X_CONF(RACK_ENCLS, 17) \
X_CONF(ENCLOSURE_CTRLS, 18) \
X_CONF(CONTROLLER_DRIVES, 19)
#define X_CONF(name, NAME, _)
Definition: obj.h:857

Definition at line 831 of file obj.h.

◆ m0_conf_root_cast_field

#define m0_conf_root_cast_field   rt_obj

Definition at line 784 of file obj.h.

◆ m0_conf_sdev_cast_field

#define m0_conf_sdev_cast_field   sd_obj

Definition at line 792 of file obj.h.

◆ m0_conf_service_cast_field

#define m0_conf_service_cast_field   cs_obj

Definition at line 791 of file obj.h.

◆ m0_conf_site_cast_field

#define m0_conf_site_cast_field   ct_obj

Definition at line 793 of file obj.h.

◆ X_CONF [1/2]

#define X_CONF (   name,
  NAME,
 
)
Value:
extern const struct m0_bob_type m0_conf_ ## name ## _bob; \
extern const struct m0_conf_obj_type M0_CONF_ ## NAME ## _TYPE;
const char * name
Definition: trace.c:110
#define NAME(ext)

Definition at line 857 of file obj.h.

◆ X_CONF [2/2]

#define X_CONF (   name,
 
)    extern const struct m0_fid M0_CONF_ ## name ## _FID;

Definition at line 857 of file obj.h.

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
M0_CONF_OBJ_TYPE_MAX 

Definition at line 350 of file obj.h.

◆ anonymous enum

anonymous enum

Levels of a m0_conf_pver_subtree.

Currently 5 levels are supported: [0] = sites, [1] = racks, [2] = enclosures, [3] = controllers, [4] = drives.

Enumerator
M0_CONF_PVER_LVL_SITES 
M0_CONF_PVER_LVL_RACKS 
M0_CONF_PVER_LVL_ENCLS 
M0_CONF_PVER_LVL_CTRLS 
M0_CONF_PVER_LVL_DRIVES 
M0_CONF_PVER_HEIGHT 

Definition at line 458 of file obj.h.

◆ m0_conf_pver_kind

Kinds of m0_conf_pvers.

Enumerator
M0_CONF_PVER_ACTUAL 
M0_CONF_PVER_FORMULAIC 
M0_CONF_PVER_VIRTUAL 

Definition at line 516 of file obj.h.

◆ m0_conf_status

Status of configuration object. Configuration object is a stub unless its status is M0_CS_READY.

See also
m0_conf_obj_is_stub()
Enumerator
M0_CS_MISSING 

Configuration is absent; no retrieval in progress.

M0_CS_LOADING 

Retrieval of configuration is in progress.

M0_CS_READY 

Configuration is available.

Definition at line 193 of file obj.h.

Function Documentation

◆ m0_conf_child_adopt()

M0_INTERNAL void m0_conf_child_adopt ( struct m0_conf_obj parent,
struct m0_conf_obj child 
)

Definition at line 425 of file obj.c.

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

◆ m0_conf_fid_is_valid()

bool m0_conf_fid_is_valid ( const struct m0_fid fid)

Definition at line 378 of file obj.c.

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

◆ m0_conf_fid_type()

const struct m0_conf_obj_type* m0_conf_fid_type ( const struct m0_fid id)

Definition at line 368 of file obj.c.

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

◆ m0_conf_obj_fini()

M0_INTERNAL void m0_conf_obj_fini ( void  )

Definition at line 413 of file obj.c.

Here is the call graph for this function:

◆ m0_conf_obj_grandparent()

struct m0_conf_obj* m0_conf_obj_grandparent ( const struct m0_conf_obj obj)

Definition at line 384 of file obj.c.

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

◆ m0_conf_obj_init()

M0_INTERNAL int m0_conf_obj_init ( void  )

Definition at line 397 of file obj.c.

Here is the call graph for this function:

◆ m0_conf_obj_is_stub()

M0_INTERNAL bool m0_conf_obj_is_stub ( const struct m0_conf_obj obj)

Returns true iff obj->co_status != M0_CS_READY.

Precondition
M0_IN(obj->co_status, (M0_CS_MISSING, M0_CS_LOADING, M0_CS_READY))

Definition at line 302 of file obj.c.

Here is the caller graph for this function:

◆ m0_conf_obj_type()

const struct m0_conf_obj_type* m0_conf_obj_type ( const struct m0_conf_obj obj)

Definition at line 363 of file obj.c.

Here is the call graph for this function:

◆ m0_conf_obj_type_next()

M0_INTERNAL const struct m0_conf_obj_type* m0_conf_obj_type_next ( const struct m0_conf_obj_type otype)

Iterates over registered conf object types.

To start iteration call m0_conf_obj_type_next(NULL). Returns NULL when the iteration is over.

const struct m0_conf_obj_type *t = NULL;
while ((t = m0_conf_obj_type_next(t)) != NULL) {
... do something with t ...
}

Definition at line 351 of file obj.c.

Here is the caller graph for this function:

◆ m0_conf_obj_type_register()

void m0_conf_obj_type_register ( const struct m0_conf_obj_type otype)

Definition at line 313 of file obj.c.

Here is the call graph for this function:

◆ m0_conf_obj_type_unregister()

void m0_conf_obj_type_unregister ( const struct m0_conf_obj_type otype)

Definition at line 340 of file obj.c.

Here is the call graph for this function:

◆ m0_conf_objx_fid()

const struct m0_fid* m0_conf_objx_fid ( const struct m0_confx_obj obj)

Definition at line 266 of file obj_ops.c.

Here is the caller graph for this function:

◆ m0_conf_objx_type()

const struct m0_conf_obj_type* m0_conf_objx_type ( const struct m0_confx_obj obj)

Definition at line 271 of file obj_ops.c.

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

Variable Documentation

◆ M0_CONF_RELFID_TYPE

M0_CONF_REL_FIDS const struct m0_fid_type M0_CONF_RELFID_TYPE

Definition at line 215 of file dir.c.

◆ M0_CONF_ROOT_FID

const struct m0_fid M0_CONF_ROOT_FID

Root configuration object FID. The same in any configuration database.

Definition at line 226 of file root.c.

◆ M0_XCA_DOMAIN

enum m0_conf_status M0_XCA_DOMAIN