Motr  M0
rm_ha.c
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 
24 #define M0_TRACE_SUBSYSTEM M0_TRACE_SUBSYS_RM
25 #include "lib/trace.h"
26 
27 #include "lib/finject.h" /* M0_FI_ENABLED */
28 #include "lib/errno.h"
29 #include "lib/memory.h" /* m0_free */
30 #include "lib/misc.h"
31 #include "lib/string.h" /* m0_strdup */
32 #include "sm/sm.h"
33 #include "conf/confc.h"
34 #include "conf/helpers.h" /* m0_confc2reqh */
35 #include "conf/diter.h"
36 #include "conf/obj_ops.h" /* m0_conf_obj_get_lock */
37 #include "reqh/reqh.h" /* m0_reqh */
38 #include "rm/rm_ha.h"
39 
47  [RM_HA_SBSCR_INIT] = {
49  .sd_name = "Initial",
50  .sd_allowed = M0_BITS(RM_HA_SBSCR_FS_OPEN)
51  },
53  .sd_name = "Open_configuration",
54  .sd_allowed = M0_BITS(RM_HA_SBSCR_FAILURE,
56  },
58  .sd_name = "Diter_search",
60  },
62  .sd_flags = M0_SDF_FAILURE | M0_SDF_FINAL,
63  .sd_name = "Failure",
64  .sd_allowed = 0
65  },
66  [RM_HA_SBSCR_FINAL] = {
67  .sd_flags = M0_SDF_TERMINAL,
68  .sd_name = "Final",
69  .sd_allowed = 0
70  }
71 };
72 
73 static const struct m0_sm_conf rm_ha_sbscr_sm_conf = {
74  .scf_name = "rm_ha_subscriber",
75  .scf_nr_states = ARRAY_SIZE(rm_ha_subscriber_states),
76  .scf_state = rm_ha_subscriber_states
77 };
78 
79 static void rm_ha_sbscr_state_set(struct m0_rm_ha_subscriber *sbscr, int state)
80 {
81  M0_LOG(M0_DEBUG, "sbscr: %p, state change:[%s -> %s]",
82  sbscr, m0_sm_state_name(&sbscr->rhs_sm, sbscr->rhs_sm.sm_state),
83  m0_sm_state_name(&sbscr->rhs_sm, state));
84  m0_sm_state_set(&sbscr->rhs_sm, state);
85 }
86 
87 static void rm_ha_sbscr_fail(struct m0_rm_ha_subscriber *sbscr, int rc)
88 {
89  M0_LOG(M0_DEBUG, "sbscr: %p, state %s failed with %d", sbscr,
90  m0_sm_state_name(&sbscr->rhs_sm, sbscr->rhs_sm.sm_state), rc);
92 }
93 
94 static void rm_ha_sbscr_ast_post(struct m0_rm_ha_subscriber *sbscr,
95  void (*cb)(struct m0_sm_group *,
96  struct m0_sm_ast *))
97 {
98  sbscr->rhs_ast.sa_cb = cb;
99  sbscr->rhs_ast.sa_datum = sbscr;
100  m0_sm_ast_post(sbscr->rhs_sm.sm_grp, &sbscr->rhs_ast);
101 }
102 
104  struct m0_rm_ha_subscriber *sbscr)
105 {
106  struct m0_conf_service *svc;
107  const char **ep;
108 
109  /* looking for rmservice having the given endpoint */
112  if (svc->cs_type == M0_CST_RMS) {
113  ep = svc->cs_endpoints;
114  while (*ep != NULL) {
115  if (m0_streq(*ep, sbscr->rhs_tracker->rht_ep)) {
116  return true;
117  }
118  ++ep;
119  }
120  }
121  return false;
122 }
123 
124 static bool rm_ha_svc_filter(const struct m0_conf_obj *obj)
125 {
127 }
128 
129 static void rm_ha_sbscr_diter_next(struct m0_rm_ha_subscriber *sbscr)
130 {
131  struct m0_conf_obj *next;
132  int rc;
133  bool found = false;
134 
135  while ((rc = m0_conf_diter_next(&sbscr->rhs_diter, rm_ha_svc_filter)) ==
136  M0_CONF_DIRNEXT) {
138  if (rm_ha_rms_is_located(next, sbscr) ||
139  M0_FI_ENABLED("subscribe")) {
141  &m0_conf_obj2reqh(next)->rh_conf_cache_exp,
142  &sbscr->rhs_tracker->rht_conf_exp);
147  m0_conf_cache_lock(next->co_cache);
148  m0_clink_add(&next->co_ha_chan,
149  &sbscr->rhs_tracker->rht_clink);
151  m0_conf_cache_unlock(next->co_cache);
152  found = true;
153  break;
154  }
155  }
156 
157  if (rc == M0_CONF_DIREND) {
158  M0_ASSERT(!found);
159  /*
160  * No M0_ERR() to not flood the log, because as for now
161  * RM services on clients (m0t1fs) are not added to conf.
162  */
163  rc = -ENOENT;
164  }
165 
166  if (rc < 0 || found) {
167  m0_clink_del_lock(&sbscr->rhs_clink);
168  m0_clink_fini(&sbscr->rhs_clink);
170  m0_conf_diter_fini(&sbscr->rhs_diter);
171  if (found)
173  else
174  rm_ha_sbscr_fail(sbscr, rc);
175  } else {
176  /*
177  * Directory entry is absent in conf cache. Once it is retrieved
178  * from confd, rm_ha_diter_cb() will be called.
179  */
181  }
182 }
183 
185  struct m0_sm_ast *ast)
186 {
187  struct m0_rm_ha_subscriber *sbscr = ast->sa_datum;
188 
189  rm_ha_sbscr_diter_next(sbscr);
190 }
191 
192 static bool rm_ha_diter_cb(struct m0_clink *clink)
193 {
194  struct m0_rm_ha_subscriber *sbscr;
195 
198  return true;
199 }
200 
202  struct m0_sm_ast *ast)
203 {
204  struct m0_rm_ha_subscriber *sbscr = ast->sa_datum;
205  struct m0_confc_ctx *cctx = &sbscr->rhs_cctx;
206  int rc;
207 
209  if (rc == 0) {
210  sbscr->rhs_dir_root = m0_confc_ctx_result(&sbscr->rhs_cctx);
211  rc = m0_conf_diter_init(&sbscr->rhs_diter, sbscr->rhs_confc,
212  sbscr->rhs_dir_root,
213  M0_CONF_ROOT_NODES_FID,
214  M0_CONF_NODE_PROCESSES_FID,
215  M0_CONF_PROCESS_SERVICES_FID);
216  if (rc == 0) {
220  &sbscr->rhs_clink);
221  rm_ha_sbscr_diter_next(sbscr);
222  } else {
224  }
225  }
227 
228  if (rc != 0)
229  rm_ha_sbscr_fail(sbscr, rc);
230 }
231 
232 static bool rm_ha_sbscr_fs_open_cb(struct m0_clink *link)
233 {
234  struct m0_rm_ha_subscriber *sbscr;
235  bool confc_is_ready;
236 
237  sbscr = container_of(link, struct m0_rm_ha_subscriber, rhs_clink);
238  confc_is_ready = m0_confc_ctx_is_completed(&sbscr->rhs_cctx);
239  M0_LOG(M0_DEBUG, "subscriber=%p confc_ready=%d",
240  sbscr, !!confc_is_ready);
241  if (confc_is_ready) {
242  m0_clink_del(&sbscr->rhs_clink);
243  m0_clink_fini(&sbscr->rhs_clink);
245  }
246  return true;
247 }
248 
249 static void rm_ha_conf_open(struct m0_sm_group *grp, struct m0_sm_ast *ast)
250 {
251  struct m0_rm_ha_subscriber *sbscr = ast->sa_datum;
252  struct m0_confc *confc = sbscr->rhs_confc;
253  struct m0_confc_ctx *cctx = &sbscr->rhs_cctx;
254  int rc;
255 
257  if (rc == 0) {
260  m0_clink_add_lock(&cctx->fc_mach.sm_chan, &sbscr->rhs_clink);
262  } else {
263  rm_ha_sbscr_fail(sbscr, M0_ERR(rc));
264  }
265 
266  M0_RC_INFO(rc, "subscriber=%p", sbscr);
267 }
268 
273  const char *rem_ep,
274  struct m0_conf_obj **obj)
275 {
276  struct m0_conf_obj *next;
277  struct m0_conf_obj *root;
278  struct m0_conf_diter it;
279  struct m0_conf_service *svc;
280  const char **ep;
281  bool found = false;
282  int rc;
283 
284  M0_PRE(confc != NULL);
285  M0_PRE(rem_ep != NULL);
286 
288  if (rc != 0)
289  return M0_RC(rc);
290 
291  M0_ASSERT(root != NULL && root->co_status == M0_CS_READY);
292 
294  M0_CONF_ROOT_NODES_FID,
295  M0_CONF_NODE_PROCESSES_FID,
296  M0_CONF_PROCESS_SERVICES_FID);
297  if (rc != 0)
298  return M0_ERR(rc);
299 
300  while (!found) {
302  if(rc != M0_CONF_DIRNEXT)
303  break;
306  if (svc->cs_type != M0_CST_RMS)
307  continue;
308  ep = svc->cs_endpoints;
309  while (*ep != NULL) {
310  if (m0_streq(*ep, rem_ep)) {
311  /*
312  * we need the object guaranteed
313  * to be pinned on return, because it is used
314  * outside of function.
315  */
317  *obj = next;
318  found = true;
319  break;
320  }
321  ++ep;
322  }
323  }
326 
327  return found ? 0 : M0_RC(rc) ?: M0_ERR(-ENOENT);
328 }
329 
330 static bool rm_ha_conf_expired_cb(struct m0_clink *cl)
331 {
332  struct m0_rm_ha_tracker *tracker = M0_AMB(tracker, cl, rht_conf_exp);
333 
334  M0_ENTRY("tracker %p", tracker);
335  m0_rm_ha_unsubscribe_lock(tracker);
336  M0_LEAVE();
337  return true;
338 }
339 
340 M0_INTERNAL int m0_rm_ha_subscriber_init(struct m0_rm_ha_subscriber *sbscr,
341  struct m0_sm_group *grp,
342  struct m0_confc *confc,
343  const char *rem_ep,
344  struct m0_rm_ha_tracker *tracker)
345 {
346  tracker->rht_ep = m0_strdup(rem_ep);
347  if (tracker->rht_ep == NULL)
348  return M0_ERR(-ENOMEM);
349  sbscr->rhs_tracker = tracker;
350  sbscr->rhs_confc = confc;
352  return M0_RC(0);
353 }
354 
355 M0_INTERNAL void m0_rm_ha_subscribe(struct m0_rm_ha_subscriber *sbscr)
356 {
358 }
359 
360 M0_INTERNAL int m0_rm_ha_subscribe_sync(struct m0_confc *confc,
361  const char *rem_ep,
362  struct m0_rm_ha_tracker *tracker)
363 {
364  struct m0_conf_obj *obj;
365  int rc;
366 
367  M0_ASSERT(confc != NULL);
368  M0_ASSERT(rem_ep != NULL);
369 
378  tracker->rht_ep = m0_strdup(rem_ep);
379  if (tracker->rht_ep == NULL)
380  return M0_ERR(-ENOMEM);
381  rc = rm_remote_ep_to_rms_obj(confc, rem_ep, &obj);
382  if (rc == 0) {
383  m0_clink_add_lock(&m0_conf_obj2reqh(obj)->rh_conf_cache_exp,
384  &tracker->rht_conf_exp);
389  m0_clink_add_lock(&obj->co_ha_chan, &tracker->rht_clink);
390  }
391  return M0_RC(rc);
392 }
393 
394 M0_INTERNAL void m0_rm_ha_subscriber_fini(struct m0_rm_ha_subscriber *sbscr)
395 {
396  m0_sm_fini(&sbscr->rhs_sm);
397 }
398 
399 M0_INTERNAL void m0_rm_ha_tracker_init(struct m0_rm_ha_tracker *tracker,
400  m0_chan_cb_t cb)
401 {
402  m0_clink_init(&tracker->rht_clink, cb);
404  tracker->rht_ep = NULL;
405  tracker->rht_state = M0_NC_UNKNOWN;
406 }
407 
408 M0_INTERNAL void m0_rm_ha_tracker_fini(struct m0_rm_ha_tracker *tracker)
409 {
410  m0_clink_fini(&tracker->rht_clink);
411  m0_clink_fini(&tracker->rht_conf_exp);
412  m0_free(tracker->rht_ep);
413 }
414 
415 M0_INTERNAL void m0_rm_ha_unsubscribe(struct m0_rm_ha_tracker *tracker)
416 {
417  struct m0_conf_obj *obj;
418 
419  if (m0_clink_is_armed(&tracker->rht_conf_exp))
421 
422  if (m0_clink_is_armed(&tracker->rht_clink)) {
423  obj = M0_AMB(obj, tracker->rht_clink.cl_chan, co_ha_chan);
429  if (obj->co_parent != NULL)
431  }
432  tracker->rht_clink.cl_chan = NULL;
433 }
434 
435 M0_INTERNAL void m0_rm_ha_unsubscribe_lock(struct m0_rm_ha_tracker *tracker)
436 {
437  struct m0_chan *ch = tracker->rht_clink.cl_chan;
438 
439  if (ch != NULL) {
440  m0_chan_lock(ch);
441  m0_rm_ha_unsubscribe(tracker);
443  }
444 }
445 
447 #undef M0_TRACE_SUBSYSTEM
448 
449 /*
450  * Local variables:
451  * c-indentation-style: "K&R"
452  * c-basic-offset: 8
453  * tab-width: 8
454  * fill-column: 80
455  * scroll-step: 1
456  * End:
457  */
458 /*
459  * vim: tabstop=8 shiftwidth=8 noexpandtab textwidth=80 nowrap
460  */
const struct m0_conf_obj_type * m0_conf_obj_type(const struct m0_conf_obj *obj)
Definition: obj.c:363
static int rm_remote_ep_to_rms_obj(struct m0_confc *confc, const char *rem_ep, struct m0_conf_obj **obj)
Definition: rm_ha.c:272
struct m0_conf_obj * cc_root
Definition: confc.h:404
#define M0_PRE(cond)
M0_INTERNAL void m0_sm_fail(struct m0_sm *mach, int fail_state, int32_t rc)
Definition: sm.c:468
#define m0_strdup(s)
Definition: string.h:43
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
#define NULL
Definition: misc.h:38
M0_INTERNAL void m0_clink_init(struct m0_clink *link, m0_chan_cb_t cb)
Definition: chan.c:201
M0_INTERNAL void m0_clink_del(struct m0_clink *link)
Definition: chan.c:267
M0_INTERNAL void m0_clink_del_lock(struct m0_clink *link)
Definition: chan.c:293
void(* sa_cb)(struct m0_sm_group *grp, struct m0_sm_ast *)
Definition: sm.h:506
M0_INTERNAL struct m0_conf_obj * m0_confc_ctx_result(struct m0_confc_ctx *ctx)
Definition: confc.c:771
Definition: sm.h:350
static const struct m0_sm_conf rm_ha_sbscr_sm_conf
Definition: rm_ha.c:73
static struct m0_sm_group * grp
Definition: bytecount.c:38
#define M0_LOG(level,...)
Definition: trace.h:167
M0_LEAVE()
const struct m0_conf_obj_type M0_CONF_SERVICE_TYPE
Definition: service.c:156
M0_INTERNAL void m0_sm_ast_post(struct m0_sm_group *grp, struct m0_sm_ast *ast)
Definition: sm.c:135
static void rm_ha_sbscr_fs_opened(struct m0_sm_group *grp, struct m0_sm_ast *ast)
Definition: rm_ha.c:201
struct m0_sm rhs_sm
Definition: rm_ha.h:132
M0_INTERNAL int m0_conf_diter_next_sync(struct m0_conf_diter *it, bool(*filter)(const struct m0_conf_obj *obj))
Definition: diter.c:555
M0_INTERNAL void m0_conf_obj_put(struct m0_conf_obj *obj)
Definition: obj_ops.c:205
static struct m0_sm_state_descr rm_ha_subscriber_states[]
Definition: rm_ha.c:46
static struct m0_rpc_client_ctx cctx
Definition: rconfc.c:69
static struct m0_be_emap_cursor it
Definition: extmap.c:46
M0_INTERNAL const char * m0_sm_state_name(const struct m0_sm *mach, int state)
Definition: sm.c:781
M0_INTERNAL int32_t m0_confc_ctx_error_lock(const struct m0_confc_ctx *ctx)
Definition: confc.c:765
M0_INTERNAL bool m0_clink_is_armed(const struct m0_clink *link)
Definition: chan.c:303
#define M0_BITS(...)
Definition: misc.h:236
Definition: sm.h:504
M0_INTERNAL void m0_chan_lock(struct m0_chan *ch)
Definition: chan.c:68
#define container_of(ptr, type, member)
Definition: misc.h:33
static bool rm_ha_sbscr_fs_open_cb(struct m0_clink *link)
Definition: rm_ha.c:232
static struct foo * obj
Definition: tlist.c:302
#define m0_confc_open(ctx, origin,...)
Definition: confc.h:678
return M0_RC(rc)
Definition: sock.c:754
struct m0_confc * rhs_confc
Definition: rm_ha.h:133
#define M0_ENTRY(...)
Definition: trace.h:170
static struct m0_sm_ast ast[NR]
Definition: locality.c:44
M0_INTERNAL void m0_conf_obj_get(struct m0_conf_obj *obj)
Definition: obj_ops.c:186
#define M0_RC_INFO(rc, fmt,...)
Definition: trace.h:209
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
struct m0_conf_root * root
Definition: note.c:50
return M0_ERR(-EOPNOTSUPP)
void * sa_datum
Definition: sm.h:508
#define M0_AMB(obj, ptr, field)
Definition: misc.h:320
M0_INTERNAL void m0_confc_ctx_fini(struct m0_confc_ctx *ctx)
Definition: confc.c:716
static bool rm_ha_svc_filter(const struct m0_conf_obj *obj)
Definition: rm_ha.c:124
#define M0_ASSERT(cond)
const char * scf_name
Definition: sm.h:352
static struct m0_confc * confc
Definition: file.c:94
void m0_sm_state_set(struct m0_sm *mach, int state)
Definition: sm.c:478
static void rm_ha_sbscr_diter_next_ast(struct m0_sm_group *grp, struct m0_sm_ast *ast)
Definition: rm_ha.c:184
M0_INTERNAL bool m0_confc_ctx_is_completed(const struct m0_confc_ctx *ctx)
Definition: confc.c:742
char * rht_ep
Definition: rm_ha.h:118
#define m0_streq(a, b)
Definition: string.h:34
M0_INTERNAL void m0_clink_cleanup_locked(struct m0_clink *link)
Definition: chan.c:319
static int next[]
Definition: cp.c:248
M0_INTERNAL int m0_confc_ctx_init(struct m0_confc_ctx *ctx, struct m0_confc *confc)
Definition: confc.c:643
M0_INTERNAL void m0_conf_diter_wait_arm(struct m0_conf_diter *it, struct m0_clink *clink)
Definition: diter.c:337
M0_INTERNAL struct m0_reqh * m0_conf_obj2reqh(const struct m0_conf_obj *obj)
Definition: helpers.c:351
M0_INTERNAL void m0_rm_ha_unsubscribe(struct m0_rm_ha_tracker *tracker)
Definition: rm_ha.c:415
struct m0_sm_group * sm_grp
Definition: sm.h:321
struct m0_chan co_ha_chan
Definition: obj.h:248
M0_INTERNAL int m0_conf_diter_next(struct m0_conf_diter *it, bool(*filter)(const struct m0_conf_obj *obj))
Definition: diter.c:532
Definition: chan.h:229
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
#define M0_CONF_CAST(ptr, type)
Definition: obj.h:780
static struct m0_clink clink[RDWR_REQUEST_MAX]
#define m0_confc_open_sync(result, origin,...)
Definition: confc.h:707
M0_INTERNAL void m0_chan_unlock(struct m0_chan *ch)
Definition: chan.c:73
bool(* m0_chan_cb_t)(struct m0_clink *link)
Definition: chan.h:176
M0_INTERNAL void m0_conf_obj_get_lock(struct m0_conf_obj *obj)
Definition: obj_ops.c:198
enum m0_ha_obj_state rht_state
Definition: rm_ha.h:122
static bool rm_ha_conf_expired_cb(struct m0_clink *cl)
Definition: rm_ha.c:330
void m0_clink_add_lock(struct m0_chan *chan, struct m0_clink *link)
Definition: chan.c:255
uint32_t sd_flags
Definition: sm.h:378
M0_INTERNAL struct m0_conf_obj * m0_conf_diter_result(const struct m0_conf_diter *it)
Definition: diter.c:576
#define m0_conf_diter_init(iter, confc, origin,...)
Definition: diter.h:235
struct m0_sm_ast rhs_ast
Definition: rm_ha.h:139
char * ep
Definition: sw.h:132
#define M0_FI_ENABLED(tag)
Definition: finject.h:231
M0_INTERNAL void m0_sm_init(struct m0_sm *mach, const struct m0_sm_conf *conf, uint32_t state, struct m0_sm_group *grp)
Definition: sm.c:313
M0_INTERNAL void m0_clink_add(struct m0_chan *chan, struct m0_clink *link)
Definition: chan.c:228
M0_INTERNAL void m0_conf_diter_fini(struct m0_conf_diter *it)
Definition: diter.c:313
static bool rm_ha_rms_is_located(struct m0_conf_obj *next, struct m0_rm_ha_subscriber *sbscr)
Definition: rm_ha.c:103
M0_INTERNAL void m0_rm_ha_subscriber_fini(struct m0_rm_ha_subscriber *sbscr)
Definition: rm_ha.c:394
static struct m0_net_test_service svc
Definition: service.c:34
static void rm_ha_sbscr_ast_post(struct m0_rm_ha_subscriber *sbscr, void(*cb)(struct m0_sm_group *, struct m0_sm_ast *))
Definition: rm_ha.c:94
M0_INTERNAL void m0_clink_fini(struct m0_clink *link)
Definition: chan.c:208
struct m0_clink rht_conf_exp
Definition: rm_ha.h:113
static void rm_ha_sbscr_fail(struct m0_rm_ha_subscriber *sbscr, int rc)
Definition: rm_ha.c:87
M0_INTERNAL void m0_confc_close(struct m0_conf_obj *obj)
Definition: confc.c:921
M0_INTERNAL void m0_rm_ha_tracker_init(struct m0_rm_ha_tracker *tracker, m0_chan_cb_t cb)
Definition: rm_ha.c:399
static uint64_t found
Definition: base.c:376
#define M0_FID0
Definition: fid.h:93
static void rm_ha_sbscr_diter_next(struct m0_rm_ha_subscriber *sbscr)
Definition: rm_ha.c:129
M0_INTERNAL void m0_conf_cache_lock(struct m0_conf_cache *cache)
Definition: cache.c:50
void m0_free(void *data)
Definition: memory.c:146
uint32_t sm_state
Definition: sm.h:307
static void rm_ha_conf_open(struct m0_sm_group *grp, struct m0_sm_ast *ast)
Definition: rm_ha.c:249
struct m0_clink rht_clink
Definition: rm_ha.h:104
int32_t rc
Definition: trigger_fop.h:47
#define ARRAY_SIZE(a)
Definition: misc.h:45
M0_INTERNAL void m0_conf_cache_unlock(struct m0_conf_cache *cache)
Definition: cache.c:55
static bool rm_ha_diter_cb(struct m0_clink *clink)
Definition: rm_ha.c:192
static void rm_ha_sbscr_state_set(struct m0_rm_ha_subscriber *sbscr, int state)
Definition: rm_ha.c:79
struct m0_conf_diter rhs_diter
Definition: rm_ha.h:137
M0_INTERNAL void m0_sm_fini(struct m0_sm *mach)
Definition: sm.c:331