Motr  M0
rmut.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 
23 #include "lib/memory.h"
24 #include "lib/cookie.h"
25 #include "lib/misc.h"
26 #include "lib/string.h" /* m0_strdup */
27 #include "lib/finject.h" /* m0_fi_enable_once */
28 #include "rpc/rpclib.h" /* m0_rpc_client_connect */
29 #include "ut/ut.h"
30 #include "lib/ub.h"
31 #include "fid/fid.h" /* m0_fid, m0_fid_tset */
32 #include "conf/obj.h"
33 #include "conf/obj_ops.h" /* m0_conf_obj_find */
34 #include "conf/dir.h" /* m0_conf_dir_add */
35 #include "rm/rm.h"
36 #include "rm/rm_service.h" /* m0_rms_type */
37 #include "rm/rm_internal.h"
38 #include "rm/ut/rings.h"
39 #include "rm/ut/rmut.h"
40 
41 extern const struct m0_tl_descr m0_remotes_tl;
42 
43 const char *serv_addr[] = { "0@lo:12345:34:1",
44  "0@lo:12345:34:2",
45  "0@lo:12345:34:3",
46  "0@lo:12345:34:4"
47 };
48 
49 const int cob_ids[] = { 20, 30, 40, 50 };
50 /*
51  * Test variable(s)
52  */
57 
58 extern void rm_api_test(void);
59 extern void local_credits_test(void);
60 extern void rm_fom_funcs_test(void);
61 extern void rm_fop_funcs_test(void);
62 extern void flock_test(void);
63 extern void rm_group_test(void);
64 extern bool m0_rm_ur_tlist_is_empty(const struct m0_tl *list);
65 extern void m0_remotes_tlist_del(struct m0_rm_remote *other);
66 extern void rmsvc(void);
67 
69 
71  struct m0_rm_credit *credit)
72 {
73  m0_rm_credit_init(credit, owner);
74  /* Set the initial capital */
75  credit->cr_ops->cro_initial_capital(credit);
76  m0_rm_owner_selfadd(owner, credit);
79 }
80 
82 {
83  int rc ;
84 
88  M0_ASSERT(rc == 0);
90 }
91 /*
92  * Recursive call to initialise object hierarchy
93  *
94  * XXX TODO: Use module/module.h API.
95  */
97 {
99 
100  switch (type) {
101  case OBJ_DOMAIN:
102  /* Initialise test_domain */
103  m0_rm_domain_init(&data->rd_dom);
104  break;
105  case OBJ_RES_TYPE:
107  /* Register test resource type */
108  data->rd_ops->rtype_set(data);
109  break;
110  case OBJ_RES:
112  data->rd_ops->resource_set(data);
113  break;
114  case OBJ_OWNER:
116  data->rd_ops->owner_set(data);
117  break;
118  default:
119  M0_IMPOSSIBLE("Invalid value of obj_type");
120  }
121 }
122 
123 /*
124  * Recursive call to finalise object hierarchy
125  *
126  * XXX TODO: Use module/module.h API.
127  */
129 {
130  struct m0_rm_remote *other;
131 
132  M0_UT_ASSERT(data != NULL);
133 
134  switch (type) {
135  case OBJ_DOMAIN:
136  /* Finalise test_domain */
137  m0_rm_domain_fini(&data->rd_dom);
138  break;
139  case OBJ_RES_TYPE:
140  /* De-register test resource type */
141  data->rd_ops->rtype_unset(data);
143  break;
144  case OBJ_RES:
145  m0_tl_teardown(m0_remotes,
146  &data->rd_res->r_remotes, other) {
147  m0_rm_remote_fini(other);
148  m0_free(other);
149  }
150  data->rd_ops->resource_unset(data);
152  break;
153  case OBJ_OWNER:
154  data->rd_ops->owner_unset(data);
156  break;
157  default:
158  M0_IMPOSSIBLE("Invalid value of obj_type");
159  }
160 }
161 
163 
164 void rm_ctx_init(struct rm_ctx *rmctx, enum rm_server id)
165 {
166  int rc;
167 
168  M0_PRE(id != SERVER_NR);
169 
170  *rmctx = (struct rm_ctx){
171  .rc_id = id,
172  .rc_rmach_ctx = {
173  .rmc_cob_id.id = cob_ids[id],
174  .rmc_ep_addr = serv_addr[id]
175  }
176  };
178  m0_mutex_init(&rmctx->rc_mutex);
181  NULL, NULL);
182  M0_UT_ASSERT(rc == 0);
183  m0_chan_init(&rmctx->rc_chan, &rmctx->rc_mutex);
184  m0_clink_init(&rmctx->rc_clink, NULL);
185  m0_clink_add_lock(&rmctx->rc_chan, &rmctx->rc_clink);
186 }
187 
188 void rm_ctx_fini(struct rm_ctx *rmctx)
189 {
190  m0_clink_del_lock(&rmctx->rc_clink);
191  m0_clink_fini(&rmctx->rc_clink);
192  m0_chan_fini_lock(&rmctx->rc_chan);
193  m0_mutex_fini(&rmctx->rc_mutex);
195 }
196 
197 void rm_ctx_connect(struct rm_ctx *src, const struct rm_ctx *dest)
198 {
199  enum { MAX_RPCS_IN_FLIGHT = 15 };
200  int rc;
201 
202  rc = m0_rpc_client_connect(&src->rc_conn[dest->rc_id],
203  &src->rc_sess[dest->rc_id],
204  &src->rc_rmach_ctx.rmc_rpc,
205  dest->rc_rmach_ctx.rmc_ep_addr,
207  M0_TIME_NEVER);
208  M0_UT_ASSERT(rc == 0);
209 }
210 
211 void rm_ctx_disconnect(struct rm_ctx *src, const struct rm_ctx *dest)
212 {
213  int rc;
214 
215  rc = m0_rpc_session_destroy(&src->rc_sess[dest->rc_id], M0_TIME_NEVER);
216  M0_UT_ASSERT(rc == 0);
217 
218  rc = m0_rpc_conn_destroy(&src->rc_conn[dest->rc_id], M0_TIME_NEVER);
219  M0_UT_ASSERT(rc == 0);
220 }
221 
223 {
224  struct m0_rm_remote *creditor;
225  struct m0_rm_owner *owner;
226  struct rm_ut_data *data = &rm_ctxs[srv_id].rc_test_data;
227  enum rm_server cred_id = rm_ctxs[srv_id].creditor_id;
228  enum rm_server debtr_id;
229  uint32_t debtors_nr = rm_ctxs[srv_id].rc_debtors_nr;
230  uint32_t i;
231 
233  owner = data->rd_owner;
234 
235  /*
236  * If creditor id is valid, do creditor setup.
237  * If there is no creditor, this server is original owner.
238  * For original owner, raise capital.
239  */
240  if (cred_id != SERVER_INVALID) {
241  rm_ctx_connect(&rm_ctxs[srv_id], &rm_ctxs[cred_id]);
246  creditor->rem_session = &rm_ctxs[srv_id].rc_sess[cred_id];
247  owner->ro_creditor = creditor;
248  /*
249  * Don't destroy creditors by loans ref-counter.
250  * (It's only for debtors.)
251  */
253  } else
254  rm_test_owner_capital_raise(owner, &data->rd_credit);
255 
256  for (i = 0; i < debtors_nr; ++i) {
257  debtr_id = rm_ctxs[srv_id].debtor_id[i];
258  if (debtr_id != SERVER_INVALID)
259  rm_ctx_connect(&rm_ctxs[srv_id], &rm_ctxs[debtr_id]);
260  }
261 
262 }
263 
265 {
266  struct m0_rm_owner *owner = rm_ctxs[srv_id].rc_test_data.rd_owner;
267  int rc;
268 
269  if (rm_ctxs[srv_id].rc_is_dead)
270  m0_fi_enable_once("owner_finalisation_check", "drop_loans");
271  m0_rm_owner_windup(owner);
273  M0_TIME_NEVER);
274  M0_ASSERT(rc == 0);
275  rm_ctx_server_windup(srv_id);
276 }
277 
279 {
280  struct m0_rm_owner *owner = rm_ctxs[srv_id].rc_test_data.rd_owner;
281  enum rm_server cred_id = rm_ctxs[srv_id].creditor_id;
282 
283  if (cred_id != SERVER_INVALID) {
284  M0_UT_ASSERT(owner->ro_creditor != NULL);
286  m0_free0(&owner->ro_creditor);
287  }
288  rm_utdata_fini(&rm_ctxs[srv_id].rc_test_data, OBJ_OWNER);
289 }
290 
291 void rm_ctx_server_stop(enum rm_server srv_id)
292 {
293  enum rm_server cred_id = rm_ctxs[srv_id].creditor_id;
294  enum rm_server debtr_id;
295  uint32_t debtors_nr = rm_ctxs[srv_id].rc_debtors_nr;
296  uint32_t i;
297 
298  if (cred_id != SERVER_INVALID)
299  rm_ctx_disconnect(&rm_ctxs[srv_id], &rm_ctxs[cred_id]);
300  for (i = 0; i < debtors_nr; ++i) {
301  debtr_id = rm_ctxs[srv_id].debtor_id[i];
302  if (debtr_id != SERVER_INVALID)
303  rm_ctx_disconnect(&rm_ctxs[srv_id], &rm_ctxs[debtr_id]);
304  }
305 }
306 
307 void rm_ctxs_rmsvc_conf_add(struct m0_confc *confc, struct rm_ctx *rmctx)
308 {
309  struct m0_fid svc_fid;
310  struct m0_conf_service *service;
311  struct m0_conf_obj *svc_obj;
312  struct m0_fid proc_fid;
313  struct m0_conf_obj *proc_obj;
314  struct m0_conf_process *process;
315  struct m0_conf_cache *cache = &confc->cc_cache;
316  int rc;
317 
319 
321  proc_obj = m0_conf_cache_lookup(cache, &proc_fid);
322  M0_ASSERT(proc_obj != NULL);
323  process = M0_CONF_CAST(proc_obj, m0_conf_process);
324 
326  0, rmctx->rc_id);
327  rc = m0_conf_obj_find(cache, &svc_fid, &svc_obj);
328  M0_ASSERT(rc == 0);
329  M0_ASSERT(m0_conf_obj_is_stub(svc_obj));
330 
332  service->cs_type = M0_CST_RMS;
333  M0_ALLOC_ARR(service->cs_endpoints, 2);
334  M0_ASSERT(service->cs_endpoints != NULL);
335  service->cs_endpoints[0] = m0_strdup(rmctx->rc_rmach_ctx.rmc_ep_addr);
336  M0_ASSERT(service->cs_endpoints[0] != NULL);
337  service->cs_endpoints[1] = NULL;
338 
339  m0_conf_dir_add(process->pc_services, svc_obj);
340  svc_obj->co_status = M0_CS_READY;
341 
343 }
344 
345 void rm_ctxs_conf_init(struct rm_ctx *rm_ctxs, int ctxs_nr)
346 {
347  struct rm_ctx *rmctx;
348  struct m0_confc *confc;
349  int i, j;
350  int rc;
351  char minimal_conf_str[] = "[5:\
352  {0x74| ((^t|1:0), 1, (11, 22), ^o|1:23, ^v|1:24, 41212,\
353  [3: \"param-0\", \"param-1\", \"param-2\"],\
354  [1: ^n|1:2], [0], [1: ^o|1:23], [1:^p|1:0], [0])},\
355  {0x70| ((^p|1:0), [1: ^o|1:23])},\
356  {0x6e| ((^n|1:2), 16000, 2, 3, 2, [1: ^r|1:3])},\
357  {0x72| ((^r|1:3), [1:3], 0, 0, 0, 0, \"addr-0\", [0])},\
358  {0x6f| ((^o|1:23), 0, [0])}]";
359 
360  for (i = 0; i < ctxs_nr; i++) {
361  rmctx = &rm_ctxs[i];
363  /*
364  * Initialise confc instance in reqh. Confc is necessary to
365  * track death of creditors/debtors.
366  */
370  m0_locality0_get()->lo_grp,
371  NULL,
372  &rmctx->rc_rmach_ctx.rmc_rpc,
373  minimal_conf_str);
374  M0_ASSERT(rc == 0);
375  for (j = 0; j < ctxs_nr; j++) {
377  }
379  }
380 }
381 
382 void rm_ctxs_conf_fini(struct rm_ctx *rm_ctxs, int ctxs_nr)
383 {
384  struct rm_ctx *rmctx;
385  struct m0_confc *confc;
386  int i;
387 
388  for (i = 0; i < ctxs_nr; i++) {
389  rmctx = &rm_ctxs[i];
396  }
397 }
398 
399 void loan_session_set(enum rm_server csrv_id,
400  enum rm_server dsrv_id)
401 {
402  struct m0_rm_owner *owner = rm_ctxs[csrv_id].rc_test_data.rd_owner;
403  struct m0_rm_loan *loan;
404  struct m0_rm_credit *credit;
405  struct m0_rm_remote *remote;
406  struct m0_cookie dcookie;
407 
409  m0_tl_for(m0_rm_ur, &owner->ro_sublet, credit) {
410  loan = bob_of(credit, struct m0_rm_loan, rl_credit, &loan_bob);
411  M0_UT_ASSERT(loan != NULL);
412  m0_cookie_init(&dcookie,
413  &rm_ctxs[dsrv_id].rc_test_data.rd_owner->ro_id);
414  remote = loan->rl_other;
415  if (m0_cookie_is_eq(&dcookie, &remote->rem_cookie))
416  remote->rem_session = &rm_ctxs[csrv_id].rc_sess[dsrv_id];
417  } m0_tl_endfor;
418 }
419 
421  enum rm_server csrv_id)
422 {
423  struct m0_rm_owner *creditor = rm_ctxs[csrv_id].rc_test_data.rd_owner;
424  struct m0_rm_owner *owner = rm_ctxs[dsrv_id].rc_test_data.rd_owner;
425 
426  m0_cookie_init(&owner->ro_creditor->rem_cookie, &creditor->ro_id);
427 }
428 
429 void credits_are_equal(enum rm_server srv_id,
430  enum rm_ut_credits_list list_id,
431  uint64_t value)
432 {
433  struct m0_rm_owner *owner = rm_ctxs[srv_id].rc_test_data.rd_owner;
434  uint64_t sum;
435  struct m0_tl *list;
436 
437  switch (list_id) {
438  case RCL_CACHED:
439  list = &owner->ro_owned[OWOS_CACHED];
440  break;
441  case RCL_HELD:
442  list = &owner->ro_owned[OWOS_HELD];
443  break;
444  case RCL_BORROWED:
445  list = &owner->ro_borrowed;
446  break;
447  case RCL_SUBLET:
448  list = &owner->ro_sublet;
449  break;
450  default:
451  M0_IMPOSSIBLE("Invalid credits list");
452  }
453 
454  sum = m0_tl_reduce(m0_rm_ur, credit, list, 0, + credit->cr_datum);
455  M0_UT_ASSERT(sum == value);
456 }
457 
458 struct m0_ut_suite rm_ut = {
459  .ts_name = "rm-ut",
460  .ts_tests = {
461  { "api", rm_api_test },
462  { "lcredits", local_credits_test },
463  { "fop-funcs", rm_fop_funcs_test },
464 #ifndef __KERNEL__
465  { "fom-funcs", rm_fom_funcs_test },
466  { "rmsvc", rmsvc },
467  { "flock", flock_test },
468  { "group", rm_group_test },
469 #endif
470  { NULL, NULL }
471  }
472 };
473 
474 /*
475  * Local variables:
476  * c-indentation-style: "K&R"
477  * c-basic-offset: 8
478  * tab-width: 8
479  * fill-column: 80
480  * scroll-step: 1
481  * End:
482  */
const struct m0_rm_credit_ops * cr_ops
Definition: rm.h:502
M0_INTERNAL int m0_rm_owner_selfadd(struct m0_rm_owner *owner, struct m0_rm_credit *r)
Definition: rm.c:732
Definition: rm.h:886
Definition: beck.c:235
uint64_t id
Definition: cob.h:2380
struct m0_reqh_service * rmservice[SERVER_NR]
Definition: rmut.c:162
#define M0_PRE(cond)
#define M0_ALLOC_ARR(arr, nr)
Definition: memory.h:84
M0_INTERNAL void m0_ut_rpc_mach_init_and_add(struct m0_ut_rpc_mach_ctx *ctx)
static struct m0_list list
Definition: list.c:144
enum m0_rm_remote_state rem_state
Definition: rm.h:748
#define m0_strdup(s)
Definition: string.h:43
void flock_test(void)
Definition: file.c:514
#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
const struct m0_conf_obj_type M0_CONF_PROFILE_TYPE
Definition: profile.c:97
static struct m0_rm_remote creditor
Definition: file.c:95
struct rm_ctx rm_ctxs[SERVER_NR]
Definition: rmut.c:54
M0_INTERNAL void m0_clink_del_lock(struct m0_clink *link)
Definition: chan.c:293
struct m0_rm_remote * ro_creditor
Definition: rm.h:1026
void creditor_cookie_setup(enum rm_server dsrv_id, enum rm_server csrv_id)
Definition: rmut.c:420
M0_INTERNAL void m0_fid_tset(struct m0_fid *fid, uint8_t tid, uint64_t container, uint64_t key)
Definition: fid.c:126
struct rm_ut_data rm_test_data
Definition: rmut.c:53
const m0_time_t M0_TIME_NEVER
Definition: time.c:108
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
M0_INTERNAL void m0_conf_dir_add(struct m0_conf_dir *dir, struct m0_conf_obj *obj)
Definition: dir.c:43
void rm_fop_funcs_test(void)
Definition: rm_fops.c:605
uint8_t ft_id
Definition: fid.h:101
const struct m0_conf_obj_type M0_CONF_SERVICE_TYPE
Definition: service.c:156
struct rm_ut_data rc_test_data
Definition: rmut.h:133
M0_INTERNAL const struct m0_bob_type loan_bob
Definition: rm.c:179
bool m0_rm_ur_tlist_is_empty(const struct m0_tl *list)
struct m0_rpc_machine rmc_rpc
struct m0_ut_rpc_mach_ctx rc_rmach_ctx
Definition: rmut.h:129
const char * serv_addr[]
Definition: rmut.c:43
M0_INTERNAL int m0_ha_client_del(struct m0_confc *confc)
Definition: epoch.c:232
int m0_rpc_session_destroy(struct m0_rpc_session *session, m0_time_t abs_timeout)
Definition: session.c:559
M0_INTERNAL int m0_confc_init(struct m0_confc *confc, struct m0_sm_group *sm_group, const char *confd_addr, struct m0_rpc_machine *rpc_mach, const char *local_conf)
Definition: confc.c:560
struct m0_bufvec data
Definition: di.c:40
Definition: rmut.h:39
int const char const void * value
Definition: dir.c:325
struct m0_rm_owner * rd_owner
Definition: rmut.h:112
static int sum
Definition: rwlock.c:53
M0_INTERNAL void m0_confc_fini(struct m0_confc *confc)
Definition: confc.c:570
M0_INTERNAL void m0_rm_domain_init(struct m0_rm_domain *dom)
Definition: rm.c:215
#define M0_BITS(...)
Definition: misc.h:236
M0_INTERNAL void m0_rm_remote_init(struct m0_rm_remote *rem, struct m0_rm_resource *res)
Definition: rm.c:1411
struct m0_rpc_session * rem_session
Definition: rm.h:755
Definition: ut.h:77
M0_INTERNAL bool m0_conf_obj_is_stub(const struct m0_conf_obj *obj)
Definition: obj.c:302
rm_ut_credits_list
Definition: rmut.h:85
M0_INTERNAL int m0_rm_owner_timedwait(struct m0_rm_owner *owner, uint64_t state, const m0_time_t abs_timeout)
Definition: rm.c:892
struct m0_clink rc_clink
Definition: rmut.h:127
#define m0_tl_endfor
Definition: tlist.h:700
void rm_ctx_fini(struct rm_ctx *rmctx)
Definition: rmut.c:188
M0_INTERNAL struct m0_fid * m0_reqh2profile(struct m0_reqh *reqh)
Definition: reqh.c:758
int i
Definition: dir.c:1033
void rm_ctxs_rmsvc_conf_add(struct m0_confc *confc, struct rm_ctx *rmctx)
Definition: rmut.c:307
Definition: rmut.h:50
Definition: rmut.h:123
struct m0_chan rm_ut_tests_chan
Definition: rmut.c:55
M0_INTERNAL void m0_ref_get(struct m0_ref *ref)
Definition: refs.c:32
void loan_session_set(enum rm_server csrv_id, enum rm_server dsrv_id)
Definition: rmut.c:399
M0_INTERNAL int m0_rpc_client_connect(struct m0_rpc_conn *conn, struct m0_rpc_session *session, struct m0_rpc_machine *rpc_mach, const char *remote_addr, struct m0_fid *svc_fid, uint64_t max_rpcs_in_flight, m0_time_t abs_timeout)
Definition: rpclib.c:102
void rm_ctx_init(struct rm_ctx *rmctx, enum rm_server id)
Definition: rmut.c:164
void rm_group_test(void)
Definition: group.c:271
struct m0_tl ro_borrowed
Definition: rm.h:1033
M0_INTERNAL struct m0_confc * m0_reqh2confc(struct m0_reqh *reqh)
Definition: reqh.c:753
rm_server
Definition: rmut.h:45
#define m0_tl_teardown(name, head, obj)
Definition: tlist.h:708
struct rm_ut_data test_data
Definition: rmut.c:68
const struct m0_tl_descr m0_remotes_tl
const struct m0_fid_type cot_ftype
Definition: obj.h:314
obj_type
Definition: rmut.h:35
void rm_utdata_owner_windup_fini(struct rm_ut_data *data)
Definition: rmut.c:81
#define m0_free0(pptr)
Definition: memory.h:77
M0_INTERNAL void m0_chan_init(struct m0_chan *chan, struct m0_mutex *ch_guard)
Definition: chan.c:96
#define M0_ASSERT(cond)
static struct m0_confc * confc
Definition: file.c:94
void rm_ctxs_conf_fini(struct rm_ctx *rm_ctxs, int ctxs_nr)
Definition: rmut.c:382
Definition: tlist.h:251
struct m0_tl ro_sublet
Definition: rm.h:1042
#define bob_of(ptr, type, field, bt)
Definition: bob.h:140
int m0_rpc_conn_destroy(struct m0_rpc_conn *conn, m0_time_t abs_timeout)
Definition: conn.c:974
struct m0_conf_cache cc_cache
Definition: confc.h:394
void rmsvc(void)
Definition: rm_service.c:229
enum rm_server debtor_id[SERVER_NR - 1]
Definition: rmut.h:137
enum rm_server rc_id
Definition: rmut.h:124
static char * proc_fid
Definition: m0hsm.c:45
M0_INTERNAL void m0_mutex_init(struct m0_mutex *mutex)
Definition: mutex.c:35
void rm_fom_funcs_test(void)
Definition: rm_foms.c:657
Definition: chan.h:229
void m0_remotes_tlist_del(struct m0_rm_remote *other)
struct m0_reqh rmc_reqh
M0_INTERNAL int m0_conf_obj_find(struct m0_conf_cache *cache, const struct m0_fid *id, struct m0_conf_obj **out)
Definition: obj_ops.c:136
struct m0_rm_remote * rl_other
Definition: rm.h:1105
void rm_utdata_init(struct rm_ut_data *data, enum obj_type type)
Definition: rmut.c:96
#define M0_CONF_CAST(ptr, type)
Definition: obj.h:780
M0_INTERNAL int m0_reqh_service_setup(struct m0_reqh_service **out, struct m0_reqh_service_type *stype, struct m0_reqh *reqh, struct m0_reqh_context *rctx, const struct m0_fid *fid)
Definition: reqh_service.c:565
uint32_t rc_debtors_nr
Definition: rmut.h:134
void rm_ctxs_conf_init(struct rm_ctx *rm_ctxs, int ctxs_nr)
Definition: rmut.c:345
const int cob_ids[]
Definition: rmut.c:49
void rm_ctx_disconnect(struct rm_ctx *src, const struct rm_ctx *dest)
Definition: rmut.c:211
void m0_clink_add_lock(struct m0_chan *chan, struct m0_clink *link)
Definition: chan.c:255
struct m0_mutex rc_mutex
Definition: rmut.h:128
struct m0_reqh_service_type m0_rms_type
Definition: rm_service.c:69
const char * ts_name
Definition: ut.h:99
Definition: rmut.h:88
struct m0_conf_dir * pc_services
Definition: obj.h:582
M0_INTERNAL struct m0_locality * m0_locality0_get(void)
Definition: locality.c:169
Definition: fid.h:38
void local_credits_test(void)
Definition: lcredits.c:438
M0_INTERNAL void m0_rm_credit_init(struct m0_rm_credit *credit, struct m0_rm_owner *owner)
Definition: rm.c:964
M0_INTERNAL void m0_rm_remote_fini(struct m0_rm_remote *rem)
Definition: rm.c:1431
struct m0_chan rc_chan
Definition: rmut.h:126
void rm_ctx_server_windup(enum rm_server srv_id)
Definition: rmut.c:278
#define M0_ALLOC_PTR(ptr)
Definition: memory.h:86
const char * rmc_ep_addr
Definition: rm.h:863
static struct m0_rm_remote * remote
Definition: rm_fops.c:35
M0_INTERNAL void m0_ut_rpc_mach_fini(struct m0_ut_rpc_mach_ctx *ctx)
M0_INTERNAL void m0_rm_owner_windup(struct m0_rm_owner *owner)
Definition: rm.c:930
Definition: rmut.h:38
struct m0_tl ro_owned[OWOS_NR]
Definition: rm.h:1047
enum rm_server creditor_id
Definition: rmut.h:136
M0_INTERNAL void m0_mutex_fini(struct m0_mutex *mutex)
Definition: mutex.c:42
M0_INTERNAL void m0_clink_fini(struct m0_clink *link)
Definition: chan.c:208
M0_INTERNAL void m0_conf_cache_clean(struct m0_conf_cache *cache, const struct m0_conf_obj_type *type)
Definition: cache.c:168
M0_INTERNAL int m0_ha_client_add(struct m0_confc *confc)
Definition: epoch.c:191
enum m0_conf_status co_status
Definition: obj.h:210
static void m0_fi_enable_once(const char *func, const char *tag)
Definition: finject.h:301
void(* cro_initial_capital)(struct m0_rm_credit *self)
Definition: rm.h:671
struct m0_ref rem_refcnt
Definition: rm.h:781
void credits_are_equal(enum rm_server srv_id, enum rm_ut_credits_list list_id, uint64_t value)
Definition: rmut.c:429
void rm_api_test(void)
Definition: rmapi.c:219
void rm_test_owner_capital_raise(struct m0_rm_owner *owner, struct m0_rm_credit *credit)
Definition: rmut.c:70
const struct m0_conf_obj_type M0_CONF_PROCESS_TYPE
Definition: process.c:161
struct m0_cookie rem_cookie
Definition: rm.h:768
int type
Definition: dir.c:1031
struct m0_ut_suite rm_ut
Definition: rmut.c:458
void rm_ctx_server_stop(enum rm_server srv_id)
Definition: rmut.c:291
M0_INTERNAL void m0_conf_cache_lock(struct m0_conf_cache *cache)
Definition: cache.c:50
struct m0_rpc_session rc_sess[SERVER_NR]
Definition: rmut.h:132
const struct m0_conf_obj_type M0_CONF_DIR_TYPE
Definition: dir.c:206
#define m0_tl_for(name, head, obj)
Definition: tlist.h:695
M0_INTERNAL void m0_chan_fini_lock(struct m0_chan *chan)
Definition: chan.c:112
void m0_free(void *data)
Definition: memory.c:146
Definition: mutex.h:47
static struct m0_reqh_service * service[REQH_IN_UT_MAX]
Definition: long_lock_ut.c:46
struct m0_pdclust_src_addr src
Definition: fd.c:108
int32_t rc
Definition: trigger_fop.h:47
M0_INTERNAL void m0_rm_domain_fini(struct m0_rm_domain *dom)
Definition: rm.c:227
struct m0_mutex rm_ut_tests_chan_mutex
Definition: rmut.c:56
void rm_ctx_server_start(enum rm_server srv_id)
Definition: rmut.c:222
#define M0_UT_ASSERT(a)
Definition: ut.h:46
M0_INTERNAL void m0_conf_cache_unlock(struct m0_conf_cache *cache)
Definition: cache.c:55
void rm_ctx_connect(struct rm_ctx *src, const struct rm_ctx *dest)
Definition: rmut.c:197
void rm_ctx_server_owner_windup(enum rm_server srv_id)
Definition: rmut.c:264
struct m0_rm_resource * ro_resource
Definition: rm.h:1015
void rm_utdata_fini(struct rm_ut_data *data, enum obj_type type)
Definition: rmut.c:128
#define M0_IMPOSSIBLE(fmt,...)