Motr  M0
reqh_fom_ut.c
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2012-2020 Seagate Technology LLC and/or its Affiliates
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  *
16  * For any questions about this software or licensing,
17  * please email opensource@seagate.com or cortx-questions@seagate.com.
18  *
19  */
20 
21 
22 #include <stdio.h>
23 #include <stdlib.h>
24 #include <sys/stat.h> /* mkdir */
25 #include <sys/types.h> /* mkdir */
26 #include <err.h>
27 
28 #include "lib/memory.h"
29 #include "net/net.h"
30 #include "fop/fop.h"
31 #include "reqh/reqh.h"
32 #include "stob/stob.h"
33 #include "stob/ad.h"
34 #include "net/lnet/lnet.h"
35 #include "rpc/rpc.h"
36 #include "fop/fop_item_type.h"
37 #include "rpc/item.h"
38 #include "rpc/rpc_internal.h"
39 #include "fop/fom_generic.h"
40 #include "reqh/ut/io_fop_xc.h"
41 #include "reqh/ut/io_fop.h"
42 #include "rpc/rpc_opcodes.h"
43 #include "rpc/rpclib.h"
44 #include "balloc/balloc.h"
45 #include "mdstore/mdstore.h"
46 #include "stob/ad.h" /* m0_stob_ad_cfg_make */
47 #include "fdmi/fdmi.h"
48 
49 #include "ut/ut.h"
50 #include "ut/be.h"
60 #define CLIENT_ENDPOINT_ADDR "0@lo:12345:34:*"
61 #define SERVER_ENDPOINT_ADDR "0@lo:12345:34:1"
62 #define SERVER_DB_NAME "reqh_ut_stob/sdb"
63 #define SERVER_BDOM_LOCATION "linuxstob:./reqh_fom_ut"
64 #define SERVER_BDOM_KEY 0xBAC570BD
65 
66 enum {
70 };
71 
72 static struct m0_stob_domain *sdom;
73 static struct m0_mdstore srv_mdstore;
76 static struct m0_be_ut_backend ut_be;
77 static struct m0_be_ut_seg ut_seg;
80 
84 static struct m0_reqh reqh;
85 
91  struct m0_mutex rb_lock;
94 };
95 
96 static struct reqh_ut_balloc *getballoc(struct m0_ad_balloc *ballroom)
97 {
98  return container_of(ballroom, struct reqh_ut_balloc, rb_ballroom);
99 }
100 
101 static int reqh_ut_balloc_init(struct m0_ad_balloc *ballroom,
102  struct m0_be_seg *db,
103  uint32_t bshift,
104  m0_bindex_t container_size,
105  m0_bcount_t groupsize,
106  m0_bcount_t spare_reserve)
107 {
108  struct reqh_ut_balloc *rb = getballoc(ballroom);
109 
111  return 0;
112 }
113 
114 static void reqh_ut_balloc_fini(struct m0_ad_balloc *ballroom)
115 {
116  struct reqh_ut_balloc *rb = getballoc(ballroom);
117 
119 }
120 
121 static int reqh_ut_balloc_alloc(struct m0_ad_balloc *ballroom,
122  struct m0_dtx *tx,
124  struct m0_ext *out,
125  uint64_t alloc_zone)
126 {
127  struct reqh_ut_balloc *rb = getballoc(ballroom);
128 
130  out->e_start = rb->rb_next;
131  out->e_end = rb->rb_next + count;
132  rb->rb_next += count;
134  return 0;
135 }
136 
137 static int reqh_ut_balloc_free(struct m0_ad_balloc *ballroom, struct m0_dtx *tx,
138  struct m0_ext *ext)
139 {
140  return 0;
141 }
142 
143 static int reqh_ut_reserve_extent(struct m0_ad_balloc *ballroom,
144  struct m0_be_tx *tx, struct m0_ext *ext,
145  uint64_t alloc_zone)
146 {
147  return 0;
148 }
149 
150 static const struct m0_ad_balloc_ops reqh_ut_balloc_ops = {
152  .bo_fini = reqh_ut_balloc_fini,
153  .bo_alloc = reqh_ut_balloc_alloc,
154  .bo_free = reqh_ut_balloc_free,
155  .bo_reserve_extent = reqh_ut_reserve_extent,
156 };
157 
158 /* static */ struct reqh_ut_balloc rb = {
159  .rb_next = 0,
160  .rb_ballroom = {
161  .ab_ops = &reqh_ut_balloc_ops
162  }
163 };
164 
165 /* Buffer pool for TM receive queue. */
167 
169 {
170  return sdom;
171 }
172 
173 static int server_init(const char *stob_path,
174  const char *srv_db_name,
175  struct m0_net_domain *net_dom,
176  uint64_t back_key,
177  struct m0_stob_domain **bdom)
178 {
179  int rc;
180  struct m0_sm_group *grp;
182  struct m0_be_tx tx;
183  struct m0_be_tx_credit cred = {};
184  struct m0_be_seg *seg;
185  struct m0_stob *bstore;
186  uint32_t bufs_nr;
187  uint32_t tms_nr;
188  char *sdom_cfg;
189  char *sdom_init_cfg;
190  char *sdom_location;
191  struct m0_stob_id stob_id;
192 
193  srv_cob_dom_id.id = 102;
194 
195  rc = M0_REQH_INIT(&reqh,
196  .rhia_dtm = NULL,
197  .rhia_db = NULL,
198  .rhia_mdstore = &srv_mdstore,
199  .rhia_fid = &g_process_fid,
200  );
201  M0_UT_ASSERT(rc == 0);
202 
204  m0_be_ut_seg_init(&ut_seg, &ut_be, 1 << 20 /* 1 MB */);
205 
206  seg = ut_seg.bus_seg;
208 
209  rc = m0_reqh_be_init(&reqh, seg);
210  M0_UT_ASSERT(rc == 0);
211 
212  /*
213  * Locate and create (if necessary) the backing store object.
214  */
217  bdom);
218  M0_UT_ASSERT(rc == 0);
219  m0_stob_id_make(0, back_key, &(*bdom)->sd_id, &stob_id);
220  rc = m0_stob_find(&stob_id, &bstore);
221  M0_UT_ASSERT(rc == 0);
222  rc = m0_stob_locate(bstore);
223  M0_UT_ASSERT(rc == 0);
224  rc = m0_stob_create(bstore, NULL, NULL);
225  M0_UT_ASSERT(rc == 0);
226 
227  /*
228  * Create AD domain over backing store object.
229  */
230  m0_stob_ad_cfg_make(&sdom_cfg, seg, m0_stob_id_get(bstore), 0);
231  sdom_location = m0_alloc(0x1000);
232  snprintf(sdom_location, 0x1000, "adstob:seg=%p,1234", seg);
233  m0_stob_ad_init_cfg_make(&sdom_init_cfg, &ut_be.but_dom);
234  rc = m0_stob_domain_create(sdom_location, sdom_init_cfg, 2,
235  sdom_cfg, &sdom);
236  M0_UT_ASSERT(rc == 0);
237 
238  m0_free(sdom_cfg);
239  m0_free(sdom_location);
240  m0_stob_put(bstore);
241 
242  /* Init mdstore without reading root cob. */
243  rc = m0_mdstore_init(&srv_mdstore, seg, false);
244  M0_UT_ASSERT(rc == -ENOENT);
246  &ut_be.but_dom, seg);
247  M0_UT_ASSERT(rc == 0);
248 
249  /* Create root session cob and other structures */
251  m0_ut_be_tx_begin(&tx, &ut_be, &cred);
253  m0_ut_be_tx_end(&tx);
254  M0_UT_ASSERT(rc == 0);
255 
256  /* Finalize old mdstore. */
258 
259  /* Init new mdstore with open root flag. */
260  rc = m0_mdstore_init(&srv_mdstore, seg, true);
261  M0_UT_ASSERT(rc == 0);
262 
264 
265  tms_nr = 1;
266  bufs_nr = m0_rpc_bufs_nr(M0_NET_TM_RECV_QUEUE_DEF_LEN, tms_nr);
267 
268  rc = m0_rpc_net_buffer_pool_setup(net_dom, &app_pool, bufs_nr, tms_nr);
269  M0_UT_ASSERT(rc == 0);
270 
271  /* Init the rpcmachine */
276  M0_UT_ASSERT(rc == 0);
279 
280  /* Init fdmi service */
282  M0_UT_ASSERT(rc == 0);
285  M0_UT_ASSERT(rc == 0);
286 
287  return rc;
288 }
289 
290 /* Fini the server */
291 static void server_fini(struct m0_stob_domain *bdom,
292  uint64_t back_key)
293 {
294  struct m0_sm_group *grp;
295  struct m0_stob *bstore;
296  int rc;
297  struct m0_stob_id stob_id;
298 
303 
306 
308  /* reqh_ut_service is finalised by m0_reqh_services_terminate(). */
311 
314  M0_UT_ASSERT(rc == 0);
315 
316  /* XXX domain can't be destroyed because of credit calculations bug */
317  /* rc = m0_stob_domain_destroy(sdom); */
318  /* M0_UT_ASSERT(rc == 0); */
320 
321  /* Fini the rpc_machine */
324 
325  m0_stob_id_make(0, back_key, &bdom->sd_id, &stob_id);
326  rc = m0_stob_find(&stob_id, &bstore);
327  M0_ASSERT(rc == 0);
328  rc = m0_stob_destroy(bstore, NULL);
329  M0_ASSERT(rc == 0);
330 
331  rc = m0_stob_domain_destroy(bdom);
332  M0_UT_ASSERT(rc == 0);
333 
336 
337  m0_reqh_fini(&reqh);
338 }
339 
340 static void fop_send(struct m0_fop *fop, struct m0_rpc_session *session)
341 {
342  int rc;
343 
344  rc = m0_rpc_post_sync(fop, session, NULL, 0 /* deadline */);
345  M0_UT_ASSERT(rc == 0);
349 }
350 
352 static void create_send(struct m0_rpc_session *session)
353 {
354  uint32_t i;
355  struct m0_fop *fop;
356  struct m0_stob_io_create *rh_io_fop;
357 
358  for (i = 0; i < 10; ++i) {
360  rh_io_fop = m0_fop_data(fop);
361  rh_io_fop->fic_object.f_seq = i;
362  rh_io_fop->fic_object.f_oid = i;
363  fop_send(fop, session);
364  }
365 }
366 
368 static void read_send(struct m0_rpc_session *session)
369 {
370  uint32_t i;
371  struct m0_fop *fop;
372  struct m0_stob_io_read *rh_io_fop;
373 
374  for (i = 0; i < 10; ++i) {
376  rh_io_fop = m0_fop_data(fop);
377  rh_io_fop->fir_object.f_seq = i;
378  rh_io_fop->fir_object.f_oid = i;
379  fop_send(fop, session);
380  }
381 }
382 
384 static void write_send(struct m0_rpc_session *session)
385 {
386  uint32_t i;
387  struct m0_fop *fop;
388  struct m0_stob_io_write *rh_io_fop;
389  uint8_t *buf;
390 
391  for (i = 0; i < 10; ++i) {
393  rh_io_fop = m0_fop_data(fop);
394  rh_io_fop->fiw_object.f_seq = i;
395  rh_io_fop->fiw_object.f_oid = i;
397  M0_ASSERT(buf != NULL);
398  rh_io_fop->fiw_value.fi_buf = buf;
399  rh_io_fop->fiw_value.fi_count = 1 << BALLOC_DEF_BLOCK_SHIFT;
400 
401  fop_send(fop, session);
402  }
403 }
404 
408 void test_reqh(void)
409 {
410  int result;
411  char opath[64];
412  const char *path;
414  struct m0_net_domain net_dom = { };
415  struct m0_net_domain srv_net_dom = { };
416  struct m0_stob_domain *bdom;
417  uint64_t back_key = 0xdf11e;
418  struct m0_rpc_client_ctx cctx = {
419  .rcx_net_dom = &net_dom,
420  .rcx_local_addr = CLIENT_ENDPOINT_ADDR,
421  .rcx_remote_addr = SERVER_ENDPOINT_ADDR,
422  .rcx_max_rpcs_in_flight = MAX_RPCS_IN_FLIGHT,
423  .rcx_fid = &g_process_fid,
424  };
425 
426  setbuf(stdout, NULL);
427  setbuf(stderr, NULL);
428 
429  path = "reqh_ut_stob";
430 
431  sdom = NULL;
435  M0_SET0(&ut_be);
436  M0_SET0(&ut_seg);
439  M0_SET0(&reqh);
440 
441 
443 
444  M0_UT_ASSERT(strlen(path) < ARRAY_SIZE(opath) - 8);
445 
446  result = m0_net_domain_init(&net_dom, xprt);
447  M0_UT_ASSERT(result == 0);
448  result = m0_net_domain_init(&srv_net_dom, xprt);
449  M0_UT_ASSERT(result == 0);
450 
451  server_init(path, SERVER_DB_NAME, &srv_net_dom, back_key, &bdom);
452 
453  result = m0_rpc_client_start(&cctx);
454  M0_UT_ASSERT(result == 0);
455 
456  /* send fops */
460 
461  result = m0_rpc_client_stop(&cctx);
462  M0_UT_ASSERT(result == 0);
463 
464  server_fini(bdom, back_key);
465 
466  m0_net_domain_fini(&net_dom);
467  m0_net_domain_fini(&srv_net_dom);
469 }
470 
472  .ts_name = "reqh-ut",
473  .ts_tests = {
474  { "reqh", test_reqh },
475  { NULL, NULL }
476  }
477 };
478 
481 /*
482  * Local variables:
483  * c-indentation-style: "K&R"
484  * c-basic-offset: 8
485  * tab-width: 8
486  * fill-column: 80
487  * scroll-step: 1
488  * End:
489  */
M0_EXTERN struct m0_reqh_service_type m0_fdmi_service_type
Definition: fdmi.h:194
uint64_t id
Definition: cob.h:240
static struct m0_reqh reqh
Definition: reqh_fom_ut.c:84
void m0_be_ut_seg_fini(struct m0_be_ut_seg *ut_seg)
Definition: stubs.c:267
M0_INTERNAL void m0_mdstore_fini(struct m0_mdstore *md)
Definition: mdstore.c:130
struct m0_fop_type m0_stob_io_read_fopt
Definition: io_fop.c:64
void m0_rpc_machine_fini(struct m0_rpc_machine *machine)
Definition: rpc_machine.c:233
#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: dtm.h:554
M0_INTERNAL void m0_reqh_services_terminate(struct m0_reqh *reqh)
Definition: reqh.c:675
M0_INTERNAL void m0_mutex_unlock(struct m0_mutex *mutex)
Definition: mutex.c:66
void m0_net_domain_fini(struct m0_net_domain *dom)
Definition: domain.c:71
static struct m0_net_buffer_pool app_pool
Definition: reqh_fom_ut.c:166
struct m0_cob_domain * md_dom
Definition: mdstore.h:58
struct m0_ad_balloc rb_ballroom
Definition: reqh_fom_ut.c:93
#define CLIENT_ENDPOINT_ADDR
Definition: reqh_fom_ut.c:60
M0_INTERNAL int m0_cob_domain_mkfs(struct m0_cob_domain *dom, const struct m0_fid *rootfid, struct m0_be_tx *tx)
Definition: cob.c:980
M0_INTERNAL void m0_reqh_service_stop(struct m0_reqh_service *service)
Definition: reqh_service.c:402
#define NULL
Definition: misc.h:38
M0_INTERNAL int m0_stob_locate(struct m0_stob *stob)
Definition: stob.c:128
#define SERVER_ENDPOINT_ADDR
Definition: reqh_fom_ut.c:61
static struct m0_rpc_machine srv_rpc_mach
Definition: reqh_fom_ut.c:75
M0_INTERNAL int m0_mdstore_init(struct m0_mdstore *md, struct m0_be_seg *db, bool init_root)
Definition: mdstore.c:78
#define M0_REQH_INIT(reqh,...)
Definition: reqh.h:262
#define SERVER_BDOM_KEY
Definition: reqh_fom_ut.c:64
static struct m0_sm_group * grp
Definition: bytecount.c:38
M0_INTERNAL void m0_reqh_service_prepare_to_stop(struct m0_reqh_service *service)
Definition: reqh_service.c:375
M0_INTERNAL int m0_stob_domain_destroy(struct m0_stob_domain *dom)
Definition: domain.c:227
static int reqh_ut_balloc_alloc(struct m0_ad_balloc *ballroom, struct m0_dtx *tx, m0_bcount_t count, struct m0_ext *out, uint64_t alloc_zone)
Definition: reqh_fom_ut.c:121
struct m0_be_seg * bus_seg
Definition: helper.h:119
#define SERVER_BDOM_LOCATION
Definition: reqh_fom_ut.c:63
int(* bo_init)(struct m0_ad_balloc *ballroom, struct m0_be_seg *db, uint32_t bshift, m0_bcount_t container_size, m0_bcount_t blocks_per_group, m0_bcount_t spare_blocks_per_group)
Definition: ad.h:77
M0_INTERNAL void m0_ut_be_tx_end(struct m0_be_tx *tx)
Definition: be.c:82
int32_t ri_error
Definition: item.h:161
static struct m0_rpc_client_ctx cctx
Definition: rconfc.c:69
void * m0_fop_data(const struct m0_fop *fop)
Definition: fop.c:219
struct m0_mutex rb_lock
Definition: reqh_fom_ut.c:91
uint64_t m0_bindex_t
Definition: types.h:80
void m0_be_ut_seg_init(struct m0_be_ut_seg *ut_seg, struct m0_be_ut_backend *ut_be, m0_bcount_t size)
Definition: stubs.c:256
uint64_t m0_bcount_t
Definition: types.h:77
static int void * buf
Definition: dir.c:1019
#define container_of(ptr, type, member)
Definition: misc.h:33
static struct m0_rpc_session session
Definition: formation2.c:38
#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
static void reqh_ut_balloc_fini(struct m0_ad_balloc *ballroom)
Definition: reqh_fom_ut.c:114
M0_INTERNAL void m0_reqh_fini(struct m0_reqh *reqh)
Definition: reqh.c:320
struct stob_io_fop_fid fic_object
Definition: io_fop.h:62
M0_INTERNAL void m0_stob_ad_init_cfg_make(char **str, struct m0_be_domain *dom)
Definition: ad.c:212
struct m0_reqh_service * rh_rpc_service
Definition: reqh.h:140
static int reqh_ut_reserve_extent(struct m0_ad_balloc *ballroom, struct m0_be_tx *tx, struct m0_ext *ext, uint64_t alloc_zone)
Definition: reqh_fom_ut.c:143
Definition: sock.c:887
static m0_bcount_t count
Definition: xcode.c:167
static struct m0_be_ut_seg ut_seg
Definition: reqh_fom_ut.c:77
void test_reqh(void)
Definition: reqh_fom_ut.c:408
M0_INTERNAL void m0_reqh_shutdown_wait(struct m0_reqh *reqh)
Definition: reqh.c:647
M0_INTERNAL void m0_cob_tx_credit(struct m0_cob_domain *dom, enum m0_cob_op optype, struct m0_be_tx_credit *accum)
Definition: cob.c:2281
int i
Definition: dir.c:1033
struct m0_fi_value fiw_value
Definition: io_fop.h:43
M0_INTERNAL int m0_stob_domain_create(const char *location, const char *str_cfg_init, uint64_t dom_key, const char *str_cfg_create, struct m0_stob_domain **out)
Definition: domain.c:217
struct reqh_ut_balloc rb
Definition: reqh_fom_ut.c:158
M0_INTERNAL const struct m0_fid M0_MDSERVICE_SLASH_FID
Definition: md_fid.c:63
struct m0_fop_type m0_stob_io_write_fopt
Definition: io_fop.c:65
M0_INTERNAL bool m0_fom_domain_is_idle_for(const struct m0_reqh_service *svc)
Definition: fom.c:1281
static struct m0_reqh_service * reqh_ut_service
Definition: reqh_fom_ut.c:78
M0_INTERNAL const struct m0_stob_id * m0_stob_id_get(struct m0_stob *stob)
Definition: stob.c:250
Definition: stob.h:163
M0_INTERNAL void m0_ut_be_tx_begin(struct m0_be_tx *tx, struct m0_be_ut_backend *ut_be, struct m0_be_tx_credit *cred)
Definition: be.c:56
#define M0_ASSERT(cond)
M0_INTERNAL int m0_rpc_net_buffer_pool_setup(struct m0_net_domain *ndom, struct m0_net_buffer_pool *app_pool, uint32_t bufs_nr, uint32_t tm_nr)
Definition: rpc.c:229
static void read_send(struct m0_rpc_session *session)
Definition: reqh_fom_ut.c:368
static void write_send(struct m0_rpc_session *session)
Definition: reqh_fom_ut.c:384
M0_INTERNAL void m0_reqh_service_fini(struct m0_reqh_service *service)
Definition: reqh_service.c:457
M0_INTERNAL uint32_t m0_rpc_bufs_nr(uint32_t len, uint32_t tms_nr)
Definition: rpc.c:271
static struct m0_cob_domain_id srv_cob_dom_id
Definition: reqh_fom_ut.c:74
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
int m0_rpc_client_stop(struct m0_rpc_client_ctx *cctx)
Definition: rpclib.c:217
static int reqh_ut_balloc_init(struct m0_ad_balloc *ballroom, struct m0_be_seg *db, uint32_t bshift, m0_bindex_t container_size, m0_bcount_t groupsize, m0_bcount_t spare_reserve)
Definition: reqh_fom_ut.c:101
uint64_t f_oid
Definition: io_fop.h:33
void m0_be_ut_backend_init(struct m0_be_ut_backend *ut_be)
Definition: stubs.c:238
M0_INTERNAL int m0_rpc_machine_init(struct m0_rpc_machine *machine, struct m0_net_domain *net_dom, const char *ep_addr, struct m0_reqh *reqh, struct m0_net_buffer_pool *receive_pool, uint32_t colour, m0_bcount_t msg_size, uint32_t queue_len)
Definition: rpc_machine.c:123
struct m0_net_xprt * m0_net_xprt_default_get(void)
Definition: net.c:151
int m0_rpc_client_start(struct m0_rpc_client_ctx *cctx)
Definition: rpclib.c:160
struct m0_rpc_item * ri_reply
Definition: item.h:163
void * m0_alloc(size_t size)
Definition: memory.c:126
M0_INTERNAL void m0_mutex_init(struct m0_mutex *mutex)
Definition: mutex.c:35
int m0_rpc_post_sync(struct m0_fop *fop, struct m0_rpc_session *session, const struct m0_rpc_item_ops *ri_ops, m0_time_t deadline)
Definition: rpclib.c:284
static void server_fini(struct m0_stob_domain *bdom, uint64_t back_key)
Definition: reqh_fom_ut.c:291
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_sm_group * m0_be_ut_backend_sm_group_lookup(struct m0_be_ut_backend *ut_be)
Definition: stubs.c:277
static const struct m0_ad_balloc_ops reqh_ut_balloc_ops
Definition: reqh_fom_ut.c:150
void m0_stob_io_fop_fini(void)
Definition: io_fop.c:680
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_bindex_t rb_next
Definition: reqh_fom_ut.c:92
Definition: seg.h:66
struct m0_net_domain * rcx_net_dom
Definition: rpclib.h:128
struct m0_be_domain but_dom
Definition: helper.h:47
uint64_t f_seq
Definition: io_fop.h:32
M0_INTERNAL int m0_reqh_state_get(struct m0_reqh *reqh)
Definition: reqh.c:398
M0_INTERNAL void m0_stob_domain_fini(struct m0_stob_domain *dom)
Definition: domain.c:204
M0_INTERNAL int m0_stob_create(struct m0_stob *stob, struct m0_dtx *dtx, const char *str_cfg)
Definition: stob.c:154
struct m0_fid sd_id
Definition: domain.h:96
const char * ts_name
Definition: ut.h:99
M0_INTERNAL int m0_stob_destroy(struct m0_stob *stob, struct m0_dtx *dtx)
Definition: stob.c:200
M0_INTERNAL void m0_reqh_start(struct m0_reqh *reqh)
Definition: reqh.c:711
struct m0_ut_suite reqh_ut
Definition: reqh_fom_ut.c:471
static void create_send(struct m0_rpc_session *session)
Definition: reqh_fom_ut.c:352
int m0_net_domain_init(struct m0_net_domain *dom, const struct m0_net_xprt *xprt)
Definition: domain.c:36
static int reqh_ut_balloc_free(struct m0_ad_balloc *ballroom, struct m0_dtx *tx, struct m0_ext *ext)
Definition: reqh_fom_ut.c:137
struct m0_stob_domain * reqh_ut_stob_domain_find(void)
Definition: reqh_fom_ut.c:168
struct m0_rpc_session rcx_session
Definition: rpclib.h:147
Definition: ext.h:37
M0_INTERNAL int m0_stob_domain_create_or_init(const char *location, const char *str_cfg_init, uint64_t dom_key, const char *str_cfg_create, struct m0_stob_domain **out)
Definition: domain.c:262
M0_INTERNAL int m0_mdstore_create(struct m0_mdstore *md, struct m0_sm_group *grp, struct m0_cob_domain_id *id, struct m0_be_domain *bedom, struct m0_be_seg *db)
Definition: mdstore.c:135
static struct m0_reqh_service * fdmi_ut_service
Definition: reqh_fom_ut.c:79
struct stob_io_fop_fid fir_object
Definition: io_fop.h:52
static struct m0_mdstore srv_mdstore
Definition: reqh_fom_ut.c:73
static int server_init(const char *stob_path, const char *srv_db_name, struct m0_net_domain *net_dom, uint64_t back_key, struct m0_stob_domain **bdom)
Definition: reqh_fom_ut.c:173
#define SERVER_DB_NAME
Definition: reqh_fom_ut.c:62
struct m0_fop * m0_fop_alloc_at(struct m0_rpc_session *sess, struct m0_fop_type *fopt)
Definition: fop.c:121
static struct reqh_ut_balloc * getballoc(struct m0_ad_balloc *ballroom)
Definition: reqh_fom_ut.c:96
M0_INTERNAL void m0_mutex_fini(struct m0_mutex *mutex)
Definition: mutex.c:42
void m0_fop_put_lock(struct m0_fop *fop)
Definition: fop.c:198
static struct m0_fop * fop
Definition: item.c:57
void m0_be_ut_backend_fini(struct m0_be_ut_backend *ut_be)
Definition: stubs.c:242
uint32_t fi_count
Definition: io_fop.h:37
M0_INTERNAL void m0_reqh_idle_wait_for(struct m0_reqh *reqh, struct m0_reqh_service *service)
Definition: reqh.c:591
M0_INTERNAL int m0_stob_find(const struct m0_stob_id *id, struct m0_stob **out)
Definition: stob.c:92
static struct m0_be_seg * seg
Definition: btree.c:40
M0_INTERNAL int m0_mdstore_destroy(struct m0_mdstore *md, struct m0_sm_group *grp, struct m0_be_domain *bedom)
Definition: mdstore.c:146
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_ad_cfg_make(char **str, const struct m0_be_seg *seg, const struct m0_stob_id *bstore_id, const m0_bcount_t size)
Definition: ad.c:220
struct m0_net_xprt * xprt
Definition: module.c:61
void m0_rpc_net_buffer_pool_cleanup(struct m0_net_buffer_pool *app_pool)
Definition: rpc.c:264
uint8_t * fi_buf
Definition: io_fop.h:38
void m0_free(void *data)
Definition: memory.c:146
M0_INTERNAL int m0_reqh_be_init(struct m0_reqh *reqh, struct m0_be_seg *seg)
Definition: reqh.c:269
Definition: mutex.h:47
struct m0_rpc_item f_item
Definition: fop.h:84
static void fop_send(struct m0_fop *fop, struct m0_rpc_session *session)
Definition: reqh_fom_ut.c:340
static struct m0_rpc_machine rpc_machine
Definition: service_ut.c:63
int32_t rc
Definition: trigger_fop.h:47
#define ARRAY_SIZE(a)
Definition: misc.h:45
struct m0_fid g_process_fid
Definition: ut.c:689
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
static struct m0_be_ut_backend ut_be
Definition: reqh_fom_ut.c:76
Definition: fop.h:80
Definition: tx.h:280
static struct m0_stob_domain * sdom
Definition: reqh_fom_ut.c:72