25 #define M0_TRACE_SUBSYSTEM M0_TRACE_SUBSYS_COB 83 #define SERVER_EP_ADDR "0@lo:12345:34:1" 84 #define CLIENT_EP_ADDR "0@lo:12345:34:*" 85 #define SERVER_ENDP M0_NET_XPRT_PREFIX_DEFAULT":"SERVER_EP_ADDR 113 "m0d",
"-T",
"AD",
"-D",
"cobfoms_ut.db",
"-S",
114 "cobfoms_ut_stob",
"-A",
"linuxstob:cobfoms_ut_addb_stob",
346 arg[
i].
ca_rc = expected_rc;
351 "cob_create" :
"cob_delete");
515 uint32_t cobfop_nr = 5;
526 for (
i = 0;
i < cobfop_nr; ++
i ) {
542 for (
i = 0;
i < cobfop_nr*2; ++
i ) {
564 for (
i = 0;
i < cobfop_nr*2; ++
i) {
657 fom->fo_fop = base_fop;
806 uint32_t nskey_bs_len;
815 nskey_bs_len = strlen(nskey_bs);
835 int expected_reply_rc)
1193 attr.ca_ctime = 1416970585;
1342 #define COB_DATA(data) M0_XCODE_OBJ(m0_fop_cob_common_xc, data) 1359 cob_rep = fp_frag->ffrp_rep;
1363 fp_frag->ffrp_fop)->cc_common :
1365 fp_frag->ffrp_fop)->cd_common;
1368 &COB_DATA(cob_cmn)) == 0);
1385 static void cobfoms_fol_verify(
void)
1415 result = cob_cd_op(&dec_cd_rec, d_fop,
true);
1417 result = cob_cd_op(&dec_cc_rec, c_fop,
true);
1421 result = cob_cd_op(&dec_cd_rec, d_fop,
false);
1423 result = cob_cd_op(&dec_cc_rec, c_fop,
false);
1490 struct m0_fid bstore_fid;
1548 device_id = device_id * 2 + 1;
1557 .ts_name =
"cob-foms-ut",
1564 {
"cobfoms_fsync_create_delete",
1582 #undef M0_TRACE_SUBSYSTEM
struct m0_fop_type m0_fop_cob_op_reply_fopt
static struct m0_fid gob_fid
static struct m0_fom_type ft
struct m0_be_domain * bs_domain
static void cobfoms_fop_thread_fini(struct m0_fop_type *ftype1, struct m0_fop_type *ftype2)
static struct m0_fom_locality dummy_loc
#define M0_ALLOC_ARR(arr, nr)
static void cc_fom_fini_test()
static void cd_stob_delete_test()
static bool exists(const struct m0_ut_module *m, const char *s_name, const char *t_name)
M0_INTERNAL void m0_fid_gob_make(struct m0_fid *gob_fid, uint32_t container, uint64_t key)
void m0_net_domain_fini(struct m0_net_domain *dom)
static void cobfoms_fsync_nonexist_tx(void)
M0_INTERNAL struct m0_fop_cob_common * m0_cobfop_common_get(struct m0_fop *fop)
static void cobfoms_fsync_create_delete(void)
struct m0_reqh * m0_cs_reqh_get(struct m0_motr *cctx)
int const char const void size_t int flags
static const char * SERVER_LOGFILE
struct m0_fom_domain * fl_dom
static const struct m0_fom_ops cd_fom_ops
struct m0_fop_type m0_fop_cob_create_fopt
struct m0_fop ** cu_createfops
M0_INTERNAL void m0_fol_rec_fini(struct m0_fol_rec *rec)
struct m0_fid si_domain_fid
struct m0_rpc_client_ctx cu_cctx
int m0_thread_join(struct m0_thread *q)
const struct m0_fol_frag_ops * rp_ops
static void dummy_locality_setup()
struct m0_rpc_server_ctx cu_sctx
const m0_time_t M0_TIME_NEVER
static struct m0_cob * test_cob
static struct m0_sm_group * grp
static void cobfoms_utinit(void)
#define M0_LOG(level,...)
static void cc_fom_dealloc(struct m0_fom *fom)
static void cobfoms_preexisting_cob(void)
struct m0_container container
static void cd_fom_dealloc(struct m0_fom *fom)
static struct m0_fom * cc_fom_alloc()
static struct m0_be_tx_credit * m0_fom_tx_credit(struct m0_fom *fom)
struct m0_sm_group fl_group
static void cob_op_credit(struct m0_fom *fom, enum m0_cob_op opcode, struct m0_be_tx_credit *accum)
int m0_rpc_server_start(struct m0_rpc_server_ctx *sctx)
static void cobfoms_fops_dispatch(struct m0_fop_type *ftype, uint64_t flags, int expected_rc)
static void fop_alloc(struct m0_fom *fom, enum cob_fom_type fomtype)
M0_INTERNAL void m0_dtx_init(struct m0_dtx *tx, struct m0_be_domain *be_domain, struct m0_sm_group *sm_group)
M0_INTERNAL void m0_ios_cdom_get(struct m0_reqh *reqh, struct m0_cob_domain **out)
M0_INTERNAL void m0_fid_convert_cob2adstob(const struct m0_fid *cob_fid, struct m0_stob_id *stob_id)
static int cc_cob_create(struct m0_fom *fom, struct m0_fom_cob_op *cc, const struct m0_cob_attr *attr)
const struct m0_fid_type m0_cob_fid_type
const struct m0_fid_type m0_file_fid_type
const struct m0_stob_type m0_stob_ad_type
static void cobfops_populate_internal(struct m0_fop *fop, uint64_t gob_fid_key)
M0_INTERNAL uint8_t m0_fid_tget(const struct m0_fid *fid)
static struct m0_rpc_client_ctx cctx
static void cobfops_threads_fini(void)
void * m0_fop_data(const struct m0_fop *fop)
static void cc_fom_populate_test()
static struct m0_addb2_mach * mach
static void fom_get_test(enum cob_fom_type fomtype)
static bool cc_cob_create_test_done
M0_INTERNAL void m0_fid_convert_adstob2bstore(const struct m0_fid *stob_domain_fid, struct m0_fid *bstore_fid)
#define M0_THREAD_INIT(thread, TYPE, init, func, arg, namefmt,...)
static void cc_cob_create_test()
static void cobfoms_send_internal(struct m0_fop_type *ftype1, struct m0_fop_type *ftype2, uint64_t flags, int rc1, int rc2, uint64_t nr)
static void cobfops_create(void)
static void fom_create(struct m0_fom **fom, enum cob_fom_type fomtype)
static void cobfops_threads_init(void)
int m0_rpc_item_wait_for_reply(struct m0_rpc_item *item, m0_time_t timeout)
struct m0_fol_frag_type m0_fop_fol_frag_type
static struct m0_be_tx * m0_fom_tx(struct m0_fom *fom)
M0_INTERNAL int m0_dtx_done_sync(struct m0_dtx *tx)
const struct m0_fol_frag_type * rpo_type
struct m0_fom_type ft_fom_type
struct m0_stob * fco_stob
const struct m0_fom_type * fo_type
M0_INTERNAL int m0_cob_nskey_make(struct m0_cob_nskey **keyh, const struct m0_fid *pfid, const char *name, size_t namelen)
static void cobfoms_fop_thread_init(uint64_t fop_nr, uint64_t thread_nr)
M0_INTERNAL void m0_sm_group_unlock(struct m0_sm_group *grp)
M0_INTERNAL void m0_fol_rec_init(struct m0_fol_rec *rec, struct m0_fol *fol)
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)
static void fid_convert_ut_check(uint32_t container, uint64_t key, uint32_t device_id)
struct m0_locality fl_locality
struct m0_fop_type * ca_ftype
struct m0_fop_type * f_type
static void cobfoms_del_nonexist_cob(void)
static void fom_dtx_done(struct m0_fom *fom, struct m0_sm_group *grp)
struct m0_net_xprt * cu_xprt
struct m0_cob_domain cu_cob_dom
static const struct m0_fid CONF_PVER_FID1
M0_INTERNAL int m0_cob_delete_put(struct m0_cob *cob, struct m0_be_tx *tx)
static void cd_fom_populate_test()
M0_INTERNAL void m0_rpc_machine_unlock(struct m0_rpc_machine *machine)
struct m0_fop_cob_op_rep_common cor_common
static int ce_stob_edit_credit(struct m0_fom *fom, struct m0_fom_cob_op *cc, struct m0_be_tx_credit *accum, uint32_t cot)
static void cob_create_api_test(void)
static void attr(struct m0_addb2__context *ctx, const uint64_t *v, char *buf)
const char * rsx_log_file_name
static void cobfops_send_wait(struct cobthread_arg *arg)
M0_INTERNAL bool m0_fid_validate_adstob(const struct m0_stob_id *stob_id)
static void cobfoms_single(void)
static int cob_ops_stob_find(struct m0_fom_cob_op *co)
M0_INTERNAL void m0_sm_group_init(struct m0_sm_group *grp)
M0_INTERNAL int m0_xcode_cmp(const struct m0_xcode_obj *o0, const struct m0_xcode_obj *o1)
static struct m0_addb2_callback c
M0_INTERNAL void m0_md_cob_mem2wire(struct m0_fop_cob *body, const struct m0_cob_attr *attr)
struct m0_be_tx_remid ffr_be_remid
static void cc_fom_get_test()
struct m0_reqh_service_type m0_ios_type
static void cob_delete_api_test(void)
static void cc_fom_create_test()
M0_INTERNAL void m0_fom_type_init(struct m0_fom_type *type, uint64_t id, const struct m0_fom_type_ops *ops, const struct m0_reqh_service_type *svc_type, const struct m0_sm_conf *sm)
static struct m0_fid cob_fid
int m0_rpc_client_stop(struct m0_rpc_client_ctx *cctx)
const struct m0_sm_conf cob_ops_conf
static int ce_stob_edit(struct m0_fom *fom, struct m0_fom_cob_op *cd, uint32_t cot)
static void cd_fom_fini(struct m0_fom *fom)
static void cc_fom_fini(struct m0_fom *fom)
struct m0_net_xprt * m0_net_xprt_default_get(void)
int m0_rpc_client_start(struct m0_rpc_client_ctx *cctx)
struct m0_net_xprt ** rsx_xprts
static void cobfoms_fsync_send_fop(struct m0_be_tx_remid *remid, int expected_rc)
struct m0_rpc_item * ri_reply
static struct m0_rpc_server_ctx sctx
M0_INTERNAL uint32_t m0_fid_cob_device_id(const struct m0_fid *cob_fid)
uint32_t rcx_recv_queue_min_length
static int cob_ops_fom_tick(struct m0_fom *fom)
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)
M0_INTERNAL int m0_cob_lookup(struct m0_cob_domain *dom, struct m0_cob_nskey *nskey, uint64_t flags, struct m0_cob **out)
M0_INTERNAL int m0_cc_stob_create(struct m0_fom *fom, struct m0_stob_id *sid)
M0_INTERNAL void m0_dtx_fini(struct m0_dtx *tx)
M0_INTERNAL struct m0_rpc_machine * session_machine(const struct m0_rpc_session *s)
static void cd_fom_create_test()
const struct m0_fom_type * fo_type
struct m0_sm_group * lo_grp
static void cobfops_populate(uint64_t index)
static void cd_fom_get_test()
struct m0_fol_rec tx_fol_rec
M0_INTERNAL void m0_fom_sm_init(struct m0_fom *fom)
struct m0_fop_type m0_fop_cob_delete_fopt
struct m0_rpc_machine machine
struct m0_net_domain * rcx_net_dom
static struct m0_fom * cd_fom_alloc()
struct m0_thread ** cu_threads
M0_INTERNAL bool m0_fid_validate_gob(const struct m0_fid *gob_fid)
M0_INTERNAL struct m0_fop_type * m0_fop_type_find(uint32_t opcode)
static void fom_fini_test(enum cob_fom_type fomtype)
static void cob_verify(struct m0_fom *fom, const bool exists)
M0_INTERNAL bool m0_is_cob_create_fop(const struct m0_fop *fop)
M0_INTERNAL void m0_reqh_idle_wait(struct m0_reqh *reqh)
void cob_attr_default_fill(struct m0_cob_attr *attr)
static void cc_fom_state_test(void)
struct m0_fop_type m0_fop_fsync_ios_fopt
static int cd_cob_delete(struct m0_fom *fom, struct m0_fom_cob_op *cd, const struct m0_cob_attr *attr)
static void cd_cob_delete_test()
static void cobfoms_utfini(void)
uint64_t rcx_max_rpcs_in_flight
M0_INTERNAL bool m0_fid_eq(const struct m0_fid *fid0, const struct m0_fid *fid1)
M0_INTERNAL bool m0_fid_validate_bstore(const struct m0_fid *bstore_fid)
M0_INTERNAL struct m0_reqh_service * m0_reqh_service_find(const struct m0_reqh_service_type *st, const struct m0_reqh *reqh)
int m0_net_domain_init(struct m0_net_domain *dom, const struct m0_net_xprt *xprt)
static const struct m0_fid CONF_PVER_FID
static void cd_fom_state_test(void)
int(* fto_redo)(struct m0_fop_fol_frag *ffrag, struct m0_fol *fol)
M0_INTERNAL struct m0_locality * m0_locality0_get(void)
static char * server_args[]
struct m0_rpc_session rcx_session
static void cc_stob_create_test()
struct m0_net_domain cu_nd
struct m0_fom_locality * fo_loc
M0_INTERNAL void m0_rpc_machine_lock(struct m0_rpc_machine *machine)
struct m0_reqh_service * fo_service
struct m0_be_tx_remid ff_be_remid
struct m0_stob_id fco_stob_id
#define M0_ALLOC_PTR(ptr)
#define M0_UT_CONF_PROCESS
static void fom_fini(struct m0_fom *fom, enum cob_fom_type fomtype)
static struct cobfoms_ut * cut
M0_INTERNAL struct m0_fom_domain * m0_fom_dom(void)
void m0_ut_fom_phase_set(struct m0_fom *fom, int phase)
static void cobfoms_multiple(void)
const struct m0_fop_type_ops * ft_ops
M0_INTERNAL int m0_fom_rc(const struct m0_fom *fom)
const char * rcx_remote_addr
static void fid_convert_ut(void)
static void fom_create_test(enum cob_fom_type fomtype)
void m0_fop_put_lock(struct m0_fop *fop)
static char COB_FOP_NR_STR[]
M0_INTERNAL int m0_cc_stob_cr_credit(struct m0_stob_id *sid, struct m0_be_tx_credit *accum)
struct m0_fop_mod_rep cor_mod_rep
static struct m0_fop * fop
struct m0_be_seg * rh_beseg
M0_INTERNAL void m0_sm_group_lock(struct m0_sm_group *grp)
static void cd_fom_fini_test()
struct m0_fop * m0_rpc_item_to_fop(const struct m0_rpc_item *item)
static void fom_dtx_init(struct m0_fom *fom, struct m0_sm_group *grp, enum m0_cob_op opcode)
const char * rcx_local_addr
M0_INTERNAL int m0_dtx_open_sync(struct m0_dtx *tx)
static int cob_fom_populate(struct m0_fom *fom)
M0_INTERNAL void m0_fid_convert_cob2gob(const struct m0_fid *cob_fid, struct m0_fid *gob_fid)
void m0_rpc_server_stop(struct m0_rpc_server_ctx *sctx)
struct m0_rpc_machine rcx_rpc_machine
M0_INTERNAL void m0_fid_convert_adstob2cob(const struct m0_stob_id *stob_id, struct m0_fid *cob_fid)
M0_INTERNAL void m0_fom_locality_inc(struct m0_fom *fom)
M0_INTERNAL void m0_stob_delete_mark(struct m0_stob *stob)
M0_INTERNAL void m0_fid_convert_gob2cob(const struct m0_fid *gob_fid, struct m0_fid *cob_fid, uint32_t device_id)
void m0_fom_phase_set(struct m0_fom *fom, int phase)
static const struct m0_fom_ops cc_fom_ops
struct m0_fop ** cu_deletefops
static int cob_op_fom_create(struct m0_fom **out)
static void cob_testdata_cleanup(struct m0_fom *fom)
static struct m0_dtm_oper_descr reply
M0_INTERNAL bool m0_fid_validate_cob(const struct m0_fid *cob_fid)
static struct m0_fom_cob_op * cob_fom_get(const struct m0_fom *fom)
#define m0_tl_for(name, head, obj)
void m0_fop_put(struct m0_fop *fop)
struct m0_rpc_item f_item
const struct m0_reqh_service_type * ft_rstype
const struct m0_stob_type m0_stob_linux_type
M0_INTERNAL void m0_fid_convert_bstore2adstob(const struct m0_fid *bstore_fid, struct m0_fid *stob_domain_fid)
static void md_cob_fop_create_delete_test(bool create_p, const struct m0_fid *pver, int expected_reply_rc)
struct m0_fid g_process_fid
struct m0_be_tx_remid fmr_remid
struct m0_motr rsx_motr_ctx
static void md_cob_create_delete()
int(* fto_undo)(struct m0_fop_fol_frag *ffrag, struct m0_fol *fol)
static void cobfops_destroy(struct m0_fop_type *ftype1, struct m0_fop_type *ftype2)
static void fom_stob_tx_credit(struct m0_fom *fom, enum m0_cob_op opcode)
M0_INTERNAL struct m0_reqh * m0_fom_reqh(const struct m0_fom *fom)
static struct m0_fom * cob_testdata_create()
struct m0_fid_type st_fidt
struct m0_fop * m0_fop_alloc(struct m0_fop_type *fopt, void *data, struct m0_rpc_machine *mach)
#define M0_IMPOSSIBLE(fmt,...)