Motr  M0
rm_foms.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 "ut/ut.h"
25 #include "lib/finject.h"
26 #include "lib/time.h" /* m0_time_now */
27 #include "fid/fid.h" /* M0_FID_TINIT */
28 #include "net/lnet/lnet.h"
29 #include "rpc/rpc.h"
30 #include "reqh/reqh.h"
31 #include "rm/rm.h"
32 #include "rm/rm_fops.h"
33 #include "rm/ut/rmut.h"
34 #include "rm/ut/rings.h"
35 #include "rm/rm_foms.c" /* To access static APIs. */
36 #include "ut/cs_fop.h" /* m0_ut_fom_phase_set */
37 
38 enum test_type {
43 };
44 
45 static struct m0_fom_locality dummy_loc;
47 static struct m0_rm_loan *test_loan;
48 struct m0_reqh reqh;
50 static struct m0_rpc_machine *machine;
51 
52 extern void m0_remotes_tlist_add(struct m0_tl *tl, struct m0_rm_remote *rem);
53 extern void m0_remotes_tlist_del(struct m0_rm_remote *rem);
54 extern const struct m0_tl_descr m0_remotes_tl;
55 
56 /*
57  *****************
58  * Common test functions for test cases in this file.
59  ******************
60  */
61 static void rmfoms_utinit(void)
62 {
67 }
68 
69 static void rmfoms_utfini(void)
70 {
73  machine = NULL;
74 }
75 
76 /*
77  * Allocate desired FOP and populate test-data in it.
78  */
79 static struct m0_fop *fop_alloc(enum m0_rm_incoming_type fomtype)
80 {
81  struct m0_fop *fop = NULL;
82 
83  switch (fomtype) {
84  case M0_RIT_BORROW:
86  M0_UT_ASSERT(fop != NULL);
87  break;
88  case M0_RIT_REVOKE:
90  M0_UT_ASSERT(fop != NULL);
91  break;
92  default:
93  M0_IMPOSSIBLE("Invalid RM-FOM type");
94  break;
95  }
96  return fop;
97 }
98 
99 /*
100  * Accept a RM-FOM. Delete FOP within FOM.
101  */
102 static void fop_dealloc(struct m0_fop *fop)
103 {
104  M0_UT_ASSERT(fop != NULL);
107 }
108 
109 /*
110  * Create and initialise RM FOMs.
111  */
112 static void fom_create(enum m0_rm_incoming_type fomtype,
113  bool err_test,
114  struct m0_fop *fop,
115  struct m0_fom **fom)
116 {
117  int rc = 0;
118  struct m0_fom *base_fom;
119 
120  if (err_test)
121  m0_fi_enable_once("request_fom_create", "fom_alloc_failure");
122 
123  switch (fomtype) {
124  case M0_RIT_BORROW:
126  &rm_ctxs[SERVER_1].rc_rmach_ctx.rmc_reqh);
127  break;
128  case M0_RIT_REVOKE:
130  &rm_ctxs[SERVER_1].rc_rmach_ctx.rmc_reqh);
131  break;
132  default:
133  M0_IMPOSSIBLE("Invalid RM-FOM type");
134  }
135  M0_UT_ASSERT(ergo(err_test, rc == -ENOMEM));
136  M0_UT_ASSERT(ergo(!err_test, rc == 0));
137 
138  if (!err_test) {
139  (*fom)->fo_service = &dummy_svc;
140  if (dummy_svc.rs_fom_key == 0)
141  dummy_svc.rs_fom_key = m0_locality_lockers_allot();
143  base_fom = *fom;
144  base_fom->fo_fop = fop;
145  base_fom->fo_loc = &dummy_loc;
146  M0_CNT_INC(base_fom->fo_loc->fl_foms);
147  m0_fom_sm_init(base_fom);
148  m0_fom_locality_inc(base_fom);
149  }
150 }
151 
152 static void fom_fini(struct m0_fom *fom, enum m0_rm_incoming_type fomtype)
153 {
155 
156  m0_fop_put_lock(fom->fo_fop);
157 
158  switch (fomtype) {
159  case M0_RIT_BORROW:
161  break;
162  case M0_RIT_REVOKE:
164  break;
165  default:
166  M0_IMPOSSIBLE("Invalid RM-FOM type");
167  }
168 }
169 
170 /*
171  * A generic RM-FOM-delete verification UT function.
172  */
173 static void fom_fini_test(enum m0_rm_incoming_type fomtype)
174 {
175  struct m0_fom *fom;
176  struct m0_fop *fop;
177 
178  /*
179  * 1. Allocate FOM object of interest
180  * 2. Calculate memory usage before and after object allocation
181  * and de-allocation.
182  */
183  fop = fop_alloc(fomtype);
184 
185  fom_create(fomtype, false, fop, &fom);
186  fom_fini(fom, fomtype);
187 }
188 
189 static void fom_create_test(enum m0_rm_incoming_type fomtype,
190  bool err_test)
191 {
192  struct m0_fom *fom = NULL;
193  struct m0_fop *fop;
194 
195  fop = fop_alloc(fomtype);
196  fom_create(fomtype, err_test, fop, &fom);
197  if (!err_test) {
198  M0_UT_ASSERT(fom != NULL);
199  fom_fini(fom, fomtype);
200  } else
201  fop_dealloc(fop);
202 }
203 
204 /*
205  *****************
206  * RM Borrow-FOM test functions
207  ******************
208  */
209 /*
210  * Populate the fake (test) RM-BORROW FOP.
211  */
212 static void brw_fop_populate(struct m0_fom *fom, enum test_type test)
213 {
214  struct m0_rm_fop_borrow *brw_fop;
215  struct m0_rm_credit credit;
216 
217  brw_fop = m0_fop_data(fom->fo_fop);
218  M0_UT_ASSERT(brw_fop != NULL);
219 
220  brw_fop->bo_base.rrq_policy = RIP_NONE;
221  brw_fop->bo_base.rrq_flags = RIF_LOCAL_WAIT;
222  brw_fop->bo_base.rrq_orig_owner = M0_FID_TINIT(M0_RM_OWNER_FT, 1, 0);
223  brw_fop->bo_base.rrq_orig_time = m0_time_now();
224 
225  m0_cookie_init(&brw_fop->bo_creditor.ow_cookie,
227  m0_cookie_init(&brw_fop->bo_base.rrq_owner.ow_cookie,
230  brw_fop->bo_group_id = M0_UINT128(0, 0);
231 
232  switch (test) {
234  case RM_UT_MEMFAIL_TEST:
235  credit.cr_datum = ALLRINGS;
236  break;
238  credit.cr_datum = VILYA;
239  break;
241  credit.cr_datum = INVALID_RING;
242  break;
243  }
244  m0_rm_credit_encode(&credit, &brw_fop->bo_base.rrq_credit.cr_opaque);
245  m0_rm_credit_fini(&credit);
246 }
247 
248 static void brw_test_cleanup(void)
249 {
250  struct m0_rm_credit *credit;
251  struct m0_rm_loan *loan;
252 
253  m0_tl_for(m0_rm_ur, &rm_test_data.rd_owner->ro_sublet, credit) {
254  m0_rm_ur_tlink_del_fini(credit);
255  loan = container_of(credit, struct m0_rm_loan, rl_credit);
256  m0_rm_loan_fini(loan);
257  m0_free(loan);
258  } m0_tl_endfor;
259 }
260 
261 /*
262  * Validate the test results.
263  */
264 static void brw_fom_state_validate(struct m0_fom *fom, int32_t rc,
265  enum test_type test)
266 {
267  struct m0_rm_fop_borrow *brw_fop;
268  struct m0_sm_group *grp = &dummy_loc.fl_group;
269 
271  switch (test) {
281  break;
291  break;
293  case RM_UT_MEMFAIL_TEST:
295  break;
296  }
298  brw_fop = m0_fop_data(fom->fo_fop);
299  M0_UT_ASSERT(brw_fop != NULL);
301  /* RM code posts AST to wakeup FOM, delete it. AST is already freed */
303 }
304 
305 /*
306  * Test function for testing BORROW FOM functions.
307  */
309 {
310  struct m0_fom *fom;
311  struct m0_fop *fop;
312  int rc;
313 
314  /* Initialise hierarchy of RM objects with rings resource */
317 
318  /* Add self-loan to the test owner object */
321 
323 
324  /*
325  * Create FOM and set the FOM phase to start processing of the request.
326  */
327  fom_create(M0_RIT_BORROW, false, fop, &fom);
328  M0_UT_ASSERT(fom != NULL);
330 
331  /*
332  * Call the first phase of FOM.
333  */
334  m0_fi_enable_once("request_pre_process", "no-subscription");
338 
339  /*
340  * Call the second phase of FOM.
341  */
342  if (test == RM_UT_MEMFAIL_TEST)
343  m0_fi_enable_once("rings_credit_copy", "fail_copy");
347 
348 
349  /*
350  * Call the third phase of FOM.
351  */
352  m0_fi_enable_once("request_post_process", "no_rpc_reply_post");
355 
359 }
360 
361 /*
362  * Test function for brw_fom_create().
363  */
364 static void brw_fom_create_test(void)
365 {
366  /* 1. Test memory failure */
368  /* 2. Test success */
370 }
371 
372 /*
373  * Test function for brw_fom_fini().
374  */
375 static void brw_fom_fini_test(void)
376 {
378 }
379 
380 /*
381  *****************
382  * RM Revoke-FOM test functions
383  ******************
384  */
385 static void rvk_data_setup(enum test_type test)
386 {
387  struct m0_rm_credit *credit;
388  struct m0_rm_remote *remote;
389 
390  M0_ALLOC_PTR(credit);
391  M0_UT_ASSERT(credit != NULL);
393  switch (test) {
395  case RM_UT_MEMFAIL_TEST:
396  credit->cr_datum = (uint64_t)VILYA;
397  break;
399  credit->cr_datum = (uint64_t)ALLRINGS;
400  break;
402  credit->cr_datum = (uint64_t)NENYA;
403  break;
404  }
405 
408 
415 
416  m0_rm_loan_init(test_loan, credit, remote);
419 
421  m0_rm_ur_tlist_add(&rm_test_data.rd_owner->ro_borrowed,
422  &test_loan->rl_credit);
423  m0_rm_ur_tlist_add(&rm_test_data.rd_owner->ro_owned[OWOS_CACHED],
424  credit);
425 
431 }
432 
433 /*
434  * Populate the fake (test) RM-REVOKE FOP.
435  */
436 static void rvk_fop_populate(struct m0_fom *fom)
437 {
438  struct m0_rm_fop_revoke *rvk_fop;
439  struct m0_rm_credit credit;
440 
441  rvk_fop = m0_fop_data(fom->fo_fop);
442  M0_UT_ASSERT(rvk_fop != NULL);
443 
444  rvk_fop->fr_base.rrq_policy = RIP_NONE;
445  rvk_fop->fr_base.rrq_flags = RIF_LOCAL_WAIT;
446  rvk_fop->fr_base.rrq_orig_owner = M0_FID_TINIT(M0_RM_OWNER_FT, 1, 0);
447  rvk_fop->fr_base.rrq_orig_time = m0_time_now();
448 
449 
451  credit.cr_datum = VILYA;
452  m0_rm_credit_encode(&credit, &rvk_fop->fr_base.rrq_credit.cr_opaque);
453 
454  m0_cookie_init(&rvk_fop->fr_loan.lo_cookie, &test_loan->rl_id);
455  m0_cookie_init(&rvk_fop->fr_base.rrq_owner.ow_cookie,
457  m0_rm_credit_fini(&credit);
458 }
459 
460 static void rvk_test_cleanup(void)
461 {
462  struct m0_rm_credit *credit;
463  struct m0_rm_remote *remote;
464  struct m0_rm_loan *loan;
465 
467  credit) {
468  m0_rm_ur_tlink_del_fini(credit);
469  m0_rm_credit_fini(credit);
470  m0_free(credit);
471  } m0_tl_endfor;
472 
473  m0_tl_for(m0_rm_ur, &rm_test_data.rd_owner->ro_borrowed, credit) {
474  m0_rm_ur_tlink_del_fini(credit);
475  loan = container_of(credit, struct m0_rm_loan, rl_credit);
476  m0_rm_loan_fini(loan);
477  m0_free(loan);
478  } m0_tl_endfor;
479 
482  m0_free(remote);
483  }
484 }
485 
486 /*
487  * Validate the test results.
488  */
489 static void rvk_fom_state_validate(struct m0_fom *fom, int32_t rc,
490  enum test_type test)
491 {
492  struct m0_rm_fop_revoke *rvk_fop;
493  struct m0_sm_group *grp = &dummy_loc.fl_group;
494 
496  switch (test) {
504  break;
508  M0_UT_ASSERT(
511  M0_UT_ASSERT(
514  break;
516  case RM_UT_MEMFAIL_TEST:
518  M0_UT_ASSERT(
521  M0_UT_ASSERT(
524  break;
525  }
528  rvk_fop = m0_fop_data(fom->fo_fop);
529  M0_UT_ASSERT(rvk_fop != NULL);
531  /* RM code posts AST to wakeup FOM, delete it. AST is already freed */
533 }
534 
535 /*
536  * Test function for to test REVOKE FOM states().
537  */
539 {
540  struct m0_fom *fom;
541  struct m0_fop *fop;
542  int rc;
543 
544  /* Initialise hierarchy of RM objects with rings resource */
547 
549 
551 
552  fom_create(M0_RIT_REVOKE, false, fop, &fom);
553  M0_UT_ASSERT(fom != NULL);
554 
557  /*
558  * Call the first FOM phase.
559  */
560  m0_fi_enable_once("request_pre_process", "no-subscription");
564 
565  /*
566  * Call the second FOM phase.
567  */
568  if (test == RM_UT_MEMFAIL_TEST)
569  m0_fi_enable_once("rings_credit_copy", "fail_copy");
573 
574  /*
575  * Call the third FOM phase.
576  */
577  m0_fi_enable_once("request_post_process", "no_rpc_reply_post");
580 
583 }
584 
585 /*
586  * Test function for rvk_fom_create().
587  */
588 static void rvk_fom_create_test(void)
589 {
590  /* 1. Test memory failure */
592 
593  /* 2. Test success */
595 }
596 
597 /*
598  * Test function for rvk_fom_fini().
599  */
600 static void rvk_fom_fini_test(void)
601 {
603 }
604 
605 /*
606  *****************
607  * Top level test functions
608  ******************
609  */
610 static void borrow_fom_funcs_test(void)
611 {
612  /* Test for brw_fom_create() */
614 
615  /* Test for brw_fom_fini() */
617 
618  /* 1. Test borrowing part (partial) of the credits available */
620 
621  /* 2. Test borrowing full credits available */
623  /*
624  * 3. Test borrowing an invalid credit (not available)
625  * Tests failure in request pre-processing.
626  */
628 
629  /* 4. Test failure in Borrow (post-processing) */
631 
632 }
633 
634 static void revoke_fom_funcs_test(void)
635 {
636  /* Test for rvk_fom_create() */
638 
639  /* Test for rvk_fom_fini() */
641 
642  /* 1. Test revoke of entire credits that were borrowed */
644 
645  /* 2. Test revoke of part of credits that were borrowed */
647 
648  /* 3. Test revoke of an invalid credit (failure in pre-processing) */
650 
651  /* 4. Test revoke post-processing failure */
654 
655 }
656 
658 {
659  rmfoms_utinit();
664  rmfoms_utfini();
665 }
666 
667 /*
668  * Local variables:
669  * c-indentation-style: "K&R"
670  * c-basic-offset: 8
671  * tab-width: 8
672  * fill-column: 80
673  * scroll-step: 1
674  * End:
675  */
Definition: rm.h:886
static void rvk_data_setup(enum test_type test)
Definition: rm_foms.c:385
struct m0_reqh_service * reqh_svc
Definition: rm_foms.c:49
static void fom_fini_test(enum m0_rm_incoming_type fomtype)
Definition: rm_foms.c:173
enum m0_rm_remote_state rem_state
Definition: rm.h:748
struct m0_fop * fo_fop
Definition: fom.h:490
uint64_t cr_datum
Definition: rm.h:514
struct m0_fom_domain * fl_dom
Definition: fom.h:256
static struct m0_fop * fop_alloc(enum m0_rm_incoming_type fomtype)
Definition: rm_foms.c:79
static void brw_test_cleanup(void)
Definition: rm_foms.c:248
#define NULL
Definition: misc.h:38
static struct m0_rm_loan * test_loan
Definition: rm_foms.c:47
struct m0_rm_fop_req fr_base
Definition: rm_fops.h:124
struct rm_ctx rm_ctxs[SERVER_NR]
Definition: rmut.c:54
static int revoke_fom_tick(struct m0_fom *)
Definition: rm_foms.c:754
#define ergo(a, b)
Definition: misc.h:293
struct rm_ut_data rm_test_data
Definition: rmut.c:53
static struct m0_sm_group * grp
Definition: bytecount.c:38
static void rm_ctx_init(struct m0_rm_lock_ctx *ctx, struct m0_client *m0c, struct m0_fid *fid)
Definition: obj_lock.c:114
struct m0_sm_group fl_group
Definition: fom.h:274
struct m0_cookie rl_cookie
Definition: rm.h:1110
struct m0_rpc_machine rmc_rpc
struct m0_ut_rpc_mach_ctx rc_rmach_ctx
Definition: rmut.h:129
static void rmfoms_utinit(void)
Definition: rm_foms.c:61
static int revoke_fom_create(struct m0_fop *fop, struct m0_fom **out, struct m0_reqh *reqh)
Definition: rm_foms.c:824
static void fom_create_test(enum m0_rm_incoming_type fomtype, bool err_test)
Definition: rm_foms.c:189
static void rvk_fom_state_test(enum test_type test)
Definition: rm_foms.c:538
struct m0_sm_ast * s_forkq
Definition: sm.h:517
Definition: rmut.h:39
struct m0_rm_owner * rd_owner
Definition: rmut.h:112
void * m0_fop_data(const struct m0_fop *fop)
Definition: fop.c:220
struct m0_rm_fop_credit rrq_credit
Definition: rm_fops.h:92
static int borrow_fom_create(struct m0_fop *fop, struct m0_fom **out, struct m0_reqh *reqh)
Definition: rm_foms.c:807
M0_INTERNAL void m0_rm_remote_init(struct m0_rm_remote *rem, struct m0_rm_resource *res)
Definition: rm.c:1411
uint64_t ro_id
Definition: rm.h:1066
static void brw_fop_populate(struct m0_fom *fom, enum test_type test)
Definition: rm_foms.c:212
void m0_remotes_tlist_add(struct m0_tl *tl, struct m0_rm_remote *rem)
#define container_of(ptr, type, member)
Definition: misc.h:33
struct m0_rm_credit rd_credit
Definition: rmut.h:114
M0_INTERNAL int m0_rm_loan_init(struct m0_rm_loan *loan, const struct m0_rm_credit *credit, struct m0_rm_remote *creditor)
Definition: rm.c:1235
M0_INTERNAL void m0_sm_group_fini(struct m0_sm_group *grp)
Definition: sm.c:65
struct tpool_test test[]
Definition: thread_pool.c:45
m0_fom_phase
Definition: fom.h:372
M0_INTERNAL int m0_rm_credit_encode(struct m0_rm_credit *credit, struct m0_buf *buf)
Definition: rm.c:3350
Definition: rings.h:41
static void brw_fom_state_test(enum test_type test)
Definition: rm_foms.c:308
#define m0_tl_endfor
Definition: tlist.h:700
struct m0_rm_fop_req bo_base
Definition: rm_fops.h:104
M0_INTERNAL void m0_sm_group_unlock(struct m0_sm_group *grp)
Definition: sm.c:96
static void rvk_fom_fini_test(void)
Definition: rm_foms.c:600
struct m0_rm_credit rl_credit
Definition: rm.h:1099
static void rm_ctx_fini(struct m0_ref *ref)
Definition: obj_lock.c:168
static void fom_fini(struct m0_fom *fom, enum m0_rm_incoming_type fomtype)
Definition: rm_foms.c:152
Definition: rmut.h:46
Definition: rings.h:38
void rm_fom_funcs_test(void)
Definition: rm_foms.c:657
struct m0_tl ro_borrowed
Definition: rm.h:1033
#define M0_FID_TINIT(type, container, key)
Definition: fid.h:90
#define m0_tl_teardown(name, head, obj)
Definition: tlist.h:708
static void borrow_fom_fini(struct m0_fom *fom)
Definition: rm_foms.c:816
static struct m0_rpc_machine * machine
Definition: rm_foms.c:50
void rm_utdata_owner_windup_fini(struct rm_ut_data *data)
Definition: rmut.c:81
M0_INTERNAL void m0_sm_group_init(struct m0_sm_group *grp)
Definition: sm.c:53
Definition: rings.h:96
m0_time_t m0_time_now(void)
Definition: time.c:134
Definition: tlist.h:251
struct m0_buf cr_opaque
Definition: rm_fops.h:86
unsigned fl_foms
Definition: fom.h:271
struct m0_tl ro_sublet
Definition: rm.h:1042
static void brw_fom_fini_test(void)
Definition: rm_foms.c:375
static struct m0_fom_locality dummy_loc
Definition: rm_foms.c:45
Definition: reqh.h:94
Definition: dump.c:103
struct m0_reqh rmc_reqh
struct m0_sm_ast * sa_next
Definition: sm.h:509
M0_INTERNAL void m0_buf_free(struct m0_buf *buf)
Definition: buf.c:55
void rm_utdata_init(struct rm_ut_data *data, enum obj_type type)
Definition: rmut.c:96
M0_INTERNAL void m0_fom_sm_init(struct m0_fom *fom)
Definition: fom.c:1674
static void brw_fom_state_validate(struct m0_fom *fom, int32_t rc, enum test_type test)
Definition: rm_foms.c:264
Definition: fom.h:481
M0_INTERNAL int64_t m0_ref_read(const struct m0_ref *ref)
Definition: refs.c:44
M0_INTERNAL void m0_rm_loan_fini(struct m0_rm_loan *loan)
Definition: rm.c:1257
static void rvk_fom_state_validate(struct m0_fom *fom, int32_t rc, enum test_type test)
Definition: rm_foms.c:489
struct m0_reqh reqh
Definition: rm_foms.c:48
#define M0_CNT_INC(cnt)
Definition: arith.h:226
struct m0_ref f_ref
Definition: fop.h:80
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_fom_locality * fo_loc
Definition: fom.h:483
#define M0_ALLOC_PTR(ptr)
Definition: memory.h:86
Definition: list.c:42
bool m0_rm_ur_tlist_is_empty(const struct m0_tl *list)
M0_INTERNAL struct m0_fom_domain * m0_fom_dom(void)
Definition: locality.c:575
void m0_ut_fom_phase_set(struct m0_fom *fom, int phase)
Definition: cs_fop.c:186
static struct m0_rm_remote * remote
Definition: rm_fops.c:35
struct m0_tl ro_owned[OWOS_NR]
Definition: rm.h:1047
m0_rm_incoming_type
Definition: rm.h:247
static void rvk_fop_populate(struct m0_fom *fom)
Definition: rm_foms.c:436
void m0_fop_put_lock(struct m0_fop *fop)
Definition: fop.c:199
static struct m0_fop * fop
Definition: item.c:57
struct m0_fop_type m0_rm_fop_revoke_fopt
Definition: rm_fops.c:75
const struct m0_tl_descr m0_remotes_tl
M0_INTERNAL void m0_sm_group_lock(struct m0_sm_group *grp)
Definition: sm.c:83
static void m0_fi_enable_once(const char *func, const char *tag)
Definition: finject.h:301
M0_INTERNAL void m0_rm_owner_unlock(struct m0_rm_owner *owner)
Definition: rm.c:603
#define M0_UINT128(hi, lo)
Definition: types.h:40
void rings_utdata_ops_set(struct rm_ut_data *data)
Definition: rings.c:375
void m0_remotes_tlist_del(struct m0_rm_remote *rem)
M0_INTERNAL void m0_fom_locality_inc(struct m0_fom *fom)
Definition: fom.c:1295
static void brw_fom_create_test(void)
Definition: rm_foms.c:364
void rm_test_owner_capital_raise(struct m0_rm_owner *owner, struct m0_rm_credit *credit)
Definition: rmut.c:70
struct m0_rm_resource * rd_res
Definition: rmut.h:111
struct m0_cookie rem_cookie
Definition: rm.h:768
M0_INTERNAL void m0_rm_owner_lock(struct m0_rm_owner *owner)
Definition: rm.c:592
uint64_t rl_id
Definition: rm.h:1111
static void borrow_fom_funcs_test(void)
Definition: rm_foms.c:610
M0_INTERNAL void m0_rm_credit_fini(struct m0_rm_credit *credit)
Definition: rm.c:985
static int borrow_fom_tick(struct m0_fom *)
Definition: rm_foms.c:730
test_type
Definition: rm_foms.c:38
static void revoke_fom_funcs_test(void)
Definition: rm_foms.c:634
static void rmfoms_utfini(void)
Definition: rm_foms.c:69
struct m0_fop_type m0_rm_fop_borrow_fopt
Definition: rm_fops.c:67
struct m0_reqh * rs_reqh
Definition: reqh_service.h:259
static void rvk_fom_create_test(void)
Definition: rm_foms.c:588
#define m0_tl_for(name, head, obj)
Definition: tlist.h:695
void m0_free(void *data)
Definition: memory.c:146
static void rvk_test_cleanup(void)
Definition: rm_foms.c:460
int32_t rc
Definition: trigger_fop.h:47
struct m0_reqh_service dummy_svc
Definition: rm_foms.c:46
#define M0_UT_ASSERT(a)
Definition: ut.h:46
static void fom_create(enum m0_rm_incoming_type fomtype, bool err_test, struct m0_fop *fop, struct m0_fom **fom)
Definition: rm_foms.c:112
static void revoke_fom_fini(struct m0_fom *fom)
Definition: rm_foms.c:833
Definition: fop.h:79
static void fop_dealloc(struct m0_fop *fop)
Definition: rm_foms.c:102
struct m0_rm_resource * ro_resource
Definition: rm.h:1015
struct m0_tl r_remotes
Definition: rm.h:315
Definition: rm.h:1156
struct m0_fop * m0_fop_alloc(struct m0_fop_type *fopt, void *data, struct m0_rpc_machine *mach)
Definition: fop.c:96
#define M0_IMPOSSIBLE(fmt,...)