Motr  M0
entrypoint.h
Go to the documentation of this file.
1 /* -*- C -*- */
2 /*
3  * Copyright (c) 2016-2020 Seagate Technology LLC and/or its Affiliates
4  *
5  * Licensed under the Apache License, Version 2.0 (the "License");
6  * you may not use this file except in compliance with the License.
7  * You may obtain a copy of the License at
8  *
9  * http://www.apache.org/licenses/LICENSE-2.0
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  *
17  * For any questions about this software or licensing,
18  * please email opensource@seagate.com or cortx-questions@seagate.com.
19  *
20  */
21 
22 
23 #pragma once
24 
25 #ifndef __MOTR_HA_ENTRYPOINT_H__
26 #define __MOTR_HA_ENTRYPOINT_H__
27 
42 #include "lib/types.h" /* uint32_t */
43 #include "lib/buf.h" /* m0_buf */
44 #include "lib/chan.h" /* m0_chan */
45 #include "lib/semaphore.h" /* m0_semaphore */
46 #include "lib/tlist.h" /* m0_tl */
47 #include "lib/mutex.h" /* m0_mutex */
48 
49 #include "sm/sm.h" /* m0_sm */
50 #include "fid/fid.h" /* m0_fid */
51 #include "xcode/xcode_attr.h" /* M0_XCA_RECORD */
52 #include "fop/fom.h" /* M0_FOM_PHASE_INIT */
53 #include "fop/fop.h" /* m0_fop */
54 #include "ha/entrypoint_fops.h" /* m0_ha_entrypoint_req */
55 #include "rpc/link.h" /* m0_rpc_link */
56 
57 
59 struct m0_rpc_session;
60 struct m0_rpc_item;
61 
66 };
67 
69  struct m0_reqh *hesc_reqh;
71  void (*hesc_request_received)
73  const struct m0_ha_entrypoint_req *req,
74  const struct m0_uint128 *req_id);
75 };
76 
84 };
85 
99 };
100 
105 };
106 
115  struct m0_fom ecl_fom;
121  struct m0_sm ecl_sm;
127 };
128 
129 M0_INTERNAL int
131  struct m0_ha_entrypoint_server_cfg *hes_cfg);
132 M0_INTERNAL void
134 /* asynchronous */
135 M0_INTERNAL void
137 /* synchronous */
138 M0_INTERNAL void
140 M0_INTERNAL void
142  const struct m0_uint128 *req_id,
143  const struct m0_ha_entrypoint_rep *rep);
144 M0_INTERNAL const struct m0_ha_entrypoint_req *
146  const struct m0_uint128 *req_id);
147 
148 
149 M0_INTERNAL int
151  const char *ep,
152  struct m0_ha_entrypoint_client_cfg *ecl_cfg);
153 M0_INTERNAL void
155 M0_INTERNAL void
157 M0_INTERNAL void
159 M0_INTERNAL void
161 M0_INTERNAL void
163 M0_INTERNAL struct m0_chan *
165 
176 M0_INTERNAL enum m0_ha_entrypoint_client_state
178 
179 M0_INTERNAL int m0_ha_entrypoint_mod_init(void);
180 M0_INTERNAL void m0_ha_entrypoint_mod_fini(void);
181 
185 
187 #endif /* __MOTR_HA_ENTRYPOINT_H__ */
188 
189 /*
190  * Local variables:
191  * c-indentation-style: "K&R"
192  * c-basic-offset: 8
193  * tab-width: 8
194  * fill-column: 80
195  * scroll-step: 1
196  * End:
197  */
198 /*
199  * vim: tabstop=8 shiftwidth=8 noexpandtab textwidth=80 nowrap
200  */
struct m0_mutex ecl_fom_running_lock
Definition: entrypoint.h:118
M0_INTERNAL const struct m0_ha_entrypoint_req * m0_ha_entrypoint_server_request_find(struct m0_ha_entrypoint_server *hes, const struct m0_uint128 *req_id)
Definition: entrypoint.c:322
struct m0_ha_entrypoint_req_fop ecl_req_fop_data
Definition: entrypoint.h:113
Definition: sm.h:350
static struct io_request req
Definition: file.c:100
M0_INTERNAL void m0_ha_entrypoint_server_start(struct m0_ha_entrypoint_server *hes)
Definition: entrypoint.c:241
struct m0_fid hecc_process_fid
Definition: entrypoint.h:104
M0_INTERNAL void m0_ha_entrypoint_mod_fini(void)
Definition: entrypoint.c:850
M0_INTERNAL void m0_ha_entrypoint_client_stop(struct m0_ha_entrypoint_client *ecl)
Definition: entrypoint.c:785
struct m0_ha_entrypoint_client_cfg ecl_cfg
Definition: entrypoint.h:108
M0_INTERNAL enum m0_ha_entrypoint_client_state m0_ha_entrypoint_client_state_get(struct m0_ha_entrypoint_client *ecl)
Definition: entrypoint.c:829
M0_INTERNAL void m0_ha_entrypoint_client_request(struct m0_ha_entrypoint_client *ecl)
Definition: entrypoint.c:708
M0_INTERNAL void m0_ha_entrypoint_server_reply(struct m0_ha_entrypoint_server *hes, const struct m0_uint128 *req_id, const struct m0_ha_entrypoint_rep *rep)
Definition: entrypoint.c:306
struct m0_fop_getxattr_rep * rep
Definition: dir.c:455
struct m0_reqh * hecc_reqh
Definition: entrypoint.h:102
Definition: sock.c:754
struct m0_fop ecl_req_fop
Definition: entrypoint.h:112
M0_INTERNAL int m0_ha_entrypoint_mod_init(void)
Definition: entrypoint.c:835
M0_INTERNAL int m0_ha_entrypoint_server_init(struct m0_ha_entrypoint_server *hes, struct m0_ha_entrypoint_server_cfg *hes_cfg)
Definition: entrypoint.c:220
struct m0_rpc_item * ecl_reply
Definition: entrypoint.h:123
struct m0_mutex hes_lock
Definition: entrypoint.h:83
M0_INTERNAL void m0_ha_entrypoint_server_fini(struct m0_ha_entrypoint_server *hes)
Definition: entrypoint.c:234
M0_INTERNAL int m0_ha_entrypoint_client_init(struct m0_ha_entrypoint_client *ecl, const char *ep, struct m0_ha_entrypoint_client_cfg *ecl_cfg)
Definition: entrypoint.c:434
struct m0_sm_group ecl_sm_group
Definition: entrypoint.h:122
Definition: tlist.h:251
struct m0_ha_entrypoint_req ecl_req
Definition: entrypoint.h:111
struct m0_tl hes_requests
Definition: entrypoint.h:80
struct m0_reqh * hesc_reqh
Definition: entrypoint.h:69
Definition: reqh.h:94
Definition: chan.h:229
struct m0_reqh_service * hes_he_service
Definition: entrypoint.h:79
struct m0_clink ecl_rlink_wait
Definition: entrypoint.h:110
void(* hesc_request_received)(struct m0_ha_entrypoint_server *hes, const struct m0_ha_entrypoint_req *req, const struct m0_uint128 *req_id)
Definition: entrypoint.h:72
struct m0_reqh_service_type m0_ha_entrypoint_service_type
Definition: entrypoint.c:135
struct m0_ha_entrypoint_server_cfg hes_cfg
Definition: entrypoint.h:78
Definition: fom.h:481
struct m0_fom ecl_fom
Definition: entrypoint.h:115
struct m0_clink ecl_clink
Definition: entrypoint.h:126
M0_INTERNAL void m0_ha_entrypoint_client_start_sync(struct m0_ha_entrypoint_client *ecl)
Definition: entrypoint.c:772
m0_ha_entrypoint_server_fom_state
Definition: entrypoint.h:62
m0_ha_entrypoint_client_state
Definition: entrypoint.h:86
struct m0_rpc_machine * hesc_rpc_machine
Definition: entrypoint.h:70
struct m0_rpc_link ecl_rlink
Definition: entrypoint.h:109
Definition: fid.h:38
M0_INTERNAL void m0_ha_entrypoint_client_fini(struct m0_ha_entrypoint_client *ecl)
Definition: entrypoint.c:464
Definition: sm.h:301
M0_INTERNAL void m0_ha_entrypoint_server_stop(struct m0_ha_entrypoint_server *hes)
Definition: entrypoint.c:258
M0_INTERNAL struct m0_chan * m0_ha_entrypoint_client_chan(struct m0_ha_entrypoint_client *ecl)
Definition: entrypoint.c:823
const struct m0_fom_type_ops m0_ha_entrypoint_fom_type_ops
Definition: entrypoint.c:959
struct m0_rpc_machine * hecc_rpc_machine
Definition: entrypoint.h:103
Definition: mutex.h:47
M0_INTERNAL void m0_ha_entrypoint_client_start(struct m0_ha_entrypoint_client *ecl)
Definition: entrypoint.c:727
struct m0_ha_entrypoint_rep ecl_rep
Definition: entrypoint.h:114
struct m0_sm_conf m0_ha_entrypoint_server_fom_states_conf
Definition: entrypoint.c:188
Definition: fop.h:79
struct m0_uint128 hes_next_id
Definition: entrypoint.h:81