Motr  M0
rm_fops.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/errno.h"
24 #include "lib/memory.h"
25 #include "lib/misc.h"
26 #include "ut/ut.h"
27 #include "rm/rm.h"
28 #include "rm/rm_fops.h"
29 #include "rm/ut/rmut.h"
30 #include "rm/ut/rings.h"
31 #include "rm/rm_internal.h" /* m0_rm_outgoing_fini */
32 #include "rm/rm_fops.c" /* To access static APIs. */
33 
34 static struct m0_rm_loan *test_loan;
35 static struct m0_rm_remote *remote;
36 static struct m0_rpc_machine ut_rm_mach;
37 
38 static void post_borrow_validate(int err);
39 static void borrow_reply_populate(struct m0_rm_fop_borrow_rep *breply,
40  int err);
41 static void post_borrow_cleanup(struct m0_rpc_item *item, int err);
42 static void borrow_fop_validate(struct m0_rm_fop_borrow *bfop);
43 static void post_revoke_validate(int err);
44 static void revoke_fop_validate(struct m0_rm_fop_revoke *rfop);
45 static void post_revoke_cleanup(struct m0_rpc_item *item, int err);
46 static void revoke_reply_populate(struct m0_fop_generic_reply *rreply,
47  int err);
48 
49 /*
50  *****************
51  * Common test functions for test cases in this file.
52  ******************
53  */
54 
55 /*
56  * Prepare parameters (request) for testing RM-FOP-send functions.
57  */
59 {
63 
67 
72 
79  /* Never destroy creditors by loans. */
90 }
91 
92 /*
93  * Finalise parameters (request) parameters for testing RM-FOP-send functions.
94  */
95 static void request_param_fini(void)
96 {
97  if (test_loan != NULL)
103 }
104 
105 /*
106  * Validate local wait/try flags for RM FOP
107  */
108 static void wait_try_flags_validate(uint64_t orig_flags,
109  uint64_t rm_fop_flags)
110 {
111  if (orig_flags & RIF_LOCAL_WAIT) {
112  M0_UT_ASSERT(rm_fop_flags & RIF_LOCAL_WAIT);
113  M0_UT_ASSERT(!(rm_fop_flags & RIF_LOCAL_TRY));
114  } else if (orig_flags & RIF_LOCAL_TRY) {
115  M0_UT_ASSERT(!(rm_fop_flags & RIF_LOCAL_WAIT));
116  M0_UT_ASSERT(rm_fop_flags & RIF_LOCAL_TRY);
117  } else {
118  M0_UT_ASSERT(rm_fop_flags & RIF_LOCAL_WAIT);
119  M0_UT_ASSERT(!(rm_fop_flags & RIF_LOCAL_TRY));
120  }
121 }
122 
123 /*
124  * Validate FOP and other data structures after RM-FOP-send function is called.
125  */
126 static void rm_req_fop_validate(enum m0_rm_incoming_type reqtype)
127 {
128  struct m0_rm_fop_borrow *bfop;
129  struct m0_rm_fop_revoke *rfop;
130  struct m0_rm_pin *pin;
131  struct m0_rm_loan *loan;
132  struct m0_rm_outgoing *og;
133  struct rm_out *oreq;
134  uint32_t pins_nr = 0;
135 
137 
139  loan = bob_of(pin->rp_credit, struct m0_rm_loan,
140  rl_credit, &loan_bob);
141  og = container_of(loan, struct m0_rm_outgoing, rog_want);
142  oreq = container_of(og, struct rm_out, ou_req);
143 
144  switch (reqtype) {
145  case M0_RIT_BORROW:
146  bfop = m0_fop_data(&oreq->ou_fop);
147  borrow_fop_validate(bfop);
148  break;
149  case M0_RIT_REVOKE:
150  rfop = m0_fop_data(&oreq->ou_fop);
151  revoke_fop_validate(rfop);
152  break;
153  default:
154  break;
155  }
156  m0_rm_ur_tlist_del(pin->rp_credit);
157  pi_tlink_del_fini(pin);
158  pr_tlink_del_fini(pin);
159  m0_free(pin);
160  m0_rm_outgoing_fini(&oreq->ou_req);
161  rm_fop_release(&oreq->ou_fop.f_ref);
162  ++pins_nr;
163  } m0_tl_endfor;
164  M0_UT_ASSERT(pins_nr == 1);
165 }
166 
167 /*
168  * Create reply for each FOP.
169  */
170 static struct m0_rpc_item *rm_reply_create(enum m0_rm_incoming_type reqtype,
171  int err)
172 {
173  struct m0_fop_generic_reply *rreply;
174  struct m0_rm_fop_borrow_rep *breply;
175  struct m0_fop_type *fopt = NULL;
176  struct m0_fop *fop;
177  struct m0_rm_pin *pin;
178  struct m0_rm_loan *loan;
179  struct m0_rm_outgoing *og;
180  struct m0_rpc_item *item = NULL;
181  struct m0_rm_owner *owner;
182  struct rm_out *oreq;
183  uint32_t pins_nr = 0;
184 
186 
188  loan = bob_of(pin->rp_credit, struct m0_rm_loan,
189  rl_credit, &loan_bob);
190  og = container_of(loan, struct m0_rm_outgoing, rog_want);
191  oreq = container_of(og, struct rm_out, ou_req);
192 
193  switch (reqtype) {
194  case M0_RIT_BORROW:
196  break;
197  case M0_RIT_REVOKE:
199  break;
200  default:
201  break;
202  }
203  fop = m0_fop_alloc(fopt, NULL, &ut_rm_mach);
204  M0_UT_ASSERT(fop != NULL);
205  item = &oreq->ou_fop.f_item;
206  switch (reqtype) {
207  case M0_RIT_BORROW:
208  breply = m0_fop_data(fop);
209  borrow_reply_populate(breply, err);
210  item->ri_reply = &fop->f_item;
212  break;
213  case M0_RIT_REVOKE:
214  rreply = m0_fop_data(fop);
215  revoke_reply_populate(rreply, err);
216  item->ri_reply = &fop->f_item;
218  break;
219  default:
220  break;
221  }
222  owner = og->rog_want.rl_credit.cr_owner;
223  /* Delete the pin so that owner_balance() does not process it */
224  m0_rm_owner_lock(owner);
225  pi_tlink_del_fini(pin);
226  pr_tlink_del_fini(pin);
227  m0_rm_owner_unlock(owner);
228  m0_free(pin);
229  ++pins_nr;
230  } m0_tl_endfor;
231  M0_UT_ASSERT(pins_nr == 1);
232 
233  return item;
234 }
235 
236 /*
237  * Test a reply FOP.
238  */
239 static void reply_test(enum m0_rm_incoming_type reqtype, int err)
240 {
241  struct m0_rpc_item *item;
242  struct m0_rm_remote *other;
243  int rc;
244 
246 
247  m0_fi_enable_once("m0_rm_outgoing_send", "no-rpc");
248  switch (reqtype) {
249  case M0_RIT_BORROW:
253  &rm_test_data.rd_credit, other);
254  M0_UT_ASSERT(rc == 0);
257  /* Lock and unlock the owner to run AST */
262  break;
263  case M0_RIT_REVOKE:
267  remote);
268  M0_UT_ASSERT(rc == 0);
271  m0_rm_ur_tlist_add(&rm_test_data.rd_owner->ro_sublet,
272  &test_loan->rl_credit);
275  /* Lock and unlock the owner to run AST */
280  /*
281  * When revoke succeeds, loan is de-allocated through
282  * revoke_reply(). If revoke fails, post_revoke_cleanup(),
283  * de-allocates the loan. Set test_loan to NULL. Otherwise,
284  * it will result in double free().
285  */
286  test_loan = NULL;
287  break;
288  default:
289  M0_IMPOSSIBLE("Invalid RM-FOM type");
290  }
291 
293 }
294 
295 /*
296  * Test a request FOP.
297  */
298 static void request_test(enum m0_rm_incoming_type reqtype)
299 {
300  struct m0_rm_credit rest;
302  int rc;
303  int i;
304 
305  for (i = 0; i < ARRAY_SIZE(flags); i++) {
307 
308  m0_fi_enable_once("m0_rm_outgoing_send", "no-rpc");
310  rc = rest.cr_ops->cro_copy(&rest, &rm_test_data.rd_credit);
311  M0_UT_ASSERT(rc == 0);
312  switch (reqtype) {
313  case M0_RIT_BORROW:
317  &rest, remote);
318  break;
319  case M0_RIT_REVOKE:
323  test_loan, &rest, remote);
324  break;
325  default:
326  M0_IMPOSSIBLE("Invalid RM-FOM type");
327  }
328  M0_UT_ASSERT(rc == 0);
329  m0_rm_credit_fini(&rest);
330 
331  rm_req_fop_validate(reqtype);
333  }
334 }
335 
336 /*
337  *****************
338  * RM Borrow-FOP test functions
339  ******************
340  */
341 /*
342  * Validates the owner lists after receiving BORROW-reply.
343  */
344 static void post_borrow_validate(int err)
345 {
346  bool got_credit;
347 
349  got_credit = !m0_rm_ur_tlist_is_empty(
354  M0_UT_ASSERT(ergo(err, !got_credit));
355  M0_UT_ASSERT(ergo(err == 0, got_credit));
356 }
357 
358 static void borrow_reply_populate(struct m0_rm_fop_borrow_rep *breply,
359  int err)
360 {
361  int rc;
362 
363  breply->br_rc = err;
364 
365  if (err == 0) {
367  &breply->br_credit.cr_opaque);
368  M0_UT_ASSERT(rc == 0);
369  }
370 }
371 
372 static void post_borrow_cleanup(struct m0_rpc_item *item, int err)
373 {
374  struct m0_rm_credit *credit;
375  struct m0_rm_loan *loan;
376  struct rm_out *outreq;
377 
378  outreq = container_of(m0_rpc_item_to_fop(item), struct rm_out, ou_fop);
379  loan = &outreq->ou_req.rog_want;
380  /*
381  * A borrow error leaves the owner lists unaffected.
382  * If borrow succeeds, the owner lists are updated. Hence they
383  * need to be cleaned-up.
384  */
385  if (err)
386  return;
387 
390  credit) {
391  m0_rm_ur_tlink_del_fini(credit);
392  m0_rm_credit_fini(credit);
393  m0_free(credit);
394  } m0_tl_endfor;
395 
396  m0_tl_for(m0_rm_ur, &rm_test_data.rd_owner->ro_borrowed, credit) {
397  m0_rm_ur_tlink_del_fini(credit);
398  loan = bob_of(credit, struct m0_rm_loan, rl_credit, &loan_bob);
399  m0_rm_loan_fini(loan);
400  m0_free(loan);
401  } m0_tl_endfor;
403 }
404 
405 /*
406  * Check if m0_rm_request_out() has filled the FOP correctly
407  */
408 static void borrow_fop_validate(struct m0_rm_fop_borrow *bfop)
409 {
410  struct m0_rm_owner *owner;
411  struct m0_rm_credit credit;
412  int rc;
413 
414  owner = m0_cookie_of(&bfop->bo_base.rrq_owner.ow_cookie,
415  struct m0_rm_owner, ro_id);
416 
417  M0_UT_ASSERT(owner != NULL);
419 
421  credit.cr_ops = &rings_credit_ops;
423  M0_UT_ASSERT(rc == 0);
425  m0_rm_credit_fini(&credit);
426 
430  bfop->bo_base.rrq_flags);
432 }
433 
434 /*
435  * Test function for m0_rm_request_out() for BORROW FOP.
436  */
437 static void borrow_request_test(void)
438 {
440 }
441 
442 /*
443  * Test function for borrow_reply().
444  */
445 static void borrow_reply_test(void)
446 {
447  /* 1. Test borrow-success */
449 
450  /* 2. Test borrow-failure */
451  reply_test(M0_RIT_BORROW, -ETIMEDOUT);
452 }
453 
454 /*
455  *****************
456  * RM Revoke-FOM test functions
457  ******************
458  */
459 /*
460  * Validates the owner lists after receiving REVOKE-reply.
461  */
462 static void post_revoke_validate(int err)
463 {
464  bool sublet;
465  bool owned;
466 
469  owned = !m0_rm_ur_tlist_is_empty(
472 
473  /* If revoke fails, credit remains in sublet list */
474  M0_UT_ASSERT(ergo(err, sublet && !owned));
475  /* If revoke succeeds, credit will be the part of cached list*/
476  M0_UT_ASSERT(ergo(err == 0, owned && !sublet));
477 }
478 
479 /*
480  * Check if m0_rm_request_out() has filled the FOP correctly
481  */
482 static void revoke_fop_validate(struct m0_rm_fop_revoke *rfop)
483 {
484  struct m0_rm_owner *owner;
485  struct m0_rm_credit credit;
486  struct m0_rm_loan *loan;
487  int rc;
488 
489  owner = m0_cookie_of(&rfop->fr_base.rrq_owner.ow_cookie,
490  struct m0_rm_owner, ro_id);
491 
492  M0_UT_ASSERT(owner != NULL);
494 
495  loan = m0_cookie_of(&rfop->fr_loan.lo_cookie, struct m0_rm_loan, rl_id);
496  M0_UT_ASSERT(loan != NULL);
497  M0_UT_ASSERT(loan == test_loan);
498 
500  credit.cr_ops = &rings_credit_ops;
502  M0_UT_ASSERT(rc == 0);
504  m0_rm_credit_fini(&credit);
505 
509  rfop->fr_base.rrq_flags);
511 }
512 
513 static void post_revoke_cleanup(struct m0_rpc_item *item, int err)
514 {
515  struct m0_rm_credit *credit;
516  struct m0_rm_loan *loan;
517 
518  /*
519  * After a successful revoke, sublet credit is transferred to
520  * OWOS_CACHED. Otherwise it remains in the sublet list.
521  * Clean up the lists.
522  */
524  if (err == 0) {
525  m0_tl_for(m0_rm_ur,
527  credit) {
528  m0_rm_ur_tlink_del_fini(credit);
529  m0_rm_credit_fini(credit);
530  m0_free(credit);
531  } m0_tl_endfor;
532  } else {
533  m0_tl_for(m0_rm_ur, &rm_test_data.rd_owner->ro_sublet, credit) {
534  m0_rm_ur_tlink_del_fini(credit);
535  loan = bob_of(credit, struct m0_rm_loan,
536  rl_credit, &loan_bob);
537  m0_rm_loan_fini(loan);
538  m0_free(loan);
539  } m0_tl_endfor;
540  }
542 }
543 
544 static void revoke_reply_populate(struct m0_fop_generic_reply *rreply,
545  int err)
546 {
547  rreply->gr_rc = err;
548 }
549 
550 /*
551  * Test function for m0_rm_request_out() for REVOKE FOP.
552  */
553 static void revoke_request_test(void)
554 {
556 }
557 
558 /*
559  * Test function for revoke_reply().
560  */
561 static void revoke_reply_test(void)
562 {
563  /* 1. Test revoke-success */
565 
566  /* 2. Test revoke-failure */
567  reply_test(M0_RIT_REVOKE, -ETIMEDOUT);
568 }
569 
570 /*
571  *****************
572  * Top level test functions
573  ******************
574  */
575 static void borrow_fop_funcs_test(void)
576 {
577  /* Initialise hierarchy of RM objects with rings resource */
580 
581  /* 1. Test m0_rm_request_out() - sending BORROW FOP */
583 
584  /* 2. Test borrow_reply() - reply for BORROW FOP */
586 
588 }
589 
590 static void revoke_fop_funcs_test(void)
591 {
592  /* Initialise hierarchy of RM objects with rings resource */
595 
596  /* 1. Test m0_rm_request_out() - sending REVOKE FOP */
598 
599  /* 2. Test revoke_reply() - reply for REVOKE FOP */
601 
603 }
604 
606 {
611 }
612 
613 /*
614  * Local variables:
615  * c-indentation-style: "K&R"
616  * c-basic-offset: 8
617  * tab-width: 8
618  * fill-column: 80
619  * scroll-step: 1
620  * End:
621  */
const struct m0_rm_credit_ops * cr_ops
Definition: rm.h:502
M0_INTERNAL int m0_rm_request_out(enum m0_rm_outgoing_type otype, struct m0_rm_incoming *in, struct m0_rm_loan *loan, struct m0_rm_credit *credit, struct m0_rm_remote *other)
Definition: rm_fops.c:354
static void request_param_fini(void)
Definition: rm_fops.c:95
static void wait_try_flags_validate(uint64_t orig_flags, uint64_t rm_fop_flags)
Definition: rm_fops.c:108
struct m0_rm_fop_credit br_credit
Definition: rm_fops.h:112
static void rm_fop_release(struct m0_ref *ref)
Definition: rm_fops.c:129
static void borrow_fop_validate(struct m0_rm_fop_borrow *bfop)
Definition: rm_fops.c:408
struct m0_rm_fop_owner rrq_owner
Definition: rm_fops.h:91
int const char const void size_t int flags
Definition: dir.c:328
uint64_t cr_datum
Definition: rm.h:514
#define NULL
Definition: misc.h:38
struct m0_rm_fop_req fr_base
Definition: rm_fops.h:124
struct m0_rm_remote * ro_creditor
Definition: rm.h:1026
#define ergo(a, b)
Definition: misc.h:293
struct rm_ut_data rm_test_data
Definition: rmut.c:53
M0_INTERNAL int m0_rm_credit_decode(struct m0_rm_credit *credit, struct m0_buf *buf)
Definition: rm.c:3376
static struct m0_rm_loan * test_loan
Definition: rm_fops.c:34
struct m0_cookie rl_cookie
Definition: rm.h:1110
M0_INTERNAL const struct m0_bob_type loan_bob
Definition: rm.c:179
const struct m0_rm_credit_ops rings_credit_ops
Definition: rings.c:272
const struct m0_rm_incoming_ops rings_incoming_ops
Definition: rings.c:296
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
uint64_t rrq_flags
Definition: rm_fops.h:94
struct m0_fop_type m0_rm_fop_borrow_rep_fopt
Definition: rm_fops.c:68
struct m0_rm_fop_credit rrq_credit
Definition: rm_fops.h:92
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 revoke_fop_validate(struct m0_rm_fop_revoke *rfop)
Definition: rm_fops.c:482
static void borrow_request_test(void)
Definition: rm_fops.c:437
#define container_of(ptr, type, member)
Definition: misc.h:33
struct m0_rm_credit rin_want
Definition: rm.h:1450
#define M0_SET0(obj)
Definition: misc.h:64
static void borrow_reply_test(void)
Definition: rm_fops.c:445
int(* cro_copy)(struct m0_rm_credit *dst, const struct m0_rm_credit *self)
Definition: rm.h:666
static void request_test(enum m0_rm_incoming_type reqtype)
Definition: rm_fops.c:298
struct m0_rm_credit rd_credit
Definition: rmut.h:114
static struct m0_rpc_item * item
Definition: item.c:56
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
static void rm_req_fop_validate(enum m0_rm_incoming_type reqtype)
Definition: rm_fops.c:126
static void revoke_request_test(void)
Definition: rm_fops.c:553
M0_INTERNAL void m0_sm_group_fini(struct m0_sm_group *grp)
Definition: sm.c:65
M0_INTERNAL int m0_rm_credit_encode(struct m0_rm_credit *credit, struct m0_buf *buf)
Definition: rm.c:3350
struct m0_rm_owner * cr_owner
Definition: rm.h:501
struct m0_sm_group rm_sm_grp
Definition: rpc_machine.h:82
#define m0_tl_endfor
Definition: tlist.h:700
struct m0_cookie lo_cookie
Definition: rm_fops.h:82
static void revoke_fop_funcs_test(void)
Definition: rm_fops.c:590
struct m0_rm_fop_req bo_base
Definition: rm_fops.h:104
m0_rm_incoming_flags
Definition: rm.h:1183
struct m0_rm_credit rl_credit
Definition: rm.h:1099
int i
Definition: dir.c:1033
M0_INTERNAL void m0_ref_get(struct m0_ref *ref)
Definition: refs.c:32
struct m0_rm_credit * rp_credit
Definition: rm.h:1677
Definition: rings.h:38
struct m0_tl ro_borrowed
Definition: rm.h:1033
M0_INTERNAL void m0_rm_incoming_init(struct m0_rm_incoming *in, struct m0_rm_owner *owner, enum m0_rm_incoming_type type, enum m0_rm_incoming_policy policy, uint64_t flags)
Definition: rm.c:1060
static void borrow_reply_populate(struct m0_rm_fop_borrow_rep *breply, int err)
Definition: rm_fops.c:358
void rm_utdata_owner_windup_fini(struct rm_ut_data *data)
Definition: rmut.c:81
#define m0_free0(pptr)
Definition: memory.h:77
Definition: rm_fops.c:46
M0_INTERNAL void m0_sm_group_init(struct m0_sm_group *grp)
Definition: sm.c:53
struct m0_buf cr_opaque
Definition: rm_fops.h:86
struct m0_tl ro_sublet
Definition: rm.h:1042
#define bob_of(ptr, type, field, bt)
Definition: bob.h:140
static void request_param_init(enum m0_rm_incoming_flags flags)
Definition: rm_fops.c:58
const struct m0_rm_incoming_ops * rin_ops
Definition: rm.h:1471
static void post_revoke_cleanup(struct m0_rpc_item *item, int err)
Definition: rm_fops.c:513
struct m0_rpc_item * ri_reply
Definition: item.h:163
struct m0_pdclust_instance pi
Definition: fd.c:107
static void reply_test(enum m0_rm_incoming_type reqtype, int err)
Definition: rm_fops.c:239
struct m0_cookie ow_cookie
Definition: rm_fops.h:77
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
static void borrow_fop_funcs_test(void)
Definition: rm_fops.c:575
struct m0_fop_type m0_fop_generic_reply_fopt
Definition: fom_generic.c:50
struct m0_rm_fop_loan fr_loan
Definition: rm_fops.h:125
static void post_revoke_validate(int err)
Definition: rm_fops.c:462
M0_INTERNAL void m0_rm_loan_fini(struct m0_rm_loan *loan)
Definition: rm.c:1257
void rm_fop_funcs_test(void)
Definition: rm_fops.c:605
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
static void rm_reply_process(struct m0_rpc_item *item)
Definition: rm_fops.c:526
static void post_borrow_cleanup(struct m0_rpc_item *item, int err)
Definition: rm_fops.c:372
#define M0_ALLOC_PTR(ptr)
Definition: memory.h:86
static void revoke_reply_populate(struct m0_fop_generic_reply *rreply, int err)
Definition: rm_fops.c:544
bool m0_rm_ur_tlist_is_empty(const struct m0_tl *list)
uint64_t rin_flags
Definition: rm.h:1448
static void post_borrow_validate(int err)
Definition: rm_fops.c:344
static struct m0_rm_remote * remote
Definition: rm_fops.c:35
uint32_t rp_flags
Definition: rm.h:1676
struct m0_tl ro_owned[OWOS_NR]
Definition: rm.h:1047
m0_rm_incoming_type
Definition: rm.h:247
static struct m0_fop * fop
Definition: item.c:57
struct m0_fop * m0_rpc_item_to_fop(const struct m0_rpc_item *item)
Definition: fop.c:346
static void m0_fi_enable_once(const char *func, const char *tag)
Definition: finject.h:301
struct m0_rm_incoming rd_in
Definition: rmut.h:113
M0_INTERNAL void m0_rm_owner_unlock(struct m0_rm_owner *owner)
Definition: rm.c:603
struct m0_ref rem_refcnt
Definition: rm.h:781
struct m0_tl rin_pins
Definition: rm.h:1466
void rings_utdata_ops_set(struct rm_ut_data *data)
Definition: rings.c:375
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
static struct m0_rpc_machine ut_rm_mach
Definition: rm_fops.c:36
uint64_t rl_id
Definition: rm.h:1111
static struct m0_rpc_item * rm_reply_create(enum m0_rm_incoming_type reqtype, int err)
Definition: rm_fops.c:170
M0_INTERNAL void m0_rm_credit_fini(struct m0_rm_credit *credit)
Definition: rm.c:985
struct m0_rpc_machine * ri_rmachine
Definition: item.h:160
#define m0_tl_for(name, head, obj)
Definition: tlist.h:695
void m0_free(void *data)
Definition: memory.c:146
struct m0_rpc_item f_item
Definition: fop.h:83
static void revoke_reply_test(void)
Definition: rm_fops.c:561
int32_t rc
Definition: trigger_fop.h:47
Definition: rm.h:1675
#define ARRAY_SIZE(a)
Definition: misc.h:45
#define M0_UT_ASSERT(a)
Definition: ut.h:46
struct m0_rm_loan rog_want
Definition: rm.h:1550
Definition: fop.h:79
uint64_t rrq_policy
Definition: rm_fops.h:93
struct m0_fop ou_fop
Definition: rm_fops.c:49
struct m0_rm_outgoing ou_req
Definition: rm_fops.c:47
struct m0_rm_resource * ro_resource
Definition: rm.h:1015
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
M0_INTERNAL void m0_rm_outgoing_fini(struct m0_rm_outgoing *out)
Definition: rm.c:1166
#define M0_IMPOSSIBLE(fmt,...)