25 #include <sys/types.h> 40 #include "fop/fom_generic_xc.h" 41 #include "reqh/ut/io_fop_xc.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 175 const char *srv_db_name,
233 snprintf(sdom_location, 0x1000,
"adstob:seg=%p,1234",
seg);
359 for (
i = 0;
i < 10; ++
i) {
375 for (
i = 0;
i < 10; ++
i) {
392 for (
i = 0;
i < 10; ++
i) {
418 uint64_t back_key = 0xdf11e;
427 setbuf(stdout,
NULL);
428 setbuf(stderr,
NULL);
430 path =
"reqh_ut_stob";
M0_EXTERN struct m0_reqh_service_type m0_fdmi_service_type
static struct m0_reqh reqh
void m0_be_ut_seg_fini(struct m0_be_ut_seg *ut_seg)
M0_INTERNAL void m0_mdstore_fini(struct m0_mdstore *md)
struct m0_fop_type m0_stob_io_read_fopt
void m0_rpc_machine_fini(struct m0_rpc_machine *machine)
#define M0_ALLOC_ARR(arr, nr)
M0_INTERNAL int m0_reqh_service_start(struct m0_reqh_service *service)
M0_INTERNAL void m0_reqh_services_terminate(struct m0_reqh *reqh)
M0_INTERNAL void m0_mutex_unlock(struct m0_mutex *mutex)
void m0_net_domain_fini(struct m0_net_domain *dom)
static struct m0_net_buffer_pool app_pool
struct m0_cob_domain * md_dom
struct m0_ad_balloc rb_ballroom
#define CLIENT_ENDPOINT_ADDR
M0_INTERNAL int m0_cob_domain_mkfs(struct m0_cob_domain *dom, const struct m0_fid *rootfid, struct m0_be_tx *tx)
M0_INTERNAL void m0_reqh_service_stop(struct m0_reqh_service *service)
M0_INTERNAL int m0_stob_locate(struct m0_stob *stob)
#define SERVER_ENDPOINT_ADDR
static struct m0_rpc_machine srv_rpc_mach
M0_INTERNAL int m0_mdstore_init(struct m0_mdstore *md, struct m0_be_seg *db, bool init_root)
#define M0_REQH_INIT(reqh,...)
static struct m0_sm_group * grp
M0_INTERNAL void m0_reqh_service_prepare_to_stop(struct m0_reqh_service *service)
M0_INTERNAL int m0_stob_domain_destroy(struct m0_stob_domain *dom)
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)
struct m0_be_seg * bus_seg
#define SERVER_BDOM_LOCATION
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)
M0_INTERNAL void m0_ut_be_tx_end(struct m0_be_tx *tx)
static struct m0_rpc_client_ctx cctx
void * m0_fop_data(const struct m0_fop *fop)
void m0_be_ut_seg_init(struct m0_be_ut_seg *ut_seg, struct m0_be_ut_backend *ut_be, m0_bcount_t size)
#define container_of(ptr, type, member)
M0_INTERNAL void m0_mutex_lock(struct m0_mutex *mutex)
static void reqh_ut_balloc_fini(struct m0_ad_balloc *ballroom)
M0_INTERNAL void m0_reqh_fini(struct m0_reqh *reqh)
struct stob_io_fop_fid fic_object
M0_INTERNAL void m0_stob_ad_init_cfg_make(char **str, struct m0_be_domain *dom)
struct m0_reqh_service * rh_rpc_service
static int reqh_ut_reserve_extent(struct m0_ad_balloc *ballroom, struct m0_be_tx *tx, struct m0_ext *ext, uint64_t alloc_zone)
static struct m0_be_ut_seg ut_seg
M0_INTERNAL void m0_reqh_shutdown_wait(struct m0_reqh *reqh)
M0_INTERNAL void m0_cob_tx_credit(struct m0_cob_domain *dom, enum m0_cob_op optype, struct m0_be_tx_credit *accum)
struct m0_fi_value fiw_value
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)
M0_INTERNAL const struct m0_fid M0_MDSERVICE_SLASH_FID
struct m0_fop_type m0_stob_io_write_fopt
M0_INTERNAL bool m0_fom_domain_is_idle_for(const struct m0_reqh_service *svc)
static struct m0_reqh_service * reqh_ut_service
M0_INTERNAL const struct m0_stob_id * m0_stob_id_get(struct m0_stob *stob)
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)
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)
static void read_send(struct m0_rpc_session *session)
static void write_send(struct m0_rpc_session *session)
M0_INTERNAL void m0_reqh_service_fini(struct m0_reqh_service *service)
M0_INTERNAL uint32_t m0_rpc_bufs_nr(uint32_t len, uint32_t tms_nr)
static struct m0_cob_domain_id srv_cob_dom_id
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)
int m0_rpc_client_stop(struct m0_rpc_client_ctx *cctx)
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)
void m0_be_ut_backend_init(struct m0_be_ut_backend *ut_be)
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)
struct m0_net_xprt * m0_net_xprt_default_get(void)
int m0_rpc_client_start(struct m0_rpc_client_ctx *cctx)
struct m0_rpc_item * ri_reply
void * m0_alloc(size_t size)
M0_INTERNAL void m0_mutex_init(struct m0_mutex *mutex)
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)
static void server_fini(struct m0_stob_domain *bdom, uint64_t back_key)
M0_INTERNAL int m0_reqh_service_allocate(struct m0_reqh_service **out, const struct m0_reqh_service_type *stype, struct m0_reqh_context *rctx)
struct m0_sm_group * m0_be_ut_backend_sm_group_lookup(struct m0_be_ut_backend *ut_be)
static const struct m0_ad_balloc_ops reqh_ut_balloc_ops
void m0_stob_io_fop_fini(void)
M0_INTERNAL void m0_reqh_service_init(struct m0_reqh_service *service, struct m0_reqh *reqh, const struct m0_fid *fid)
struct m0_net_domain * rcx_net_dom
struct m0_be_domain but_dom
M0_INTERNAL int m0_reqh_state_get(struct m0_reqh *reqh)
M0_INTERNAL void m0_stob_domain_fini(struct m0_stob_domain *dom)
M0_INTERNAL int m0_stob_create(struct m0_stob *stob, struct m0_dtx *dtx, const char *str_cfg)
M0_INTERNAL int m0_stob_destroy(struct m0_stob *stob, struct m0_dtx *dtx)
M0_INTERNAL void m0_reqh_start(struct m0_reqh *reqh)
struct m0_ut_suite reqh_ut
static void create_send(struct m0_rpc_session *session)
int m0_net_domain_init(struct m0_net_domain *dom, const struct m0_net_xprt *xprt)
static int reqh_ut_balloc_free(struct m0_ad_balloc *ballroom, struct m0_dtx *tx, struct m0_ext *ext)
struct m0_stob_domain * reqh_ut_stob_domain_find(void)
struct m0_rpc_session rcx_session
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)
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)
static struct m0_reqh_service * fdmi_ut_service
struct stob_io_fop_fid fir_object
static struct m0_mdstore srv_mdstore
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)
struct m0_fop * m0_fop_alloc_at(struct m0_rpc_session *sess, struct m0_fop_type *fopt)
static struct reqh_ut_balloc * getballoc(struct m0_ad_balloc *ballroom)
M0_INTERNAL void m0_mutex_fini(struct m0_mutex *mutex)
void m0_fop_put_lock(struct m0_fop *fop)
static struct m0_fop * fop
void m0_be_ut_backend_fini(struct m0_be_ut_backend *ut_be)
M0_INTERNAL void m0_reqh_idle_wait_for(struct m0_reqh *reqh, struct m0_reqh_service *service)
M0_INTERNAL int m0_stob_find(const struct m0_stob_id *id, struct m0_stob **out)
static struct m0_be_seg * seg
M0_INTERNAL int m0_mdstore_destroy(struct m0_mdstore *md, struct m0_sm_group *grp, struct m0_be_domain *bedom)
struct stob_io_fop_fid fiw_object
void m0_stob_io_fop_init(void)
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)
struct m0_net_xprt * xprt
void m0_rpc_net_buffer_pool_cleanup(struct m0_net_buffer_pool *app_pool)
M0_INTERNAL int m0_reqh_be_init(struct m0_reqh *reqh, struct m0_be_seg *seg)
struct m0_rpc_item f_item
static void fop_send(struct m0_fop *fop, struct m0_rpc_session *session)
static struct m0_rpc_machine rpc_machine
struct m0_fid g_process_fid
struct m0_fop_type m0_stob_io_create_fopt
M0_INTERNAL void m0_stob_put(struct m0_stob *stob)
static struct m0_be_ut_backend ut_be
static struct m0_stob_domain * sdom