Motr  M0
obj.c
Go to the documentation of this file.
1 /* -*- C -*- */
2 /*
3  * Copyright (c) 2016-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 /*
25  * Client API system tests to check if Client API matches its
26  * specifications.
27  */
28 
29 #define M0_TRACE_SUBSYSTEM M0_TRACE_SUBSYS_CLIENT
30 #include "lib/trace.h"
31 
32 #include "motr/client.h"
33 #include "motr/st/st.h"
34 #include "motr/st/st_misc.h"
35 #include "motr/st/st_assert.h"
36 
37 #include "lib/memory.h"
38 #include "lib/types.h"
39 #include "lib/errno.h" /* ENOENT */
40 #include "lib/finject.h" /* m0_fi_enable_once */
41 
42 #ifndef __KERNEL__
43 #include <stdlib.h>
44 #include <unistd.h>
45 #else
46 #include <linux/delay.h>
47 #endif
48 
49 static struct m0_uint128 test_id;
51 static uint64_t layout_id;
52 
58 static void obj_create_simple(void)
59 {
60  struct m0_op *ops[] = {NULL};
61  struct m0_obj *obj;
62  struct m0_uint128 id;
63  int rc;
64 
67 
68  /* Initialise ids. */
69  oid_get(&id);
70 
72  &id, layout_id);
73  rc = st_entity_create(NULL, &obj->ob_entity, &ops[0]);
74  ST_ASSERT_FATAL(rc == 0);
75  ST_ASSERT_FATAL(ops[0] != NULL);
76  ST_ASSERT_FATAL(ops[0]->op_sm.sm_rc == 0);
77 
79 
81  M0_OS_STABLE),
82  m0_time_from_now(5,0));
83  ST_ASSERT_FATAL(rc == 0);
84  ST_ASSERT_FATAL(ops[0]->op_sm.sm_state == M0_OS_STABLE);
85 
86  st_op_fini(ops[0]);
87  st_op_free(ops[0]);
88  st_entity_fini(&obj->ob_entity);
89  mem_free(obj);
90 }
91 
92 /*
93  * Test error handling of object operation using fault injection.
94  */
95 static void obj_create_error_handling(void)
96 {
97  struct m0_op *ops[] = {NULL};
98  struct m0_obj *obj;
99  struct m0_uint128 id;
100  int rc;
101 
104 
105  /* Initialise ids. */
106  oid_get(&id);
107 
109  &id, layout_id);
110  rc = st_entity_create(NULL, &obj->ob_entity, &ops[0]);
111  ST_ASSERT_FATAL(rc == 0);
112  ST_ASSERT_FATAL(ops[0] != NULL);
113  ST_ASSERT_FATAL(ops[0]->op_sm.sm_rc == 0);
114 
115  m0_fi_enable("cob_ios_prepare", "invalid_rpc_session");
117  m0_fi_disable("cob_ios_prepare", "invalid_rpc_session");
118 
120  M0_OS_STABLE),
121  m0_time_from_now(5,0));
122  /*
123  * As invalid_rpc_session faults are injected during
124  * launching an op above and because of it op->op_sm.sm_rc
125  * is expected to be EINVAL.
126  */
127 
128  ST_ASSERT_FATAL(ops[0]->op_sm.sm_rc == -EINVAL);
129  ST_ASSERT_FATAL(ops[0]->op_sm.sm_state != M0_OS_STABLE);
130 
131  st_op_fini(ops[0]);
132  st_op_free(ops[0]);
133  st_entity_fini(&obj->ob_entity);
134  mem_free(obj);
135 }
139 static void obj_open_non_existent(void)
140 {
141  int rc;
142  struct m0_op *ops[1] = {NULL};
143  struct m0_obj *obj;
144  struct m0_uint128 id;
145 
147 
148  /* Initialise the id. */
149  oid_get(&id);
150 
152  &id, layout_id);
153 
154  /* Try opening a non-existent object. */
155  rc = m0_entity_open(&obj->ob_entity, &ops[0]);
156  ST_ASSERT_FATAL(rc == 0);
157  ST_ASSERT_FATAL(ops[0] != NULL);
158  ST_ASSERT_FATAL(ops[0]->op_sm.sm_rc == 0);
159 
161  rc = st_op_wait(ops[0],
163  M0_OS_STABLE),
164  m0_time_from_now(5,0));
165  ST_ASSERT_FATAL(rc == 0);
166  ST_ASSERT_FATAL(ops[0]->op_sm.sm_state == M0_OS_STABLE);
167  ST_ASSERT_FATAL(ops[0]->op_sm.sm_rc == 0);
168  ST_ASSERT_FATAL(ops[0]->op_rc == -ENOENT);
169  ST_ASSERT_FATAL(obj->ob_entity.en_sm.sm_state ==
170  M0_ES_INIT);
171 
172  st_op_fini(ops[0]);
173  st_op_free(ops[0]);
174  st_entity_fini(&obj->ob_entity);
175  mem_free(obj);
176 }
177 
186 {
187  enum { CREATE_MULTIPLE_N_OBJS = 20 };
188  uint32_t i;
189  struct m0_op *ops[CREATE_MULTIPLE_N_OBJS] = {NULL};
190  struct m0_obj **objs = NULL;
191  struct m0_uint128 id[CREATE_MULTIPLE_N_OBJS];
192  int rc;
193 
194  MEM_ALLOC_ARR(objs, CREATE_MULTIPLE_N_OBJS);
195  for (i = 0; i < CREATE_MULTIPLE_N_OBJS; ++i) {
196  MEM_ALLOC_PTR(objs[i]);
197  ST_ASSERT_FATAL(objs[i] != NULL);
198  }
199 
200  /* Initialise ids. */
201  for (i = 0; i < CREATE_MULTIPLE_N_OBJS; ++i) {
202  oid_get(id + i);
203  }
204 
205  /* Create different objects. */
206  for (i = 0; i < CREATE_MULTIPLE_N_OBJS; ++i) {
208  &id[i], layout_id);
209  rc = st_entity_create(NULL, &objs[i]->ob_entity, &ops[i]);
210  ST_ASSERT_FATAL(rc == 0);
211  ST_ASSERT_FATAL(ops[i] != NULL);
212  ST_ASSERT_FATAL(ops[i]->op_sm.sm_rc == 0);
213  }
214 
216 
217  /* We wait for each op. */
218  for (i = 0; i < CREATE_MULTIPLE_N_OBJS; ++i) {
219  /*
220  * Note: (Sining) M0_TIME_NEVER is not used here in order
221  * to test timeout handling (emulate a client application)
222  * in release_op(st_assert.c).
223  */
225  M0_OS_STABLE),
226  m0_time_from_now(5,0));
227  ST_ASSERT_FATAL(rc == 0);
228  }
229 
230  /* All correctly created. */
231  for (i = 0; i < CREATE_MULTIPLE_N_OBJS; ++i) {
233  ops[i]->op_sm.sm_state == M0_OS_STABLE);
234  }
235 
236  /* Clean up. */
237  for (i = 0; i < CREATE_MULTIPLE_N_OBJS; ++i) {
238  st_op_fini(ops[i]);
239  st_op_free(ops[i]);
240  st_entity_fini(&objs[i]->ob_entity);
241  mem_free(objs[i]);
242  }
243 
244  mem_free(objs);
245 }
246 
248 {
249  int i;
250  int j;
251  int rc;
252  int nr_pools = 2;
253  int nr_objs_per_pool = 10;
254  struct m0_op *ops[1] = {NULL};
255  struct m0_obj *obj;
256  struct m0_uint128 id;
257  struct m0_fid pool_fids[2];
258  struct m0_fid *pool;
259 
260  /*
261  * Must be the pool fid set
262  * in m0t1fs/linux_kernel/st/m0t1fs_common_inc.sh::build_conf().
263  */
264  pool_fids[0].f_container = 0x6f00000000000001;
265  pool_fids[0].f_key = 0x9;
266  pool_fids[1].f_container = 0x6f0000000000000a;
267  pool_fids[1].f_key = 0x1;
268 
269  for (i = 0; i < nr_pools; i++) {
270  for (j = 0; j < nr_objs_per_pool; j++) {
271  oid_get(&id);
272 
274  M0_SET0(obj);
275  pool = pool_fids + i;
276 
277  st_obj_init(
279  &id, layout_id);
280 
281  /* Create the entity */
282  ops[0] = NULL;
283  rc = st_entity_create(pool, &obj->ob_entity,
284  &ops[0]);
285  ST_ASSERT_FATAL(rc == 0);
286  ST_ASSERT_FATAL(ops[0] != NULL);
287  ST_ASSERT_FATAL(ops[0]->op_sm.sm_rc == 0);
288 
290  rc = st_op_wait(ops[0],
292  M0_OS_STABLE),
293  m0_time_from_now(5,0));
294  ST_ASSERT_FATAL(rc == 0);
295  ST_ASSERT_FATAL(ops[0]->op_sm.sm_state ==
296  M0_OS_STABLE);
297 
298  st_op_fini(ops[0]);
299  st_op_free(ops[0]);
300  st_entity_fini(&obj->ob_entity);
301  mem_free(obj);
302  }
303  }
304 }
305 
309 static void obj_create_then_delete(void)
310 {
311  int i;
312  int rc;
313  int rounds = 20;
314  struct m0_op *ops_c[1] = {NULL};
315  struct m0_op *ops_d[1] = {NULL};
316  struct m0_obj *obj;
317  struct m0_uint128 id;
318 
320 
321  /* initialise the id */
322  oid_get(&id);
323 
324  for (i = 0; i < rounds; i++) {
325  M0_SET0(obj);
327  &id, layout_id);
328 
329  /* Create the entity */
330  rc = st_entity_create(NULL, &obj->ob_entity, &ops_c[0]);
331  ST_ASSERT_FATAL(rc == 0);
332  ST_ASSERT_FATAL(ops_c[0] != NULL);
333  ST_ASSERT_FATAL(ops_c[0]->op_sm.sm_rc == 0);
334 
335  st_op_launch(ops_c, ARRAY_SIZE(ops_c));
336  rc = st_op_wait(ops_c[0], M0_BITS(M0_OS_FAILED,
337  M0_OS_STABLE),
338  m0_time_from_now(5,0));
339  ST_ASSERT_FATAL(rc == 0);
340  ST_ASSERT_FATAL(ops_c[0]->op_sm.sm_state == M0_OS_STABLE);
341 
342  /* Delete the entity */
343  st_entity_delete(&obj->ob_entity, &ops_d[0]);
344  ST_ASSERT_FATAL(ops_d[0] != NULL);
345  ST_ASSERT_FATAL(ops_d[0]->op_sm.sm_rc == 0);
346  st_op_launch(ops_d, ARRAY_SIZE(ops_d));
347  rc = st_op_wait(ops_d[0], M0_BITS(M0_OS_FAILED,
348  M0_OS_STABLE),
349  m0_time_from_now(5,0));
350  ST_ASSERT_FATAL(rc == 0);
351  ST_ASSERT_FATAL(ops_d[0]->op_sm.sm_state == M0_OS_STABLE);
352 
353  st_op_fini(ops_d[0]);
354  st_op_fini(ops_c[0]);
355  }
356 
357  st_op_free(ops_d[0]);
358  st_op_free(ops_c[0]);
359  st_entity_fini(&obj->ob_entity);
360  mem_free(obj);
361 }
362 
367 static void obj_delete_multiple(void)
368 {
369  uint32_t n_objs = 5;
370  uint32_t rounds = 20;
371  uint32_t max_ops = 4; /* max. ops in one launch() */
372  struct m0_uint128 *ids = NULL;
373  struct m0_obj *objs = NULL;
374  struct m0_op **ops = NULL;
375  bool *obj_used = NULL;
376  bool *obj_exists = NULL;
377  bool *already_chosen = NULL;
378  uint32_t i;
379  uint32_t j;
380  uint32_t idx;
381  uint32_t n_ops;
382  int rc;
383 
384  /* Parameters are correct. */
385  ST_ASSERT_FATAL(n_objs >= max_ops);
386 
387  MEM_ALLOC_ARR(ids, n_objs);
389  MEM_ALLOC_ARR(objs, n_objs);
390  ST_ASSERT_FATAL(objs != NULL);
391  MEM_ALLOC_ARR(obj_used, n_objs);
392  ST_ASSERT_FATAL(obj_used != NULL);
393  MEM_ALLOC_ARR(obj_exists, n_objs);
394  ST_ASSERT_FATAL(obj_exists != NULL);
395  MEM_ALLOC_ARR(already_chosen, n_objs);
396  ST_ASSERT_FATAL(already_chosen != NULL);
397 
398  MEM_ALLOC_ARR(ops, max_ops);
400  for (i = 0; i < max_ops; i++)
401  ops[i] = NULL;
402 
403  /* Initialise the objects. Closed set. */
404  for (i = 0; i < n_objs; ++i)
405  oid_get(ids + i);
406 
407  memset(obj_exists, 0, n_objs*sizeof(obj_exists[0]));
408  /* Repeat several rounds. */
409  for (i = 0; i < rounds; ++i) {
410  /* Each round, a different number of ops in the same launch. */
411  n_ops = generate_random(max_ops) + 1;
412  memset(already_chosen, 0, n_objs*sizeof(already_chosen[0]));
413 
414  /* Set the ops. */
415  for (j = 0; j < n_ops; ++j) {
416  /* Pick n_ops objects. */
417  do {
418  idx = generate_random(n_objs);
419  } while(already_chosen[idx]);
420  already_chosen[idx] = true;
421  obj_used[idx] = true;
422 
423  M0_SET0(&objs[idx]);
424  st_obj_init(&objs[idx],
426  &ids[idx], layout_id);
427  if (obj_exists[idx]) {
428  st_entity_open(&objs[idx].ob_entity);
430  &objs[idx].ob_entity, &ops[j]);
431  obj_exists[idx] = false;
432  ST_ASSERT_FATAL(ops[j] != NULL);
433  } else {
435  NULL, &objs[idx].ob_entity, &ops[j]);
436  obj_exists[idx] = true;
437  ST_ASSERT_FATAL(ops[j] != NULL);
438  }
439  ST_ASSERT_FATAL(rc == 0);
440  ST_ASSERT_FATAL(ops[j] != NULL);
441  ST_ASSERT_FATAL(ops[j]->op_sm.sm_rc == 0);
442  }
443 
444  /* Launch and check. */
445  st_op_launch(ops, n_ops);
446  for (j = 0; j < n_ops; ++j) {
447  rc = st_op_wait(ops[j],
449  M0_OS_STABLE),
450  M0_TIME_NEVER);
451  //m0_time_from_now(5,0));
452  ST_ASSERT_FATAL(rc == 0);
454  M0_OS_STABLE);
455  st_op_fini(ops[j]);
456  }
457  }
458 
459  /* Clean up. */
460  for (i = 0; i < max_ops; ++i) {
461  if (ops[i] != NULL)
462  st_op_free(ops[i]);
463  }
464 
465  /* Clean up. */
466  for (i = 0; i < n_objs; ++i) {
467  if (obj_used[i] == true)
468  st_entity_fini(&objs[i].ob_entity);
469  }
470 
471  mem_free(ops);
472  mem_free(already_chosen);
473  mem_free(obj_exists);
474  mem_free(objs);
475  mem_free(ids);
476 }
477 
478 
482 static void obj_no_wait(void)
483 {
484  struct m0_op *ops[] = {NULL};
485  struct m0_obj *obj;
486  struct m0_uint128 id;
487  int rc;
488 
491 
492  /* Initialise ids. */
493  oid_get(&id);
494 
496  &id, layout_id);
497  rc = st_entity_create(NULL, &obj->ob_entity, &ops[0]);
498  ST_ASSERT_FATAL(rc == 0);
499  ST_ASSERT_FATAL(ops[0] != NULL);
500  ST_ASSERT_FATAL(ops[0]->op_sm.sm_rc == 0);
501 
503 
504  /* A call to m0_op_wait is not strictly required. */
505 #ifndef __KERNEL__
506  sleep(5);
507 #else
508  msleep(5000);
509 #endif
510 
511  ST_ASSERT_FATAL(rc == 0);
512  ST_ASSERT_FATAL(ops[0]->op_sm.sm_state == M0_OS_STABLE);
513 
514  st_op_fini(ops[0]);
515  st_op_free(ops[0]);
516  st_entity_fini(&obj->ob_entity);
517  mem_free(obj);
518 }
519 
523 static void obj_wait_no_launch(void)
524 {
525  struct m0_op *ops[] = {NULL};
526  struct m0_obj *obj;
527  struct m0_uint128 id;
528  int rc;
529 
532 
533  /* Initialise ids. */
534  oid_get(&id);
535 
537  &id, layout_id);
538  rc = st_entity_create(NULL, &obj->ob_entity, &ops[0]);
539  ST_ASSERT_FATAL(rc == 0);
540  ST_ASSERT_FATAL(ops[0] != NULL);
541  ST_ASSERT_FATAL(ops[0]->op_sm.sm_rc == 0);
542 
543  /* The operation is not launched so the state should not change. */
544 
546  M0_OS_STABLE),
547  m0_time_from_now(3,0));
548  ST_ASSERT_FATAL(rc == -ETIMEDOUT);
549  ST_ASSERT_FATAL(ops[0]->op_sm.sm_state ==
551 
552  st_op_fini(ops[0]);
553  st_op_free(ops[0]);
554  st_entity_fini(&obj->ob_entity);
555  mem_free(obj);
556 }
557 
561 static void obj_wait_twice(void)
562 {
563  struct m0_op *ops[] = {NULL};
564  struct m0_obj *obj;
565  struct m0_uint128 id;
566  int rc;
567 
570 
571  /* Initialise ids. */
572  oid_get(&id);
573 
575  &id, layout_id);
576  rc = st_entity_create(NULL, &obj->ob_entity, &ops[0]);
577  ST_ASSERT_FATAL(rc == 0);
578  ST_ASSERT_FATAL(ops[0] != NULL);
579  ST_ASSERT_FATAL(ops[0]->op_sm.sm_rc == 0);
580 
582 
583  /* Calling op_wait() several times should have an innocuous effect*/
585  M0_OS_STABLE),
586  m0_time_from_now(5,0));
587 
588  ST_ASSERT_FATAL(rc == 0);
589  ST_ASSERT_FATAL(ops[0]->op_sm.sm_state == M0_OS_STABLE);
590 
592  M0_OS_STABLE),
593  m0_time_from_now(5,0));
594  ST_ASSERT_FATAL(rc == 0);
595  ST_ASSERT_FATAL(ops[0]->op_sm.sm_state == M0_OS_STABLE);
596 
597  st_op_fini(ops[0]);
598  st_op_free(ops[0]);
599  st_entity_fini(&obj->ob_entity);
600  mem_free(obj);
601 }
602 
603 static void mock_op_cb_stable(struct m0_op *op)
604 {
605  int *val;
606 
607  val = (int *)op->op_datum;
608  *val = 'S';
609 }
610 
611 static void mock_op_cb_failed(struct m0_op *op)
612 {
613  int *val;
614 
615  val = (int *)op->op_datum;
616  *val = 'F';
617 }
618 
622 static void obj_op_setup(void)
623 {
624  int rc;
625  int val = 0;
626  struct m0_uint128 id;
627  struct m0_obj *obj;
628  struct m0_op *ops[] = {NULL};
629  struct m0_op_ops cbs;
630 
633 
634  /*
635  * Set callbacks for operations.
636  * oop_executed is not supported (see comments in motr/client.h)
637  */
638  cbs.oop_executed = NULL;
641 
642  /* Initilise an CREATE op. */
643  oid_get(&id);
645  &id, layout_id);
646  rc = st_entity_create(NULL, &obj->ob_entity, &ops[0]);
647  ST_ASSERT_FATAL(rc == 0);
648  ST_ASSERT_FATAL(ops[0] != NULL);
649  ST_ASSERT_FATAL(ops[0]->op_sm.sm_rc == 0);
650 
651  /* Test callback functions for OS_STABLE*/
652  ops[0]->op_datum = (void *)&val;
653  m0_op_setup(ops[0], &cbs, 0);
656  M0_OS_STABLE),
657  m0_time_from_now(5,0));
658  if (rc == 0) {
659  ST_ASSERT_FATAL(ops[0]->op_sm.sm_state ==
660  M0_OS_STABLE);
661  ST_ASSERT_FATAL(val == 'S');
662  }
663 
664  st_op_fini(ops[0]);
665  st_op_free(ops[0]);
666  st_entity_fini(&obj->ob_entity);
667 
668  /* Test callback function for OS_FAILED*/
669  /* @TODO: The following procedure is invalid since EO_DELETE cannot be
670  * done from ES_INIT state anymore. Need to revisit this later. */
671 #if 0
672  memset(obj, 0, sizeof *obj);
673  oid_get(&id);
674 
676  &id, layout_id);
677  rc = st_entity_delete(&obj->ob_entity, &ops[0]);
678  ST_ASSERT_FATAL(rc == 0);
679 
680  ops[0]->op_datum = (void *)&val;
681  m0_op_setup(ops[0], &cbs, 0);
684  M0_OS_STABLE),
685  m0_time_from_now(5,0));
686  if (rc == 0) {
687  ST_ASSERT_FATAL(ops[0]->op_sm.sm_state
688  == M0_OS_FAILED);
689  ST_ASSERT_FATAL(val == 'F');
690  }
691 
692  st_op_fini(ops[0]);
693  st_op_free(ops[0]);
694  st_entity_fini(&obj->ob_entity);
695 #endif
696 
697  /* End of the test */
698  mem_free(obj);
699 }
700 
704 static int st_obj_suite_init(void)
705 {
706  int rc = 0;
707 
708  /*
709  * Retrieve the uber realm. We don't need to open this,
710  * as realms are not actually implemented yet
711  */
713  &M0_UBER_REALM,
714  st_get_instance());
716 
717  if (rc != 0)
718  console_printf("Failed to open uber realm\n");
719 
720  test_id = M0_ID_APP;
721  test_id.u_lo += generate_random(0xffff);
722 
724  return rc;
725 }
726 
730 static int st_obj_suite_fini(void)
731 {
732  return 0;
733 }
734 
736  .ss_name = "obj_st",
737  .ss_init = st_obj_suite_init,
738  .ss_fini = st_obj_suite_fini,
739  .ss_tests = {
740  { "obj_create_simple",
742  { "obj_create_error_handling",
744  { "obj_open_non_existent",
746  { "obj_create_multiple_objects",
748  { "obj_create_on_multiple_pools",
750  { "obj_create_then_delete",
752  { "obj_delete_multiple",
754  { "obj_no_wait",
755  &obj_no_wait},
756  { "obj_wait_twice",
757  &obj_wait_twice},
758  { "obj_wait_no_launch",
760  { "obj_op_setup",
761  &obj_op_setup},
762  { NULL, NULL }
763  }
764 };
765 
766 #undef M0_TRACE_SUBSYSTEM
767 
768 /*
769  * Local variables:
770  * c-indentation-style: "K&R"
771  * c-basic-offset: 8
772  * tab-width: 8
773  * fill-column: 80
774  * scroll-step: 1
775  * End:
776  */
uint64_t id
Definition: cob.h:2380
static struct m0_uint128 test_id
Definition: obj.c:49
int st_entity_create(struct m0_fid *pool, struct m0_entity *entity, struct m0_op **op)
Definition: api.c:71
static void obj_create_then_delete(void)
Definition: obj.c:309
static int st_obj_suite_fini(void)
Definition: obj.c:730
void st_op_free(struct m0_op *op)
Definition: api.c:147
Definition: client.h:788
#define NULL
Definition: misc.h:38
static void obj_wait_twice(void)
Definition: obj.c:561
Definition: idx_mock.c:52
static void mock_op_cb_stable(struct m0_op *op)
Definition: obj.c:603
const m0_time_t M0_TIME_NEVER
Definition: time.c:108
void(* oop_executed)(struct m0_op *op)
Definition: client.h:909
#define MEM_ALLOC_PTR(arr)
Definition: st_misc.h:81
uint64_t m0_client_layout_id(const struct m0_client *instance)
Definition: obj.c:859
#define M0_BITS(...)
Definition: misc.h:236
struct m0_container st_obj_container
Definition: obj.c:50
#define M0_SET0(obj)
Definition: misc.h:64
const struct m0_uint128 M0_UBER_REALM
Definition: client.c:85
#define ST_ASSERT_FATAL(a)
Definition: st_assert.h:31
static struct foo * obj
Definition: tlist.c:302
const struct m0_uint128 M0_ID_APP
Definition: client.c:92
op
Definition: libdemo.c:64
static void obj_create_multiple_objects(void)
Definition: obj.c:185
int i
Definition: dir.c:1033
struct m0_realm co_realm
Definition: client.h:881
Definition: client.h:641
static int st_obj_suite_init(void)
Definition: obj.c:704
struct m0_sm op_sm
Definition: client.h:656
struct st_suite st_suite_obj
Definition: obj.c:735
M0_INTERNAL void m0_fi_disable(const char *fp_func, const char *fp_tag)
Definition: finject.c:485
void(* oop_stable)(struct m0_op *op)
Definition: client.h:911
struct m0_entity re_entity
Definition: client.h:871
static void m0_fi_enable(const char *func, const char *tag)
Definition: finject.h:276
int oid_get(struct m0_uint128 *oid)
Definition: oid.c:373
Definition: st.h:83
static void obj_create_error_handling(void)
Definition: obj.c:95
static uint64_t layout_id
Definition: obj.c:51
uint64_t f_container
Definition: fid.h:39
int32_t sm_rc
Definition: sm.h:336
void console_printf(const char *fmt,...)
Definition: st_misc.c:155
void(* oop_failed)(struct m0_op *op)
Definition: client.h:910
static void mem_free(const struct m0_be_btree *btree, struct m0_be_tx *tx, void *ptr)
Definition: btree.c:102
struct m0_addb2__id_intrp ids[]
Definition: dump.c:1074
static void obj_wait_no_launch(void)
Definition: obj.c:523
void st_obj_init(struct m0_obj *obj, struct m0_realm *parent, const struct m0_uint128 *id, uint64_t layout_id)
Definition: api.c:42
static struct m0_pool pool
Definition: iter_ut.c:58
static void obj_op_setup(void)
Definition: obj.c:622
static void mock_op_cb_failed(struct m0_op *op)
Definition: obj.c:611
static void obj_create_simple(void)
Definition: obj.c:58
#define MEM_ALLOC_ARR(arr, nr)
Definition: st_misc.h:80
static void obj_delete_multiple(void)
Definition: obj.c:367
Definition: fid.h:38
uint64_t f_key
Definition: fid.h:40
m0_time_t m0_time_from_now(uint64_t secs, long ns)
Definition: time.c:96
struct m0_client * st_get_instance()
Definition: st.c:57
void st_op_launch(struct m0_op **op, uint32_t nr)
Definition: api.c:129
void st_entity_fini(struct m0_entity *entity)
Definition: api.c:94
uint32_t generate_random(uint32_t max)
Definition: st_misc.c:164
const char * ss_name
Definition: st.h:85
int st_entity_delete(struct m0_entity *entity, struct m0_op **op)
Definition: api.c:83
void m0_container_init(struct m0_container *con, struct m0_realm *parent, const struct m0_uint128 *id, struct m0_client *instance)
Definition: realm.c:31
static void obj_no_wait(void)
Definition: obj.c:482
void st_entity_open(struct m0_entity *entity)
Definition: api.c:153
struct m0_sm en_sm
Definition: client.h:732
int m0_entity_open(struct m0_entity *entity, struct m0_op **op)
Definition: obj.c:885
struct m0_fom_ops ops
Definition: io_foms.c:623
uint64_t u_lo
Definition: types.h:37
static void obj_create_on_multiple_pools(void)
Definition: obj.c:247
int32_t st_op_wait(struct m0_op *op, uint64_t bits, m0_time_t to)
Definition: api.c:136
uint32_t sm_state
Definition: sm.h:307
void st_op_fini(struct m0_op *op)
Definition: api.c:142
int32_t rc
Definition: trigger_fop.h:47
#define ARRAY_SIZE(a)
Definition: misc.h:45
static void obj_open_non_existent(void)
Definition: obj.c:139
void m0_op_setup(struct m0_op *op, const struct m0_op_ops *cbs, m0_time_t linger)
Definition: client.c:908