32 #define M0_TRACE_SUBSYSTEM M0_TRACE_SUBSYS_HA 36 #include "ha/entrypoint_fops_xc.h" 53 .
name =
"HA Cluster Entry Point Get Req",
55 .
xt = m0_ha_entrypoint_req_fop_xc,
61 .
name =
"HA Cluster Entry Point Get Reply",
63 .
xt = m0_ha_entrypoint_rep_fop_xc,
80 if (git_rev_id_dup ==
NULL)
84 .erf_generation =
req->heq_generation,
85 .erf_process_fid =
req->heq_process_fid,
86 .erf_link_params =
req->heq_link_params,
88 .erf_pid =
req->heq_pid,
97 const char *rpc_endpoint,
100 char *rpc_endpoint_dup =
m0_strdup(rpc_endpoint);
103 if (rpc_endpoint_dup ==
NULL || git_rev_id_dup ==
NULL) {
112 .heq_rpc_endpoint = rpc_endpoint_dup,
114 .heq_git_rev_id = git_rev_id_dup,
130 .hae_quorum =
rep_fop->hbp_quorum,
132 .af_count =
rep_fop->hbp_confd_fids.af_count,
134 .hae_active_rm_fid =
rep_fop->hbp_active_rm_fid,
136 .hae_link_params =
rep_fop->hbp_link_params,
137 .hae_link_do_reconnect = !!
rep_fop->hbp_link_do_reconnect,
138 .hae_disconnected_previously =
139 !!
rep_fop->hbp_disconnected_previously,
140 .hae_control =
rep_fop->hbp_control,
144 rep_fop->hbp_confd_eps.ab_count);
148 rep->hae_confd_fids.af_count);
150 for (
i = 0;
i <
rep->hae_confd_fids.af_count; ++
i) {
151 rep->hae_confd_fids.af_elems[
i] =
152 rep_fop->hbp_confd_fids.af_elems[
i];
167 rm_ep =
rep->hae_active_rm_ep ==
NULL ?
170 .hbp_quorum =
rep->hae_quorum,
172 .af_count =
rep->hae_confd_fids.af_count,
175 .ab_count =
rep->hae_confd_fids.af_count,
177 .hbp_active_rm_fid =
rep->hae_active_rm_fid,
179 .hbp_link_params =
rep->hae_link_params,
180 .hbp_link_do_reconnect = !!
rep->hae_link_do_reconnect,
181 .hbp_disconnected_previously =
182 !!
rep->hae_disconnected_previously,
183 .hbp_control =
rep->hae_control,
186 rep_fop->hbp_confd_eps.ab_count);
188 for (
i = 0;
i <
rep_fop->hbp_confd_eps.ab_count; ++
i) {
194 rep_fop->hbp_confd_fids.af_count);
196 for (
i = 0;
i <
rep_fop->hbp_confd_fids.af_count; ++
i) {
197 rep_fop->hbp_confd_fids.af_elems[
i] =
198 rep->hae_confd_fids.af_elems[
i];
225 return M0_RC(-EINVAL);
255 #undef M0_TRACE_SUBSYSTEM
struct m0_buf erf_git_rev_id
struct m0_fid hae_active_rm_fid
#define M0_ALLOC_ARR(arr, nr)
M0_INTERNAL const char ** m0_strings_dup(const char **src)
M0_INTERNAL int m0_ha_entrypoint_rep_copy(struct m0_ha_entrypoint_rep *to, struct m0_ha_entrypoint_rep *from)
#define M0_FOP_TYPE_INIT(ft,...)
static struct io_request req
const char ** hae_confd_eps
struct m0_ha_link_params hae_link_params
M0_INTERNAL int m0_ha_entrypoint_fop2req(const struct m0_ha_entrypoint_req_fop *req_fop, const char *rpc_endpoint, struct m0_ha_entrypoint_req *req)
void m0_fop_type_fini(struct m0_fop_type *fopt)
M0_INTERNAL void m0_ha_cookie_to_xc(const struct m0_ha_cookie *hc, struct m0_ha_cookie_xc *hc_xc)
static struct m0_xcode_type ** xt[]
struct m0_fop_getxattr_rep * rep
struct m0_fop_type m0_ha_entrypoint_rep_fopt
struct m0_fop_type m0_ha_entrypoint_req_fopt
return M0_ERR(-EOPNOTSUPP)
M0_INTERNAL int m0_ha_entrypoint_req2fop(const struct m0_ha_entrypoint_req *req, struct m0_ha_entrypoint_req_fop *req_fop)
struct m0_fid erf_process_fid
M0_INTERNAL void m0_ha_entrypoint_fops_init(void)
#define M0_BUF_INITS(str)
M0_INTERNAL int m0_ha_entrypoint_rep2fop(const struct m0_ha_entrypoint_rep *rep, struct m0_ha_entrypoint_rep_fop *rep_fop)
M0_INTERNAL int m0_buf_copy(struct m0_buf *dest, const struct m0_buf *src)
M0_INTERNAL int m0_ha_entrypoint_fop2rep(const struct m0_ha_entrypoint_rep_fop *rep_fop, struct m0_ha_entrypoint_rep *rep)
struct m0_reqh_service_type m0_ha_entrypoint_service_type
enum m0_ha_entrypoint_control hae_control
M0_INTERNAL char * m0_buf_strdup(const struct m0_buf *buf)
struct m0_ha_cookie_xc erf_cookie_expected
M0_INTERNAL void m0_strings_free(const char **arr)
M0_INTERNAL void m0_ha_entrypoint_req_free(struct m0_ha_entrypoint_req *req)
M0_INTERNAL int m0_fid_arr_copy(struct m0_fid_arr *to, const struct m0_fid_arr *from)
M0_INTERNAL void m0_ha_entrypoint_rep_free(struct m0_ha_entrypoint_rep *rep)
M0_INTERNAL int m0_bufs_to_strings(const char ***dest, const struct m0_bufs *src)
M0_INTERNAL void m0_ha_entrypoint_fops_fini(void)
int32_t erf_first_request
M0_INTERNAL void m0_ha_cookie_from_xc(struct m0_ha_cookie *hc, const struct m0_ha_cookie_xc *hc_xc)
const struct m0_fom_type_ops m0_ha_entrypoint_fom_type_ops
struct m0_fid_arr hae_confd_fids
struct m0_ha_link_params erf_link_params
struct m0_sm_conf m0_ha_entrypoint_server_fom_states_conf