Motr  M0
note.c
Go to the documentation of this file.
1 /* -*- C -*- */
2 /*
3  * Copyright (c) 2013-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 
31 #define M0_TRACE_SUBSYSTEM M0_TRACE_SUBSYS_HA
32 #include "lib/trace.h"
33 
34 #include "conf/confc.h"
35 #include "fop/fom_generic.h"
36 #include "fop/fop.h"
37 #include "lib/chan.h"
38 #include "lib/memory.h"
39 #include "lib/trace.h"
40 #include "lib/finject.h"
41 #include "rpc/rpc_internal.h" /* m0_rpc__post_locked */
42 #include "rpc/rpclib.h"
43 #include "rpc/session.h"
44 #include "fid/fid.h" /* FID_F */
45 #include "module/instance.h" /* m0_get */
46 
47 #include "ha/note.h"
48 #include "ha/note_fops.h"
49 #include "ha/note_xc.h"
50 #include "ha/msg.h" /* m0_ha_msg */
51 #include "ha/link.h" /* m0_ha_link_send */
52 #include "ha/ha.h" /* m0_ha_send */
53 #include "motr/ha.h" /* m0_motr_ha */
54 
58 static bool note_invariant(const struct m0_ha_nvec *note, bool known)
59 {
60 #define N(i) (note->nv_note[i])
61  return m0_forall(i, note->nv_nr,
62  _0C((N(i).no_state != M0_NC_UNKNOWN) == known) &&
63  _0C(!m0_fid_is_set(&N(i).no_id) ||
65  _0C(ergo(M0_IN(N(i).no_state,
71 #undef N
72 }
73 
74 M0_INTERNAL int m0_ha_state_get(struct m0_ha_nvec *note, struct m0_chan *chan)
75 {
76 
77  uint64_t id_of_get;
78 
79  M0_ENTRY("chan=%p note->nv_nr=%"PRIi32" note->nv_note[0].no_id="FID_F
80  " note->nv_note[0].no_state=%u", chan, note->nv_nr,
81  FID_P(note->nv_nr > 0 ? &note->nv_note[0].no_id : &M0_FID0),
82  note->nv_nr > 0 ? note->nv_note[0].no_state : 0);
83  M0_PRE(note_invariant(note, false));
84  M0_NVEC_PRINT(note, " > ", M0_DEBUG);
85 
86  if (m0_get()->i_note_handler == NULL)
87  return M0_ERR(-EINVAL);
88 
89  id_of_get = m0_ha_note_handler_add(m0_get()->i_note_handler,
90  note, chan);
91  m0_ha_msg_nvec_send(note, id_of_get, false, M0_HA_NVEC_GET, NULL);
92  return M0_RC(0);
93 }
94 
95 M0_INTERNAL void m0_ha_state_set(const struct m0_ha_nvec *note)
96 {
97  M0_ENTRY("note->nv_nr=%"PRIi32" note->nv_note[0].no_id="FID_F
98  " note->nv_note[0].no_state=%u", note->nv_nr,
99  FID_P(note->nv_nr > 0 ? &note->nv_note[0].no_id : &M0_FID0),
100  note->nv_nr > 0 ? note->nv_note[0].no_state : 0);
101  M0_PRE(note_invariant(note, true));
102  m0_ha_msg_nvec_send(note, 0, false, M0_HA_NVEC_SET, NULL);
103 }
104 
105 M0_INTERNAL void m0_ha_local_state_set(const struct m0_ha_nvec *nvec)
106 {
107  if (!M0_FI_ENABLED("no_ha"))
108  m0_ha_state_set(nvec);
109 }
110 
112 {
113  struct m0_ha_state_single *hss;
114  struct m0_ha_nvec *nvec = fop->f_data.fd_data;
115 
116  M0_PRE(nvec != NULL);
117  hss = container_of(nvec, struct m0_ha_state_single, hss_nvec);
118  m0_free(hss);
119  fop->f_data.fd_data = NULL;
120 }
121 
123 {
124  struct m0_fop *fop = container_of(item, struct m0_fop, f_item);
125 
127  m0_fop_put(fop);
128 }
129 
132 };
133 
134 M0_INTERNAL void m0_ha_state_single_post(struct m0_ha_nvec *nvec)
135 {
136  M0_ENTRY();
137  M0_PRE(nvec != NULL);
138  M0_PRE(note_invariant(nvec, true));
139 
140  m0_ha_msg_nvec_send(nvec, 0, false, M0_HA_NVEC_SET, NULL);
141 }
142 
149 static void ha_state_accept(struct m0_confc *confc,
150  const struct m0_ha_nvec *note,
151  uint64_t ignore_same_state)
152 {
153  struct m0_conf_obj *obj;
154  struct m0_conf_cache *cache;
155  enum m0_ha_obj_state prev_ha_state;
156  int i;
157 
158  M0_ENTRY("confc=%p note->nv_nr=%"PRIi32, confc, note->nv_nr);
159  M0_PRE(note_invariant(note, true));
160 
161  /*
162  * @todo check if this can be avoided or if it is masking the
163  * real problem here.
164  */
166  return;
167 
168  cache = &confc->cc_cache;
170  for (i = 0; i < note->nv_nr; ++i) {
172  M0_LOG(M0_DEBUG, "nv_note[%d]=(no_id="FID_F" no_state=%"PRIu32
173  ") obj=%p obj->co_status=%d", i,
174  FID_P(&note->nv_note[i].no_id),
175  note->nv_note[i].no_state,
176  obj, obj == NULL ? -1 : obj->co_status);
177  if (obj != NULL && obj->co_status == M0_CS_READY) {
178  prev_ha_state = obj->co_ha_state;
179  obj->co_ha_state = note->nv_note[i].no_state;
180  if (!ignore_same_state ||
181  prev_ha_state != obj->co_ha_state)
182  m0_chan_broadcast(&obj->co_ha_chan);
183  }
184  }
186  M0_LEAVE();
187 }
188 
189 M0_INTERNAL void m0_ha_state_accept(const struct m0_ha_nvec *note,
190  bool ignore_same_state)
191 {
193  ignore_same_state);
194 }
195 
196 M0_INTERNAL void m0_ha_msg_accept(const struct m0_ha_msg *msg,
197  struct m0_ha_link *hl)
198 {
199  const struct m0_ha_msg_nvec *nvec_req;
200  struct m0_confc *confc;
201  struct m0_conf_cache *cache;
202  struct m0_ha_nvec nvec;
203  struct m0_conf_obj *obj;
204  struct m0_fid obj_fid;
205  int i;
206 
207  if (msg->hm_data.hed_type != M0_HA_MSG_NVEC)
208  return;
209  M0_PRE(M0_IN(msg->hm_data.u.hed_nvec.hmnv_ignore_same_state,
210  (false, true)));
211 
212  nvec = (struct m0_ha_nvec){
213  .nv_nr = msg->hm_data.u.hed_nvec.hmnv_nr,
214  };
215  M0_LOG(M0_DEBUG, "nvec nv_nr=%"PRIu32" hmvn_type=%s", nvec.nv_nr,
216  msg->hm_data.u.hed_nvec.hmnv_type == M0_HA_NVEC_SET ? "SET" :
217  msg->hm_data.u.hed_nvec.hmnv_type == M0_HA_NVEC_GET ? "GET" :
218  "UNKNOWN!");
219  M0_ALLOC_ARR(nvec.nv_note, nvec.nv_nr);
220  M0_ASSERT(nvec.nv_note != NULL);
221  for (i = 0; i < nvec.nv_nr; ++i) {
222  nvec.nv_note[i] = msg->hm_data.u.hed_nvec.hmnv_arr.hmna_arr[i];
223  M0_LOG(M0_DEBUG, "nv_note[%d]=(no_id="FID_F" "
224  "no_state=%"PRIu32")", i, FID_P(&nvec.nv_note[i].no_id),
225  nvec.nv_note[i].no_state);
226  }
227  if (msg->hm_data.u.hed_nvec.hmnv_type == M0_HA_NVEC_SET) {
228  m0_ha_state_accept(&nvec,
229  msg->hm_data.u.hed_nvec.hmnv_ignore_same_state);
230  if (msg->hm_data.u.hed_nvec.hmnv_id_of_get != 0) {
232  m0_get()->i_note_handler, &nvec,
233  msg->hm_data.u.hed_nvec.hmnv_id_of_get);
234  }
235  } else if (M0_FI_ENABLED("invalid_confc")){
236  nvec_req = &msg->hm_data.u.hed_nvec;
237  for (i = 0; i < nvec_req->hmnv_nr; ++i) {
238  obj_fid = nvec_req->hmnv_arr.hmna_arr[i].no_id;
239  nvec.nv_note[i] = (struct m0_ha_note){
240  .no_id = obj_fid,
241  .no_state = M0_NC_ONLINE,
242  };
243  }
244  m0_ha_msg_nvec_send(&nvec,
245  msg->hm_data.u.hed_nvec.hmnv_id_of_get,
246  false,
247  M0_HA_NVEC_SET, hl);
248  } else {
250  cache = &confc->cc_cache;
251  nvec_req = &msg->hm_data.u.hed_nvec;
253  for (i = 0; i < nvec_req->hmnv_nr; ++i) {
254  obj_fid = nvec_req->hmnv_arr.hmna_arr[i].no_id;
255  obj = m0_conf_cache_lookup(cache, &obj_fid);
256  if (obj == NULL) {
257  M0_LOG(M0_DEBUG, "obj == NULL");
258  nvec.nv_note[i] = (struct m0_ha_note){
259  .no_id = obj_fid,
260  .no_state = M0_NC_ONLINE,
261  };
262  } else {
263  nvec.nv_note[i] = (struct m0_ha_note){
264  .no_id = obj->co_id,
265  .no_state = obj->co_ha_state,
266  };
267  }
268  }
270  m0_ha_msg_nvec_send(&nvec,
271  msg->hm_data.u.hed_nvec.hmnv_id_of_get,
272  false,
273  M0_HA_NVEC_SET, hl);
274  }
275  m0_free(nvec.nv_note);
276 }
277 
278 M0_INTERNAL uint64_t
279 m0_ha_msg_nvec_send(const struct m0_ha_nvec *nvec,
280  uint64_t id_of_get,
281  bool ignore_same_state,
282  int direction,
283  struct m0_ha_link *hl)
284 {
285  struct m0_ha_msg *msg;
286  uint64_t tag;
287 
288  if (hl == NULL)
289  hl = m0_get()->i_ha_link;
290  if (hl == NULL) {
291  M0_LOG(M0_WARN, "hl == NULL");
292  return 0;
293  }
294  M0_ALLOC_PTR(msg);
295  M0_ASSERT(msg != NULL);
296  *msg = (struct m0_ha_msg){
297  .hm_data = {
299  .u.hed_nvec = {
300  .hmnv_type = direction,
301  .hmnv_id_of_get = id_of_get,
302  .hmnv_ignore_same_state = ignore_same_state,
303  .hmnv_nr = nvec->nv_nr,
304  },
305  },
306  };
307  M0_ASSERT(nvec->nv_nr > 0 &&
308  nvec->nv_nr <=
309  ARRAY_SIZE(msg->hm_data.u.hed_nvec.hmnv_arr.hmna_arr));
310  memcpy(msg->hm_data.u.hed_nvec.hmnv_arr.hmna_arr, nvec->nv_note,
311  nvec->nv_nr * sizeof(nvec->nv_note[0]));
312  m0_ha_link_send(hl, msg, &tag);
313  m0_free(msg);
314 
315  return tag;
316 }
317 
322  uint64_t hsg_magic;
323  uint64_t hsg_id;
324 };
325 
326 M0_TL_DESCR_DEFINE(ha_gets, "m0_ha_note_handler::hmh_gets", static,
327  struct ha_note_handler_request, hsg_tlink, hsg_magic,
328  20, 21); /* XXX */
329 M0_TL_DEFINE(ha_gets, static, struct ha_note_handler_request);
330 
331 static void ha_note_handler_msg(struct m0_ha_handler *hh,
332  struct m0_ha *ha,
333  struct m0_ha_link *hl,
334  struct m0_ha_msg *msg,
335  uint64_t tag,
336  void *data)
337 {
338  struct m0_ha_note_handler *hnh;
339 
340  hnh = container_of(hh, struct m0_ha_note_handler, hnh_handler);
341  M0_ASSERT(hnh == data);
342  m0_ha_msg_accept(msg, hl);
343 }
344 
345 M0_INTERNAL int m0_ha_note_handler_init(struct m0_ha_note_handler *hnh,
346  struct m0_ha_dispatcher *hd)
347 {
348  M0_PRE(M0_IS0(hnh));
349 
350  m0_mutex_init(&hnh->hnh_lock);
351  ha_gets_tlist_init(&hnh->hnh_gets);
352  hnh->hnh_dispatcher = hd;
353  hnh->hnh_handler = (struct m0_ha_handler){
354  .hh_data = hnh,
355  .hh_msg_received_cb = &ha_note_handler_msg,
356  };
357  hnh->hnh_id_of_get = 100;
359  M0_ASSERT(m0_get()->i_note_handler == NULL);
360  m0_get()->i_note_handler = hnh;
361  return 0;
362 }
363 
364 M0_INTERNAL void m0_ha_note_handler_fini(struct m0_ha_note_handler *hnh)
365 {
366  struct ha_note_handler_request *hsg;
367 
368  M0_ASSERT(m0_get()->i_note_handler == hnh);
369  m0_mutex_lock(&hnh->hnh_lock);
370  m0_tl_for (ha_gets, &hnh->hnh_gets, hsg) {
371  M0_LOG(M0_WARN, "handler %p del id=%"PRIu64, hsg, hsg->hsg_id);
372  ha_gets_tlink_del_fini(hsg);
373  } m0_tl_endfor;
374  m0_mutex_unlock(&hnh->hnh_lock);
375 
378  ha_gets_tlist_fini(&hnh->hnh_gets);
379  m0_mutex_fini(&hnh->hnh_lock);
380 }
381 
382 M0_INTERNAL uint64_t m0_ha_note_handler_add(struct m0_ha_note_handler *hnh,
383  struct m0_ha_nvec *nvec_req,
384  struct m0_chan *chan)
385 {
386  struct ha_note_handler_request *hsg;
387 
388  M0_ALLOC_PTR(hsg);
389  m0_mutex_lock(&hnh->hnh_lock);
390  *hsg = (struct ha_note_handler_request){
391  .hsg_wait_chan = chan,
392  .hsg_nvec = nvec_req,
393  .hsg_id = hnh->hnh_id_of_get++,
394  };
395  ha_gets_tlink_init_at_tail(hsg, &hnh->hnh_gets);
396  m0_mutex_unlock(&hnh->hnh_lock);
397  M0_LOG(M0_DEBUG, "add id=%"PRIu64, hsg->hsg_id);
398  return hsg->hsg_id;
399 }
400 
401 M0_INTERNAL void m0_ha_note_handler_signal(struct m0_ha_note_handler *hnh,
402  struct m0_ha_nvec *nvec_rep,
403  uint64_t id)
404 {
405  struct ha_note_handler_request *hsg;
406  int i;
407 
408  M0_LOG(M0_DEBUG, "signal id=%"PRIu64, id);
409  /*
410  * @todo For LDR-R1 only two confd's are present and after a confd failure
411  * quorum is not possible in rconfc. During shutdown ha dispatcher is
412  * already added to the list and not cleaned up due rconfc not able to
413  * elect the confd and this function is not called. In this case it is
414  * found that some pending elements are in the ha_gets list, which
415  * causes panic during ha_gets list finalisation.
416  */
417  m0_mutex_lock(&hnh->hnh_lock);
418  hsg = m0_tl_find(ha_gets, hsg1, &hnh->hnh_gets, id == hsg1->hsg_id);
419  M0_ASSERT_INFO(hsg != NULL, "id=%"PRIu64, id);
420  ha_gets_tlink_del_fini(hsg);
421  m0_mutex_unlock(&hnh->hnh_lock);
422  M0_ASSERT(nvec_rep->nv_nr == hsg->hsg_nvec->nv_nr);
423  for (i = 0; i < nvec_rep->nv_nr; ++i) {
424  M0_ASSERT(m0_fid_eq(&nvec_rep->nv_note[i].no_id,
425  &hsg->hsg_nvec->nv_note[i].no_id));
426  hsg->hsg_nvec->nv_note[i].no_state =
427  nvec_rep->nv_note[i].no_state;
428  }
430  m0_free(hsg);
431 }
432 
433 M0_INTERNAL const char *m0_ha_state2str(enum m0_ha_obj_state state)
434 {
435 #define S_CASE(x) case x: return # x
436  switch (state) {
445  default:
446  M0_IMPOSSIBLE("Invalid state: %d", state);
447  }
448 #undef S_CASE
449 }
450 
451 #undef M0_TRACE_SUBSYSTEM
452 
453 /*
454 * Local variables:
455 * c-indentation-style: "K&R"
456 * c-basic-offset: 8
457 * tab-width: 8
458 * fill-column: 80
459 * scroll-step: 1
460 * End:
461 */
462 /*
463 * vim: tabstop=8 shiftwidth=8 noexpandtab textwidth=80 nowrap
464 */
void * fd_data
Definition: fop.h:75
Definition: beck.c:235
M0_INTERNAL int m0_ha_state_get(struct m0_ha_nvec *note, struct m0_chan *chan)
Definition: note.c:74
uint64_t hed_type
Definition: msg.h:88
M0_INTERNAL uint64_t m0_ha_msg_nvec_send(const struct m0_ha_nvec *nvec, uint64_t id_of_get, bool ignore_same_state, int direction, struct m0_ha_link *hl)
Definition: note.c:279
#define M0_PRE(cond)
static void ha_state_single_fop_data_free(struct m0_fop *fop)
Definition: note.c:111
#define M0_ALLOC_ARR(arr, nr)
Definition: memory.h:84
M0_INTERNAL void m0_mutex_unlock(struct m0_mutex *mutex)
Definition: mutex.c:66
struct m0_tlink hsg_tlink
Definition: note.c:320
M0_INTERNAL void m0_chan_broadcast_lock(struct m0_chan *chan)
Definition: chan.c:178
#define NULL
Definition: misc.h:38
uint64_t hnh_id_of_get
Definition: note.h:396
struct m0_ha_msg_nvec_array hmnv_arr
Definition: note.h:265
#define ergo(a, b)
Definition: misc.h:293
static uint64_t tag(uint8_t code, uint64_t id)
Definition: addb2.c:1047
M0_INTERNAL struct m0_conf_obj * m0_conf_cache_lookup(const struct m0_conf_cache *cache, const struct m0_fid *id)
Definition: cache.c:106
struct m0_ha_dispatcher * hnh_dispatcher
Definition: note.h:395
#define M0_LOG(level,...)
Definition: trace.h:167
M0_LEAVE()
const struct m0_conf_obj_type * m0_conf_fid_type(const struct m0_fid *fid)
Definition: obj.c:368
struct m0_ha_handler hnh_handler
Definition: note.h:394
struct m0_fid no_id
Definition: note.h:325
const struct m0_conf_obj_type M0_CONF_SDEV_TYPE
Definition: sdev.c:122
struct m0_bufvec data
Definition: di.c:40
M0_INTERNAL void m0_ha_note_handler_fini(struct m0_ha_note_handler *hnh)
Definition: note.c:364
struct m0_ha_msg_data hm_data
Definition: msg.h:122
uint64_t hsg_magic
Definition: note.c:322
struct m0_ha_note hmna_arr[M0_HA_STATE_UPDATE_LIMIT]
Definition: note.h:221
const struct m0_conf_obj_type M0_CONF_POOL_TYPE
Definition: pool.c:249
M0_INTERNAL struct m0 * m0_get(void)
Definition: instance.c:41
#define container_of(ptr, type, member)
Definition: misc.h:33
M0_INTERNAL void m0_mutex_lock(struct m0_mutex *mutex)
Definition: mutex.c:49
static bool note_invariant(const struct m0_ha_nvec *note, bool known)
Definition: note.c:58
#define N(i)
M0_INTERNAL bool m0_fid_is_set(const struct m0_fid *fid)
Definition: fid.c:106
M0_INTERNAL void m0_ha_clients_iterate(m0_ha_client_cb_t iter, const void *data, uint64_t data2)
Definition: epoch.c:251
static struct m0_rpc_item * item
Definition: item.c:56
M0_INTERNAL void m0_ha_state_set(const struct m0_ha_nvec *note)
Definition: note.c:95
static struct foo * obj
Definition: tlist.c:302
#define S_CASE(x)
#define m0_tl_endfor
Definition: tlist.h:700
struct m0_rpc_item_ops ha_ri_ops
Definition: note.c:130
M0_INTERNAL void m0_ha_link_send(struct m0_ha_link *hl, const struct m0_ha_msg *msg, uint64_t *tag)
Definition: link.c:556
M0_INTERNAL int m0_ha_note_handler_init(struct m0_ha_note_handler *hnh, struct m0_ha_dispatcher *hd)
Definition: note.c:345
return M0_RC(rc)
#define M0_ENTRY(...)
Definition: trace.h:170
int i
Definition: dir.c:1033
#define PRIu64
Definition: types.h:58
int32_t nv_nr
Definition: note.h:196
M0_INTERNAL uint64_t m0_ha_note_handler_add(struct m0_ha_note_handler *hnh, struct m0_ha_nvec *nvec_req, struct m0_chan *chan)
Definition: note.c:382
return M0_ERR(-EOPNOTSUPP)
static void ha_state_accept(struct m0_confc *confc, const struct m0_ha_nvec *note, uint64_t ignore_same_state)
Definition: note.c:149
#define M0_NVEC_PRINT(nvec_, label, level)
Definition: note.h:268
M0_INTERNAL struct m0_confc * m0_reqh2confc(struct m0_reqh *reqh)
Definition: reqh.c:753
#define M0_ASSERT(cond)
static struct m0_confc * confc
Definition: file.c:94
static struct m0_chan chan
Definition: note.c:97
m0_ha_obj_state
Definition: note.h:119
struct m0_conf_cache cc_cache
Definition: confc.h:394
static void ha_state_single_replied(struct m0_rpc_item *item)
Definition: note.c:122
M0_INTERNAL void m0_mutex_init(struct m0_mutex *mutex)
Definition: mutex.c:35
#define PRIi32
Definition: types.h:67
Definition: msg.h:115
M0_TL_DEFINE(ha_gets, static, struct ha_note_handler_request)
struct m0_chan * hsg_wait_chan
Definition: note.c:319
const struct m0_conf_obj_type M0_CONF_DRIVE_TYPE
Definition: drive.c:108
M0_TL_DESCR_DEFINE(ha_gets, "m0_ha_note_handler::hmh_gets", static, struct ha_note_handler_request, hsg_tlink, hsg_magic, 20, 21)
Definition: chan.h:229
M0_INTERNAL void m0_ha_dispatcher_attach(struct m0_ha_dispatcher *hd, struct m0_ha_handler *hh)
Definition: dispatcher.c:219
M0_INTERNAL bool m0_confc_is_inited(const struct m0_confc *confc)
Definition: confc.c:448
bool m0_conf_fid_is_valid(const struct m0_fid *fid)
Definition: obj.c:378
#define FID_P(f)
Definition: fid.h:77
uint32_t no_state
Definition: note.h:327
struct m0_fid no_id
Definition: note.h:180
Definition: ha.h:289
struct m0_mutex hnh_lock
Definition: note.h:393
struct m0_ha_link * i_ha_link
Definition: instance.h:110
void(* rio_replied)(struct m0_rpc_item *item)
Definition: item.h:300
M0_INTERNAL bool m0_fid_eq(const struct m0_fid *fid0, const struct m0_fid *fid1)
Definition: fid.c:164
#define m0_forall(var, nr,...)
Definition: misc.h:112
struct m0_fop_data f_data
Definition: fop.h:82
#define PRIu32
Definition: types.h:66
struct m0_ha_nvec * hsg_nvec
Definition: note.c:321
union m0_ha_msg_data::@212 u
M0_INTERNAL void m0_ha_dispatcher_detach(struct m0_ha_dispatcher *hd, struct m0_ha_handler *hh)
Definition: dispatcher.c:225
#define M0_FI_ENABLED(tag)
Definition: finject.h:231
Definition: fid.h:38
const struct m0_conf_obj_type M0_CONF_NODE_TYPE
Definition: node.c:128
#define M0_IS0(obj)
Definition: misc.h:70
#define M0_ALLOC_PTR(ptr)
Definition: memory.h:86
static void ha_note_handler_msg(struct m0_ha_handler *hh, struct m0_ha *ha, struct m0_ha_link *hl, struct m0_ha_msg *msg, uint64_t tag, void *data)
Definition: note.c:331
#define _0C(exp)
Definition: assert.h:311
M0_INTERNAL void m0_mutex_fini(struct m0_mutex *mutex)
Definition: mutex.c:42
static struct m0_fop * fop
Definition: item.c:57
uint64_t hmnv_nr
Definition: note.h:264
#define M0_ASSERT_INFO(cond, fmt,...)
struct m0_ha_note_handler * i_note_handler
Definition: instance.h:111
M0_INTERNAL void m0_ha_note_handler_signal(struct m0_ha_note_handler *hnh, struct m0_ha_nvec *nvec_rep, uint64_t id)
Definition: note.c:401
M0_INTERNAL const char * m0_ha_state2str(enum m0_ha_obj_state state)
Definition: note.c:433
struct m0_tl hnh_gets
Definition: note.h:392
#define M0_FID0
Definition: fid.h:93
struct m0_ha_note * nv_note
Definition: note.h:197
M0_INTERNAL void m0_ha_state_accept(const struct m0_ha_nvec *note, bool ignore_same_state)
Definition: note.c:189
M0_INTERNAL void m0_conf_cache_lock(struct m0_conf_cache *cache)
Definition: cache.c:50
#define m0_tl_find(name, var, head,...)
Definition: tlist.h:757
M0_INTERNAL void m0_ha_state_single_post(struct m0_ha_nvec *nvec)
Definition: note.c:134
#define m0_tl_for(name, head, obj)
Definition: tlist.h:695
void m0_free(void *data)
Definition: memory.c:146
void m0_fop_put(struct m0_fop *fop)
Definition: fop.c:177
struct m0_rpc_item f_item
Definition: fop.h:83
M0_INTERNAL void m0_ha_msg_accept(const struct m0_ha_msg *msg, struct m0_ha_link *hl)
Definition: note.c:196
void * hh_data
Definition: dispatcher.h:70
M0_INTERNAL void m0_chan_broadcast(struct m0_chan *chan)
Definition: chan.c:172
void(* m0_ha_client_cb_t)(void *client, const void *data, uint64_t data2)
Definition: epoch.h:236
#define ARRAY_SIZE(a)
Definition: misc.h:45
M0_INTERNAL void m0_conf_cache_unlock(struct m0_conf_cache *cache)
Definition: cache.c:55
Definition: fop.h:79
#define FID_F
Definition: fid.h:75
Definition: trace.h:478
M0_INTERNAL void m0_ha_local_state_set(const struct m0_ha_nvec *nvec)
Definition: note.c:105
#define M0_IMPOSSIBLE(fmt,...)
uint32_t no_state
Definition: note.h:182