Motr  M0
mt_fom.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 #define M0_TRACE_SUBSYSTEM M0_TRACE_SUBSYS_CLIENT
24 #include "lib/trace.h"
25 
26 #include "motr/client.h"
27 #include "motr/st/st.h"
28 #include "motr/st/st_misc.h"
29 #include "motr/st/st_assert.h"
30 #include "lib/trace.h"
31 
32 #include "fid/fid.h"
33 #include "fop/fom_simple.h" /* m0_fom_simple */
34 #include "lib/misc.h" /* M0_SRC_PATH */
35 
36 static int st_mt_init(void)
37 {
38  return 0;
39 }
40 
41 static int st_mt_fini(void)
42 {
43  return 0;
44 }
45 
46 enum {
47  /* CMT_PUTS = 256, Reduces UT run time */
48  CMT_PUTS = 64,
51  CMT_IDXS = 64,
53 
54  /* CMT_BATCH = 32, Reduces UT run time */
55  CMT_BATCH = 16,
56  CMT_BATCH_OFF = 1024,
59 
60  /* CMT_KV_SZ = 128, Reduces UT run time */
61  CMT_KV_SZ = 10,
62 };
64 
65 enum {
73 };
74 
75 struct st_fom_ctx {
78  int sfc_i;
79  bool sfc_fired;
80  struct m0_op *sfc_op;
81  struct m0_client *sfc_cli;
83 
87  int64_t sfc_ci;
88 };
89 
90 struct st_mt_ctxt {
92  struct m0_client *csc_cli;
95 
96  struct m0_reqh *csc_reqh;
98  uint64_t csc_foms_nr;
99  uint64_t csc_loc_nr;
101 };
102 
103 /* XXX copy-paste from lib/ut/locality.c */
104 static void fom_simple_svc_start(struct m0_reqh *reqh)
105 {
106  struct m0_reqh_service_type *stype;
107  struct m0_reqh_service *service;
108  int rc;
109 
110  stype = m0_reqh_service_type_find("simple-fom-service");
111  M0_ASSERT(stype != NULL);
113  M0_ASSERT(rc == 0);
115  &M0_FID_INIT(0xdeadb00f, 0xb00fdead));
117  M0_ASSERT(rc == 0);
119 }
120 
121 static void st_op_lock(struct m0_op *op)
122 {
123  m0_sm_group_lock(op->op_sm.sm_grp);
124 }
125 
126 static void st_op_unlock(struct m0_op *op)
127 {
128  m0_sm_group_unlock(op->op_sm.sm_grp);
129 }
130 
131 static int st_op_tick_ret(struct m0_op *op,
132  struct m0_fom *fom)
133 {
135 
136  st_op_lock(op);
137 
138  if (op->op_sm.sm_state < M0_OS_STABLE) {
139  ret = M0_FSO_WAIT;
140  m0_fom_wait_on(fom, &op->op_sm.sm_chan, &fom->fo_cb);
141  }
142 
143  st_op_unlock(op);
144 
145  return ret;
146 }
147 
148 static void st_dix_kv_destroy(struct m0_bufvec *keys,
149  struct m0_bufvec *vals)
150 {
151  m0_bufvec_free(keys);
152  m0_bufvec_free(vals);
153 }
154 
155 static void st_kv_alloc_and_fill(struct m0_bufvec *keys,
156  struct m0_bufvec *vals,
157  uint32_t first,
158  uint32_t last,
159  bool emptyvals)
160 {
161  uint32_t i;
162  uint32_t count = last - first + 1;
163  int rc;
164 
165  rc = m0_bufvec_alloc(keys, count, CMT_KV_SZ);
166  M0_ASSERT(rc == 0);
167  rc = emptyvals ?
170  M0_ASSERT(rc == 0);
171  for (i = 0; i < count; i++) {
172  sprintf(keys->ov_buf[i], "%0*"PRIu32, CMT_KV_SZ - 1, first + i);
173  if (!emptyvals)
174  sprintf(vals->ov_buf[i], "%0*"PRIu32, CMT_KV_SZ - 1,
175  first + i);
176  }
177 }
178 
179 static void st_vals_check(struct m0_bufvec *keys,
180  struct m0_bufvec *vals,
181  uint32_t first,
182  uint32_t last)
183 {
184  uint32_t i;
185  uint32_t count = last - first + 1;
186  char *key;
187  char *val;
188 
189  M0_ASSERT(vals->ov_vec.v_nr == keys->ov_vec.v_nr);
190  M0_ASSERT(keys->ov_vec.v_nr == count);
191  for (i = 0; i < count; i++) {
192  char buf[CMT_KV_SZ];
193  key = (char *)keys->ov_buf[i];
194  val = (char *)vals->ov_buf[i];
195  sprintf(buf, "%0*"PRIu32, CMT_KV_SZ - 1, first + i);
196  M0_ASSERT(memcmp(key, buf, CMT_KV_SZ) == 0);
197  M0_ASSERT(memcmp(val, buf, CMT_KV_SZ) == 0);
198  }
199 }
200 
201 static void st_ifid_fill(struct m0_fid *ifid, int i)
202 {
204 }
205 
206 static int st_common_tick(struct m0_fom *fom, void *data, int *phase,
207  int rqtype)
208 {
209  struct st_fom_ctx *fctx = data;
210  struct m0_idx *idxs = fctx->sfc_ctx->csc_index;
211  struct m0_fid *ifid = fctx->sfc_ctx->csc_ifid;
212  struct m0_bufvec *keys = &fctx->sfc_keys;
213  struct m0_bufvec *vals = &fctx->sfc_vals;
214  int *rcs = fctx->sfc_rcs;
215  int64_t ci;
216  int rc;
217 
218  M0_LOG(M0_DEBUG, "i=%d fired=%d rqtype=%d",
219  fctx->sfc_i, !!fctx->sfc_fired, rqtype);
220  if (!fctx->sfc_fired) {
221  ci = m0_atomic64_sub_return(&fctx->sfc_ctx->csc_counter, 1);
222  M0_LOG(M0_DEBUG, "fom=%p rq=%d ci=%d", fom, rqtype, (int)ci);
223  if (ci < 0)
224  return -1;
225 
226  fctx->sfc_ci = ci;
227  fctx->sfc_fired = true;
228  M0_SET0(keys);
229  M0_SET0(vals);
230  st_kv_alloc_and_fill(keys, vals,
231  (int)ci * CMT_BATCH_OFF,
232  (int)ci * CMT_BATCH_OFF + CMT_BATCH,
233  M0_IN(rqtype, (REQ_GET, REQ_DEL)));
234  switch(rqtype) {
235  case REQ_CREATE:
236  st_ifid_fill(&ifid[ci], ci);
237  m0_idx_init(&idxs[ci],
238  &fctx->sfc_ctx->csc_realm.co_realm,
239  (struct m0_uint128 *)&ifid[ci]);
240  rc = m0_entity_create(NULL, &idxs[ci].in_entity,
241  &fctx->sfc_op);
242  break;
243  case REQ_DELETE:
244  rc = m0_entity_delete(&idxs[ci].in_entity,
245  &fctx->sfc_op);
246  break;
247  case REQ_PUT:
248  rc = m0_idx_op(&idxs[ci % CMT_IDXS_NR],
249  M0_IC_PUT,
250  keys, vals, rcs, 0,
251  &fctx->sfc_op);
252  break;
253  case REQ_DEL:
254  rc = m0_idx_op(&idxs[ci % CMT_IDXS_NR],
255  M0_IC_DEL,
256  keys, NULL, rcs, 0,
257  &fctx->sfc_op);
258  break;
259  case REQ_GET:
260  rc = m0_idx_op(&idxs[ci % CMT_IDXS_NR],
261  M0_IC_GET,
262  keys, vals, rcs, 0,
263  &fctx->sfc_op);
264  break;
265  default:
266  M0_IMPOSSIBLE("");
267  }
268  M0_ASSERT(rc == 0);
269  m0_op_launch(&fctx->sfc_op, 1);
270  }
271  rc = st_op_tick_ret(fctx->sfc_op, fom);
272  if (rc == M0_FSO_WAIT)
273  return M0_RC(rc);
274 
275  switch(rqtype) {
276  case REQ_DELETE:
277  case REQ_CREATE:
278  break;
279  case REQ_GET:
280  ci = fctx->sfc_ci;
281  st_vals_check(keys, vals, (int)ci * CMT_BATCH_OFF,
282  (int)ci * CMT_BATCH_OFF + CMT_BATCH);
283  default:
284  M0_ASSERT(m0_forall(i, CMT_IDXS_NR, rcs[i] == 0));
285  }
286  m0_op_fini(fctx->sfc_op);
287  m0_free0(&fctx->sfc_op);
288 
289  st_dix_kv_destroy(keys, vals);
290  fctx->sfc_fired = false;
291 
292  return M0_FSO_AGAIN;
293 }
294 
295 static int st_get_tick(struct m0_fom *fom, void *data, int *phase)
296 {
297  return st_common_tick(fom, data, phase, REQ_GET);
298 }
299 
300 static int st_put_tick(struct m0_fom *fom, void *data, int *phase)
301 {
302  return st_common_tick(fom, data, phase, REQ_PUT);
303 }
304 
305 static int st_del_tick(struct m0_fom *fom, void *data, int *phase)
306 {
307  return st_common_tick(fom, data, phase, REQ_DEL);
308 }
309 
310 static int st_idx_create_tick(struct m0_fom *fom, void *data, int *phase)
311 {
312  return st_common_tick(fom, data, phase, REQ_CREATE);
313 }
314 
315 static int st_idx_delete_tick(struct m0_fom *fom, void *data, int *phase)
316 {
317  return st_common_tick(fom, data, phase, REQ_DELETE);
318 }
319 
320 static void st_fom_free(struct m0_fom_simple *fom_s)
321 {
322  struct st_fom_ctx *fctx;
323 
324  fctx = container_of(fom_s, struct st_fom_ctx, sfc_fom_s);
325  m0_semaphore_up(&fctx->sfc_done);
326 }
327 
328 static void st_foms_run(struct st_mt_ctxt *ctx,
329  int (*tick)(struct m0_fom *, void *, int *))
330 {
331  struct st_fom_ctx *fctx;
332  struct m0_fom_simple *fom_s;
333  int foms_to_run;
334  int i;
335 
336  foms_to_run = ctx->csc_foms_nr;
337  for (i = 0; i < foms_to_run; ++i) {
338  fctx = &ctx->csc_fctx[i];
339  fom_s = &fctx->sfc_fom_s;
340  fctx->sfc_i = i;
341  fctx->sfc_fired = false;
342  M0_SET0(fom_s);
343  m0_fom_simple_post(fom_s, ctx->csc_reqh, NULL,
344  tick, &st_fom_free, fctx, i);
345  }
346  for (i = 0; i < foms_to_run; ++i)
347  m0_semaphore_down(&ctx->csc_fctx[i].sfc_done);
348 }
349 
350 static void st_foms_init(struct st_mt_ctxt *ctx)
351 {
352  struct m0_reqh *reqh = ctx->csc_reqh;
353  struct st_fom_ctx *fctx;
354  uint64_t loc_nr;
355  uint64_t foms_nr;
356  int i;
357 
358  M0_PRE(ctx->csc_reqh != NULL);
359  M0_PRE(ctx->csc_cli != NULL);
360 
362  foms_nr = loc_nr * CMT_FOM_PER_LOC;
363 
364  M0_ALLOC_ARR(ctx->csc_fctx, foms_nr);
365  M0_ASSERT(ctx->csc_fctx != NULL);
366  ctx->csc_foms_nr = foms_nr;
367  ctx->csc_loc_nr = loc_nr;
368 
369  for (i = 0; i < foms_nr; ++i) {
370  fctx = &ctx->csc_fctx[i];
371  fctx->sfc_cli = ctx->csc_cli;
372  fctx->sfc_ctx = ctx;
373  m0_semaphore_init(&fctx->sfc_done, 0);
374  }
375 }
376 
377 void st_mt_inst(struct m0_client *cli)
378 {
379  static struct st_mt_ctxt ctx = {};
380 
381  m0_container_init(&ctx.csc_realm, NULL,
382  &M0_UBER_REALM,
383  cli);
384 
385  ctx.csc_reqh = &cli->m0c_reqh;
386  ctx.csc_cli = cli;
387  fom_simple_svc_start(ctx.csc_reqh);
388  st_foms_init(&ctx);
389 
390  m0_atomic64_set(&ctx.csc_counter, CMT_IDXS);
392 
393  m0_atomic64_set(&ctx.csc_counter, CMT_PUTS);
395 
396  m0_atomic64_set(&ctx.csc_counter, CMT_GETS);
398 
399  m0_atomic64_set(&ctx.csc_counter, CMT_DELS);
401 
402  m0_atomic64_set(&ctx.csc_counter, CMT_IDXD);
404 }
405 
406 void st_lsfid_inst(struct m0_client *cli,
407  void (*print)(struct m0_fid*))
408 {
409  enum { BATCH_SZ = 128 };
410 
411  struct m0_fid ifid0;
412  struct m0_bufvec keys;
413  struct m0_op *op = NULL;
414  struct m0_idx idx0;
415  struct m0_container realm;
416  int32_t rcs[BATCH_SZ];
417  int i;
418  int rc;
419 
421  ifid0 = M0_FID_TINIT(m0_dix_fid_type.ft_id, 0, 0);
422  rc = m0_bufvec_alloc(&keys, BATCH_SZ, sizeof(struct m0_fid));
423  M0_ASSERT(rc == 0);
424 
425  m0_idx_init(&idx0, &realm.co_realm, (struct m0_uint128 *)&ifid0);
426  rc = m0_idx_op(&idx0, M0_IC_LIST, &keys, NULL, rcs, 0,
427  &op);
428  M0_ASSERT(rc == 0);
429  m0_op_launch(&op, 1);
431  M0_ASSERT(rc == 0);
432 
433  m0_op_fini(op);
434  m0_free0(&op);
435  m0_idx_fini(&idx0);
436 
437  for (i = 0; i < BATCH_SZ; ++i) {
438  if (rcs[i] == 0) {
439  struct m0_fid *fid = keys.ov_buf[i];
440 
441  M0_ASSERT(keys.ov_vec.v_count[i] ==
442  sizeof(struct m0_fid));
445  if (print != NULL)
446  print(fid);
447  }
448  }
449 
450  m0_bufvec_free(&keys);
451 }
452 
453 /* Launches index operations and cancel operation after launch */
455  void (*print)(struct m0_fid*))
456 {
457  enum { BATCH_SZ = 128 };
458 
459  struct m0_fid ifid[BATCH_SZ];
460  struct m0_bufvec keys[BATCH_SZ];
461  struct m0_op *op[BATCH_SZ] = { NULL };
462  struct m0_idx idx[BATCH_SZ];
463  int32_t rcs[BATCH_SZ];
464  struct m0_container realm;
465  int i;
466  int rc;
467 
469  for (i = 0; i < BATCH_SZ; i++) {
470  st_ifid_fill(&ifid[i], i);
471  rc = m0_bufvec_alloc(&keys[i], BATCH_SZ, sizeof(struct m0_fid));
472  M0_ASSERT(rc == 0);
473  m0_idx_init(&idx[i], &realm.co_realm,
474  (struct m0_uint128 *)&ifid[i]);
475  rc = m0_idx_op(&idx[i], M0_IC_LIST, &keys[i],
476  NULL, rcs, 0,
477  &op[i]);
478  M0_ASSERT(rc == 0);
479  }
480 
481  for (i = 0; i < BATCH_SZ; i++)
482  m0_op_launch(&op[i], 1);
483 
484  /* op wait can be used here for few seconds. */
485  for (i = 0; i < BATCH_SZ; i++) {
486  rc = m0_op_wait(op[i],
489  M0_OS_STABLE),
490  m0_time_from_now(5, 0));
491  M0_ASSERT(rc == 0);
492  }
493 
494  for (i = 0; i < BATCH_SZ; i++) {
495  m0_op_cancel(&op[i], 1);
496  rc = m0_op_wait(op[i],
498  M0_OS_STABLE),
499  M0_TIME_NEVER);
500  M0_ASSERT(rc == 0);
501  }
502 
503  for (i = 0; i < BATCH_SZ; ++i) {
504  m0_op_fini(op[i]);
505  m0_free0(&op[i]);
506  m0_idx_fini(&idx[i]);
507  m0_bufvec_free(&keys[i]);
508  }
509 }
510 
511 void st_mt(void)
512 {
514 }
515 
516 void st_lsfid(void)
517 {
519 }
520 
521 void st_lsfid_cancel(void)
522 {
524 }
525 
527  .ss_name = "st_mt",
528  .ss_init = st_mt_init,
529  .ss_fini = st_mt_fini,
530  .ss_tests = {
531  { "st_mt", st_mt },
532  { "st_lsfid", st_lsfid },
533  { "st_lsfid_cancel", st_lsfid_cancel },
534  { NULL, NULL },
535  }
536 };
537 
538 #undef M0_TRACE_SUBSYSTEM
539 
540 /*
541  * Local variables:
542  * c-indentation-style: "K&R"
543  * c-basic-offset: 8
544  * tab-width: 8
545  * fill-column: 80
546  * scroll-step: 1
547  * End:
548  */
Definition: mt_fom.c:70
static int st_mt_init(void)
Definition: mt_fom.c:36
void st_lsfid_cancel(void)
Definition: mt_fom.c:521
static void st_kv_alloc_and_fill(struct m0_bufvec *keys, struct m0_bufvec *vals, uint32_t first, uint32_t last, bool emptyvals)
Definition: mt_fom.c:155
#define M0_PRE(cond)
#define M0_ALLOC_ARR(arr, nr)
Definition: memory.h:84
M0_INTERNAL int m0_reqh_service_start(struct m0_reqh_service *service)
Definition: reqh_service.c:343
Definition: client.h:835
struct m0_idx csc_index[CMT_IDXS_NR]
Definition: mt_fom.c:93
static void tick(struct m0_locality_chore *chore, struct m0_locality *loc, void *place)
Definition: locality.c:326
#define NULL
Definition: misc.h:38
Definition: idx_mock.c:52
const m0_time_t M0_TIME_NEVER
Definition: time.c:108
void m0_op_fini(struct m0_op *op)
Definition: client.c:847
struct m0_op * sfc_op
Definition: mt_fom.c:80
#define M0_LOG(level,...)
Definition: trace.h:167
uint8_t ft_id
Definition: fid.h:101
#define M0_FID_INIT(container, key)
Definition: fid.h:84
struct m0_vec ov_vec
Definition: vec.h:147
static int64_t m0_atomic64_sub_return(struct m0_atomic64 *a, int64_t d)
struct m0_semaphore sfc_done
Definition: mt_fom.c:77
struct m0_bufvec data
Definition: di.c:40
static void st_foms_init(struct st_mt_ctxt *ctx)
Definition: mt_fom.c:350
M0_INTERNAL void m0_fom_wait_on(struct m0_fom *fom, struct m0_chan *chan, struct m0_fom_callback *cb)
Definition: fom.c:1490
#define M0_BITS(...)
Definition: misc.h:236
void m0_idx_fini(struct m0_idx *idx)
Definition: idx.c:643
#define container_of(ptr, type, member)
Definition: misc.h:33
#define M0_SET0(obj)
Definition: misc.h:64
const struct m0_uint128 M0_UBER_REALM
Definition: client.c:85
struct m0_atomic64 csc_counter
Definition: mt_fom.c:100
M0_INTERNAL bool m0_fid_is_set(const struct m0_fid *fid)
Definition: fid.c:106
struct st_suite st_suite_mt
Definition: mt_fom.c:526
Definition: mt_fom.c:71
void ** ov_buf
Definition: vec.h:149
Definition: sock.c:887
static m0_bcount_t count
Definition: xcode.c:167
struct m0_reqh * csc_reqh
Definition: mt_fom.c:96
M0_INTERNAL struct m0_reqh_service_type * m0_reqh_service_type_find(const char *sname)
Definition: reqh_service.c:168
M0_INTERNAL void m0_fom_simple_post(struct m0_fom_simple *simpleton, struct m0_reqh *reqh, struct m0_sm_conf *conf, int(*tick)(struct m0_fom *, void *, int *), void(*free)(struct m0_fom_simple *sfom), void *data, size_t locality)
Definition: fom_simple.c:49
uint64_t csc_loc_nr
Definition: mt_fom.c:99
struct m0_fid fid
Definition: di.c:46
M0_INTERNAL int m0_bufvec_alloc(struct m0_bufvec *bufvec, uint32_t num_segs, m0_bcount_t seg_size)
Definition: vec.c:220
int32_t m0_op_wait(struct m0_op *op, uint64_t bits, m0_time_t to)
Definition: client.c:739
int sfc_rcs[CMT_IDXS_NR]
Definition: mt_fom.c:86
int m0_idx_op(struct m0_idx *idx, enum m0_idx_opcode opcode, struct m0_bufvec *keys, struct m0_bufvec *vals, int32_t *rcs, uint32_t flags, struct m0_op **op)
Definition: idx.c:554
return M0_RC(rc)
op
Definition: libdemo.c:64
M0_INTERNAL void m0_bufvec_free(struct m0_bufvec *bufvec)
Definition: vec.c:395
int64_t sfc_ci
Definition: mt_fom.c:87
M0_INTERNAL void m0_sm_group_unlock(struct m0_sm_group *grp)
Definition: sm.c:96
int i
Definition: dir.c:1033
static M0_UNUSED void print(struct m0_be_list *list)
Definition: list.c:186
Definition: client.h:641
static void st_fom_free(struct m0_fom_simple *fom_s)
Definition: mt_fom.c:320
struct m0_bufvec sfc_keys
Definition: mt_fom.c:84
static int key
Definition: locality.c:283
#define M0_FID_TINIT(type, container, key)
Definition: fid.h:90
static const struct socktype stype[]
Definition: sock.c:1156
#define m0_free0(pptr)
Definition: memory.h:77
M0_INTERNAL const struct m0_fid_type m0_dix_fid_type
Definition: cas.c:168
#define M0_ASSERT(cond)
Definition: st.h:83
void st_mt_inst(struct m0_client *cli)
Definition: mt_fom.c:377
struct m0t1fs_inode * ci
Definition: dir.c:622
struct m0_reqh m0c_reqh
static void st_foms_run(struct st_mt_ctxt *ctx, int(*tick)(struct m0_fom *, void *, int *))
Definition: mt_fom.c:328
void m0_op_launch(struct m0_op **op, uint32_t nr)
Definition: client.c:725
M0_INTERNAL bool m0_reqh_service_invariant(const struct m0_reqh_service *svc)
Definition: reqh_service.c:143
struct m0_container csc_realm
Definition: mt_fom.c:91
Definition: mt_fom.c:72
static int st_get_tick(struct m0_fom *fom, void *data, int *phase)
Definition: mt_fom.c:295
M0_INTERNAL int m0_semaphore_init(struct m0_semaphore *semaphore, unsigned value)
Definition: semaphore.c:38
M0_INTERNAL uint64_t m0_reqh_nr_localities(const struct m0_reqh *reqh)
Definition: reqh.c:723
static void st_ifid_fill(struct m0_fid *ifid, int i)
Definition: mt_fom.c:201
static int st_idx_create_tick(struct m0_fom *fom, void *data, int *phase)
Definition: mt_fom.c:310
#define M0_POST(cond)
M0_INTERNAL int m0_reqh_service_allocate(struct m0_reqh_service **out, const struct m0_reqh_service_type *stype, struct m0_reqh_context *rctx)
Definition: reqh_service.c:185
Definition: reqh.h:94
struct m0_fom_simple sfc_fom_s
Definition: mt_fom.c:76
uint32_t v_nr
Definition: vec.h:51
Definition: dump.c:103
M0_INTERNAL void m0_reqh_service_init(struct m0_reqh_service *service, struct m0_reqh *reqh, const struct m0_fid *fid)
Definition: reqh_service.c:428
m0_bcount_t * v_count
Definition: vec.h:53
struct m0_client * csc_cli
Definition: mt_fom.c:92
void m0_op_cancel(struct m0_op **op, uint32_t nr)
Definition: client.c:639
static struct fdmi_ctx ctx
Definition: main.c:80
#define FID_P(f)
Definition: fid.h:77
struct st_fom_ctx * csc_fctx
Definition: mt_fom.c:97
void st_lsfid_inst_cancel(struct m0_client *cli, void(*print)(struct m0_fid *))
Definition: mt_fom.c:454
#define m0_forall(var, nr,...)
Definition: misc.h:112
int m0_entity_create(struct m0_fid *pool, struct m0_entity *entity, struct m0_op **op)
Definition: obj.c:801
Definition: fom.h:481
static void st_op_unlock(struct m0_op *op)
Definition: mt_fom.c:126
M0_BASSERT(CMT_PUTS >=CMT_IDXS)
#define PRIu32
Definition: types.h:66
static void st_op_lock(struct m0_op *op)
Definition: mt_fom.c:121
struct m0_reqh reqh
Definition: rm_foms.c:48
struct m0_bufvec sfc_vals
Definition: mt_fom.c:85
static int st_common_tick(struct m0_fom *fom, void *data, int *phase, int rqtype)
Definition: mt_fom.c:206
struct m0_fid csc_ifid[CMT_IDXS_NR]
Definition: mt_fom.c:94
static int st_put_tick(struct m0_fom *fom, void *data, int *phase)
Definition: mt_fom.c:300
int sfc_i
Definition: mt_fom.c:78
Definition: fid.h:38
bool sfc_fired
Definition: mt_fom.c:79
m0_fom_phase_outcome
Definition: fom.h:625
static void st_vals_check(struct m0_bufvec *keys, struct m0_bufvec *vals, uint32_t first, uint32_t last)
Definition: mt_fom.c:179
void st_lsfid_inst(struct m0_client *cli, void(*print)(struct m0_fid *))
Definition: mt_fom.c:406
static struct m0_realm realm
Definition: sync.c:87
void st_mt(void)
Definition: mt_fom.c:511
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
static int st_op_tick_ret(struct m0_op *op, struct m0_fom *fom)
Definition: mt_fom.c:131
static void st_dix_kv_destroy(struct m0_bufvec *keys, struct m0_bufvec *vals)
Definition: mt_fom.c:148
M0_INTERNAL void m0_sm_group_lock(struct m0_sm_group *grp)
Definition: sm.c:83
const char * ss_name
Definition: st.h:85
static int st_idx_delete_tick(struct m0_fom *fom, void *data, int *phase)
Definition: mt_fom.c:315
int m0_entity_delete(struct m0_entity *entity, struct m0_op **op)
Definition: obj.c:824
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 struct m0_sns_cm_file_ctx fctx
Definition: net.c:55
struct m0_client * sfc_cli
Definition: mt_fom.c:81
M0_INTERNAL void m0_semaphore_down(struct m0_semaphore *semaphore)
Definition: semaphore.c:49
Definition: nucleus.c:42
static int st_del_tick(struct m0_fom *fom, void *data, int *phase)
Definition: mt_fom.c:305
M0_INTERNAL void m0_semaphore_up(struct m0_semaphore *semaphore)
Definition: semaphore.c:65
struct st_mt_ctxt * sfc_ctx
Definition: mt_fom.c:82
static int loc_nr(void)
Definition: locality.c:330
static int st_mt_fini(void)
Definition: mt_fom.c:41
void st_lsfid(void)
Definition: mt_fom.c:516
static struct m0_reqh_service * service[REQH_IN_UT_MAX]
Definition: long_lock_ut.c:46
static struct m0_fid ifid
Definition: service_ut.c:66
int32_t rc
Definition: trigger_fop.h:47
void m0_idx_init(struct m0_idx *idx, struct m0_realm *parent, const struct m0_uint128 *id)
Definition: idx.c:626
uint64_t csc_foms_nr
Definition: mt_fom.c:98
static struct m0_addb2_frame_header last
Definition: storage.c:93
#define FID_F
Definition: fid.h:75
Definition: vec.h:145
static void m0_atomic64_set(struct m0_atomic64 *a, int64_t num)
M0_INTERNAL int m0_bufvec_empty_alloc(struct m0_bufvec *bufvec, uint32_t num_segs)
Definition: vec.c:213
static void fom_simple_svc_start(struct m0_reqh *reqh)
Definition: mt_fom.c:104
Definition: idx_mock.c:47
#define M0_IMPOSSIBLE(fmt,...)