22 #define M0_TRACE_SUBSYSTEM M0_TRACE_SUBSYS_CONF 26 #include "conf/onwire_xc.h" 31 #define XCAST(xobj) ((struct m0_confx_pver *)(&(xobj)->xo_u)) 43 _0C(kind == self->pv_kind) &&
46 &self->pv_u.subtree.pvs_attr))) &&
49 _0C(!
M0_IS0(&self->pv_u.formulaic.pvf_allowance))) &&
100 .pvf_base =
s->xvf_base
128 .
xva_N =
s->pvs_attr.pa_N,
129 .xva_K =
s->pvs_attr.pa_K,
130 .xva_S =
s->pvs_attr.pa_S,
131 .xva_P =
s->pvs_attr.pa_P
149 .xvf_base =
s->pvf_base
174 const struct m0_confx_pver_formulaic *x =
175 &xobj->u.xpv_formulaic;
176 const struct m0_conf_pver_formulaic *c =
177 &obj->pv_u.formulaic;
179 c->pvf_id == x->xvf_id &&
180 m0_fid_eq(&c->pvf_base, &x->xvf_base) &&
181 u32arr_cmp(&x->xvf_allowance, c->pvf_allowance,
182 ARRAY_SIZE(c->pvf_allowance));
189 c->pvs_attr.pa_N ==
x->xva_N &&
190 c->pvs_attr.pa_K ==
x->xva_K &&
191 c->pvs_attr.pa_S ==
x->xva_S &&
192 c->pvs_attr.pa_P ==
x->xva_P &&
218 &
pver->pv_u.formulaic.pvf_base, &
obj) ?:
223 *
out = &
pver->pv_u.subtree.pvs_sitevs->cd_obj;
230 static const struct m0_fid *rels[] = { &M0_CONF_PVER_SITEVS_FID,
243 m0_conf_pver_bob_fini(
x);
262 .
ft_id = M0_CONF__PVER_FT_ID,
263 .ft_name =
"conf_pver" 265 .cot_create = &pver_create,
266 .cot_xt = &m0_confx_pver_xc,
267 .cot_branch =
"u_pver",
268 .cot_xc_init = &m0_xc_m0_confx_pver_struct_init,
273 #undef M0_TRACE_SUBSYSTEM
const struct m0_conf_obj_type M0_CONF_OBJV_TYPE
struct m0_conf_dir * pvs_sitevs
static const struct m0_conf_obj_ops pver_ops
struct m0_pdclust_attr pvs_attr
static bool pver_match(const struct m0_conf_obj *cached, const struct m0_confx_obj *flat)
union m0_confx_pver_u::@125 u
const struct m0_conf_obj_type M0_CONF_PVER_TYPE
M0_CONF__INVARIANT_DEFINE(pver_invariant, m0_conf_pver)
bool(* coo_invariant)(const struct m0_conf_obj *obj)
static bool pver_check(const void *bob)
M0_BASSERT(offsetof(struct m0_confx_pver, xv_header)==0)
struct m0_conf_cache * co_cache
struct arr_u32 xva_tolerance
struct m0_conf_obj * co_parent
M0_INTERNAL bool m0_conf_obj_is_stub(const struct m0_conf_obj *obj)
enum m0_conf_pver_kind pv_kind
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)
M0_CONF__BOB_DEFINE(m0_conf_pver, M0_CONF_PVER_MAGIC, pver_check)
M0_CONF__CTOR_DEFINE(pver_create, m0_conf_pver, &pver_ops)
return M0_ERR(-EOPNOTSUPP)
const struct m0_fid_type cot_ftype
static struct m0_addb2_callback c
union m0_conf_pver::@122 pv_u
uint32_t pvs_tolerance[M0_CONF_PVER_HEIGHT]
M0_INTERNAL void confx_encode(struct m0_confx_obj *dest, const struct m0_conf_obj *src)
M0_INTERNAL int m0_conf_pver_fid_read(const struct m0_fid *fid, enum m0_conf_pver_kind *kind, uint64_t *container, uint64_t *key)
struct m0_confx_header xv_header
M0_INTERNAL int m0_conf_obj_find(struct m0_conf_cache *cache, const struct m0_fid *id, struct m0_conf_obj **out)
static int pver_encode(struct m0_confx_obj *dest, const struct m0_conf_obj *src)
#define M0_CONF_CAST(ptr, type)
M0_INTERNAL int arrfid_from_dir(struct m0_fid_arr *dest, const struct m0_conf_dir *dir)
static void pver_delete(struct m0_conf_obj *obj)
static int pver_lookup(const struct m0_conf_obj *parent, const struct m0_fid *name, struct m0_conf_obj **out)
struct m0_conf_pver_subtree subtree
M0_INTERNAL bool m0_fid_eq(const struct m0_fid *fid0, const struct m0_fid *fid1)
M0_INTERNAL void u32arr_free(struct arr_u32 *arr)
static int pver_decode(struct m0_conf_obj *dest, const struct m0_confx_obj *src)
struct m0_conf_pver_formulaic formulaic
M0_INTERNAL int u32arr_encode(struct arr_u32 *dest, const uint32_t *src, uint32_t src_nr)
enum m0_conf_status co_status
M0_INTERNAL bool u32arr_cmp(const struct arr_u32 *a1, const uint32_t *a2, uint32_t a2_nr)
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
#define offsetof(typ, memb)
M0_INTERNAL bool m0_conf_obj_invariant(const struct m0_conf_obj *obj)
static const struct m0_fid ** pver_downlinks(const struct m0_conf_obj *obj)
struct m0_fid_arr xva_sitevs
#define M0_IMPOSSIBLE(fmt,...)
M0_INTERNAL bool m0_pdclust_attr_check(const struct m0_pdclust_attr *attr)