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 "fop/fom_generic_xc.h"
41 #include "reqh/ut/io_fop_xc.h"
42 #include "reqh/ut/io_fop.h"
43 #include "rpc/rpc_opcodes.h"
44 #include "rpc/rpclib.h"
45 #include "balloc/balloc.h"
46 #include "mdstore/mdstore.h"
47 #include "stob/ad.h" /* m0_stob_ad_cfg_make */
48 #include "fdmi/fdmi.h"
49 
50 #include "ut/ut.h"
51 #include "ut/be.h"
61 #define CLIENT_ENDPOINT_ADDR "0@lo:12345:34:*"
62 #define SERVER_ENDPOINT_ADDR "0@lo:12345:34:1"
63 #define SERVER_DB_NAME "reqh_ut_stob/sdb"
64 #define SERVER_BDOM_LOCATION "linuxstob:./reqh_fom_ut"
65 #define SERVER_BDOM_KEY 0xBAC570BD
66 
67 enum {
71 };
72 
73 static struct m0_stob_domain *sdom;
74 static struct m0_mdstore srv_mdstore;
77 static struct m0_be_ut_backend ut_be;
78 static struct m0_be_ut_seg ut_seg;
81 
85 static struct m0_reqh reqh;
86 
92  struct m0_mutex rb_lock;
95 };
96 
97 static struct reqh_ut_balloc *getballoc(struct m0_ad_balloc *ballroom)
98 {
99  return container_of(ballroom, struct reqh_ut_balloc, rb_ballroom);
100 }
101 
102 static int reqh_ut_balloc_init(struct m0_ad_balloc *ballroom,
103  struct m0_be_seg *db,
104  uint32_t bshift,
105  m0_bindex_t container_size,
106  m0_bcount_t groupsize,
107  m0_bcount_t spare_reserve)
108 {
109  struct reqh_ut_balloc *rb = getballoc(ballroom);
110 
112  return 0;
113 }
114 
115 static void reqh_ut_balloc_fini(struct m0_ad_balloc *ballroom)
116 {
117  struct reqh_ut_balloc *rb = getballoc(ballroom);
118 
120 }
121 
122 static int reqh_ut_balloc_alloc(struct m0_ad_balloc *ballroom,
123  struct m0_dtx *tx,
125  struct m0_ext *out,
126  uint64_t alloc_zone)
127 {
128  struct reqh_ut_balloc *rb = getballoc(ballroom);
129 
131  out->e_start = rb->rb_next;
132  out->e_end = rb->rb_next + count;
133  rb->rb_next += count;
135  return 0;
136 }
137 
138 static int reqh_ut_balloc_free(struct m0_ad_balloc *ballroom, struct m0_dtx *tx,
139  struct m0_ext *ext)
140 {
141  return 0;
142 }
143 
144 static int reqh_ut_reserve_extent(struct m0_ad_balloc *ballroom,
145  struct m0_be_tx *tx, struct m0_ext *ext,
146  uint64_t alloc_zone)
147 {
148  return 0;
149 }
150 
151 static const struct m0_ad_balloc_ops reqh_ut_balloc_ops = {
153  .bo_fini = reqh_ut_balloc_fini,
154  .bo_alloc = reqh_ut_balloc_alloc,
155  .bo_free = reqh_ut_balloc_free,
156  .bo_reserve_extent = reqh_ut_reserve_extent,
157 };
158 
159 /* static */ struct reqh_ut_balloc rb = {
160  .rb_next = 0,
161  .rb_ballroom = {
162  .ab_ops = &reqh_ut_balloc_ops
163  }
164 };
165 
166 /* Buffer pool for TM receive queue. */
168 
170 {
171  return sdom;
172 }
173 
174 static int server_init(const char *stob_path,
175  const char *srv_db_name,
176  struct m0_net_domain *net_dom,
177  uint64_t back_key,
178  struct m0_stob_domain **bdom)
179 {
180  int rc;
181  struct m0_sm_group *grp;
183  struct m0_be_tx tx;
184  struct m0_be_tx_credit cred = {};
185  struct m0_be_seg *seg;
186  struct m0_stob *bstore;
187  uint32_t bufs_nr;
188  uint32_t tms_nr;
189  char *sdom_cfg;
190  char *sdom_init_cfg;
191  char *sdom_location;
192  struct m0_stob_id stob_id;
193 
194  srv_cob_dom_id.id = 102;
195 
196  rc = M0_REQH_INIT(&reqh,
197  .rhia_dtm = NULL,
198  .rhia_db = NULL,
199  .rhia_mdstore = &srv_mdstore,
200  .rhia_fid = &g_process_fid,
201  );
202  M0_UT_ASSERT(rc == 0);
203 
205  m0_be_ut_seg_init(&ut_seg, &ut_be, 1 << 20 /* 1 MB */);
206 
207  seg = ut_seg.bus_seg;
209 
210  rc = m0_reqh_be_init(&reqh, seg);
211  M0_UT_ASSERT(rc == 0);
212 
213  /*
214  * Locate and create (if necessary) the backing store object.
215  */
218  bdom);
219  M0_UT_ASSERT(rc == 0);
220  m0_stob_id_make(0, back_key, &(*bdom)->sd_id, &stob_id);
221  rc = m0_stob_find(&stob_id, &bstore);
222  M0_UT_ASSERT(rc == 0);
223  rc = m0_stob_locate(bstore);
224  M0_UT_ASSERT(rc == 0);
225  rc = m0_stob_create(bstore, NULL, NULL);
226  M0_UT_ASSERT(rc == 0);
227 
228  /*
229  * Create AD domain over backing store object.
230  */
231  m0_stob_ad_cfg_make(&sdom_cfg, seg, m0_stob_id_get(bstore), 0);
232  sdom_location = m0_alloc(0x1000);
233  snprintf(sdom_location, 0x1000, "adstob:seg=%p,1234", seg);
234  m0_stob_ad_init_cfg_make(&sdom_init_cfg, &ut_be.but_dom);
235  rc = m0_stob_domain_create(sdom_location, sdom_init_cfg, 2,
236  sdom_cfg, &sdom);
237  M0_UT_ASSERT(rc == 0);
238 
239  m0_free(sdom_cfg);
240  m0_free(sdom_location);
241  m0_stob_put(bstore);
242 
243  /* Init mdstore without reading root cob. */
244  rc = m0_mdstore_init(&srv_mdstore, seg, false);
245  M0_UT_ASSERT(rc == -ENOENT);
247  &ut_be.but_dom, seg);
248  M0_UT_ASSERT(rc == 0);
249 
250  /* Create root session cob and other structures */
252  m0_ut_be_tx_begin(&tx, &ut_be, &cred);
254  m0_ut_be_tx_end(&tx);
255  M0_UT_ASSERT(rc == 0);
256 
257  /* Finalize old mdstore. */
259 
260  /* Init new mdstore with open root flag. */
261  rc = m0_mdstore_init(&srv_mdstore, seg, true);
262  M0_UT_ASSERT(rc == 0);
263 
265 
266  tms_nr = 1;
267  bufs_nr = m0_rpc_bufs_nr(M0_NET_TM_RECV_QUEUE_DEF_LEN, tms_nr);
268 
269  rc = m0_rpc_net_buffer_pool_setup(net_dom, &app_pool, bufs_nr, tms_nr);
270  M0_UT_ASSERT(rc == 0);
271 
272  /* Init the rpcmachine */
277  M0_UT_ASSERT(rc == 0);
280 
281  /* Init fdmi service */
283  M0_UT_ASSERT(rc == 0);
286  M0_UT_ASSERT(rc == 0);
287 
288  return rc;
289 }
290 
291 /* Fini the server */
292 static void server_fini(struct m0_stob_domain *bdom,
293  uint64_t back_key)
294 {
295  struct m0_sm_group *grp;
296  struct m0_stob *bstore;
297  int rc;
298  struct m0_stob_id stob_id;
299 
304 
307 
309  /* reqh_ut_service is finalised by m0_reqh_services_terminate(). */
312 
315  M0_UT_ASSERT(rc == 0);
316 
317  /* XXX domain can't be destroyed because of credit calculations bug */
318  /* rc = m0_stob_domain_destroy(sdom); */
319  /* M0_UT_ASSERT(rc == 0); */
321 
322  /* Fini the rpc_machine */
325 
326  m0_stob_id_make(0, back_key, &bdom->sd_id, &stob_id);
327  rc = m0_stob_find(&stob_id, &bstore);
328  M0_ASSERT(rc == 0);
329  rc = m0_stob_destroy(bstore, NULL);
330  M0_ASSERT(rc == 0);
331 
332  rc = m0_stob_domain_destroy(bdom);
333  M0_UT_ASSERT(rc == 0);
334 
337 
338  m0_reqh_fini(&reqh);
339 }
340 
341 static void fop_send(struct m0_fop *fop, struct m0_rpc_session *session)
342 {
343  int rc;
344 
345  rc = m0_rpc_post_sync(fop, session, NULL, 0 /* deadline */);
346  M0_UT_ASSERT(rc == 0);
350 }
351 
353 static void create_send(struct m0_rpc_session *session)
354 {
355  uint32_t i;
356  struct m0_fop *fop;
357  struct m0_stob_io_create *rh_io_fop;
358 
359  for (i = 0; i < 10; ++i) {
361  rh_io_fop = m0_fop_data(fop);
362  rh_io_fop->fic_object.f_seq = i;
363  rh_io_fop->fic_object.f_oid = i;
364  fop_send(fop, session);
365  }
366 }
367 
369 static void read_send(struct m0_rpc_session *session)
370 {
371  uint32_t i;
372  struct m0_fop *fop;
373  struct m0_stob_io_read *rh_io_fop;
374 
375  for (i = 0; i < 10; ++i) {
377  rh_io_fop = m0_fop_data(fop);
378  rh_io_fop->fir_object.f_seq = i;
379  rh_io_fop->fir_object.f_oid = i;
380  fop_send(fop, session);
381  }
382 }
383 
385 static void write_send(struct m0_rpc_session *session)
386 {
387  uint32_t i;
388  struct m0_fop *fop;
389  struct m0_stob_io_write *rh_io_fop;
390  uint8_t *buf;
391 
392  for (i = 0; i < 10; ++i) {
394  rh_io_fop = m0_fop_data(fop);
395  rh_io_fop->fiw_object.f_seq = i;
396  rh_io_fop->fiw_object.f_oid = i;
398  M0_ASSERT(buf != NULL);
399  rh_io_fop->fiw_value.fi_buf = buf;
400  rh_io_fop->fiw_value.fi_count = 1 << BALLOC_DEF_BLOCK_SHIFT;
401 
402  fop_send(fop, session);
403  }
404 }
405 
409 void test_reqh(void)
410 {
411  int result;
412  char opath[64];
413  const char *path;
415  struct m0_net_domain net_dom = { };
416  struct m0_net_domain srv_net_dom = { };
417  struct m0_stob_domain *bdom;
418  uint64_t back_key = 0xdf11e;
419  struct m0_rpc_client_ctx cctx = {
420  .rcx_net_dom = &net_dom,
421  .rcx_local_addr = CLIENT_ENDPOINT_ADDR,
422  .rcx_remote_addr = SERVER_ENDPOINT_ADDR,
423  .rcx_max_rpcs_in_flight = MAX_RPCS_IN_FLIGHT,
424  .rcx_fid = &g_process_fid,
425  };
426 
427  setbuf(stdout, NULL);
428  setbuf(stderr, NULL);
429 
430  path = "reqh_ut_stob";
431 
432  sdom = NULL;
436  M0_SET0(&ut_be);
437  M0_SET0(&ut_seg);
440  M0_SET0(&reqh);
441 
442 
444 
445  M0_UT_ASSERT(strlen(path) < ARRAY_SIZE(opath) - 8);
446 
447  result = m0_net_domain_init(&net_dom, xprt);
448  M0_UT_ASSERT(result == 0);
449  result = m0_net_domain_init(&srv_net_dom, xprt);
450  M0_UT_ASSERT(result == 0);
451 
452  server_init(path, SERVER_DB_NAME, &srv_net_dom, back_key, &bdom);
453 
454  result = m0_rpc_client_start(&cctx);
455  M0_UT_ASSERT(result == 0);
456 
457  /* send fops */
461 
462  result = m0_rpc_client_stop(&cctx);
463  M0_UT_ASSERT(result == 0);
464 
465  server_fini(bdom, back_key);
466 
467  m0_net_domain_fini(&net_dom);
468  m0_net_domain_fini(&srv_net_dom);
470 }
471 
473  .ts_name = "reqh-ut",
474  .ts_tests = {
475  { "reqh", test_reqh },
476  { NULL, NULL }
477  }
478 };
479 
482 /*
483  * Local variables:
484  * c-indentation-style: "K&R"
485  * c-basic-offset: 8
486  * tab-width: 8
487  * fill-column: 80
488  * scroll-step: 1
489  * End:
490  */
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:85
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:167
struct m0_cob_domain * md_dom
Definition: mdstore.h:58
struct m0_ad_balloc rb_ballroom
Definition: reqh_fom_ut.c:94
#define CLIENT_ENDPOINT_ADDR
Definition: reqh_fom_ut.c:61
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:62
static struct m0_rpc_machine srv_rpc_mach
Definition: reqh_fom_ut.c:76
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:65
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:122
struct m0_be_seg * bus_seg
Definition: helper.h:119
#define SERVER_BDOM_LOCATION
Definition: reqh_fom_ut.c:64
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:220
struct m0_mutex rb_lock
Definition: reqh_fom_ut.c:92
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:115
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:144
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:78
void test_reqh(void)
Definition: reqh_fom_ut.c:409
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:159
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:79
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:369
static void write_send(struct m0_rpc_session *session)
Definition: reqh_fom_ut.c:385
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:75
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:102
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:292
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:151
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:93
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:472
static void create_send(struct m0_rpc_session *session)
Definition: reqh_fom_ut.c:353
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:138
struct m0_stob_domain * reqh_ut_stob_domain_find(void)
Definition: reqh_fom_ut.c:169
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:80
struct stob_io_fop_fid fir_object
Definition: io_fop.h:52
static struct m0_mdstore srv_mdstore
Definition: reqh_fom_ut.c:74
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:174
#define SERVER_DB_NAME
Definition: reqh_fom_ut.c:63
struct m0_fop * m0_fop_alloc_at(struct m0_rpc_session *sess, struct m0_fop_type *fopt)
Definition: fop.c:122
static struct reqh_ut_balloc * getballoc(struct m0_ad_balloc *ballroom)
Definition: reqh_fom_ut.c:97
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:199
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:83
static void fop_send(struct m0_fop *fop, struct m0_rpc_session *session)
Definition: reqh_fom_ut.c:341
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:77
Definition: fop.h:79
Definition: tx.h:280
static struct m0_stob_domain * sdom
Definition: reqh_fom_ut.c:73