30 #define M0_TRACE_SUBSYSTEM M0_TRACE_SUBSYS_DIX 82 .mhc_rpc_machine = &
ctx->dc_rpc_machine,
83 .mhc_reqh = &
ctx->dc_reqh,
84 .mhc_dispatcher_cfg = {
85 .hdc_enable_note =
true,
86 .hdc_enable_keepalive =
false,
87 .hdc_enable_fvec =
true 106 ctx->dc_motr_ha.mh_link,
150 .rhia_dtm = (
void*)1,
152 .rhia_mdstore = (
void*)1,
153 .rhia_pc = &
ctx->dc_pools_common,
159 laddr =
ctx->dc_laddr;
197 return &
ctx->dc_reqh.rh_rconfc;
258 goto err_domain_fini;
262 goto err_domain_fini;
270 .ca_rmach = &
ctx->dc_rpc_machine,
284 goto err_rconfc_stop;
288 goto err_rconfc_stop;
292 goto err_conf_fs_close;
296 goto err_conf_fs_close;
300 goto err_pools_common_fini;
304 goto err_pools_destroy;
310 goto err_pools_service_ctx_destroy;
314 goto err_pool_versions_destroy;
319 goto err_pool_versions_destroy;
325 err_pool_versions_destroy:
327 err_pools_service_ctx_destroy:
331 err_pools_common_fini:
384 const struct m0_fid *layout,
385 const struct m0_fid *ldescr)
397 "Pool version for FID="FID_F" is not found.\n",
404 int main(
int argc,
char **argv)
412 char *layout_pver =
NULL;
413 char *ldescr_pver =
NULL;
416 struct m0_fid layout_pver_fid;
417 struct m0_fid ldescr_pver_fid;
418 struct m0_fid root_pver_fid;
431 fprintf(stderr,
"Cannot init module %i\n",
rc);
438 LAMBDA(
void, (
const char *
string) {
442 LAMBDA(
void, (
const char *str) {
446 LAMBDA(
void, (
const char *str) {
450 LAMBDA(
void, (
const char *
string) {
451 layout_pver = (
char*)
string;
455 LAMBDA(
void, (
const char *
string) {
456 ldescr_pver = (
char*)
string;
459 " info\n\t\t\tcheck - check meta info\n" 460 "\t\t\tdestroy - destroy meta info",
461 LAMBDA(
void, (
const char *
string) {
471 fprintf(stderr,
"Invalid parameter(s).\n");
483 "Invalid action! Actions: create|check|destroy.\n");
488 (layout_pver ==
NULL || ldescr_pver ==
NULL)) {
489 fprintf(stderr,
"layout in case of CREATE is mandatory.\n");
497 fprintf(stderr,
"Incorrect FID format for: %s\n", layout_pver);
502 fprintf(stderr,
"Incorrect FID format for: %s\n", ldescr_pver);
507 fprintf(stderr,
"Initialisation error: %d\n",
rc);
512 fprintf(stderr,
"Can't find root pver fid: %d\n",
rc);
534 &
ctx.dc_reqh.rh_ldom, &root_pver_fid);
537 "DIX client initialisation failure: (%d)\n",
557 fprintf(stdout,
"Metadata exists: %s\n",
558 exists ?
"true" :
"false");
567 fprintf(stdout,
"Execution result: %s (%d)\n",
rc == 0 ?
568 "Success" :
"Failure",
rc);
577 fprintf(stdout,
"Metadata exists: false\n");
581 "DIX client start failure: (%d)\n",
rc);
583 fprintf(stderr,
"No metadata found?\n");
598 #undef M0_TRACE_SUBSYSTEM #define M0_GETOPTS(progname, argc, argv,...)
M0_INTERNAL uint64_t m0_process(void)
struct m0_net_domain dc_ndom
M0_INTERNAL void m0_pools_common_fini(struct m0_pools_common *pc)
struct m0_uint128 uuid[1000]
void m0_rpc_machine_fini(struct m0_rpc_machine *machine)
M0_INTERNAL void m0_reqh_services_terminate(struct m0_reqh *reqh)
M0_INTERNAL void m0_dix_cli_stop_lock(struct m0_dix_cli *cli)
static bool exists(const struct m0_ut_module *m, const char *s_name, const char *t_name)
void m0_net_domain_fini(struct m0_net_domain *dom)
static int dix_root_pver_find(struct dix_ctx *ctx, struct m0_fid *out)
static int dix_init(struct dix_ctx *ctx, const char *local_addr, const char *ha_addr, const char *profile)
M0_INTERNAL int m0_motr_ha_start(struct m0_motr_ha *mha)
M0_INTERNAL int m0_dix_meta_create(struct m0_dix_cli *cli, struct m0_sm_group *grp, struct m0_dix_ldesc *dld_layout, struct m0_dix_ldesc *dld_ldescr)
M0_INTERNAL int m0_conf_full_load(struct m0_conf_root *r)
static void dix_layouts_fini(struct dix_ctx *ctx)
M0_INTERNAL int m0_layout_domain_init(struct m0_layout_domain *dom)
#define M0_REQH_INIT(reqh,...)
M0_INTERNAL void m0_uuid_generate(struct m0_uint128 *u)
M0_INTERNAL struct m0_pool_version * m0_pool_version_find(struct m0_pools_common *pc, const struct m0_fid *id)
static uint32_t max_rpc_msg_size
static void dix_rpc_fini(struct dix_ctx *ctx)
struct m0_conf_obj rt_obj
struct m0_pool_version * pv
static struct m0_motr_ha_cfg motr_ha_cfg
#define M0_LOG(level,...)
M0_INTERNAL void m0_reqh_layouts_cleanup(struct m0_reqh *reqh)
const struct m0_conf_obj_type M0_CONF_SERVICE_TYPE
int main(int argc, char **argv)
M0_INTERNAL void m0_layout_domain_fini(struct m0_layout_domain *dom)
M0_INTERNAL void m0_rconfc_stop_sync(struct m0_rconfc *rconfc)
struct m0_rpc_machine dc_rpc_machine
M0_INTERNAL void m0_instance_setup(struct m0 *instance)
static int dix_service_start(struct m0_reqh_service_type *stype, struct m0_reqh *reqh)
M0_INTERNAL int m0_pools_setup(struct m0_pools_common *pc, const struct m0_fid *profile, struct m0_sm_group *sm_grp, struct m0_dtm *dtm)
M0_INTERNAL void m0_reqh_fini(struct m0_reqh *reqh)
M0_INTERNAL int m0_motr_ha_init(struct m0_motr_ha *mha, struct m0_motr_ha_cfg *mha_cfg)
static struct m0_pools_common pc
struct m0_pools_common dc_pools_common
M0_INTERNAL void m0_motr_ha_disconnect(struct m0_motr_ha *mha)
M0_INTERNAL int m0_confc_root_open(struct m0_confc *confc, struct m0_conf_root **root)
static void dix_ha_fini(struct dix_ctx *ctx)
static void dix_ha_stop(struct dix_ctx *ctx)
M0_INTERNAL struct m0_fid * m0_reqh2profile(struct m0_reqh *reqh)
#define M0_STRINGARG(ch, desc, func)
struct m0_conf_root * root
return M0_ERR(-EOPNOTSUPP)
M0_INTERNAL struct m0_confc * m0_reqh2confc(struct m0_reqh *reqh)
#define M0_FID_TINIT(type, container, key)
static const struct socktype stype[]
struct m0_fid rt_imeta_pver
const struct m0_fid_type cot_ftype
M0_INTERNAL int m0_reqh_conf_setup(struct m0_reqh *reqh, struct m0_confc_args *args)
struct m0_net_transfer_mc rm_tm
M0_INTERNAL int m0_dix_cli_start_sync(struct m0_dix_cli *cli)
M0_INTERNAL void m0_pools_common_service_ctx_connect_sync(struct m0_pools_common *pc)
M0_INTERNAL int m0_rpc_net_buffer_pool_setup(struct m0_net_domain *ndom, struct m0_net_buffer_pool *app_pool, uint32_t bufs_nr, uint32_t tm_nr)
M0_INTERNAL uint32_t m0_rpc_bufs_nr(uint32_t len, uint32_t tms_nr)
static void dix_net_fini(struct dix_ctx *ctx)
static int dix_reqh_services_start(struct dix_ctx *ctx)
M0_INTERNAL int m0_dix_ldesc_init(struct m0_dix_ldesc *ld, struct m0_ext *range, m0_bcount_t range_nr, enum m0_dix_hash_fnc_type htype, struct m0_fid *pver)
M0_INTERNAL int m0_dix_meta_check(struct m0_dix_cli *cli, struct m0_sm_group *grp, bool *result)
M0_INTERNAL int m0_rpc_machine_init(struct m0_rpc_machine *machine, struct m0_net_domain *net_dom, const char *ep_addr, struct m0_reqh *reqh, struct m0_net_buffer_pool *receive_pool, uint32_t colour, m0_bcount_t msg_size, uint32_t queue_len)
struct m0_net_xprt * m0_net_xprt_default_get(void)
M0_INTERNAL void m0_pools_service_ctx_destroy(struct m0_pools_common *pc)
M0_INTERNAL int m0_reqh_mdpool_layout_build(struct m0_reqh *reqh)
static int dix_ha_init(struct dix_ctx *ctx, const char *ha_addr)
static int m0_rconfc_start_sync(struct m0_rconfc *rconfc)
struct m0_sm_group * lo_grp
M0_INTERNAL void m0_motr_ha_connect(struct m0_motr_ha *mha)
static const struct m0_fid fids[]
M0_INTERNAL int m0_reqh_service_setup(struct m0_reqh_service **out, struct m0_reqh_service_type *stype, struct m0_reqh *reqh, struct m0_reqh_context *rctx, const struct m0_fid *fid)
M0_INTERNAL int m0_fid_sscanf(const char *s, struct m0_fid *fid)
M0_INTERNAL int m0_layout_standard_types_register(struct m0_layout_domain *dom)
static int dix_rpc_init(struct dix_ctx *ctx)
M0_INTERNAL int m0_dix_cli_init(struct m0_dix_cli *cli, struct m0_sm_group *sm_group, struct m0_pools_common *pc, struct m0_layout_domain *ldom, const struct m0_fid *pver)
M0_INTERNAL void m0_rconfc_fini(struct m0_rconfc *rconfc)
M0_INTERNAL int m0_reqh_state_get(struct m0_reqh *reqh)
M0_INTERNAL void m0_dix_ldesc_fini(struct m0_dix_ldesc *ld)
struct m0_reqh_service_type m0_rms_type
M0_INTERNAL void m0_dix_cli_bootstrap_lock(struct m0_dix_cli *cli)
M0_INTERNAL void m0_reqh_start(struct m0_reqh *reqh)
static struct m0_fid profile
int m0_net_domain_init(struct m0_net_domain *dom, const struct m0_net_xprt *xprt)
M0_INTERNAL int m0_pools_common_init(struct m0_pools_common *pc, struct m0_rpc_machine *rmach)
M0_INTERNAL struct m0_locality * m0_locality0_get(void)
M0_INTERNAL int m0_dix_meta_destroy(struct m0_dix_cli *cli, struct m0_sm_group *grp)
M0_INTERNAL void m0_layout_domain_cleanup(struct m0_layout_domain *dom)
static void dix_fini(struct dix_ctx *ctx)
M0_INTERNAL void m0_conf_ha_process_event_post(struct m0_ha *ha, struct m0_ha_link *hl, const struct m0_fid *process_fid, uint64_t pid, enum m0_conf_ha_process_event event, enum m0_conf_ha_process_type type)
M0_INTERNAL int m0_pools_service_ctx_create(struct m0_pools_common *pc)
struct m0_motr_ha dc_motr_ha
M0_INTERNAL void m0_layout_standard_types_unregister(struct m0_layout_domain *dom)
static struct m0 instance
static int dix_net_init(struct dix_ctx *ctx, const char *local_addr)
int fini(struct workload *w)
M0_INTERNAL void m0_confc_close(struct m0_conf_obj *obj)
static void reqh_fini(void)
M0_INTERNAL void m0_motr_ha_stop(struct m0_motr_ha *mha)
struct m0_net_buffer_pool dc_buffer_pool
M0_INTERNAL void m0_dix_cli_fini_lock(struct m0_dix_cli *cli)
const struct m0_conf_obj_type M0_CONF_PROCESS_TYPE
M0_INTERNAL int m0_pool_versions_setup(struct m0_pools_common *pc)
void m0_rpc_net_buffer_pool_cleanup(struct m0_net_buffer_pool *app_pool)
M0_INTERNAL void m0_pool_versions_destroy(struct m0_pools_common *pc)
M0_INTERNAL void m0_motr_ha_fini(struct m0_motr_ha *mha)
static uint32_t tm_recv_queue_min_len
static int dix_pver_fids_check(struct dix_ctx *ctx, const struct m0_fid *root, const struct m0_fid *layout, const struct m0_fid *ldescr)
M0_INTERNAL struct m0_rconfc * dix2rconfc(struct dix_ctx *ctx)
static struct m0_reqh_service * service[REQH_IN_UT_MAX]
static struct m0_rpc_machine rpc_machine
static int dix_layouts_init(struct dix_ctx *ctx)
M0_INTERNAL int m0_module_init(struct m0_module *module, int level)
M0_INTERNAL void m0_fid_tassume(struct m0_fid *fid, const struct m0_fid_type *ft)
#define M0_IMPOSSIBLE(fmt,...)
M0_INTERNAL void m0_pools_destroy(struct m0_pools_common *pc)
struct m0_net_buffer_pool * ntm_recv_pool