24 #include <sys/types.h> 40 #define M0_TRACE_SUBSYSTEM M0_TRACE_SUBSYS_IOSERVICE 147 &
fom->fo_tx.tx_betx.t_payload);
305 "state=%d type=%d, %"PRIu64,
343 if (M0_IN(phase, (st.fcrw_st_next_phase_again,
344 st.fcrw_st_next_phase_wait))) {
350 st.fcrw_st_next_phase_again :
351 st.fcrw_st_next_phase_wait);
370 int acquired_net_bufs;
376 struct m0_fid invalid_fid;
422 fom->fo_sm_phase.sm_rc = 0;
472 while (acquired_net_bufs > 0) {
477 netbufs_tlink_del_fini(nb);
724 int acquired_net_bufs;
732 struct m0_fid invalid_fid;
823 while (acquired_net_bufs > 0) {
828 netbufs_tlink_del_fini(nb);
1093 cc.fco_stob_id = stob_id;
1315 #define WRITE_FOP_DATA(fop) M0_XCODE_OBJ(m0_fop_cob_writev_xc, fop) 1349 wfop_rep = fp_frag->ffrp_rep;
1610 &targ[
i],
"io_thrd");
1689 iofop = io_fops[
index];
1699 for (
i = 0;
i < buf_nr; ++
i)
1731 for (
i = 0;
i < buf_nr; ++
i) {
1745 for (
i = 0;
i < buf_nr; ++
i) {
1762 const char *caddr =
"0@lo:12345:34:*";
1763 const char *saddr =
"0@lo:12345:34:1";
1826 {
"bulkio_server_single_read_write",
1828 {
"bulkio_server_write_fol_rec_verify",
1830 {
"bulkio_server_write_fol_rec_undo_verify",
1832 {
"bulkio_server_read_write_state_test",
1834 {
"bulkio_server_vectored_read_write",
1840 {
"bulkio_server_fsync_multiple_read_write",
1842 {
"bulkio_server_rw_multiple_nb_server",
1844 {
"bulkio_server_rw_state_transition_test",
1855 {
"bulkio_server_read_write_fv_mismatch",
1856 bulkio_server_read_write_fv_mismatch},
1863 #undef M0_TRACE_SUBSYSTEM
M0_INTERNAL struct m0_stob_domain * m0_stob_dom_get(struct m0_stob *stob)
struct m0_be_domain * bs_domain
M0_INTERNAL int m0_cc_cob_setup(struct m0_fom_cob_op *cc, struct m0_cob_domain *cdom, const struct m0_cob_attr *attr, struct m0_be_tx *ctx)
#define M0_ALLOC_ARR(arr, nr)
struct m0_tl fcrw_stio_list
struct m0_fol_rec_header fr_header
static int bulkio_server_read_fom_tick(struct m0_fom *fom)
static int io_fop_stob_create_fom_create(struct m0_fop *fop, struct m0_fom **m, struct m0_reqh *reqh)
struct m0_reqh * m0_cs_reqh_get(struct m0_motr *cctx)
int(* rpo_undo)(struct m0_fol_frag *frag, struct m0_be_tx *tx)
struct m0_thread ** bp_threads
M0_INTERNAL void m0_fol_rec_fini(struct m0_fol_rec *rec)
static void fom_phase_set(struct m0_fom *fom, int phase)
static struct m0_addb2_mach * m
M0_INTERNAL int m0_stob_locate(struct m0_stob *stob)
static const struct m0_fom_ops bulkio_stob_create_fom_ops
struct m0_tl rios_buffer_pools
M0_INTERNAL int m0_rpc_bulk_store(struct m0_rpc_bulk *rbulk, const struct m0_rpc_conn *conn, struct m0_net_buf_desc_data *to_desc, const struct m0_net_buffer_callbacks *bulk_cb)
struct m0_bufvec nb_buffer
int m0_thread_join(struct m0_thread *q)
static void bulkio_server_write_fol_rec_undo_verify(void)
const struct m0_fol_frag_ops * rp_ops
struct m0_tl fcrw_netbuf_list
static struct m0_sm_group * grp
M0_INTERNAL int m0_rpc_bulk_buf_databuf_add(struct m0_rpc_bulk_buf *rbuf, void *buf, m0_bcount_t count, m0_bindex_t index, struct m0_net_domain *netdom)
#define M0_LOG(level,...)
static struct m0_be_tx_credit * m0_fom_tx_credit(struct m0_fom *fom)
M0_INTERNAL void m0_storage_dev_get(struct m0_storage_dev *dev)
M0_INTERNAL struct m0_net_buffer * m0_net_buffer_pool_get(struct m0_net_buffer_pool *pool, uint32_t colour)
M0_INTERNAL void m0_net_buffer_pool_unlock(struct m0_net_buffer_pool *pool)
static void builkio_ut_stob_get(struct m0_io_fom_cob_rw *fom_obj)
static void bulkio_fini(void)
M0_INTERNAL void m0_dtx_init(struct m0_dtx *tx, struct m0_be_domain *be_domain, struct m0_sm_group *sm_group)
struct m0_rpc_server_ctx * bp_sctx
int(* fto_create)(struct m0_fop *fop, struct m0_fom **out, struct m0_reqh *reqh)
struct m0_rpc_bulk if_rbulk
struct m0_fid bp_fids[IO_FIDS_NR]
const struct m0_fid_type m0_cob_fid_type
struct m0_net_domain * rios_ndom
static void io_fops_submit(uint32_t index, enum M0_RPC_OPCODES op)
enum m0_ha_obj_state isd_ha_state
struct m0_net_buf_desc_data * id_descs
void * m0_fop_data(const struct m0_fop *fop)
static int bulkio_server_write_fom_tick(struct m0_fom *fom)
static void bulkio_init(void)
#define M0_THREAD_INIT(thread, TYPE, init, func, arg, namefmt,...)
static void fill_buffers_pool(uint32_t colour)
struct m0_sm_conf io_conf
void(* rpo_undo_credit)(const struct m0_fol_frag *frag, struct m0_be_tx_credit *accum)
int bulkio_server_start(struct bulkio_params *bp, const char *saddr)
struct m0_rpc_bulk fcrw_bulk
struct m0_net_buffer_pool * fcrw_bp
static const struct m0_fop_type_ops bulkio_stob_create_ops
#define container_of(ptr, type, member)
static const struct m0_fom_type_ops ut_io_fom_cob_rw_type_ops
static const struct m0_fom_type_ops bulkio_server_read_fomt_ops
static void io_fop_desc_get(struct m0_fop *fop, struct m0_net_buf_desc_data **desc)
const struct m0_sm_conf m0_generic_conf
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)
struct m0_be_tx_remid bp_remid
const struct m0_fol_frag_type * rpo_type
static void bulkio_server_write_fol_rec_verify(void)
struct m0_fom_type ft_fom_type
int bulkio_client_start(struct bulkio_params *bp, const char *caddr, const char *saddr)
const struct m0_fom_type * fo_type
uint64_t bp_offsets[IO_FIDS_NR]
static void bulkio_stob_create(void)
M0_INTERNAL void m0_cob_tx_credit(struct m0_cob_domain *dom, enum m0_cob_op optype, struct m0_be_tx_credit *accum)
enum M0_RPC_OPCODES ta_op
static int ut_io_fom_cob_rw_state(struct m0_fom *fom)
static const struct m0_fom_ops bulkio_server_write_fom_ops
M0_INTERNAL void m0_sm_group_unlock(struct m0_sm_group *grp)
static void io_fop_replied(struct m0_fop *fop, struct m0_fop *bkpfop)
void io_fops_destroy(struct bulkio_params *bp)
M0_INTERNAL void m0_fol_rec_init(struct m0_fol_rec *rec, struct m0_fol *fol)
static void bulkio_stob_fom_fini(struct m0_fom *fom)
static void m0_io_fom_cob_rw_fini(struct m0_fom *fom)
struct m0_fop_type * f_type
struct m0_net_buffer_pool rios_bp
M0_INTERNAL void m0_fid_set(struct m0_fid *fid, uint64_t container, uint64_t key)
static int check_write_fom_tick(struct m0_fom *fom)
static bool bulkio_stob_created
static void io_single_fop_submit(enum M0_RPC_OPCODES op)
struct m0_cob_domain * rios_cdom
static void attr(struct m0_addb2__context *ctx, const uint64_t *v, char *buf)
enum m0_net_queue_type nb_qtype
M0_INTERNAL void m0_storage_devs_lock(struct m0_storage_devs *devs)
M0_INTERNAL void m0_fi_disable(const char *fp_func, const char *fp_tag)
struct m0_net_buffer * bb_nbuf
int m0_fom_tick_generic(struct m0_fom *fom)
struct m0_rpc_client_ctx * bp_cctx
static void m0_fi_enable(const char *func, const char *tag)
void m0_fom_fini(struct m0_fom *fom)
fom_state_transition_tests
static struct m0_cob * cob
struct m0_io_descs crw_desc
struct m0_rm_domain bp_rdom
static int ut_io_fom_cob_rw_create(struct m0_fop *fop, struct m0_fom **m, struct m0_reqh *reqh)
M0_INTERNAL int m0_xcode_cmp(const struct m0_xcode_obj *o0, const struct m0_xcode_obj *o1)
static const struct m0_fop_type_ops bulkio_server_read_fop_ut_ops
static void bulkio_server_multiple_read_write(void)
void io_fops_rpc_submit(struct thrd_arg *t)
M0_INTERNAL void m0_cob_oikey_make(struct m0_cob_oikey *oikey, const struct m0_fid *fid, int linkno)
M0_INTERNAL void m0_fid_convert_cob2stob(const struct m0_fid *cob_fid, struct m0_stob_id *stob_id)
struct m0_rpc_conn rcx_connection
static int next_read_test
static void bulkio_server_single_read_write(void)
static const struct m0_fom_type_ops bulkio_server_write_fomt_ops
static int io_fop_coalesce(struct m0_fop *res_fop, uint64_t size)
static struct m0_stob_domain * dom
M0_INTERNAL void m0_net_buffer_pool_lock(struct m0_net_buffer_pool *pool)
struct m0_be_tx_credit tx_betx_cred
void bulkio_params_init(struct bulkio_params *bp)
static const struct m0_fom_type_ops bulkio_stob_create_fomt_ops
static struct m0_io_fom_cob_rw_state_transition io_fom_read_st[]
struct bulkio_params * ta_bp
M0_INTERNAL uint32_t m0_fid_cob_device_id(const struct m0_fid *cob_fid)
static int check_read_fom_tick(struct m0_fom *fom)
M0_INTERNAL void m0_dtx_fini(struct m0_dtx *tx)
struct m0_sm_group * lo_grp
enum m0_conf_service_type isd_srv_type
M0_INTERNAL m0_bcount_t m0_net_domain_get_max_buffer_size(struct m0_net_domain *dom)
static int bulkio_stob_create_fom_tick(struct m0_fom *fom)
void bulkio_client_stop(struct m0_rpc_client_ctx *cctx)
M0_INTERNAL void m0_buf_free(struct m0_buf *buf)
static size_t m0_io_fom_cob_rw_locality_get(const struct m0_fom *fom)
M0_INTERNAL int m0_buf_copy(struct m0_buf *dest, const struct m0_buf *src)
static const struct m0_fop_type_ops bulkio_server_write_fop_ut_ops
static int next_write_test
M0_INTERNAL struct m0_storage_devs * m0_cs_storage_devs_get(void)
M0_INTERNAL struct m0_fop_type * m0_fop_type_find(uint32_t opcode)
M0_INTERNAL struct m0_storage_dev * m0_storage_devs_find_by_dom(struct m0_storage_devs *devs, struct m0_stob_domain *dom)
struct m0_fop_cob_rw_reply c_rep
M0_INTERNAL struct m0_stob_domain * m0_stob_domain_find_by_stob_id(const struct m0_stob_id *stob_id)
M0_INTERNAL void m0_reqh_idle_wait(struct m0_reqh *reqh)
void cob_attr_default_fill(struct m0_cob_attr *attr)
static int m0_io_fom_cob_rw_tick(struct m0_fom *fom)
const struct m0_fom_type_ops * ft_ops
static void bulkio_server_read_write_state_test(void)
struct m0_ut_suite bulkio_server_ut
static void empty_buffers_pool(uint32_t colour)
M0_INTERNAL int m0_stob_create(struct m0_stob *stob, struct m0_dtx *dtx, const char *str_cfg)
static const struct m0_io_fom_cob_rw_state_transition io_fom_write_st[]
struct m0_fop_type m0_fop_cob_readv_fopt
static bool fol_check_enabled
static void fop_create_populate(int index, enum M0_RPC_OPCODES op, int buf_nr)
M0_INTERNAL int64_t m0_ref_read(const struct m0_ref *ref)
struct m0_net_buffer ** bp_iobuf
void bulkioapi_test(void)
static const struct m0_fid CONF_PVER_FID
int(* fto_redo)(struct m0_fop_fol_frag *ffrag, struct m0_fol *fol)
M0_INTERNAL struct m0_locality * m0_locality0_get(void)
struct m0_io_fop ** bp_rfops
M0_INTERNAL void m0_sm_init(struct m0_sm *mach, const struct m0_sm_conf *conf, uint32_t state, struct m0_sm_group *grp)
M0_INTERNAL uint32_t m0_net_tm_colour_get(struct m0_net_transfer_mc *tm)
static struct m0_net_buffer * nb_list[64]
#define M0_ALLOC_PTR(ptr)
struct m0_net_domain * m0_fop_domain_get(const struct m0_fop *fop)
static void bulkio_server_read_write_multiple_nb(void)
const struct m0_fop_type_ops * ft_ops
M0_INTERNAL int m0_fom_rc(const struct m0_fom *fom)
struct m0_sm_conf ft_conf
void bulkio_params_fini(struct bulkio_params *bp)
static void bulkio_server_rw_state_transition_test(void)
void bulkio_server_stop(struct m0_rpc_server_ctx *sctx)
static struct m0_buf payload_buf
static struct m0_fop * fop
struct m0_net_domain bp_cnetdom
struct m0_be_seg * rh_beseg
M0_INTERNAL void m0_sm_group_lock(struct m0_sm_group *grp)
struct m0_net_buffer_pool * ut_get_buffer_pool(struct m0_fom *fom)
#define WRITE_FOP_DATA(fop)
static void m0_fi_enable_once(const char *func, const char *tag)
M0_INTERNAL void m0_storage_devs_unlock(struct m0_storage_devs *devs)
M0_INTERNAL int m0_cob_locate(struct m0_cob_domain *dom, struct m0_cob_oikey *oikey, uint64_t flags, struct m0_cob **out)
M0_INTERNAL int m0_stob_find(const struct m0_stob_id *id, struct m0_stob **out)
M0_INTERNAL int m0_dtx_open_sync(struct m0_dtx *tx)
static const struct fom_phase_desc fpd_table[]
int io_fsync_send_fop(struct m0_be_tx_remid *remid, struct thrd_arg *t)
void io_fops_create(struct bulkio_params *bp, enum M0_RPC_OPCODES op, int fids_nr, int fops_nr, int segs_nr)
M0_INTERNAL void m0_file_fini(struct m0_file *file)
void(* fo_fini)(struct m0_fom *fom)
M0_INTERNAL void m0_net_buffer_pool_put(struct m0_net_buffer_pool *pool, struct m0_net_buffer *buf, uint32_t colour)
static const struct m0_fom_ops bulkio_server_read_fom_ops
static struct m0_net_buffer_pool * buf_pool
void(* fto_fop_replied)(struct m0_fop *fop, struct m0_fop *bfop)
M0_INTERNAL int m0_io_fop_init(struct m0_io_fop *iofop, const struct m0_fid *gfid, struct m0_fop_type *ftype, void(*fop_release)(struct m0_ref *))
static struct bulkio_params * bp
M0_INTERNAL bool m0_is_read_fop(const struct m0_fop *fop)
M0_INTERNAL void m0_stob_create_credit(struct m0_stob_domain *dom, struct m0_be_tx_credit *accum)
const struct m0_fop_type_ops io_fop_rwv_ops
void m0_fom_phase_set(struct m0_fom *fom, int phase)
const struct m0_net_buffer_callbacks m0_rpc__buf_bulk_cb
static int io_fop_server_write_fom_create(struct m0_fop *fop, struct m0_fom **m, struct m0_reqh *reqh)
const struct m0_fom_type_ops io_fom_type_ops
M0_INTERNAL struct m0_fop_cob_rw * io_rw_get(struct m0_fop *fop)
static const struct m0_fom_ops ut_io_fom_cob_rw_ops
M0_INTERNAL int m0_io_fop_prepare(struct m0_fop *fop)
#define m0_tl_find(name, var, head,...)
M0_INTERNAL int m0_rpc_bulk_buf_add(struct m0_rpc_bulk *rbulk, uint32_t segs_nr, m0_bcount_t length, struct m0_net_domain *netdom, struct m0_net_buffer *nb, struct m0_rpc_bulk_buf **out)
struct m0_fop_type m0_fop_cob_writev_fopt
#define m0_tl_for(name, head, obj)
static void bulkio_server_fsync_multiple_read_write(void)
M0_INTERNAL void m0_stob_get(struct m0_stob *stob)
static int io_fop_server_read_fom_create(struct m0_fop *fop, struct m0_fom **m, struct m0_reqh *reqh)
struct m0_io_indexvec crw_ivec
struct m0_io_fop ** bp_wfops
static int m0_io_fom_cob_rw_create(struct m0_fop *fop, struct m0_fom **out, struct m0_reqh *reqh)
struct m0_stob * fcrw_stob
struct m0_motr rsx_motr_ctx
M0_INTERNAL void m0_stob_put(struct m0_stob *stob)
int(* fto_undo)(struct m0_fop_fol_frag *ffrag, struct m0_fol *fol)
static void add_buffer_bulk(struct m0_rpc_bulk *rbulk, enum M0_RPC_OPCODES op, int index)
struct m0_net_transfer_mc * m0_fop_tm_get(const struct m0_fop *fop)
static void release_one_buffer(uint32_t colour)
M0_INTERNAL void m0_file_init(struct m0_file *file, const struct m0_fid *fid, struct m0_rm_domain *dom, enum m0_di_types di_type)
struct m0_file bp_file[IO_FIDS_NR]
M0_INTERNAL void m0_fid_tassume(struct m0_fid *fid, const struct m0_fid_type *ft)
M0_INTERNAL void m0_sm_fini(struct m0_sm *mach)
M0_INTERNAL int m0_fol_rec_decode(struct m0_fol_rec *rec, struct m0_buf *at)