Motr  M0
io_fop.c
Go to the documentation of this file.
1 /* -*- C -*- */
2 /*
3  * Copyright (c) 2012-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/misc.h"
24 #include "lib/errno.h"
25 #include "lib/assert.h"
26 #include "lib/memory.h"
27 #include "lib/chan.h"
28 #include "lib/list.h"
29 
30 #include "balloc/balloc.h"
31 
32 #include "net/net.h"
33 #include "fop/fop.h"
34 #include "reqh/reqh.h"
35 #include "fop/fom.h"
36 #include "fop/fom_generic.h"
37 #include "stob/stob.h"
38 #include "stob/ad.h"
39 #include "rpc/rpc.h"
40 #include "rpc/rpc_opcodes.h"
41 #include "fop/fop_item_type.h"
42 #include "reqh/ut/io_fop.h"
43 #include "reqh/ut/io_fop_xc.h"
44 #include "ut/ut.h"
45 
61 };
62 
69 
72  .sd_name = "Create stob",
73  .sd_allowed = (1 << M0_FOPH_SUCCESS) |
74  (1 << M0_FOPH_FAILURE)
75  },
76 };
77 
80  .sd_name = "Read stob",
81  .sd_allowed = (1 << M0_FOPH_READ_STOB_IO_WAIT) |
82  (1 << M0_FOPH_FAILURE)
83  },
85  .sd_name = "Read stob wait",
86  .sd_allowed = (1 << M0_FOPH_SUCCESS)
87  },
88 };
89 
90 const struct m0_sm_conf read_conf = {
91  .scf_name = "Stob read",
92  .scf_nr_states = ARRAY_SIZE(stob_read_phases),
93  .scf_state = stob_read_phases,
94 };
95 
98  .sd_name = "Write stob",
99  .sd_allowed = (1 << M0_FOPH_READ_STOB_IO_WAIT) |
100  (1 << M0_FOPH_FAILURE)
101  },
103  .sd_name = "Write stob wait",
104  .sd_allowed = (1 << M0_FOPH_SUCCESS)
105  },
106 };
107 
108 const struct m0_sm_conf write_conf = {
109  .scf_name = "Stob write",
110  .scf_nr_states = ARRAY_SIZE(stob_write_phases),
111  .scf_state = stob_write_phases,
112 };
113 
120  struct m0_fom sif_fom;
132 };
133 
134 extern struct m0_stob_domain *reqh_ut_stob_domain_find(void);
135 static int stob_create_fom_create(struct m0_fop *fop, struct m0_fom **out,
136  struct m0_reqh *reqh);
137 static int stob_read_fom_create(struct m0_fop *fop, struct m0_fom **out,
138  struct m0_reqh *reqh);
139 static int stob_write_fom_create(struct m0_fop *fop, struct m0_fom **out,
140  struct m0_reqh *reqh);
141 
142 static int stob_create_fom_tick(struct m0_fom *fom);
143 static int stob_read_fom_tick(struct m0_fom *fom);
144 static int stob_write_fom_tick(struct m0_fom *fom);
145 
146 static void stob_io_fom_fini(struct m0_fom *fom);
147 static size_t stob_find_fom_home_locality(const struct m0_fom *fom);
148 
154  .fo_tick = stob_create_fom_tick,
155  .fo_home_locality = stob_find_fom_home_locality
156 };
157 
160  .fo_tick = stob_write_fom_tick,
161  .fo_home_locality = stob_find_fom_home_locality
162 };
163 
164 static struct m0_fom_ops stob_read_fom_ops = {
166  .fo_tick = stob_read_fom_tick,
167  .fo_home_locality = stob_find_fom_home_locality
168 };
169 
175 };
176 
179 };
180 
183 };
184 
188 static struct m0_stob *stob_object_find(const struct stob_io_fop_fid *fid,
189  struct m0_fom *fom)
190 {
191  struct m0_stob *stob;
192  int rc;
193  struct m0_stob_id stob_id;
194 
195  m0_stob_id_make(0, fid->f_oid, &reqh_ut_stob_domain_find()->sd_id,
196  &stob_id);
197  rc = m0_stob_find(&stob_id, &stob);
198  M0_ASSERT(rc == 0);
200  M0_ASSERT(rc == 0);
201  return stob;
202 }
203 
209  struct m0_fom_ops *fom_ops, struct m0_fop_type *fop_type,
210  struct m0_fom **out, struct m0_reqh *reqh)
211 {
212  struct m0_stob_io_fom *fom_obj;
213 
214  M0_PRE(fop != NULL);
215  M0_PRE(fom_ops != NULL);
216  M0_PRE(fop_type != NULL);
217  M0_PRE(out != NULL);
218 
219  fom_obj = m0_alloc(sizeof *fom_obj);
220  if (fom_obj == NULL)
221  return -ENOMEM;
223  if (fom_obj->sif_rep_fop == NULL) {
224  m0_free(fom_obj);
225  return -ENOMEM;
226  }
227  fom_obj->sif_stobj = NULL;
228 
229  m0_fom_init(&fom_obj->sif_fom, &fop->f_type->ft_fom_type, fom_ops, fop,
230  fom_obj->sif_rep_fop, reqh);
231 
232  *out = &fom_obj->sif_fom;
233  return 0;
234 }
235 
239 static int stob_create_fom_create(struct m0_fop *fop, struct m0_fom **out,
240  struct m0_reqh *reqh)
241 {
244 }
245 
249 static int stob_write_fom_create(struct m0_fop *fop, struct m0_fom **out,
250  struct m0_reqh *reqh)
251 {
254 }
255 
259 static int stob_read_fom_create(struct m0_fop *fop, struct m0_fom **out,
260  struct m0_reqh *reqh)
261 {
264 }
265 
273 static size_t stob_find_fom_home_locality(const struct m0_fom *fom)
274 {
275  size_t iloc;
276 
277  if (fom == NULL)
278  return -EINVAL;
279 
280  switch (m0_fop_opcode(fom->fo_fop)) {
282  struct m0_stob_io_create *fop;
283  uint64_t oid;
284  fop = m0_fop_data(fom->fo_fop);
285  oid = fop->fic_object.f_oid;
286  iloc = oid;
287  break;
288  }
290  struct m0_stob_io_write *fop;
291  uint64_t oid;
292  fop = m0_fop_data(fom->fo_fop);
293  oid = fop->fiw_object.f_oid;
294  iloc = oid;
295  break;
296  }
298  struct m0_stob_io_read *fop;
299  uint64_t oid;
300  fop = m0_fop_data(fom->fo_fop);
301  oid = fop->fir_object.f_oid;
302  iloc = oid;
303  break;
304  }
305  default:
306  return -EINVAL;
307  }
308  return iloc;
309 }
310 
315 static int stob_create_fom_tick(struct m0_fom *fom)
316 {
317  struct m0_stob_io_create *in_fop;
318  struct m0_stob_io_create_rep *out_fop;
319  struct m0_stob_io_fom *fom_obj;
320  struct m0_rpc_item *item;
321  struct m0_fop *fop;
322  int result;
323 
325 
326  fom_obj = container_of(fom, struct m0_stob_io_fom, sif_fom);
327  if (m0_fom_phase(fom) < M0_FOPH_NR) {
331  }
332  result = m0_fom_tick_generic(fom);
333  } else {
334  in_fop = m0_fop_data(fom->fo_fop);
335  out_fop = m0_fop_data(fom_obj->sif_rep_fop);
336 
337  fom_obj->sif_stobj = stob_object_find(&in_fop->fic_object, fom);
338 
339  result = m0_stob_create(fom_obj->sif_stobj, &fom->fo_tx, NULL);
340  out_fop->ficr_rc = result;
341  fop = fom_obj->sif_rep_fop;
344  fom->fo_rep_fop = fom_obj->sif_rep_fop;
347  result = M0_FSO_AGAIN;
348  }
349 
350  if (m0_fom_phase(fom) == M0_FOPH_FINISH && m0_fom_rc(fom) == 0)
351  m0_stob_put(fom_obj->sif_stobj);
352 
353  return result;
354 }
355 
360 static int stob_read_fom_tick(struct m0_fom *fom)
361 {
362  struct m0_stob_io_read *in_fop;
363  struct m0_stob_io_read_rep *out_fop;
364  struct m0_stob_io_fom *fom_obj;
365  struct m0_stob_io *stio;
366  struct m0_stob *stobj;
367  struct m0_rpc_item *item;
368  struct m0_fop *fop;
369  void *addr;
372  uint32_t bshift;
373  int result = 0;
374 
376 
377  fom_obj = container_of(fom, struct m0_stob_io_fom, sif_fom);
378  stio = &fom_obj->sif_stio;
379  if (m0_fom_phase(fom) < M0_FOPH_NR) {
380  result = m0_fom_tick_generic(fom);
381  } else {
382  out_fop = m0_fop_data(fom_obj->sif_rep_fop);
383  M0_ASSERT(out_fop != NULL);
384 
386  uint8_t *buf;
387 
388  in_fop = m0_fop_data(fom->fo_fop);
389  M0_ASSERT(in_fop != NULL);
390  fom_obj->sif_stobj = stob_object_find(
391  &in_fop->fir_object, fom);
392 
393  stobj = fom_obj->sif_stobj;
394  bshift = m0_stob_block_shift(stobj);
395 
397  M0_ASSERT(buf != NULL);
398  out_fop->firr_value.fi_buf = buf;
399  out_fop->firr_value.fi_count =
401 
402  addr = m0_stob_addr_pack(buf, bshift);
403  count = out_fop->firr_value.fi_count >> bshift;
404  offset = 0;
405 
406  m0_stob_io_init(stio);
407 
408  stio->si_user = (struct m0_bufvec)
410 
411  stio->si_stob.iv_vec.v_nr = 1;
412  stio->si_stob.iv_vec.v_count = &count;
413  stio->si_stob.iv_index = &offset;
414 
415  stio->si_opcode = SIO_READ;
416  stio->si_flags = 0;
417 
418  m0_mutex_lock(&stio->si_mutex);
419  m0_fom_wait_on(fom, &stio->si_wait, &fom->fo_cb);
420  m0_mutex_unlock(&stio->si_mutex);
421  result = m0_stob_io_prepare_and_launch(stio, stobj,
422  &fom->fo_tx,
423  NULL);
424 
425  if (result != 0) {
426  m0_mutex_lock(&stio->si_mutex);
427  m0_fom_callback_cancel(&fom->fo_cb);
428  m0_mutex_unlock(&stio->si_mutex);
430  } else {
433  result = M0_FSO_WAIT;
434  }
435  } else if (m0_fom_phase(fom) == M0_FOPH_READ_STOB_IO_WAIT) {
436  stobj = fom_obj->sif_stobj;
437  bshift = m0_stob_block_shift(stobj);
438  out_fop->firr_count = stio->si_count << bshift;
441  }
442 
443  if (m0_fom_phase(fom) == M0_FOPH_FAILURE ||
445  out_fop->firr_rc = m0_fom_rc(fom);
446  fop = fom_obj->sif_rep_fop;
449  fom->fo_rep_fop = fom_obj->sif_rep_fop;
450  result = M0_FSO_AGAIN;
451  }
452 
453  }
454 
455  if (m0_fom_phase(fom) == M0_FOPH_FINISH) {
456  /*
457  If we fail in any of the generic phase, stob io
458  is uninitialised, so no need to fini.
459  */
460  if (stio->si_state != SIS_ZERO) {
461  m0_stob_io_fini(stio);
462  m0_stob_put(fom_obj->sif_stobj);
463  }
464  }
465 
466  return result;
467 }
468 
469 static void fom_stob_write_credit(struct m0_fom *fom)
470 {
471  struct m0_stob_io_write *in_fop;
472  struct m0_stob *stobj;
475  struct m0_stob_io io;
476 
477  in_fop = m0_fop_data(fom->fo_fop);
478  stobj = stob_object_find(&in_fop->fiw_object, fom);
479  index = 0;
480  count = in_fop->fiw_value.fi_count >> m0_stob_block_shift(stobj);
481  io = (struct m0_stob_io) { .si_opcode = SIO_WRITE };
482  io.si_stob = (struct m0_indexvec) {
483  .iv_vec = (struct m0_vec) {.v_nr = 1, .v_count = &count},
484  .iv_index = &index};
486  m0_stob_put(stobj);
487 }
488 
493 static int stob_write_fom_tick(struct m0_fom *fom)
494 {
495  struct m0_stob_io_write *in_fop;
496  struct m0_stob_io_write_rep *out_fop;
497  struct m0_stob_io_fom *fom_obj;
498  struct m0_stob_io *stio;
499  struct m0_stob *stobj;
500  struct m0_rpc_item *item;
501  struct m0_fop *fop;
502  void *addr;
505  uint32_t bshift;
506  int result = 0;
507 
509 
510  fom_obj = container_of(fom, struct m0_stob_io_fom, sif_fom);
511  stio = &fom_obj->sif_stio;
512 
513  if (m0_fom_phase(fom) < M0_FOPH_NR) {
516  result = m0_fom_tick_generic(fom);
517  } else {
518  out_fop = m0_fop_data(fom_obj->sif_rep_fop);
519  M0_ASSERT(out_fop != NULL);
520 
522  in_fop = m0_fop_data(fom->fo_fop);
523  M0_ASSERT(in_fop != NULL);
524 
525  fom_obj->sif_stobj = stob_object_find(
526  &in_fop->fiw_object, fom);
527 
528  stobj = fom_obj->sif_stobj;
529  bshift = m0_stob_block_shift(stobj);
530 
532  bshift);
533  count = in_fop->fiw_value.fi_count >> bshift;
534  offset = 0;
535 
536  m0_stob_io_init(stio);
537 
538  stio->si_user = (struct m0_bufvec)
540 
541  stio->si_stob.iv_vec.v_nr = 1;
542  stio->si_stob.iv_vec.v_count = &count;
543  stio->si_stob.iv_index = &offset;
544  stio->si_opcode = SIO_WRITE;
545  stio->si_fol_frag = &fom_obj->sif_fol_frag;
546  stio->si_flags = 0;
547  result = m0_stob_io_private_setup(stio, stobj);
548  M0_UT_ASSERT(result == 0);
550  m0_mutex_lock(&stio->si_mutex);
551  m0_fom_wait_on(fom, &stio->si_wait, &fom->fo_cb);
552  m0_mutex_unlock(&stio->si_mutex);
553  result = m0_stob_io_prepare_and_launch(stio, stobj,
554  &fom->fo_tx,
555  NULL);
556 
557  if (result != 0) {
558  m0_mutex_lock(&stio->si_mutex);
559  m0_fom_callback_cancel(&fom->fo_cb);
560  m0_mutex_unlock(&stio->si_mutex);
562  } else {
565  result = M0_FSO_WAIT;
566  }
568  stobj = fom_obj->sif_stobj;
569  bshift = m0_stob_block_shift(stobj);
570  out_fop->fiwr_count = stio->si_count << bshift;
573  }
574 
575  if (m0_fom_phase(fom) == M0_FOPH_FAILURE ||
577  out_fop->fiwr_rc = m0_fom_rc(fom);
578  fop = fom_obj->sif_rep_fop;
581  fom->fo_rep_fop = fom_obj->sif_rep_fop;
582  result = M0_FSO_AGAIN;
583  }
584  }
585 
586  if (m0_fom_phase(fom) == M0_FOPH_FINISH) {
587  /*
588  If we fail in any of the generic phase, stob io
589  is uninitialised, so no need to fini.
590  */
591  if (stio->si_state != SIS_ZERO) {
592  m0_stob_io_fini(stio);
593  m0_stob_put(fom_obj->sif_stobj);
594  }
595  }
596  return result;
597 }
598 
602 static void stob_io_fom_fini(struct m0_fom *fom)
603 {
604  struct m0_stob_io_fom *fom_obj;
605 
606  fom_obj = container_of(fom, struct m0_stob_io_fom, sif_fom);
607  m0_fom_fini(fom);
608  m0_free(fom_obj);
609 }
610 
611 void m0_stob_io_fop_fini(void);
612 
617 {
622  m0_xc_reqh_ut_io_fop_init();
623 
624  m0_stob_io_create_xc->xct_flags = M0_XCODE_TYPE_FLAG_DOM_RPC;
625  m0_stob_io_read_xc->xct_flags = M0_XCODE_TYPE_FLAG_DOM_RPC;
626  m0_stob_io_write_xc->xct_flags = M0_XCODE_TYPE_FLAG_DOM_RPC;
627  m0_stob_io_create_rep_xc->xct_flags = M0_XCODE_TYPE_FLAG_DOM_RPC;
628  m0_stob_io_read_rep_xc->xct_flags = M0_XCODE_TYPE_FLAG_DOM_RPC;
629  m0_stob_io_write_rep_xc->xct_flags = M0_XCODE_TYPE_FLAG_DOM_RPC;
630  stob_io_fop_fid_xc->xct_flags = M0_XCODE_TYPE_FLAG_DOM_RPC;
631  m0_fi_value_xc->xct_flags = M0_XCODE_TYPE_FLAG_DOM_RPC;
632 
634  .name = "Stob create",
636  .xt = m0_stob_io_create_xc,
637  .fom_ops = &stob_create_fom_type_ops,
638  .sm = &m0_generic_conf,
639  .rpc_flags = M0_RPC_MUTABO_REQ,
640  .svc_type = &m0_rpc_service_type);
642  .name = "Stob read",
644  .xt = m0_stob_io_read_xc,
645  .fom_ops = &stob_read_fom_type_ops,
646  .sm = &read_conf,
647  .rpc_flags = M0_RPC_ITEM_TYPE_REQUEST,
648  .svc_type = &m0_rpc_service_type);
650  .name = "Stob write",
652  .xt = m0_stob_io_write_xc,
653  .fom_ops = &stob_write_fom_type_ops,
654  .sm = &write_conf,
655  .rpc_flags = M0_RPC_MUTABO_REQ,
656  .svc_type = &m0_rpc_service_type);
658  .name = "Stob create reply",
660  .xt = m0_stob_io_create_rep_xc,
661  .rpc_flags = M0_RPC_ITEM_TYPE_REPLY,
662  .svc_type = &m0_rpc_service_type);
664  .name = "Stob read reply",
666  .xt = m0_stob_io_read_rep_xc,
667  .rpc_flags = M0_RPC_ITEM_TYPE_REPLY,
668  .svc_type = &m0_rpc_service_type);
670  .name = "Stob write reply",
672  .xt = m0_stob_io_write_rep_xc,
673  .rpc_flags = M0_RPC_ITEM_TYPE_REPLY,
674  .svc_type = &m0_rpc_service_type);
675 }
676 
681 {
688  m0_xc_reqh_ut_io_fop_fini();
689 }
690 
691 /*
692  * Local variables:
693  * c-indentation-style: "K&R"
694  * c-basic-offset: 8
695  * tab-width: 8
696  * fill-column: 80
697  * scroll-step: 1
698  * End:
699  */
#define M0_BUFVEC_INIT_BUF(addr_ptr, count_ptr)
Definition: vec.h:165
void m0_fom_phase_moveif(struct m0_fom *fom, int32_t rc, int phase0, int phase1)
Definition: fom.c:1710
static struct m0_fom_ops stob_read_fom_ops
Definition: io_fop.c:164
uint32_t m0_fop_opcode(const struct m0_fop *fop)
Definition: fop.c:226
struct m0_fop_type m0_stob_io_read_fopt
Definition: io_fop.c:64
#define M0_PRE(cond)
stob_fom_phases
Definition: io_fop.c:55
#define M0_ALLOC_ARR(arr, nr)
Definition: memory.h:84
const struct m0_sm_conf read_conf
Definition: io_fop.c:90
enum m0_stob_io_flags si_flags
Definition: io.h:290
int32_t firr_rc
Definition: io_fop.h:56
static struct m0_fom_ops stob_create_fom_ops
Definition: io_fop.c:152
M0_INTERNAL void m0_mutex_unlock(struct m0_mutex *mutex)
Definition: mutex.c:66
M0_INTERNAL void m0_stob_io_fini(struct m0_stob_io *io)
Definition: io.c:122
#define NULL
Definition: misc.h:38
Definition: io.h:230
M0_INTERNAL int m0_stob_locate(struct m0_stob *stob)
Definition: stob.c:128
struct m0_sm_state_descr stob_read_phases[]
Definition: io_fop.c:78
M0_INTERNAL void m0_stob_io_credit(const struct m0_stob_io *io, const struct m0_stob_domain *dom, struct m0_be_tx_credit *accum)
Definition: io.c:130
#define M0_FOP_TYPE_INIT(ft,...)
Definition: fop.h:307
Definition: sm.h:350
struct m0_fom sif_fom
Definition: io_fop.c:120
static void fom_stob_write_credit(struct m0_fom *fom)
Definition: io_fop.c:469
static struct m0_be_tx_credit * m0_fom_tx_credit(struct m0_fom *fom)
Definition: fom.h:542
static const struct m0_fom_type_ops stob_write_fom_type_ops
Definition: io_fop.c:181
int(* fto_create)(struct m0_fop *fop, struct m0_fom **out, struct m0_reqh *reqh)
Definition: fom.h:650
Definition: vec.h:49
uint32_t firr_count
Definition: io_fop.h:57
void * m0_fop_data(const struct m0_fop *fop)
Definition: fop.c:220
void m0_fop_type_fini(struct m0_fop_type *fopt)
Definition: fop.c:232
M0_INTERNAL void m0_stob_ad_balloc_set(struct m0_stob_io *io, uint64_t flags)
Definition: ad.c:2204
M0_INTERNAL void m0_sm_conf_extend(const struct m0_sm_state_descr *base, struct m0_sm_state_descr *sub, uint32_t nr)
Definition: sm.c:763
uint64_t m0_bindex_t
Definition: types.h:80
M0_INTERNAL void m0_fom_wait_on(struct m0_fom *fom, struct m0_chan *chan, struct m0_fom_callback *cb)
Definition: fom.c:1490
struct m0_chan si_wait
Definition: io.h:318
uint64_t m0_bcount_t
Definition: types.h:77
struct m0_sm_state_descr stob_create_phases[]
Definition: io_fop.c:70
static int void * buf
Definition: dir.c:1019
#define container_of(ptr, type, member)
Definition: misc.h:33
M0_INTERNAL void m0_mutex_lock(struct m0_mutex *mutex)
Definition: mutex.c:49
struct m0_stob * sif_stobj
Definition: io_fop.c:124
static struct m0_xcode_type ** xt[]
Definition: protocol.c:64
struct m0_reqh_service_type m0_rpc_service_type
Definition: service.c:120
struct stob_io_fop_fid fic_object
Definition: io_fop.h:62
const struct m0_sm_conf m0_generic_conf
Definition: fom_generic.c:838
static struct m0_rpc_item * item
Definition: item.c:56
m0_fom_phase
Definition: fom.h:372
Definition: sock.c:887
static m0_bcount_t count
Definition: xcode.c:167
struct m0_fom_type ft_fom_type
Definition: fop.h:232
struct m0_stob_domain * so_domain
Definition: stob.h:165
static int stob_create_fom_create(struct m0_fop *fop, struct m0_fom **out, struct m0_reqh *reqh)
Definition: io_fop.c:239
struct m0_fid fid
Definition: di.c:46
struct m0_vec iv_vec
Definition: vec.h:139
static void stob_io_fom_fini(struct m0_fom *fom)
Definition: io_fop.c:602
M0_INTERNAL uint32_t m0_stob_block_shift(struct m0_stob *stob)
Definition: stob.c:270
struct m0_bufvec si_user
Definition: io.h:300
struct m0_sm_state_descr stob_write_phases[]
Definition: io_fop.c:96
static const struct m0_fom_type_ops stob_read_fom_type_ops
Definition: io_fop.c:177
m0_bindex_t * iv_index
Definition: vec.h:141
struct m0_fop_type m0_stob_io_create_rep_fopt
Definition: io_fop.c:66
int opcode
Definition: crate.c:301
void m0_fom_init(struct m0_fom *fom, const struct m0_fom_type *fom_type, const struct m0_fom_ops *ops, struct m0_fop *fop, struct m0_fop *reply, struct m0_reqh *reqh)
Definition: fom.c:1372
static char * addr
Definition: node_k.c:37
struct m0_fi_value fiw_value
Definition: io_fop.h:43
struct m0_fop_type * f_type
Definition: fop.h:81
static int stob_io_fop_fom_create_helper(struct m0_fop *fop, struct m0_fom_ops *fom_ops, struct m0_fop_type *fop_type, struct m0_fom **out, struct m0_reqh *reqh)
Definition: io_fop.c:208
struct m0_stob_domain * reqh_ut_stob_domain_find(void)
Definition: reqh_fom_ut.c:169
struct m0_fop_type m0_stob_io_write_fopt
Definition: io_fop.c:65
const char * name
Definition: trace.c:110
static const struct m0_fom_type_ops stob_create_fom_type_ops
Definition: io_fop.c:173
M0_INTERNAL int m0_stob_io_prepare_and_launch(struct m0_stob_io *io, struct m0_stob *obj, struct m0_dtx *tx, struct m0_io_scope *scope)
Definition: io.c:219
Definition: stob.h:163
int m0_fom_tick_generic(struct m0_fom *fom)
Definition: fom_generic.c:848
const struct m0_sm_conf write_conf
Definition: io_fop.c:108
struct m0_indexvec si_stob
Definition: io.h:311
int32_t si_rc
Definition: io.h:334
void m0_fom_fini(struct m0_fom *fom)
Definition: fom.c:1324
static struct m0_stob * stob
Definition: storage.c:39
#define M0_ASSERT(cond)
const char * scf_name
Definition: sm.h:352
void m0_fom_phase_move(struct m0_fom *fom, int32_t rc, int phase)
Definition: fom.c:1699
uint32_t scf_nr_states
Definition: sm.h:354
static struct m0_fom_ops stob_write_fom_ops
Definition: io_fop.c:158
static int stob_read_fom_create(struct m0_fop *fop, struct m0_fom **out, struct m0_reqh *reqh)
Definition: io_fop.c:259
M0_INTERNAL void m0_stob_id_make(uint64_t container, uint64_t key, const struct m0_fid *dom_id, struct m0_stob_id *stob_id)
Definition: stob.c:343
M0_INTERNAL void * m0_stob_addr_pack(const void *buf, uint32_t shift)
Definition: io.c:293
M0_INTERNAL int m0_stob_io_private_setup(struct m0_stob_io *io, struct m0_stob *obj)
Definition: io.c:49
const struct m0_rpc_item_type * ri_type
Definition: item.h:200
void * m0_alloc(size_t size)
Definition: memory.c:126
struct m0_fol_frag * si_fol_frag
Definition: io.h:390
Definition: xcode.h:73
Definition: reqh.h:94
uint32_t v_nr
Definition: vec.h:51
void m0_stob_io_fop_fini(void)
Definition: io_fop.c:680
enum m0_stob_io_state si_state
Definition: io.h:345
Definition: dump.c:103
static m0_bindex_t offset
Definition: dump.c:173
Definition: io.h:285
static size_t stob_find_fom_home_locality(const struct m0_fom *fom)
Definition: io_fop.c:273
m0_bcount_t * v_count
Definition: vec.h:53
uint32_t fiwr_count
Definition: io_fop.h:48
static struct m0_stob_io io
Definition: ad.c:59
m0_bcount_t si_count
Definition: io.h:340
struct m0_mutex si_mutex
Definition: io.h:319
static int stob_create_fom_tick(struct m0_fom *fom)
Definition: io_fop.c:315
struct m0_fop * m0_fop_reply_alloc(struct m0_fop *req, struct m0_fop_type *rept)
Definition: fop.c:129
M0_INTERNAL int m0_stob_create(struct m0_stob *stob, struct m0_dtx *dtx, const char *str_cfg)
Definition: stob.c:154
Definition: fom.h:481
M0_INTERNAL enum m0_stob_state m0_stob_state_get(struct m0_stob *stob)
Definition: stob.c:265
struct m0_reqh reqh
Definition: rm_foms.c:48
struct m0_fol_frag sif_fol_frag
Definition: io_fop.c:131
const char * sd_name
Definition: sm.h:383
struct m0_sm_state_descr * scf_state
Definition: sm.h:356
static int stob_write_fom_tick(struct m0_fom *fom)
Definition: io_fop.c:493
static int stob_write_fom_create(struct m0_fop *fop, struct m0_fom **out, struct m0_reqh *reqh)
Definition: io_fop.c:249
struct stob_io_fop_fid fir_object
Definition: io_fop.h:52
static int stob_read_fom_tick(struct m0_fom *fom)
Definition: io_fop.c:360
M0_INTERNAL int m0_fom_rc(const struct m0_fom *fom)
Definition: fom.c:1727
struct m0_rpc_item * m0_fop_to_rpc_item(const struct m0_fop *fop)
Definition: fop.c:338
struct m0_fop_type m0_stob_io_write_rep_fopt
Definition: io_fop.c:68
static struct m0_fop * fop
Definition: item.c:57
struct m0_fop_type m0_stob_io_read_rep_fopt
Definition: io_fop.c:67
static struct m0_stob * stob_object_find(const struct stob_io_fop_fid *fid, struct m0_fom *fom)
Definition: io_fop.c:188
struct m0_rpc_item_type ft_rpc_item_type
Definition: fop.h:235
uint32_t fi_count
Definition: io_fop.h:37
M0_INTERNAL void m0_fom_callback_cancel(struct m0_fom_callback *cb)
Definition: fom.c:1514
int32_t fiwr_rc
Definition: io_fop.h:47
M0_INTERNAL void m0_stob_io_init(struct m0_stob_io *io)
Definition: io.c:111
M0_INTERNAL int m0_stob_find(const struct m0_stob_id *id, struct m0_stob **out)
Definition: stob.c:92
void(* fo_fini)(struct m0_fom *fom)
Definition: fom.h:657
struct stob_io_fop_fid fiw_object
Definition: io_fop.h:42
void m0_stob_io_fop_init(void)
Definition: io_fop.c:616
#define out(...)
Definition: gen.c:41
M0_INTERNAL void m0_stob_create_credit(struct m0_stob_domain *dom, struct m0_be_tx_credit *accum)
Definition: stob.c:148
void m0_fom_phase_set(struct m0_fom *fom, int phase)
Definition: fom.c:1688
struct m0_stob_io sif_stio
Definition: io_fop.c:126
Definition: io.h:229
uint8_t * fi_buf
Definition: io_fop.h:38
void m0_free(void *data)
Definition: memory.c:146
struct m0_fop * sif_rep_fop
Definition: io_fop.c:122
int32_t rc
Definition: trigger_fop.h:47
#define ARRAY_SIZE(a)
Definition: misc.h:45
struct m0_fop_type m0_stob_io_create_fopt
Definition: io_fop.c:63
#define M0_UT_ASSERT(a)
Definition: ut.h:46
M0_INTERNAL void m0_stob_put(struct m0_stob *stob)
Definition: stob.c:291
fop_type
Definition: stats_ut_svc.c:51
Definition: fop.h:79
Definition: vec.h:145
struct m0_fi_value firr_value
Definition: io_fop.h:58
Definition: io.h:240
enum m0_stob_io_opcode si_opcode
Definition: io.h:286