Motr  M0
ha.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_MOTR_HA_H__
26 #define __MOTR_MOTR_HA_H__
27 
34 #include "lib/tlist.h" /* m0_tl */
35 #include "lib/types.h" /* uint64_t */
36 #include "lib/mutex.h" /* m0_mutex */
37 #include "fid/fid.h" /* m0_fid */
38 #include "module/module.h" /* m0_module */
39 #include "ha/ha.h" /* m0_ha */
40 #include "ha/dispatcher.h" /* m0_ha_dispatcher */
41 
42 struct m0_rpc_machine;
43 struct m0_reqh;
44 struct m0_ha_link;
45 
48  const char *mhc_addr;
50  struct m0_reqh *mhc_reqh;
52 };
53 
54 struct m0_motr_ha {
57  struct m0_ha mh_ha;
60 };
61 
62 M0_INTERNAL void m0_motr_ha_cfg_make(struct m0_motr_ha_cfg *mha_cfg,
63  struct m0_reqh *reqh,
64  struct m0_rpc_machine *rmach,
65  const char *addr);
66 
67 M0_INTERNAL int m0_motr_ha_init(struct m0_motr_ha *mha,
68  struct m0_motr_ha_cfg *mha_cfg);
69 M0_INTERNAL int m0_motr_ha_start(struct m0_motr_ha *mha);
70 M0_INTERNAL void m0_motr_ha_stop(struct m0_motr_ha *mha);
71 M0_INTERNAL void m0_motr_ha_fini(struct m0_motr_ha *mha);
72 
73 M0_INTERNAL void m0_motr_ha_connect(struct m0_motr_ha *mha);
74 M0_INTERNAL void m0_motr_ha_disconnect(struct m0_motr_ha *mha);
75 
76 extern const struct m0_ha_ops m0_motr_ha_ops;
77 
79 #endif /* __MOTR_MOTR_HA_H__ */
80 
81 /*
82  * Local variables:
83  * c-indentation-style: "K&R"
84  * c-basic-offset: 8
85  * tab-width: 8
86  * fill-column: 80
87  * scroll-step: 1
88  * End:
89  */
90 /*
91  * vim: tabstop=8 shiftwidth=8 noexpandtab textwidth=80 nowrap
92  */
M0_INTERNAL int m0_motr_ha_start(struct m0_motr_ha *mha)
Definition: ha.c:549
struct m0_motr_ha_cfg mh_cfg
Definition: ha.h:55
struct m0_fid mhc_process_fid
Definition: ha.h:51
struct m0_ha mh_ha
Definition: ha.h:57
M0_INTERNAL int m0_motr_ha_init(struct m0_motr_ha *mha, struct m0_motr_ha_cfg *mha_cfg)
Definition: ha.c:509
M0_INTERNAL void m0_motr_ha_disconnect(struct m0_motr_ha *mha)
Definition: ha.c:578
const struct m0_ha_ops m0_motr_ha_ops
Definition: ha.c:358
struct m0_ha_link * mh_link
Definition: ha.h:58
const char * mhc_addr
Definition: ha.h:48
Definition: xcode.h:73
Definition: reqh.h:94
M0_INTERNAL void m0_motr_ha_connect(struct m0_motr_ha *mha)
Definition: ha.c:567
struct m0_module mh_module
Definition: ha.h:56
Definition: ha.h:289
Definition: ha.h:54
struct m0_reqh reqh
Definition: rm_foms.c:48
struct m0_rpc_machine * mhc_rpc_machine
Definition: ha.h:49
Definition: fid.h:38
struct m0_ha_dispatcher_cfg mhc_dispatcher_cfg
Definition: ha.h:47
M0_INTERNAL void m0_motr_ha_cfg_make(struct m0_motr_ha_cfg *mha_cfg, struct m0_reqh *reqh, struct m0_rpc_machine *rmach, const char *addr)
Definition: ha.c:61
Definition: ha.h:239
M0_INTERNAL void m0_motr_ha_stop(struct m0_motr_ha *mha)
Definition: ha.c:560
struct m0_reqh * mhc_reqh
Definition: ha.h:50
struct m0_ha_dispatcher mh_dispatcher
Definition: ha.h:59
M0_INTERNAL void m0_motr_ha_fini(struct m0_motr_ha *mha)
Definition: ha.c:537