Motr  M0
rm_ha.h
Go to the documentation of this file.
1 /* -*- C -*- */
2 /*
3  * Copyright (c) 2015-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_RM_RM_HA_H__
26 #define __MOTR_RM_RM_HA_H__
27 
28 #include "lib/chan.h" /* m0_clink */
29 #include "sm/sm.h"
30 #include "conf/confc.h" /* m0_confc_ctx, m0_confc */
31 #include "conf/diter.h" /* m0_conf_diter */
32 
93 };
94 
118  char *rht_ep;
123 };
124 
132  struct m0_sm rhs_sm;
133  struct m0_confc *rhs_confc;
140 };
141 
153 };
154 
160 M0_INTERNAL void m0_rm_ha_tracker_init(struct m0_rm_ha_tracker *tracker,
161  m0_chan_cb_t cb);
166 M0_INTERNAL void m0_rm_ha_tracker_fini(struct m0_rm_ha_tracker *tracker);
167 
178 M0_INTERNAL int m0_rm_ha_subscriber_init(struct m0_rm_ha_subscriber *sbscr,
179  struct m0_sm_group *grp,
180  struct m0_confc *confc,
181  const char *rem_ep,
182  struct m0_rm_ha_tracker *tracker);
183 
193 M0_INTERNAL void m0_rm_ha_subscribe(struct m0_rm_ha_subscriber *sbscr);
194 
198 M0_INTERNAL void m0_rm_ha_subscriber_fini(struct m0_rm_ha_subscriber *sbscr);
199 
204 M0_INTERNAL int m0_rm_ha_subscribe_sync(struct m0_confc *confc,
205  const char *rem_ep,
206  struct m0_rm_ha_tracker *tracker);
207 
214 M0_INTERNAL void m0_rm_ha_unsubscribe(struct m0_rm_ha_tracker *tracker);
215 
219 M0_INTERNAL void m0_rm_ha_unsubscribe_lock(struct m0_rm_ha_tracker *tracker);
220 
222 #endif /* __MOTR_RM_RM_HA_H__ */
223 
224 /*
225  * Local variables:
226  * c-indentation-style: "K&R"
227  * c-basic-offset: 8
228  * tab-width: 8
229  * fill-column: 80
230  * scroll-step: 1
231  * End:
232  */
233 /*
234  * vim: tabstop=8 shiftwidth=8 noexpandtab textwidth=80 nowrap
235  */
M0_INTERNAL void m0_rm_ha_unsubscribe_lock(struct m0_rm_ha_tracker *tracker)
Definition: rm_ha.c:435
struct m0_rm_ha_tracker * rhs_tracker
Definition: rm_ha.h:134
M0_INTERNAL int m0_rm_ha_subscriber_init(struct m0_rm_ha_subscriber *sbscr, struct m0_sm_group *grp, struct m0_confc *confc, const char *rem_ep, struct m0_rm_ha_tracker *tracker)
Definition: rm_ha.c:340
static struct m0_sm_group * grp
Definition: bytecount.c:38
struct m0_sm rhs_sm
Definition: rm_ha.h:132
Definition: sm.h:504
m0_rm_ha_subscriber_state
Definition: rm_ha.h:87
enum m0_ha_obj_state rhe_state
Definition: rm_ha.h:150
struct m0_confc * rhs_confc
Definition: rm_ha.h:133
M0_INTERNAL void m0_rm_ha_subscribe(struct m0_rm_ha_subscriber *sbscr)
Definition: rm_ha.c:355
struct m0_conf_obj * rhs_dir_root
Definition: rm_ha.h:136
struct m0_confc_ctx rhs_cctx
Definition: rm_ha.h:135
M0_INTERNAL void m0_rm_ha_tracker_fini(struct m0_rm_ha_tracker *tracker)
Definition: rm_ha.c:408
static struct m0_confc * confc
Definition: file.c:94
char * rht_ep
Definition: rm_ha.h:118
m0_ha_obj_state
Definition: note.h:119
M0_INTERNAL void m0_rm_ha_unsubscribe(struct m0_rm_ha_tracker *tracker)
Definition: rm_ha.c:415
M0_INTERNAL int m0_rm_ha_subscribe_sync(struct m0_confc *confc, const char *rem_ep, struct m0_rm_ha_tracker *tracker)
Definition: rm_ha.c:360
struct m0_clink rhs_clink
Definition: rm_ha.h:138
bool(* m0_chan_cb_t)(struct m0_clink *link)
Definition: chan.h:176
enum m0_ha_obj_state rht_state
Definition: rm_ha.h:122
struct m0_rm_ha_tracker * rhe_tracker
Definition: rm_ha.h:152
struct m0_sm_ast rhs_ast
Definition: rm_ha.h:139
M0_INTERNAL void m0_rm_ha_subscriber_fini(struct m0_rm_ha_subscriber *sbscr)
Definition: rm_ha.c:394
Definition: sm.h:301
struct m0_clink rht_conf_exp
Definition: rm_ha.h:113
M0_INTERNAL void m0_rm_ha_tracker_init(struct m0_rm_ha_tracker *tracker, m0_chan_cb_t cb)
Definition: rm_ha.c:399
struct m0_clink rht_clink
Definition: rm_ha.h:104
struct m0_queue_link rhe_link
Definition: rm_ha.h:148
struct m0_conf_diter rhs_diter
Definition: rm_ha.h:137