22 #define M0_TRACE_SUBSYSTEM M0_TRACE_SUBSYS_CONF 26 #include "conf/onwire_xc.h" 30 #define XCAST(xobj) ((struct m0_confx_objv *)(&(xobj)->xo_u)) 51 const struct m0_fid *relfid;
60 return s->xj_children.af_count == 0 ?
75 if (
s->cv_real !=
NULL)
77 return s->cv_children ==
NULL ? 0 :
107 enum { SITE,
RACK, ENCL, CTRL, DISK };
108 static const struct m0_fid *downlinks[][2] = {
109 [SITE] = { &M0_CONF_SITEV_RACKVS_FID,
NULL },
110 [
RACK] = { &M0_CONF_RACKV_ENCLVS_FID,
NULL },
111 [ENCL] = { &M0_CONF_ENCLV_CTRLVS_FID,
NULL },
112 [CTRL] = { &M0_CONF_CTRLV_DRIVEVS_FID,
NULL },
119 return downlinks[SITE];
121 return downlinks[
RACK];
123 return downlinks[ENCL];
125 return downlinks[CTRL];
127 return downlinks[DISK];
134 m0_conf_objv_bob_fini(
x);
153 .
ft_id = M0_CONF__OBJV_FT_ID,
154 .ft_name =
"conf_objv" 156 .cot_create = &objv_create,
157 .cot_xt = &m0_confx_objv_xc,
158 .cot_branch =
"u_objv",
159 .cot_xc_init = &m0_xc_m0_confx_objv_struct_init,
164 #undef M0_TRACE_SUBSYSTEM const struct m0_conf_obj_type * m0_conf_obj_type(const struct m0_conf_obj *obj)
M0_INTERNAL int conf_dirs_lookup(struct m0_conf_obj **out, const struct m0_fid *name, const struct conf_dir_relation *rels, size_t nr_rels)
const struct m0_conf_obj_type M0_CONF_OBJV_TYPE
const struct m0_conf_obj_type M0_CONF_SITE_TYPE
bool(* coo_invariant)(const struct m0_conf_obj *obj)
struct m0_confx_header xj_header
static void objv_delete(struct m0_conf_obj *obj)
static bool objv_match(const struct m0_conf_obj *cached, const struct m0_confx_obj *flat)
const struct m0_conf_obj_type M0_CONF_CONTROLLER_TYPE
static int objv_encode(struct m0_confx_obj *dest, const struct m0_conf_obj *src)
M0_INTERNAL int m0_conf_dir_new(struct m0_conf_obj *parent, const struct m0_fid *relfid, const struct m0_conf_obj_type *children_type, const struct m0_fid_arr *children_ids, struct m0_conf_dir **out)
#define M0_ERR_INFO(rc, fmt,...)
return M0_ERR(-EOPNOTSUPP)
const struct m0_conf_obj_type M0_CONF_ENCLOSURE_TYPE
const struct m0_fid_type cot_ftype
static const struct m0_conf_obj_ops objv_ops
const struct m0_fid **(* coo_downlinks)(const struct m0_conf_obj *obj)
M0_INTERNAL void confx_encode(struct m0_confx_obj *dest, const struct m0_conf_obj *src)
static const struct m0_fid ** objv_downlinks(const struct m0_conf_obj *obj)
const struct m0_conf_obj_type M0_CONF_DRIVE_TYPE
static int objv_decode(struct m0_conf_obj *dest, const struct m0_confx_obj *src)
M0_INTERNAL int m0_conf_obj_find(struct m0_conf_cache *cache, const struct m0_fid *id, struct m0_conf_obj **out)
#define M0_CONF_CAST(ptr, type)
M0_INTERNAL int arrfid_from_dir(struct m0_fid_arr *dest, const struct m0_conf_dir *dir)
static bool objv_check(const void *bob)
M0_INTERNAL bool m0_fid_eq(const struct m0_fid *fid0, const struct m0_fid *fid1)
M0_CONF__BOB_DEFINE(m0_conf_objv, M0_CONF_OBJV_MAGIC, objv_check)
enum m0_conf_status co_status
struct m0_conf_dir * cv_children
static struct m0_addb2_source * s
M0_INTERNAL bool m0_conf_dir_elems_match(const struct m0_conf_dir *dir, const struct m0_fid_arr *fids)
struct m0_pdclust_src_addr src
M0_CONF__CTOR_DEFINE(objv_create, m0_conf_objv, &objv_ops)
#define offsetof(typ, memb)
const struct m0_conf_obj_type M0_CONF_RACK_TYPE
M0_CONF__INVARIANT_DEFINE(objv_invariant, m0_conf_objv)
struct m0_conf_obj * cv_real
M0_BASSERT(offsetof(struct m0_confx_objv, xj_header)==0)
struct m0_fid_arr xj_children
const struct m0_conf_obj_ops * co_ops
static int objv_lookup(const struct m0_conf_obj *parent, const struct m0_fid *name, struct m0_conf_obj **out)