Motr  M0
sync.c
Go to the documentation of this file.
1 /* -*- C -*- */
2 /*
3  * Copyright (c) 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  * Production code : m0t1fs/linux_kernel/f{ile,sync}.c
25  * UT code : m0t1fs/linux_kernel/ut/fsync.c
26  *
27  * The production code is added this way to build motr kernel module.
28  * Both production code and UT code are part of Motr kernel module
29  * but production code file is not directly added to Makefile as a file
30  * that needs to be compiled.
31  * Instead, UT code is added in Makefile for motr kernel module build
32  * which subsequently adds production code file to motr kernel module.
33  */
34 
35 #include "ut/ut.h" /* m0_test_suite */
36 #include "lib/tlist.h"
37 #include "lib/hash.h"
38 #include "mdservice/fsync_fops.h" /* m0_fop_fsync_mds_fopt */
39 #include "lib/misc.h" /* M0_SET0() */
40 #include "reqh/reqh_service.h" /* m0_reqh_service_txid */
41 
42 #include "motr/ut/client.h"
43 #include "motr/client_internal.h"
44 #include "motr/sync.h" /* sync_interactions */
45 #include "motr/sync.c"
46 
48 
49 /* counters to indicate how many times each sub is/was called */
50 static int ut_post_rpc_count = 0;
51 static int ut_wait_for_reply_count = 0;
52 static int ut_fop_fini_count = 0;
53 
54 /* values for control the behaviour of stub functions */
55 static int ut_post_rpc_delay = 0;
56 static int ut_post_rpc_early_return = -EINVAL;
57 static int ut_post_rpc_return = -EINVAL;
58 static int ut_wait_for_reply_return = -EINVAL;
60 
61 /* The reply fop, set in ut_wait_for_reply */
62 static struct m0_fop reply_fop;
63 
64 /* The reply data */
66 
67 /* The fake sync request and target. */
68 static struct sync_request sreq;
69 static struct sync_target stgt;
70 
71 /* The fake records that need fsycning */
72 #define NUM_STRECORDS 10
75 
76 /* copy of the fsync interactions -
77  * used to restore the original function pointers */
78 static struct sync_interactions copy;
79 
80 /* The fake object we try to fsync against */
81 static struct m0_obj obj;
82 
83 /* The fake client instance we fsync against */
84 static struct m0_client cinst;
85 
86 /* The fake client realm */
87 static struct m0_realm realm;
88 
89 /* A fake rpc connection. */
90 static struct m0_rpc_conn conn = { .c_rpc_machine = (void*)1 };
91 
92 /* A fake serivce context for fsync to send rpc to */
94 
95 static int ut_post_rpc(struct m0_rpc_item *item)
96 {
98 
99  /* Check this item came in with the 'right' session */
101 
102  /* After a certain point, change our return value */
105  else
106  return ut_post_rpc_return;
107 }
108 
110 {
111  struct m0_fop *request_fop;
112  struct m0_fop_fsync *request_data;
113 
115 
116  /* Make sure we received a valid reply */
117  M0_ASSERT(item != NULL);
118 
119  /* fop/reply are dealt with serially, so we can use the same object
120  * as a reply every time */
122 
123  request_fop = m0_rpc_item_to_fop(item);
124  M0_ASSERT(request_fop != NULL);
125  request_data = m0_fop_data(request_fop);
126  M0_UT_ASSERT(request_data != NULL);
128  reply_data.ffr_be_remid = request_data->ff_be_remid;
129 
131 
133 }
134 
140 static void ut_fop_fini(struct m0_fop *fop)
141 {
143 
144  if (fop->f_data.fd_data != &reply_data && fop->f_data.fd_data != NULL)
146  fop->f_data.fd_data = NULL;
147 }
148 
152 static void ut_reset_stub_counters(void)
153 {
154  ut_post_rpc_count = 0;
156  ut_fop_fini_count = 0;
157 
158  /* Ensure early/late behaviour does nothing for ut_post_rpc */
159  ut_post_rpc_delay = 0;
160 }
161 
167 static void fake_setup(void)
168 {
169  int i = 0;
170 
171  M0_SET0(&obj);
172  M0_SET0(&realm);
173  M0_SET0(&service);
174  M0_SET0(&stx);
175 
180  spti_tlist_init(&obj.ob_entity.en_pending_tx);
181 
183  service.sc_type = M0_CST_IOS;
186 
187  /* Add some records that need syncing
188  * This creates @10 records, all for the same service that need
189  * syncing. This would never happen in reality.
190  * sync_record_update will only ever update the first service it
191  * finds, assuming that there are no duplicates.
192  */
193  for (i = 0; i < NUM_STRECORDS; i++) {
194  m0_tlink_init(&spti_tl, &stx[i]);
195  stx[i].stx_tri.tri_txid = 3;
196  stx[i].stx_tri.tri_locality = 7;
198  spti_tlist_add(&obj.ob_entity.en_pending_tx, &stx[i]);
199  }
200 
201  /* Add the object and build stx list in the sync list.*/
202  M0_SET0(&sreq);
203  spf_tlist_init(&sreq.sr_fops);
204  spti_tlist_init(&sreq.sr_stxs);
205  sync_target_tlist_init(&sreq.sr_targets);
207 
210  sync_target_tlink_init_at(&stgt, &sreq.sr_targets);
211 
212  for (i = 0; i < NUM_STRECORDS; i++) {
213  m0_tlink_init(&spti_tl, &sreq_stx[i]);
214  sreq_stx[i].stx_tri.tri_txid = 3;
217  spti_tlist_add(&sreq.sr_stxs, &sreq_stx[i]);
218  }
219 }
220 
225 {
226  int rv;
227  struct sync_fop_wrapper *sfw;
228  struct m0_reqh_service_txid stx;
229  struct m0_fop_fsync *ffd;
230 
231  fake_setup();
232 
233  M0_SET0(&stx);
234  M0_SET0(&copy);
235 
236  /* Copy the fsync_interactions struct so that we can restore it to
237  * default values later */
238  copy = si;
239 
240  /* we need to override post rpc and fop_fini */
244 
245  /* Test the values get packed into the fop correctly */
247  ut_post_rpc_return = 0;
249  stx.stx_tri.tri_txid = 4000ULL;
250  stx.stx_tri.tri_locality = 11;
252  M0_FSYNC_MODE_ACTIVE, false, &sfw);
253  M0_UT_ASSERT(rv == 0);
254  ffd = m0_fop_data(&sfw->sfw_fop);
255  M0_UT_ASSERT(ffd != NULL);
260 
261  /* reset anything that got initalised */
262  m0_fop_fini(&sfw->sfw_fop);
263  m0_free(sfw);
264  M0_SET0(&stx);
265 
266  /* cause post_rpc to fail */
268  ut_post_rpc_return = -EINVAL;
270  stx.stx_tri.tri_txid = 4000ULL;
271  stx.stx_tri.tri_locality = 99;
273  M0_FSYNC_MODE_ACTIVE, false, &sfw);
276 
277  /* Restore the fsync_interactions struct */
278  si = copy;
279 }
280 
281 int default_txid = 42;
283 
284 void
286  struct sync_fop_wrapper *sfw,
287  struct m0_reqh_service_txid *stx)
288 {
289  struct m0_fop_fsync *ffd;
290 
291  /* Initialise the fops */
293  m0_fop_data_alloc(&sfw->sfw_fop);
294  ffd = m0_fop_data(&sfw->sfw_fop);
295  M0_UT_ASSERT(ffd != NULL);
302  reply_data.ffr_rc = 0;
305  sfw->sfw_stx = stx;
306 }
307 
308 
309 void
310 call_sync_reply_wait(struct m0_client *input_cinst,
311  struct m0_obj *input_obj,
312  struct sync_fop_wrapper *input_sfw,
313  int expect_return,
314  int expect_ut_wait_for_reply_count,
315  int expect_ut_fop_fini_count,
316  uint64_t expect_txid,
317  size_t expect_locality)
318 {
319  int rv;
320 
321  input_sfw->sfw_req = &sreq;
322  rv = sync_reply_wait(input_sfw);
323  M0_UT_ASSERT(rv == expect_return);
324  M0_UT_ASSERT(ut_wait_for_reply_count == expect_ut_wait_for_reply_count);
325  M0_UT_ASSERT(ut_fop_fini_count == expect_ut_fop_fini_count);
326  M0_UT_ASSERT(input_sfw->sfw_stx->stx_tri.tri_txid == expect_txid);
328  expect_locality);
329 }
330 
335 {
336  struct m0_reqh_service_txid *iter;
337  struct sync_fop_wrapper sfw;
338  struct m0_reqh_service_txid stx;
339  struct m0_fop_fsync *ffd;
340 
341  fake_setup();
342 
343  M0_SET0(&sfw);
344  M0_SET0(&stx);
345  M0_SET0(&ffd);
346  M0_SET0(&copy);
347 
348  /* Copy the fsync_interactions struct so that we can restore it to
349  * default values later */
350  copy = si;
351 
352  /* we need to override wait for reply and fop_fini */
356 
357  /* Initialise the fops */
359 
360  /* wait for reply fails */
362  ut_wait_for_reply_return = -EINVAL;
364  call_sync_reply_wait(NULL, &obj, &sfw,
366  1, 1, default_txid,
368 
369  /* remote fop fails */
374  call_sync_reply_wait(NULL, &obj, &sfw,
377 
378  /* inode:transaction-to-sync increased while fop was in flight */
379  /* super block record should still be updated - this can happen
380  * when the inode has been updated, and we raced to get the super_block
381  * lock before the thread updating the inode */
383  ffd = m0_fop_data(&sfw.sfw_fop);
384  M0_UT_ASSERT(ffd != NULL);
385  ffd->ff_be_remid.tri_txid = 42;
386  stx.stx_tri.tri_txid = 50;
388  reply_data.ffr_rc = 0;
391  iter = &service.sc_max_pending_tx;
392  iter->stx_tri.tri_txid = 42;
397  call_sync_reply_wait(NULL, &obj, &sfw, 0,
398  1, 1, 50, 2);
399  /* Check superblock record was updated */
401  iter = &service.sc_max_pending_tx;
402  M0_UT_ASSERT(iter->stx_tri.tri_txid == 0);
403  M0_UT_ASSERT(iter->stx_tri.tri_locality == 0);
405 
406  /*
407  * Client instance: transaction-to-sync increased while fop
408  * was in flight.
409  */
410  /*
411  * As sfw->sfw_stx stores stx that is merged from all involved
412  * targets, client updates stx's of targets only, not the one
413  * sfw->sfw_stx.
414  */
416  ffd = m0_fop_data(&sfw.sfw_fop);
417  M0_UT_ASSERT(ffd != NULL);
418  ffd->ff_be_remid.tri_txid = 42;
419  stx.stx_tri.tri_txid = 42;
421  reply_data.ffr_rc = 0;
424  iter = &service.sc_max_pending_tx;
425  iter->stx_tri.tri_txid = 50;
426  iter->stx_tri.tri_locality = 81;
431  call_sync_reply_wait(NULL, &obj, &sfw, 0, 1, 1, 0, 0);
432  /* Check superblock record was not updated */
434  iter = &service.sc_max_pending_tx;
435  M0_UT_ASSERT(iter->stx_tri.tri_txid != 0);
436  M0_UT_ASSERT(iter->stx_tri.tri_locality != 0);
438 
439  /* transaction-to-sync set to 0 on success */
441  ffd = m0_fop_data(&sfw.sfw_fop);
442  M0_UT_ASSERT(ffd != NULL);
443  ffd->ff_be_remid.tri_txid = 42;
444  stx.stx_tri.tri_txid = 42;
445  stx.stx_tri.tri_locality = 12;
446  reply_data.ffr_rc = 0;
449  iter = &service.sc_max_pending_tx;
450  iter->stx_tri.tri_txid = 42;
451  iter->stx_tri.tri_locality = 12;
453 
457  call_sync_reply_wait(NULL, &obj, &sfw, 0, 1, 1, 0, 0);
458  /* Check superblock record was updated */
460  iter = &service.sc_max_pending_tx;
461  M0_UT_ASSERT(iter->stx_tri.tri_txid == 0);
462  M0_UT_ASSERT(iter->stx_tri.tri_locality == 0);
464 
465  /* Restore the fsync_interactions struct */
466  si = copy;
467 }
468 
473 {
474  struct m0_reqh_service_txid *iter;
475  struct m0_be_tx_remid btr;
476 
477  fake_setup();
478 
479  /* test the inode record is updated */
480  btr.tri_txid = 50;
481  btr.tri_locality = 3;
483  /* test the first record was updated */
484  M0_UT_ASSERT(stx[NUM_STRECORDS-1].stx_tri.tri_txid == 50ULL);
485  /* check later records were not updated */
486  M0_UT_ASSERT(stx[0].stx_tri.tri_txid != 50ULL);
487  M0_UT_ASSERT(stx[0].stx_tri.tri_locality != 3);
488 
489  /* test the sb record is updated */
491  iter = &service.sc_max_pending_tx;
493  btr.tri_txid = 999;
494  btr.tri_locality = 18;
496  M0_UT_ASSERT(iter->stx_tri.tri_txid == 999ULL);
497  M0_UT_ASSERT(iter->stx_tri.tri_locality == 18);
498 }
499 
501  struct m0_obj *input_obj,
502  int input_flag, int expect_return,
503  int expect_ut_post_rpc_count,
504  int expect_ut_wait_for_reply_count,
505  int expect_ut_fop_fini_count)
506 {
507  int rv;
508 
509  /* Reset sreq. */
510  sreq.sr_nr_fops = 0;
511  sreq.sr_rc = 0;
512  rv = sync_request_launch_and_wait(&sreq, input_flag);
513  M0_UT_ASSERT(rv == expect_return);
514  M0_UT_ASSERT(ut_post_rpc_count == expect_ut_post_rpc_count);
515  M0_UT_ASSERT(ut_wait_for_reply_count == expect_ut_wait_for_reply_count);
516  M0_UT_ASSERT(ut_fop_fini_count == expect_ut_fop_fini_count);
517 }
518 
523 {
524  int i;
525 
526  fake_setup();
527 
528  M0_SET0(&reply_fop);
530  M0_SET0(&copy);
531 
532  /* Copy the fsync_interactions struct so that we can restore it to
533  * default values later */
534  copy = si;
535 
536  /* Load the stubs over the top of the fsync_interactions struct */
541 
542  /* Cause fop sending to fail at the first attempt - check an error
543  * is returned and that we don't wait for a reply to the failed fop */
545  ut_post_rpc_return = -EINVAL;
546  ut_post_rpc_early_return = -EINVAL;
549 
550  /* Cause fop sending to fail after a few have been sent - check those
551  * that were sent correctly have their replies processed */
554  ut_post_rpc_delay = 4;
555  ut_post_rpc_return = -EINVAL;
561  /* reset replies */
562  for (i = 0; i < NUM_STRECORDS; i++)
563  sreq_stx[i].stx_tri.tri_txid = 3;
564 
565  /* Cause a remote fop to fail - test the error is propogated */
568  ut_post_rpc_delay = 2;
569  ut_post_rpc_return = 0;
575  /* reset replies */
576  for (i = 0; i < NUM_STRECORDS; i++)
577  sreq_stx[i].stx_tri.tri_txid = 3;
578 
579  /* Send replies for the versions requested - test records are updated
580  so that repeated calls to fsync have no effect */
582  ut_post_rpc_return = 0;
587  /* test the records were updated */
588  M0_UT_ASSERT(stx[NUM_STRECORDS - 1].stx_tri.tri_txid == 0);
589  /* Don't reset replies ! */
590 
591  /* Test a repeated call to fsync causes no fops to be sent */
593  ut_post_rpc_return = 0;
597  &obj, M0_FSYNC_MODE_ACTIVE, -EAGAIN, 0, 0, 0);
598  /* Restore the fsync_interactions struct */
599  si = copy;
600 
601 }
602 
604  int expect_return,
605  int expect_ut_post_rpc_count,
606  int expect_ut_fop_fini_count)
607 {
608  int rv;
609 
610  rv = m0_entity_sync(&obj->ob_entity);
611  M0_UT_ASSERT(rv == expect_return);
612  M0_UT_ASSERT(ut_post_rpc_count == expect_ut_post_rpc_count);
613  M0_UT_ASSERT(ut_fop_fini_count == expect_ut_fop_fini_count);
614 }
615 
617 {
618  /*
619  * Copy the fsync_interactions struct so that we can restore it to
620  * default values later.
621  */
622  M0_SET0(&copy);
623  copy = si;
624 
625  /* Setup fake test env */
626  fake_setup();
631 
632  /* Check normal operation works */
634  ut_post_rpc_return = 0;
637  call_m0_obj_sync(&obj, 0, 1, 1);
638 
639  /* test the records were updated */
640  M0_UT_ASSERT(stx[NUM_STRECORDS - 1].stx_tri.tri_txid == 0);
641 
642  /* Restore the fsync_interactions struct */
643  si = copy;
644 }
645 
646 M0_INTERNAL int ut_sync_init(void)
647 {
648 #ifndef __KERNEL__
650 #endif
651 
653 
654  return 0;
655 }
656 
657 M0_INTERNAL int ut_sync_fini(void)
658 {
659  return 0;
660 }
661 
662 struct m0_ut_suite ut_suite_sync = {
663  .ts_name = "sync-ut",
664  .ts_init = ut_sync_init,
665  .ts_fini = ut_sync_fini,
666  .ts_tests = {
667 
668  { "m0_obj_sync",
670  { "sync_request_launch_and_wait",
672  { "sync_record_update",
674  { "sync_reply_wait",
676  { "sync_request_fop_send",
678  { NULL, NULL },
679  }
680 };
static void fake_setup(void)
Definition: sync.c:167
static int ut_post_rpc_count
Definition: sync.c:50
void * fd_data
Definition: fop.h:75
struct m0_fop sfw_fop
Definition: sync.h:101
#define NUM_STRECORDS
Definition: sync.c:72
M0_INTERNAL void m0_mutex_unlock(struct m0_mutex *mutex)
Definition: mutex.c:66
struct m0_mutex en_pending_tx_lock
Definition: client.h:737
Definition: client.h:788
#define NULL
Definition: misc.h:38
static int ut_post_rpc_delay
Definition: sync.c:55
struct m0_tl sr_stxs
Definition: sync.h:76
struct m0_mutex sc_max_pending_tx_lock
Definition: reqh_service.h:773
void ut_test_sync_record_update(void)
Definition: sync.c:472
int32_t sr_rc
Definition: sync.h:91
static int ut_wait_for_reply_count
Definition: sync.c:51
M0_INTERNAL void m0_fop_init(struct m0_fop *fop, struct m0_fop_type *fopt, void *data, void(*fop_release)(struct m0_ref *))
Definition: fop.c:79
uint64_t m0_time_t
Definition: time.h:37
uint32_t srt_type
Definition: sync.h:56
int m0_entity_sync(struct m0_entity *ent)
Definition: sync.c:1061
static struct sync_interactions copy
Definition: sync.c:78
struct m0_reqh_service_txid * sfw_stx
Definition: sync.h:109
static struct sync_request sreq
Definition: sync.c:68
void * m0_fop_data(const struct m0_fop *fop)
Definition: fop.c:220
static void ut_reset_stub_counters(void)
Definition: sync.c:152
M0_INTERNAL void m0_xcode_free_obj(struct m0_xcode_obj *obj)
Definition: xcode.c:248
static struct m0_rpc_conn conn
Definition: sync.c:90
#define M0_SET0(obj)
Definition: misc.h:64
M0_INTERNAL void m0_mutex_lock(struct m0_mutex *mutex)
Definition: mutex.c:49
Definition: ut.h:77
int32_t ffr_rc
Definition: fsync_fops.h:64
struct m0_fop_type m0_fop_fsync_mds_fopt
Definition: fsync_fops.c:33
static struct m0_rpc_item * item
Definition: item.c:56
static int ut_fop_fini_count
Definition: sync.c:52
int default_locality
Definition: sync.c:282
struct m0_tl en_pending_tx
Definition: client.h:736
void call_sync_reply_wait(struct m0_client *input_cinst, struct m0_obj *input_obj, struct sync_fop_wrapper *input_sfw, int expect_return, int expect_ut_wait_for_reply_count, int expect_ut_fop_fini_count, uint64_t expect_txid, size_t expect_locality)
Definition: sync.c:310
int i
Definition: dir.c:1033
static int ut_wait_for_reply_remote_return
Definition: sync.c:59
struct m0_rpc_machine * c_rpc_machine
Definition: conn.h:278
M0_INTERNAL int ut_sync_init(void)
Definition: sync.c:646
struct m0_entity * srt_ent
Definition: sync.h:58
int default_txid
Definition: sync.c:281
void(* si_fop_fini)(struct m0_fop *fop)
Definition: sync.h:129
static struct sync_target stgt
Definition: sync.c:69
static int ut_post_rpc_early_return
Definition: sync.c:56
#define M0_ASSERT(cond)
static struct m0_reqh_service_txid sreq_stx[NUM_STRECORDS]
Definition: sync.c:74
static int sync_request_launch_and_wait(struct sync_request *sreq, enum m0_fsync_mode mode)
Definition: sync.c:600
struct m0_be_tx_remid stx_tri
Definition: reqh_service.h:739
struct m0_be_tx_remid ffr_be_remid
Definition: fsync_fops.h:70
void test_sync_reply_wait_init(struct sync_fop_wrapper *sfw, struct m0_reqh_service_txid *stx)
Definition: sync.c:285
int(* si_post_rpc)(struct m0_rpc_item *item)
Definition: sync.h:127
struct m0_reqh_service_ctx * stx_service_ctx
Definition: reqh_service.h:733
enum m0_conf_service_type sc_type
Definition: reqh_service.h:757
struct m0_rpc_item * ri_reply
Definition: item.h:163
M0_INTERNAL void m0_mutex_init(struct m0_mutex *mutex)
Definition: mutex.c:35
M0_INTERNAL void ut_shuffle_test_order(struct m0_ut_suite *suite)
Definition: client.c:1205
struct m0_ut_suite ut_suite_sync
Definition: sync.c:47
struct m0_tl sr_targets
Definition: sync.h:72
void ut_test_m0_obj_sync(void)
Definition: sync.c:616
static struct m0_reqh_service_ctx service
Definition: sync.c:93
static struct m0_reqh_service_txid stx[NUM_STRECORDS]
Definition: sync.c:73
M0_INTERNAL int m0_fop_data_alloc(struct m0_fop *fop)
Definition: fop.c:71
M0_INTERNAL void m0_fop_fini(struct m0_fop *fop)
Definition: fop.c:136
struct sync_request * sfw_req
Definition: sync.h:111
M0_INTERNAL void m0_tlink_init(const struct m0_tl_descr *d, void *obj)
Definition: tlist.c:63
uint64_t tri_txid
Definition: tx.h:431
static int ut_post_rpc_return
Definition: sync.c:57
static int sync_request_fop_send(struct sync_request *sreq, struct m0_reqh_service_txid *stx, enum m0_fsync_mode mode, bool set_ri_ops, struct sync_fop_wrapper **sfw_out)
Definition: sync.c:411
static void ut_fop_fini(struct m0_fop *fop)
Definition: sync.c:140
uint64_t tri_locality
Definition: tx.h:432
struct m0_sm s_sm
Definition: session.h:325
static uint32_t timeout
Definition: console.c:52
static struct m0_client cinst
Definition: sync.c:84
const char * ts_name
Definition: ut.h:99
struct m0_fop_data f_data
Definition: fop.h:82
static int ut_post_rpc(struct m0_rpc_item *item)
Definition: sync.c:95
struct m0_realm * en_realm
Definition: client.h:710
void call_sync_request_launch_and_wait(struct m0_obj *input_obj, int input_flag, int expect_return, int expect_ut_post_rpc_count, int expect_ut_wait_for_reply_count, int expect_ut_fop_fini_count)
Definition: sync.c:500
int(* si_wait_for_reply)(struct m0_rpc_item *item, m0_time_t timeout)
Definition: sync.h:128
M0_INTERNAL void m0_fop_release(struct m0_ref *ref)
Definition: fop.c:148
struct m0_be_tx_remid ff_be_remid
Definition: fsync_fops.h:48
static struct m0_realm realm
Definition: sync.c:87
void(* si_fop_put)(struct m0_fop *fop)
Definition: sync.h:130
static void ut_test_sync_request_launch_and_wait(void)
Definition: sync.c:522
struct m0_rpc_session * ri_session
Definition: item.h:147
struct m0_entity ob_entity
Definition: client.h:789
static struct m0_obj obj
Definition: sync.c:81
void ut_test_sync_reply_wait(void)
Definition: sync.c:334
M0_INTERNAL int ut_sync_fini(void)
Definition: sync.c:657
static struct m0_fop * fop
Definition: item.c:57
void call_m0_obj_sync(struct m0_obj *obj, int expect_return, int expect_ut_post_rpc_count, int expect_ut_fop_fini_count)
Definition: sync.c:603
int32_t sr_nr_fops
Definition: sync.h:85
struct m0_fop * m0_rpc_item_to_fop(const struct m0_rpc_item *item)
Definition: fop.c:346
static struct m0_fop reply_fop
Definition: sync.c:62
struct m0_client * re_instance
Definition: client.h:873
struct m0_tl sr_fops
Definition: sync.h:84
static int ut_wait_for_reply(struct m0_rpc_item *item, m0_time_t timeout)
Definition: sync.c:109
static int sync_reply_wait(struct sync_fop_wrapper *sfw)
Definition: sync.c:567
uint32_t ff_fsync_mode
Definition: fsync_fops.h:51
static struct m0_fop_fsync_rep reply_data
Definition: sync.c:65
M0_INTERNAL void m0_client_init_io_op(void)
Definition: io.c:815
struct m0_rpc_link sc_rlink
Definition: reqh_service.h:759
#define M0_FOP_XCODE_OBJ(f)
Definition: fop.h:334
void sync_record_update(struct m0_reqh_service_ctx *service, struct m0_entity *ent, struct m0_op *op, struct m0_be_tx_remid *btr)
Definition: sync.c:788
void m0_free(void *data)
Definition: memory.c:146
struct m0_rpc_item f_item
Definition: fop.h:83
uint32_t sm_state
Definition: sm.h:307
static void ut_test_sync_request_fop_send(void)
Definition: sync.c:224
union sync_target::@361 u
enum m0_entity_type en_type
Definition: client.h:706
static struct sync_interactions si
Definition: sync.c:121
struct m0_rpc_conn * s_conn
Definition: session.h:312
#define M0_UT_ASSERT(a)
Definition: ut.h:46
struct m0_mutex sr_fops_lock
Definition: sync.h:83
struct m0_reqh_service_txid sc_max_pending_tx
Definition: reqh_service.h:772
Definition: fop.h:79
static int ut_wait_for_reply_return
Definition: sync.c:58