40 #define M0_TRACE_SUBSYSTEM M0_TRACE_SUBSYS_CLIENT 65 _0C(ioreq_fop_bob_check(
fop)) &&
210 while (ti_cob_index != rep_index) {
230 src = (
char *)
src + cs_sz;
249 uint64_t actual_bytes = 0;
292 if (reply_item !=
NULL) {
296 if (
rc < 0 || reply_item ==
NULL) {
325 "sns state = %d", ioo, req_item,
345 if (tioreq->
ti_rc == 0)
356 #define LOGMSG(ioo, rc, tireq) "ioo=%p from=%s rc=%d ti_rc=%d @"FID_F,\ 357 (ioo), m0_rpc_conn_addr((tioreq)->ti_session->s_conn),\ 358 (rc), (tioreq)->ti_rc, FID_P(&(tioreq)->ti_fid) 381 ioo, &iofop->
if_fop, (
unsigned long long)actual_bytes,
382 (
unsigned long long)rbulk->
rb_bytes);
449 M0_LOG(
M0_INFO,
"ioreq_fop %p, target_ioreq %p io_request %p",
482 if (reply_item !=
NULL) {
486 if (
rc < 0 || reply_item ==
NULL) {
495 rc =
rc ? M0_IN(
reply->cor_rc, (0, -EEXIST)) ? 0 :
reply->cor_rc : 0;
497 remid = &
reply->cor_common.cor_mod_rep.fmr_remid;
542 ti =
M0_AMB(ti, cc_fop, ti_cc_fop);
601 uint32_t req_sm_state;
610 rbulk =
buf->bb_rbulk;
614 iofop =
M0_AMB(iofop, rbulk, if_rbulk);
728 M0_PRE(*cursor < ioo->ioo_iomap_nr);
738 M0_POST(i < ioo->ioo_iomap_nr);
790 rc =
map->pi_ops->pi_dgmode_process(
map,
918 size_t non_queued_buf_nr;
922 buf_nr = rpcbulk_tlist_length(&rbulk->
rb_buflist);
928 "non_queued_buf_nr %llu", &iofop->
if_fop,
item,
930 (
unsigned long long)buf_nr,
931 (
unsigned long long)non_queued_buf_nr);
945 if (buf_nr > non_queued_buf_nr) {
967 ioreq_fop_bob_fini(reqfop);
986 M0_ENTRY(
"ioreq_fop %p, target_ioreq %p",
fop, ti);
998 ioreq_fop_bob_init(
fop);
999 iofops_tlink_init(
fop);
1000 fop->irf_pattr = pattr;
1001 fop->irf_tioreq = ti;
1002 fop->irf_reply_rc = 0;
1048 iofops_tlink_fini(
fop);
1063 #undef M0_TRACE_SUBSYSTEM
static void m0_atomic64_inc(struct m0_atomic64 *a)
M0_INTERNAL void m0_ivec_cursor_init(struct m0_ivec_cursor *cur, const struct m0_indexvec *ivec)
M0_INTERNAL int m0_rpc_post(struct m0_rpc_item *item)
M0_INTERNAL void m0_chan_wait(struct m0_clink *link)
m0_time_t ri_resend_interval
static void io_bottom_half(struct m0_sm_group *grp, struct m0_sm_ast *ast)
static void application_attribute_copy(struct m0_indexvec *rep_ivec, struct target_ioreq *ti, struct m0_op_io *ioo, struct m0_buf *buf)
M0_INTERNAL void m0_mutex_unlock(struct m0_mutex *mutex)
M0_INTERNAL struct m0_fop_cob_common * m0_cobfop_common_get(struct m0_fop *fop)
M0_INTERNAL int ioreq_fop_dgmode_read(struct ioreq_fop *irfop)
static int(* diff[M0_PARITY_CAL_ALGO_NR])(struct m0_parity_math *math, struct m0_buf *old, struct m0_buf *new, struct m0_buf *parity, uint32_t index)
M0_INTERNAL void m0_clink_init(struct m0_clink *link, m0_chan_cb_t cb)
struct m0_atomic64 nxr_rdbulk_nr
M0_INTERNAL bool m0__obj_is_di_enabled(struct m0_op_io *ioo)
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)
M0_INTERNAL void m0_clink_del_lock(struct m0_clink *link)
void(* sa_cb)(struct m0_sm_group *grp, struct m0_sm_ast *)
bool m0_rpc_item_is_generic_reply_fop(const struct m0_rpc_item *item)
M0_TL_DESCR_DEFINE(iofops, "List of IO fops", M0_INTERNAL, struct ioreq_fop, irf_link, irf_magic, M0_IOFOP_MAGIC, M0_TIOREQ_MAGIC)
M0_INTERNAL bool m0__is_oostore(struct m0_client *instance)
static struct m0_sm_group * grp
M0_INTERNAL void m0_fop_init(struct m0_fop *fop, struct m0_fop_type *fopt, void *data, void(*fop_release)(struct m0_ref *))
#define M0_LOG(level,...)
const struct m0_op_io_ops * ioo_ops
struct m0_io_fop irf_iofop
M0_INTERNAL void m0_sm_ast_post(struct m0_sm_group *grp, struct m0_sm_ast *ast)
static void m0_atomic64_sub(struct m0_atomic64 *a, int64_t num)
struct m0_sm_group * oo_sm_grp
static const struct m0_rpc_item_ops cc_item_ops
struct m0_rpc_bulk if_rbulk
static void m0_sm_io_done_ast(struct m0_sm_group *grp, struct m0_sm_ast *ast)
enum target_ioreq_type ti_req_type
struct m0_net_buf_desc_data * id_descs
void * m0_fop_data(const struct m0_fop *fop)
M0_INTERNAL void m0_indexvec_free(struct m0_indexvec *ivec)
struct m0_indexvec ti_trunc_ivec
M0_INTERNAL void m0_mutex_lock(struct m0_mutex *mutex)
M0_ADDB2_ADD(M0_AVI_FS_CREATE, new_fid.f_container, new_fid.f_key, mode, rc)
struct m0_net_buffer * nbe_buffer
M0_INTERNAL bool m0_is_read_rep(const struct m0_fop *fop)
static struct m0_rpc_item * item
M0_INTERNAL uint64_t m0__obj_lid(struct m0_obj *obj)
M0_INTERNAL bool m0_tlist_is_empty(const struct m0_tl_descr *d, const struct m0_tl *list)
static uint32_t unit_size
static struct m0_sm_ast ast[NR]
void(* iro_iosm_handle_executed)(struct m0_sm_group *grp, struct m0_sm_ast *ast)
int32_t m0_rpc_item_generic_reply_rc(const struct m0_rpc_item *reply)
int m0_obj_layout_id_to_unit_size(uint64_t layout_id)
void m0_fop_put0_lock(struct m0_fop *fop)
const struct m0_bob_type ioo_bobtype
static void ioreq_fop_release(struct m0_ref *ref)
M0_INTERNAL bool ioreq_fop_invariant(const struct ioreq_fop *fop)
struct nw_xfer_request ioo_nwxfer
struct m0_rpc_machine * m0_fop_rpc_machine(const struct m0_fop *fop)
return M0_ERR(-EOPNOTSUPP)
M0_INTERNAL const char * m0_fop_name(const struct m0_fop *fop)
M0_INTERNAL void m0_rpc_machine_unlock(struct m0_rpc_machine *machine)
M0_INTERNAL struct m0_fop_cob_rw_reply * io_rw_rep_get(struct m0_fop *fop)
M0_INTERNAL void m0_rpc_bulk_default_cb(const struct m0_net_buffer_event *evt)
M0_INTERNAL struct m0_client * m0__op_instance(const struct m0_op *op)
const struct m0_net_buffer_callbacks client__buf_bulk_cb
enum sns_repair_state ioo_sns_state
struct m0_indexvec ioo_ext
#define M0_AMB(obj, ptr, field)
struct m0_io_descs crw_desc
struct m0_rpc_item_header2 ri_header
void m0_sm_state_set(struct m0_sm *mach, int state)
struct m0_rpc_machine * m0_fop_session_machine(const struct m0_rpc_session *s)
M0_INTERNAL bool m0_is_io_fop_rep(const struct m0_fop *fop)
static struct m0_fop reply_fop
#define bob_of(ptr, type, field, bt)
static void m0_atomic64_dec(struct m0_atomic64 *a)
struct m0_atomic64 nxr_ccfop_nr
struct m0_sm_ast ioo_done_ast
M0_INTERNAL int m0_indexvec_wire2mem(struct m0_io_indexvec *wire_ivec, int max_frags_nr, uint32_t bshift, struct m0_indexvec *mem_ivec)
M0_INTERNAL struct m0_obj_attr * m0_io_attr(struct m0_op_io *ioo)
struct m0_fop * m0_fop_get(struct m0_fop *fop)
const struct m0_rpc_item_type * ri_type
struct m0_rpc_item * ri_reply
struct m0_fop_mod_rep rwr_mod_rep
struct m0_sm_group * sm_grp
M0_INTERNAL uint32_t m0_fid_cob_device_id(const struct m0_fid *cob_fid)
struct m0_buf rwr_di_data_cksum
struct m0_0vec bb_zerovec
m0_net_buffer_cb_proc_t nbc_cb[M0_NET_QT_NR]
M0_INTERNAL int ioreq_fop_async_submit(struct m0_io_fop *iofop, struct m0_rpc_session *session)
M0_INTERNAL int m0_fop_data_alloc(struct m0_fop *fop)
M0_INTERNAL void m0_fop_fini(struct m0_fop *fop)
struct m0_rpc_session * ti_session
static struct m0_clink clink[RDWR_REQUEST_MAX]
M0_INTERNAL bool m0_ivec_cursor_move(struct m0_ivec_cursor *cur, m0_bcount_t count)
struct m0_op_common oo_oc
static void ioreq_cc_bottom_half(struct m0_sm_group *grp, struct m0_sm_ast *ast)
struct m0_io_indexvec ct_io_ivec
M0_INTERNAL bool addr_is_network_aligned(void *addr)
M0_INTERNAL struct m0_op * m0__ioo_to_op(struct m0_op_io *ioo)
struct m0_bob_type iofop_bobtype
static void ioreq_cc_rpc_item_cb(struct m0_rpc_item *item)
static int64_t m0_atomic64_get(const struct m0_atomic64 *a)
void(* rio_replied)(struct m0_rpc_item *item)
M0_INTERNAL uint32_t m0_indexvec_pack(struct m0_indexvec *iv)
struct m0_fop_type m0_fop_cob_readv_fopt
M0_INTERNAL size_t m0_rpc_bulk_buf_length(struct m0_rpc_bulk *rbulk)
M0_INTERNAL size_t m0_rpc_bulk_store_del_unqueued(struct m0_rpc_bulk *rbulk)
M0_INTERNAL int ioreq_cc_fop_init(struct target_ioreq *ti)
struct target_ioreq * irf_tioreq
M0_INTERNAL int m0_indexvec_mem2wire(struct m0_indexvec *mem_ivec, int max_frags_nr, uint32_t bshift, struct m0_io_indexvec *wire_ivec)
M0_INTERNAL void m0_rpc_machine_lock(struct m0_rpc_machine *machine)
static void ioreq_pgiomap_find(struct m0_op_io *ioo, uint64_t grpid, uint64_t *cursor, struct pargrp_iomap **out)
struct cc_req_fop ti_cc_fop
M0_INTERNAL void m0_clink_add(struct m0_chan *chan, struct m0_clink *link)
const struct m0_rpc_item_ops * ri_ops
M0_INTERNAL bool m0__obj_is_cksum_validation_allowed(struct m0_op_io *ioo)
struct m0_rpc_session * ri_session
M0_INTERNAL m0_bcount_t m0_io_count(const struct m0_io_indexvec *io_info)
struct m0_fop_type m0_fop_cob_create_fopt
struct m0_entity ob_entity
M0_INTERNAL int ioreq_fop_init(struct ioreq_fop *fop, struct target_ioreq *ti, enum page_attr pattr)
M0_INTERNAL m0_bindex_t m0_ivec_cursor_index(const struct m0_ivec_cursor *cur)
M0_INTERNAL void m0_clink_fini(struct m0_clink *link)
M0_INTERNAL bool m0_rpc_bulk_is_empty(struct m0_rpc_bulk *rbulk)
struct m0_atomic64 nxr_iofop_nr
static struct m0_fop * fop
M0_TL_DEFINE(iofops, M0_INTERNAL, struct ioreq_fop)
static struct m0 instance
struct m0_fop * m0_rpc_item_to_fop(const struct m0_rpc_item *item)
static struct m0_be_seg * seg
static uint32_t ioreq_sm_state(const struct io_request *req)
M0_INTERNAL void m0_io_fop_fini(struct m0_io_fop *iofop)
M0_INTERNAL struct m0_file * m0_client_fop_to_file(struct m0_fop *fop)
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 *))
struct nw_xfer_request * ti_nwxfer
M0_INTERNAL void m0_rpc_bulk_store_del(struct m0_rpc_bulk *rbulk)
M0_INTERNAL bool m0_is_read_fop(const struct m0_fop *fop)
static uint64_t pargrp_id_find(m0_bindex_t index, const struct io_request *req, const struct io_req_fop *ir_fop)
M0_INTERNAL struct m0_fop_cob_rw * io_rw_get(struct m0_fop *fop)
M0_INTERNAL void ioreq_fop_fini(struct ioreq_fop *fop)
struct m0_fop_type m0_fop_cob_truncate_fopt
struct m0_indexvec ti_goff_ivec
struct m0_rpc_machine * ri_rmachine
static struct m0_dtm_oper_descr reply
struct m0_fop_type m0_fop_cob_writev_fopt
#define LOGMSG(ioo, rc, tireq)
M0_INTERNAL uint64_t m0_sm_id_get(const struct m0_sm *sm)
void sync_record_update(struct m0_reqh_service_ctx *service, struct m0_entity *ent, struct m0_op *op, struct m0_be_tx_remid *btr)
#define m0_tl_for(name, head, obj)
static const struct m0_rpc_item_ops item_ops
struct m0_rpc_item f_item
struct m0_bufvec ioo_attr
struct m0_io_indexvec crw_ivec
static void io_rpc_item_cb(struct m0_rpc_item *item)
struct m0_pdclust_src_addr src
struct m0_indexvec ti_ivec
struct m0_rpc_conn * s_conn
struct m0_be_tx_remid fmr_remid
struct pargrp_iomap ** ioo_iomaps
static bool should_ioreq_sm_complete(struct m0_op_io *ioo)
M0_INTERNAL void * m0_extent_vec_get_checksum_addr(void *cksum_buf_vec, m0_bindex_t off, void *ivec, m0_bindex_t unit_sz, m0_bcount_t cs_sz)
static void ioreq_cc_fop_release(struct m0_ref *ref)
static void client_passive_recv(const struct m0_net_buffer_event *evt)
M0_INTERNAL struct m0_reqh_service_ctx * m0_reqh_service_ctx_from_session(struct m0_rpc_session *session)
M0_BOB_DEFINE(M0_INTERNAL, &iofop_bobtype, ioreq_fop)