Motr  M0
write.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  * Client API system tests to check if Client API matches its
25  * specifications.
26  */
27 
28 #define M0_TRACE_SUBSYSTEM M0_TRACE_SUBSYS_CLIENT
29 #include "lib/trace.h"
30 
31 #include "motr/client.h"
32 #include "motr/st/st.h"
33 #include "motr/st/st_misc.h"
34 #include "motr/st/st_assert.h"
35 
36 #include "lib/memory.h"
37 
39 extern struct m0_addb_ctx m0_addb_ctx;
40 
41 enum { MAX_OPS = 16 };
42 
43 /* Parity group aligned (in units)*/
44 enum {
48 };
49 
50 static int create_obj(struct m0_uint128 *oid, int unit_size)
51 {
52  int rc = 0;
53  struct m0_op *ops[1] = {NULL};
54  struct m0_obj obj;
55  struct m0_uint128 id;
56  uint64_t lid;
57 
58  /* Make sure everything in 'obj' is clean*/
59  memset(&obj, 0, sizeof(obj));
60 
61  oid_get(&id);
64 
65  st_entity_create(NULL, &obj.ob_entity, &ops[0]);
66  if (ops[0] == NULL)
67  return -ENOENT;
68 
70 
71  rc = st_op_wait(
73  m0_time_from_now(3,0));
74 
75  st_op_fini(ops[0]);
76  st_op_free(ops[0]);
77  st_entity_fini(&obj.ob_entity);
78 
79  *oid = id;
80  return rc;
81 }
82 
83 static int bufvec_cmp(struct m0_bufvec b1, struct m0_bufvec b2)
84 {
85  int rc = 0;
86  void *d1;
87  void *d2;
88  uint64_t l1;
89  uint64_t l2;
90  uint64_t step;
91  struct m0_bufvec_cursor c1;
92  struct m0_bufvec_cursor c2;
93 
94  m0_bufvec_cursor_init(&c1, &b1);
95  m0_bufvec_cursor_init(&c2, &b2);
96 
97  step = 0;
98  while (!m0_bufvec_cursor_move(&c1, step)
99  && !m0_bufvec_cursor_move(&c2, step))
100  {
101  d1 = m0_bufvec_cursor_addr(&c1);
102  d2 = m0_bufvec_cursor_addr(&c2);
103  if (d1 == NULL || d2 == NULL) {
104  rc = -EINVAL;
105  break;
106  }
107 
108  l1 = m0_bufvec_cursor_step(&c1);
109  l2 = m0_bufvec_cursor_step(&c2);
110  step = min_check(l1, l2);
111 
112  /* Check the contents */
113  rc = memcmp(d1, d2, step);
114  if (rc)
115  break;
116  }
117 
118  return rc;
119 }
120 
121 /* Verify each stride one by one */
122 static int write_verify(struct m0_bufvec *data_w, struct m0_uint128 oid,
123  int start, int stride, int unit_size, int nr_ops)
124 {
125  int i;
126  int rc;
127  struct m0_obj obj;
128  struct m0_op *ops_r[1] = {NULL};
129  struct m0_indexvec ext_r;
130  struct m0_bufvec data_r;
131  struct m0_bufvec attr_r;
132  uint64_t lid;
133 
134  rc = 0;
136 
137  /* Setup bufvec, indexvec and ops for READs */
138  for (i = 0; i < nr_ops; i++) {
139  M0_SET0(&obj);
140  ops_r[0] = NULL;
141 
143  &oid, lid);
144 
145  st_entity_open(&obj.ob_entity);
146 
147  if (m0_indexvec_alloc(&ext_r, 1) ||
148  m0_bufvec_alloc(&data_r, 1, unit_size * stride) ||
149  m0_bufvec_alloc(&attr_r, 1, 1))
150  {
151  rc = -ENOMEM;
152  goto CLEANUP;
153  }
154 
155  ext_r.iv_index[0] = unit_size * (start + i * stride);
156  ext_r.iv_vec.v_count[0] = unit_size * stride;
157  attr_r.ov_vec.v_count[0] = 0;
158 
159  /* Create and launch the read requests */
161  &ext_r, &data_r, NULL, 0, 0, &ops_r[0]);
162  if (ops_r[0] == NULL)
163  goto CLEANUP;
164 
165  st_op_launch(ops_r, 1);
166 
167  /* Wait for read to finish */
168  rc = st_op_wait(ops_r[0],
170  M0_OS_STABLE),
171  M0_TIME_NEVER);
172 
173  /* Compare the data */
174  if (rc == 0 && ops_r[0]->op_sm.sm_state == M0_OS_STABLE)
175  rc = bufvec_cmp(data_r, data_w[i]);
176 
177  st_op_fini(ops_r[0]);
178  st_op_free(ops_r[0]);
179 
180 CLEANUP:
181  st_entity_fini(&obj.ob_entity);
182 
183  if (ext_r.iv_vec.v_nr != 0)
184  m0_indexvec_free(&ext_r);
185  if (data_r.ov_buf != NULL)
186  m0_bufvec_free(&data_r);
187  if (attr_r.ov_buf != NULL)
188  m0_bufvec_free(&attr_r);
189 
190  if (rc != 0) {
191  console_printf("write_verfiy: m0_op_wait failed\n");
192  break;
193  }
194  }
195 
196  return rc;
197 }
198 
199 /*
200  * We issue 'nr_ops' of WRITES in one go.
201  * stride: in units
202  */
203 static int write_obj(struct m0_uint128 oid, int start,
204  int stride, int unit_size, int nr_ops, bool verify)
205 {
206  int i;
207  int rc = 0;
208  uint64_t lid;
209  struct m0_obj obj;
210  struct m0_op **ops_w;
211  struct m0_indexvec *ext_w;
212  struct m0_bufvec *data_w;
213  struct m0_bufvec *attr_w;
214 
216 
217  if (nr_ops > MAX_OPS)
218  return -EINVAL;
219 
220  /* Init obj */
221  M0_SET0(&obj);
224 
225  st_entity_open(&obj.ob_entity);
226 
227  /* Setup bufvec, indexvec and ops for WRITEs */
228  MEM_ALLOC_ARR(ops_w, nr_ops);
229  MEM_ALLOC_ARR(ext_w, nr_ops);
230  MEM_ALLOC_ARR(data_w, nr_ops);
231  MEM_ALLOC_ARR(attr_w, nr_ops);
232  if (ops_w == NULL || ext_w == NULL || data_w == NULL || attr_w == NULL)
233  goto CLEANUP;
234 
235  for (i = 0; i < nr_ops; i++) {
236  if (m0_indexvec_alloc(&ext_w[i], 1) ||
237  m0_bufvec_alloc(&data_w[i], 1, unit_size * stride) ||
238  m0_bufvec_alloc(&attr_w[i], 1, 1))
239  {
240  rc = -ENOMEM;
241  goto CLEANUP;
242  }
243 
244  memset(data_w[i].ov_buf[0], 'A', unit_size * stride);
245  ext_w[i].iv_index[0] = unit_size * (start + i * stride);
246  ext_w[i].iv_vec.v_count[0] = unit_size * stride;
247  attr_w[i].ov_vec.v_count[0] = 0;
248  }
249 
250  /* Create and launch write requests */
251  for (i = 0; i < nr_ops; i++) {
252  ops_w[i] = NULL;
254  &ext_w[i], &data_w[i], NULL, 0, 0, &ops_w[i]);
255  if (ops_w[i] == NULL)
256  break;
257  }
258  if (i == 0) goto CLEANUP;
259 
260  st_op_launch(ops_w, nr_ops);
261 
262  /* Wait for write to finish */
263  for (i = 0; i < nr_ops; i++) {
264  rc = st_op_wait(ops_w[i],
266  M0_OS_STABLE),
267  M0_TIME_NEVER);
268 
269  st_op_fini(ops_w[i]);
270  st_op_free(ops_w[i]);
271  }
272 
273  /* 3. Verify the data written */
274  if (!verify)
275  goto CLEANUP;
276  rc = write_verify(data_w, oid, start, stride, unit_size, nr_ops);
277 
278 CLEANUP:
279  st_entity_fini(&obj.ob_entity);
280 
281  for (i = 0; i < nr_ops; i++) {
282  if (ext_w != NULL && ext_w[i].iv_vec.v_nr != 0)
283  m0_indexvec_free(&ext_w[i]);
284  if (data_w != NULL && data_w[i].ov_buf != NULL)
285  m0_bufvec_free(&data_w[i]);
286  if (attr_w != NULL && attr_w[i].ov_buf != NULL)
287  m0_bufvec_free(&attr_w[i]);
288  }
289 
290  if (ops_w != NULL) mem_free(ops_w);
291  if (ext_w != NULL) mem_free(ext_w);
292  if (data_w != NULL) mem_free(data_w);
293  if (attr_w != NULL) mem_free(attr_w);
294 
295  return rc;
296 }
297 
298 /*
299  * Because of the current limitation of ST_ASSERT (can only be used
300  * in top function), we duplicate for the following small/medium/large tests
301  * to get more assert checks.
302  */
303 #define write_objs(nr_objs, size, unit_size, verify) \
304  do { \
305  int rc; \
306  int i; \
307  int j; \
308  int start = 0; \
309  int nr_units; \
310  int nr_pargrps; \
311  struct m0_uint128 oid; \
312  \
313  nr_units = size / unit_size; \
314  nr_pargrps = nr_units / DEFAULT_PARGRP_DATA_UNIT_NUM; \
315  \
316  for (i = 0; i < nr_objs; i++) { \
317  rc = create_obj(&oid, unit_size); \
318  ST_ASSERT_FATAL(rc == 0);\
319  \
320  for (j = 0; j < nr_pargrps; j++) { \
321  start = j * DEFAULT_PARGRP_DATA_UNIT_NUM; \
322  rc = write_obj(oid, start, \
323  DEFAULT_PARGRP_DATA_UNIT_NUM, \
324  unit_size, 1, verify);\
325  ST_ASSERT_FATAL(rc == 0); \
326  } \
327  \
328  /* write the rest of data */ \
329  start += DEFAULT_PARGRP_DATA_UNIT_NUM; \
330  if (start >= nr_units) \
331  continue; \
332  \
333  rc = write_obj(oid, start, \
334  nr_units - start, unit_size, 1, verify); \
335  ST_ASSERT_FATAL(rc == 0); \
336  } \
337  } while(0)
338 
339 static void write_small_objs(void)
340 {
342 }
343 
344 static void write_medium_objs(void)
345 {
347 }
348 
349 static void write_large_objs(void)
350 {
352 }
353 
354 static void write_with_layout_id(void)
355 {
356  write_objs(1, LARGE_OBJ_SIZE, 16384, true);
357 }
358 
360 {
361  int i;
362  int rc;
363  int nr_rounds;
364  int nr_ops;
365  struct m0_uint128 oid;
366 
367  nr_rounds = 4;
368 
369  /* Create an object */
371  ST_ASSERT_FATAL(rc == 0);
372 
373  /* We change the number of ops issued together in each round */
374  nr_ops = 2^nr_rounds;
375  for (i = 0; i < nr_rounds; i++) {
376  rc = write_obj(oid, 0,
379  nr_ops, true);
380  ST_ASSERT_FATAL(rc == 0);
381 
382  nr_ops /= 2;
383  }
384 }
385 
386 static void write_pargrps_rmw(void)
387 {
388  int i;
389  int rc;
390  int start;
391  int strides[10] = {1, 3, 5, 7, 11, 13, 17, 19, 23, 29};
392  struct m0_uint128 oid;
393 
394  /* Create an object */
396  ST_ASSERT_FATAL(rc == 0);
397 
398  /*
399  * Write prime number of units to an object.
400  */
401  start = 0;
402  for (i = 0; i < 10; i++) {
403  rc = write_obj(oid, start, strides[i],
404  DEFAULT_PARGRP_UNIT_SIZE, 1, true);
405  ST_ASSERT_FATAL(rc == 0);
406  start += strides[i];
407  }
408 }
409 
410 /* Verify order of segments with nr_ent chunks which were passed to write
411  * out of order */
412 static int write_verify_unorder(struct m0_bufvec *data_w, struct m0_uint128 oid,
413  int start, int stride, int unit_size,
414  int nr_ops, int nr_ent)
415 {
416  int i;
417  int j;
418  int rc;
419  struct m0_obj obj;
420  struct m0_op *ops_r[1] = {NULL};
421  struct m0_indexvec ext_r;
422  struct m0_bufvec data_r;
423  struct m0_bufvec attr_r;
424  uint64_t lid;
425 
426  rc = 0;
428 
429  /* Setup bufvec, indexvec and ops for READs */
430  for (i = 0; i < nr_ops; i++) {
431  M0_SET0(&obj);
432  ops_r[0] = NULL;
433 
435 
436  st_entity_open(&obj.ob_entity);
437 
438  rc = m0_indexvec_alloc(&ext_r, nr_ent) ?:
439  m0_bufvec_alloc(&data_r, nr_ent, unit_size * stride) ?:
440  m0_bufvec_alloc(&attr_r, nr_ent, 1);
441 
442  if (rc != 0)
443  goto CLEANUP;
444 
445  for (j = 0; j < nr_ent; j++) {
446  ext_r.iv_index[j] = unit_size * (start + j * stride);
447  ext_r.iv_vec.v_count[j] = unit_size * stride;
448  attr_r.ov_vec.v_count[j] = 0;
449  }
450 
451  /* Create and launch the read requests */
452  st_obj_op(&obj, M0_OC_READ, &ext_r, &data_r, NULL, 0,
453  0, &ops_r[0]);
454  if (ops_r[0] == NULL) {
455  rc = -ENOMEM;
456  goto CLEANUP;
457  }
458 
459  st_op_launch(ops_r, 1);
460 
461  /* Wait for read to finish */
462  rc = st_op_wait(ops_r[0],
464  M0_OS_STABLE),
465  M0_TIME_NEVER);
466 
467  /* Compare the data */
468  if (rc == 0 && ops_r[0]->op_sm.sm_state == M0_OS_STABLE)
469  rc = bufvec_cmp(data_r, data_w[i]);
470 
471  st_op_fini(ops_r[0]);
472  st_op_free(ops_r[0]);
473 
474 CLEANUP:
475  st_entity_fini(&obj.ob_entity);
476 
477  if (ext_r.iv_vec.v_nr != 0)
478  m0_indexvec_free(&ext_r);
479  if (data_r.ov_buf != NULL)
480  m0_bufvec_free(&data_r);
481  if (attr_r.ov_buf != NULL)
482  m0_bufvec_free(&attr_r);
483 
484  if (rc != 0) {
485  console_printf("write_verfiy: m0_op_wait failed\n");
486  break;
487  }
488  }
489 
490  return rc;
491 }
492 
493 #define INDEX(ivec, i) ((ivec)->iv_index[(i)])
494 #define COUNT(ivec, i) ((ivec)->iv_vec.v_count[(i)])
495 
496 /*
497  * Issue 'nr_ops' of 'nr_ent' WRITES with unordered data and index vectors.
498  * stride: in units
499  */
500 static int write_unordered_obj(struct m0_uint128 oid, int start, int stride,
501  int unit_size, int nr_ops, int nr_ent,
502  bool verify)
503 {
504  int i;
505  int j;
506  int rc = 0;
507  uint64_t lid;
508  struct m0_obj obj;
509  struct m0_op **ops_w;
510  struct m0_indexvec *ext_w;
511  struct m0_bufvec *data_w;
512  struct m0_bufvec *attr_w;
513 
515 
516  if (nr_ops > MAX_OPS)
517  return -EINVAL;
518 
519  /* Init obj */
520  M0_SET0(&obj);
523 
524  st_entity_open(&obj.ob_entity);
525 
526  /* Setup bufvec, indexvec and ops for WRITEs */
527  MEM_ALLOC_ARR(ops_w, nr_ops);
528  MEM_ALLOC_ARR(ext_w, nr_ops);
529  MEM_ALLOC_ARR(data_w, nr_ops);
530  MEM_ALLOC_ARR(attr_w, nr_ops);
531  if (ops_w == NULL || ext_w == NULL || data_w == NULL || attr_w == NULL)
532  goto CLEANUP;
533 
534  for (j = 0; j < nr_ops; j++) {
535  if (m0_indexvec_alloc(&ext_w[j], nr_ent) ||
536  m0_bufvec_alloc(&data_w[j], nr_ent, unit_size * stride) ||
537  m0_bufvec_alloc(&attr_w[j], nr_ent, 1))
538  {
539  rc = -ENOMEM;
540  goto CLEANUP;
541  }
542 
543  for (i = 0; i < nr_ent; i++) {
544  memset(data_w[j].ov_buf[i], 'A' + i,
545  unit_size * stride);
546  ext_w[j].iv_index[i] = unit_size * (start + i * stride);
547  ext_w[j].iv_vec.v_count[i] = unit_size * stride;
548  attr_w[j].ov_vec.v_count[i] = 0;
549  }
550 
551  /* Reorder index and data vectors */
552  for (i = 0; i < nr_ent; i+=2) {
553  M0_SWAP(INDEX(&ext_w[j], i), INDEX(&ext_w[j], i + 1));
554  M0_SWAP(COUNT(&ext_w[j], i), COUNT(&ext_w[j], i + 1));
555  memset(data_w[j].ov_buf[i], 'A' + i + 1,
556  unit_size * stride);
557  memset(data_w[j].ov_buf[i + 1], 'A' + i,
558  unit_size * stride);
559  }
560  }
561 
562  /* Create and launch write requests */
563  for (i = 0; i < nr_ops; i++) {
564  ops_w[i] = NULL;
565  st_obj_op(&obj, M0_OC_WRITE, &ext_w[i], &data_w[i], NULL,
566  0, 0, &ops_w[i]);
567  if (ops_w[i] == NULL) {
568  rc = -ENOMEM;
569  break;
570  }
571  }
572  if (i == 0)
573  goto CLEANUP;
574 
575  st_op_launch(ops_w, nr_ops);
576 
577  /* Wait for write to finish */
578  for (i = 0; i < nr_ops; i++) {
579  rc = st_op_wait(ops_w[i],
581  M0_OS_STABLE),
582  M0_TIME_NEVER);
583 
584  st_op_fini(ops_w[i]);
585  st_op_free(ops_w[i]);
586  }
587 
588  for (j = 0; j < nr_ops; j++)
589  for (i = 0; i < nr_ent; i+=2) {
590  memset(data_w[j].ov_buf[i], 'A' + i,
591  unit_size * stride);
592  memset(data_w[j].ov_buf[i + 1], 'A' + i + 1,
593  unit_size * stride);
594  }
595  /* 3. Verify the data written */
596  if (!verify)
597  goto CLEANUP;
598 
599  rc = write_verify_unorder(&data_w[0], oid, start, stride, unit_size,
600  nr_ops, nr_ent);
601 
602 CLEANUP:
603  st_entity_fini(&obj.ob_entity);
604 
605  for (i = 0; i < nr_ops; i++) {
606  if (ext_w != NULL && ext_w[i].iv_vec.v_nr != 0)
607  m0_indexvec_free(&ext_w[i]);
608  if (data_w != NULL && data_w[i].ov_buf != NULL)
609  m0_bufvec_free(&data_w[i]);
610  if (attr_w != NULL && attr_w[i].ov_buf != NULL)
611  m0_bufvec_free(&attr_w[i]);
612  }
613 
614  if (ops_w != NULL) mem_free(ops_w);
615  if (ext_w != NULL) mem_free(ext_w);
616  if (data_w != NULL) mem_free(data_w);
617  if (attr_w != NULL) mem_free(attr_w);
618 
619  return rc;
620 }
621 
626 static void write_unorder_pargrp(void)
627 {
628  int rc;
629  int nr_segs;
630  int nr_ops;
631  int start;
632  int stride;
633  struct m0_uint128 oid;
634 
635  /* 1. Create an object */
637  ST_ASSERT_FATAL(rc == 0);
638 
639  /*
640  * 2. We want to write/read one group with nr_segs chunks
641  * from the beginning of the object
642  */
643  start = 0;
644  stride = 100; /* or DEFAULT_PARGRP_DATA_UNIT_NUM */;
645  nr_segs = 10;
646  nr_ops = 1;
648  nr_ops, nr_segs, true);
649  ST_ASSERT_FATAL(rc == 0);
650 }
651 
655 static void write_pargrps(void)
656 {
657  int i;
658  int rc;
659  int nr_rounds;
660  int start;
661  int stride;
662  struct m0_uint128 oid;
663 
664  /* 1. Create an object */
666  ST_ASSERT_FATAL(rc == 0);
667 
668  /*
669  * 2. We want to write/read one group from the beginning
670  * of the object
671  */
672  start = 0;
673  stride = 100; /* or DEFAULT_PARGRP_DATA_UNIT_NUM */;
674  nr_rounds = 2;
675  for (i = 0; i < nr_rounds; i++) {
676  rc = write_obj(oid, start, stride,
677  DEFAULT_PARGRP_UNIT_SIZE, 1, true);
678  ST_ASSERT_FATAL(rc == 0);
679  start += stride;
680  }
681 }
682 
683 /* Initialises the Client environment.*/
684 static int st_write_init(void)
685 {
686  int rc = 0;
687 
688 #if 0
689  st_obj_prev_trace_level = m0_trace_level;
691 #endif
692 
693  /*
694  * Retrieve the uber realm. We don't need to open this,
695  * as realms are not actually implemented yet
696  */
699  st_get_instance());
701 
702  if (rc != 0)
703  console_printf("Failed to open uber realm\n");
704 
706  return rc;
707 }
708 
709 /* Finalises the Client environment.*/
710 static int st_write_fini(void)
711 {
712  //m0_trace_level = st_obj_prev_trace_level;
713  return 0;
714 }
715 
717  .ss_name = "m0_write_st",
718  .ss_init = st_write_init,
719  .ss_fini = st_write_fini,
720  .ss_tests = {
721  { "write_unorder_pargrp", &write_unorder_pargrp},
722  { "write_pargrps", &write_pargrps},
723  { "write_pargrps_rmw", &write_pargrps_rmw},
724  { "write_pargrps_in_parallel_ops", &write_pargrps_in_parallel_ops},
725  { "write_small_objs", &write_small_objs},
726  { "write_medium_objs", &write_medium_objs},
727  { "write_large_objs", &write_large_objs},
728  { "write_with_layout_id", &write_with_layout_id},
729  { NULL, NULL }
730  }
731 };
732 
733 #undef M0_TRACE_SUBSYSTEM
734 
735 /*
736  * Local variables:
737  * c-indentation-style: "K&R"
738  * c-basic-offset: 8
739  * tab-width: 8
740  * fill-column: 80
741  * scroll-step: 1
742  * End:
743  */
uint64_t id
Definition: cob.h:2380
int st_entity_create(struct m0_fid *pool, struct m0_entity *entity, struct m0_op **op)
Definition: api.c:71
static int bufvec_cmp(struct m0_bufvec b1, struct m0_bufvec b2)
Definition: write.c:83
void st_op_free(struct m0_op *op)
Definition: api.c:147
Definition: client.h:788
M0_INTERNAL int m0_indexvec_alloc(struct m0_indexvec *ivec, uint32_t len)
Definition: vec.c:532
#define NULL
Definition: misc.h:38
static int st_write_fini(void)
Definition: write.c:710
static int write_unordered_obj(struct m0_uint128 oid, int start, int stride, int unit_size, int nr_ops, int nr_ent, bool verify)
Definition: write.c:500
const m0_time_t M0_TIME_NEVER
Definition: time.c:108
static void write_small_objs(void)
Definition: write.c:339
#define min_check(a, b)
Definition: arith.h:88
uint64_t m0_obj_unit_size_to_layout_id(int unit_size)
Definition: obj.c:836
struct m0_vec ov_vec
Definition: vec.h:147
static void write_unorder_pargrp(void)
Definition: write.c:626
uint64_t m0_client_layout_id(const struct m0_client *instance)
Definition: obj.c:859
M0_INTERNAL void m0_indexvec_free(struct m0_indexvec *ivec)
Definition: vec.c:553
struct m0_addb_ctx m0_addb_ctx
#define M0_BITS(...)
Definition: misc.h:236
M0_INTERNAL void * m0_bufvec_cursor_addr(struct m0_bufvec_cursor *cur)
Definition: vec.c:597
#define M0_SET0(obj)
Definition: misc.h:64
const struct m0_uint128 M0_UBER_REALM
Definition: client.c:85
#define M0_SWAP(v0, v1)
Definition: arith.h:207
static void write_pargrps_rmw(void)
Definition: write.c:386
#define ST_ASSERT_FATAL(a)
Definition: st_assert.h:31
void ** ov_buf
Definition: vec.h:149
static struct foo * obj
Definition: tlist.c:302
M0_INTERNAL int m0_bufvec_alloc(struct m0_bufvec *bufvec, uint32_t num_segs, m0_bcount_t seg_size)
Definition: vec.c:220
struct m0_vec iv_vec
Definition: vec.h:139
static uint32_t unit_size
Definition: layout.c:53
M0_INTERNAL void m0_bufvec_free(struct m0_bufvec *bufvec)
Definition: vec.c:395
m0_bindex_t * iv_index
Definition: vec.h:141
M0_INTERNAL bool m0_bufvec_cursor_move(struct m0_bufvec_cursor *cur, m0_bcount_t count)
Definition: vec.c:574
struct m0_container st_write_container
Definition: write.c:38
int i
Definition: dir.c:1033
struct m0_realm co_realm
Definition: client.h:881
Definition: client.h:641
static void write_large_objs(void)
Definition: write.c:349
static int st_write_init(void)
Definition: write.c:684
#define INDEX(ivec, i)
Definition: write.c:493
Definition: write.c:41
void st_container_init(struct m0_container *con, struct m0_realm *parent, const struct m0_uint128 *id, struct m0_client *instance)
Definition: api.c:34
M0_INTERNAL m0_bcount_t m0_bufvec_cursor_step(const struct m0_bufvec_cursor *cur)
Definition: vec.c:581
struct m0_entity re_entity
Definition: client.h:871
int oid_get(struct m0_uint128 *oid)
Definition: oid.c:373
Definition: st.h:83
M0_INTERNAL void m0_bufvec_cursor_init(struct m0_bufvec_cursor *cur, const struct m0_bufvec *bvec)
Definition: vec.c:563
#define write_objs(nr_objs, size, unit_size, verify)
Definition: write.c:303
static int write_obj(struct m0_uint128 oid, int start, int stride, int unit_size, int nr_ops, bool verify)
Definition: write.c:203
uint32_t v_nr
Definition: vec.h:51
int32_t sm_rc
Definition: sm.h:336
m0_bcount_t * v_count
Definition: vec.h:53
void console_printf(const char *fmt,...)
Definition: st_misc.c:155
static void write_pargrps(void)
Definition: write.c:655
static void mem_free(const struct m0_be_btree *btree, struct m0_be_tx *tx, void *ptr)
Definition: btree.c:102
static void write_medium_objs(void)
Definition: write.c:344
static int write_verify_unorder(struct m0_bufvec *data_w, struct m0_uint128 oid, int start, int stride, int unit_size, int nr_ops, int nr_ent)
Definition: write.c:412
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
void st_obj_op(struct m0_obj *obj, enum m0_obj_opcode opcode, struct m0_indexvec *ext, struct m0_bufvec *data, struct m0_bufvec *attr, uint64_t mask, uint32_t flags, struct m0_op **op)
Definition: api.c:100
#define MEM_ALLOC_ARR(arr, nr)
Definition: st_misc.h:80
#define COUNT(ivec, i)
Definition: write.c:494
static int create_obj(struct m0_uint128 *oid, int unit_size)
Definition: write.c:50
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
m0_trace_level
Definition: trace.h:454
#define M0_CLIENT_THREAD_ENTER
static int start(struct m0_fom *fom)
Definition: trigger_fom.c:321
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
const char * ss_name
Definition: st.h:85
static void write_pargrps_in_parallel_ops(void)
Definition: write.c:359
static int write_verify(struct m0_bufvec *data_w, struct m0_uint128 oid, int start, int stride, int unit_size, int nr_ops)
Definition: write.c:122
void st_entity_open(struct m0_entity *entity)
Definition: api.c:153
struct m0_sm en_sm
Definition: client.h:732
struct m0_fom_ops ops
Definition: io_foms.c:623
int32_t st_op_wait(struct m0_op *op, uint64_t bits, m0_time_t to)
Definition: api.c:136
struct st_suite st_suite_m0_write
Definition: write.c:716
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 write_with_layout_id(void)
Definition: write.c:354
Definition: vec.h:145