39 #define M0_TRACE_SUBSYSTEM M0_TRACE_SUBSYS_CLIENT 144 ios_cob_req_bob_check(icr));
166 memcpy(
tgt->s_buf,
name->b_addr, (
int)
name->b_nob);
187 #ifdef CLIENT_FOR_M0T1FS 250 m0_ast_rc_bob_fini(&cr->
cr_ar);
251 cob_req_bob_fini(cr);
314 cob_req_bob_init(cr);
315 m0_ast_rc_bob_init(&cr->
cr_ar);
385 #ifdef CLIENT_FOR_M0T1FS 397 if (obj_name ==
NULL)
417 entity =
op->op_entity;
466 op_grp = &
op->op_sm_group;
497 op_grp = &
op->op_sm_group;
498 en_grp = &
op->op_entity->en_sm_group;
501 if (
op->op_sm.sm_rc != 0)
513 switch(
op->op_entity->en_sm.sm_state) {
572 if (getattr_rep->
g_rc == 0) {
578 if (getattr_ios_rep->
cgr_rc == 0) {
812 bool all_replied =
true;
838 if (
ar->ar_rc == 0) {
850 if (all_replied ==
false)
853 if (all_replied ==
false) {
926 uint64_t container_id)
933 M0_PRE(container_id < pver->pv_pc->pc_nr_devices);
935 ios_ctx =
pver->pv_pc->pc_dev2svc[container_id].pds_ctx;
1028 m0_ast_rc_bob_fini(&icr->
icr_ar);
1029 ios_cob_req_bob_fini(icr);
1045 uint32_t
i, uint32_t cob_type,
1098 return M0_ERR_INFO(-ENOMEM,
"fop allocation failed");
1112 return M0_ERR_INFO(-ENOMEM,
"failed allocation of" 1115 ios_cob_req_bob_init(icr);
1116 m0_ast_rc_bob_init(&icr->
icr_ar);
1285 for (
i = 0;
i < icr_nr; ++
i) {
1310 bool all_failed =
true;
1321 for (
i = 0;
i < icr_nr; ++
i) {
1331 for (
i = 0;
i < icr_nr; ++
i) {
1334 all_failed = all_failed && (
rc != 0);
1342 return M0_RC(all_failed ?
rc : 0);
1356 uint32_t pool_width;
1475 uint32_t rep_opcode;
1476 uint32_t req_opcode;
1513 switch (rep_opcode) {
1549 if (remid !=
NULL) {
1616 #ifdef CLIENT_FOR_M0T1FS 1624 #ifdef CLIENT_FOR_M0T1FS 1636 M0_IMPOSSIBLE(
"Can't send message of <unimplemented> type.");
1642 #ifdef CLIENT_FOR_M0T1FS 1697 struct m0_service_context *mds_ctx;
1710 return &mds_ctx->sc_rlink.rlk_sess;
1736 #ifdef CLIENT_FOR_M0T1FS 1813 bool skip_meta_data =
false;
1840 #ifdef CLIENT_FOR_M0T1FS 1848 if (cob_attr ==
NULL) {
1862 skip_meta_data =
true;
1872 skip_meta_data =
true;
1876 if (!skip_meta_data) {
1999 obj->ob_entity.en_id.u_hi,
obj->ob_entity.en_id.u_lo);
2007 if (cob_attr ==
NULL) {
2058 ent_id =
obj->ob_entity.en_id;
2062 &
obj->ob_attr.oa_pver);
2079 if (cob_attr ==
NULL) {
2109 #undef M0_TRACE_SUBSYSTEM
static int cob_mds_fop_populate(struct cob_req *cr, struct m0_fop *fop)
M0_INTERNAL int m0_rpc_post(struct m0_rpc_item *item)
struct m0_fid m0c_root_fid
static bool ios_cob_req_invariant(struct ios_cob_req *icr)
static struct m0_fid gob_fid
uint32_t m0_fop_opcode(const struct m0_fop *fop)
struct m0_fop ** cr_ios_fop
const struct m0_bob_type ar_bobtype
m0_time_t ri_resend_interval
#define M0_ALLOC_ARR(arr, nr)
static void cob_ast_ios_io_send(struct m0_sm_group *grp, struct m0_sm_ast *ast)
M0_INTERNAL int m0__obj_layout_send(struct m0_obj *obj, struct m0_op_layout *ol)
M0_INTERNAL void m0_mutex_unlock(struct m0_mutex *mutex)
M0_INTERNAL void m0_fid_gob_make(struct m0_fid *gob_fid, uint32_t container, uint64_t key)
struct m0_cob_attr * cr_cob_attr
M0_INTERNAL struct m0_fop_cob_common * m0_cobfop_common_get(struct m0_fop *fop)
enum m0_rpc_item_priority ri_prio
static const struct m0_rpc_item_ops cob_ios_ri_ops
M0_INTERNAL int m0__obj_attr_get_sync(struct m0_obj *obj)
struct m0_sm_group * ol_sm_grp
static void cob_body_wire2mem(struct m0_cob_attr *attr, const struct m0_fop_cob *body)
void(* sa_cb)(struct m0_sm_group *grp, struct m0_sm_ast *)
static void cob_req_to_rpc_map(const struct cob_req *cr, const struct m0_rpc_item *item)
const struct m0_bob_type op_bobtype
M0_INTERNAL struct m0_pool_version * m0_pool_version_find(struct m0_pools_common *pc, const struct m0_fid *id)
static struct io_request req
static void cob_ast_fail_cr(struct m0_sm_group *grp, struct m0_sm_ast *ast)
static void cob_req_free(struct cob_req *cr)
M0_INTERNAL void m0_fop_init(struct m0_fop *fop, struct m0_fop_type *fopt, void *data, void(*fop_release)(struct m0_ref *))
struct m0_pool_version * pv
struct m0_poolmach pv_mach
#define M0_LOG(level,...)
M0_INTERNAL void m0_sm_ast_post(struct m0_sm_group *grp, struct m0_sm_ast *ast)
struct m0_sm_group * oo_sm_grp
M0_INTERNAL struct cob_req * cob_req_ref_get(struct cob_req *cr)
static void to_cob_req_map(const struct m0_op *op, const struct cob_req *cr)
M0_INTERNAL int obj_fid_make_name(char *name, size_t name_len, const struct m0_fid *fid)
static int cob_req_send(struct cob_req *cr)
struct m0_fop_type m0_fop_getattr_fopt
static void cob_rep_process(struct cob_req *cr)
void * m0_fop_data(const struct m0_fop *fop)
M0_INTERNAL void cob_rep_attr_copy(struct cob_req *cr)
struct m0_fop_type m0_fop_create_fopt
static void cob_body_mem2wire(struct m0_fop_cob *body, struct m0_cob_attr *attr, int valid, struct cob_req *cr)
static void cob_entity_sm_move(struct m0_op *op)
static const struct m0_rpc_item_ops cob_mds_ri_ops
static int cob_getattr_rep_rc(struct cob_req *cr)
static struct cob_req * rpc_item_to_cr(struct m0_rpc_item *item)
static int icrs_rc(struct cob_req *cr)
#define container_of(ptr, type, member)
M0_INTERNAL void m0_mutex_lock(struct m0_mutex *mutex)
static int cob_name_mem2wire(struct m0_fop_str *tgt, const struct m0_buf *name)
M0_ADDB2_ADD(M0_AVI_FS_CREATE, new_fid.f_container, new_fid.f_key, mode, rc)
static struct m0_rpc_session * fid_to_mds_session(struct m0_client *cinst, const struct m0_fid *fid)
M0_INTERNAL bool m0_fid_is_set(const struct m0_fid *fid)
static struct m0_rpc_item * item
struct m0_sm_group * cr_op_sm_grp
static void icr_ast(struct m0_sm_group *grp, struct m0_sm_ast *ast)
static void cob_ios_fop_fini(struct m0_fop *ios_fop)
static struct m0_pools_common pc
const struct m0_bob_type cr_bobtype
struct m0_client * cr_cinst
static void cob_complete_op(struct m0_op *op)
uint64_t pc_nr_svcs[M0_CST_NR]
static int cob_ios_req_send_async(struct cob_req *cr)
M0_INTERNAL struct m0_obj * m0__obj_entity(struct m0_entity *entity)
static int cob_ios_req_send_sync(struct cob_req *cr)
struct m0_fop_type m0_fop_cob_getattr_fopt
static struct m0_sm_ast ast[NR]
M0_INTERNAL struct m0_pool_version * m0_pool_version_md_get(const struct m0_pools_common *pc)
M0_INTERNAL void m0_sm_group_unlock(struct m0_sm_group *grp)
M0_INTERNAL uint64_t m0_dummy_id_generate(void)
enum m0_client_layout_type ml_type
struct m0_fop_type * f_type
struct m0_pools_common m0c_pools_common
struct m0_rpc_machine * m0_fop_rpc_machine(const struct m0_fop *fop)
M0_INTERNAL void m0_ref_put(struct m0_ref *ref)
#define M0_ERR_INFO(rc, fmt,...)
struct m0_fop_cob cgr_body
struct m0_reqh_service_ctx ** pc_mds_map
void m0_ref_init(struct m0_ref *ref, int init_num, void(*release)(struct m0_ref *ref))
return M0_ERR(-EOPNOTSUPP)
M0_INTERNAL void m0_ref_get(struct m0_ref *ref)
uint32_t pc_md_redundancy
static struct cob_req * cob_req_alloc(struct m0_pool_version *pv)
M0_INTERNAL int m0_op_stable(struct m0_op *op)
struct m0_fop_mod_rep s_mod_rep
void m0_rpc_item_cancel(struct m0_rpc_item *item)
#define M0_AMB(obj, ptr, field)
static void attr(struct m0_addb2__context *ctx, const uint64_t *v, char *buf)
struct m0_fop_type m0_fop_cob_setattr_fopt
M0_INTERNAL struct m0_client * m0__oo_instance(struct m0_op_obj *oo)
struct m0_fop_mod_rep u_mod_rep
static int cob_ios_fop_populate(struct cob_req *cr, struct m0_fop *fop, struct m0_fid *cob_fid, uint32_t cob_idx)
struct m0_fop * cr_rep_fop
struct m0_fop * cr_mds_fop
static void icrs_fail(struct cob_req *cr, int rc)
struct m0_fop_type m0_fop_unlink_fopt
static void cob_ios_fop_release(struct m0_ref *ref)
struct m0_rpc_machine * m0_fop_session_machine(const struct m0_rpc_session *s)
M0_INTERNAL void m0_rpc_session_cancel(struct m0_rpc_session *session)
struct m0_client_layout * ol_layout
M0_INTERNAL struct m0_rpc_session * m0_reqh_mdpool_service_index_to_session(const struct m0_reqh *reqh, const struct m0_fid *gob_fid, uint32_t index)
#define bob_of(ptr, type, field, bt)
static int cob_ios_fop_get(struct cob_req *cr, uint32_t i, uint32_t cob_type, struct m0_rpc_session *session)
static struct ios_cob_req * rpc_item_to_icr(struct m0_rpc_item *item)
static void cob_fail_cr(struct cob_req *cr, int rc)
struct m0_op_common ol_oc
static int cob_make_name(struct cob_req *cr)
static struct m0_fid cob_fid
enum m0_conf_service_type sc_type
static void cob_ios_rio_replied(struct m0_rpc_item *item)
struct m0_rpc_item * ri_reply
void * m0_alloc(size_t size)
static int cob_ios_md_send(struct cob_req *cr)
M0_INTERNAL uint32_t m0_fid_cob_device_id(const struct m0_fid *cob_fid)
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 int cob_mds_send(struct cob_req *cr)
static const struct m0_bob_type icr_bobtype
static void cob_mds_rio_replied(struct m0_rpc_item *item)
M0_INTERNAL int m0_fop_data_alloc(struct m0_fop *fop)
M0_INTERNAL void m0_fop_fini(struct m0_fop *fop)
struct m0_op_common oo_oc
bool m0_conf_fid_is_valid(const struct m0_fid *fid)
static struct fdmi_ctx ctx
M0_INTERNAL int m0_op_executed(struct m0_op *op)
static void cob_ast_complete_cr(struct m0_sm_group *grp, struct m0_sm_ast *ast)
static void cob_req_release(struct cob_req *cr)
#define MOTR_MDCOB_LOOKUP_SKIP
static void cob_attr_init(struct cob_req *cr, struct m0_cob_attr *attr, int *valid)
void(* rio_replied)(struct m0_rpc_item *item)
static struct m0_client cinst
M0_INTERNAL int m0__obj_namei_cancel(struct m0_op *op)
M0_INTERNAL int m0_rpc_session_validate(struct m0_rpc_session *session)
const struct m0_bob_type ol_bobtype
int32_t m0_rpc_item_error(const struct m0_rpc_item *item)
M0_INTERNAL void m0__obj_attr_set(struct m0_obj *obj, struct m0_fid pver, uint64_t lid)
struct m0_pdclust_tgt_addr tgt
M0_INTERNAL int64_t m0_ref_read(const struct m0_ref *ref)
int(* olo_copy_to_app)(struct m0_client_layout *to, void *data)
struct m0_sm_group en_sm_group
struct m0_sm_group op_sm_group
static void cob_req_ref_release(struct m0_ref *ref)
#define M0_FI_ENABLED(tag)
struct m0_fop_type m0_fop_setattr_fopt
M0_INTERNAL int m0_op_failed(struct m0_op *op)
M0_INTERNAL void cob_req_ref_put(struct cob_req *cr)
#define M0_ALLOC_PTR(ptr)
struct m0_entity * op_entity
const struct m0_rpc_item_ops * ri_ops
struct m0_rpc_session * ri_session
struct m0_fop_type m0_fop_cob_create_fopt
struct m0_entity ob_entity
struct m0_fop * m0_fop_alloc_at(struct m0_rpc_session *sess, struct m0_fop_type *fopt)
const struct m0_op_layout_ops * ol_ops
M0_INTERNAL void m0_sm_move(struct m0_sm *mach, int32_t rc, int state)
void m0_fop_put_lock(struct m0_fop *fop)
static struct m0_fop * fop
M0_INTERNAL void m0_sm_group_lock(struct m0_sm_group *grp)
struct m0_fop * m0_rpc_item_to_fop(const struct m0_rpc_item *item)
M0_INTERNAL struct m0_client * m0__obj_instance(const struct m0_obj *obj)
int(* olo_copy_from_app)(struct m0_client_layout *from, void *data)
struct m0_rpc_session rlk_sess
static int cob_ios_send(struct cob_req *cr, uint32_t idx)
#define OP_OBJ2CODE(op_obj)
static void cob_fail_op(struct m0_op *op, int rc)
M0_INTERNAL void m0_fid_convert_gob2cob(const struct m0_fid *gob_fid, struct m0_fid *cob_fid, uint32_t device_id)
M0_INTERNAL bool m0_fid_is_valid(const struct m0_fid *fid)
struct m0_rpc_link sc_rlink
struct m0_rpc_machine * ri_rmachine
static void icrs_complete(struct cob_req *cr)
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)
struct m0_rpc_item f_item
struct m0_pdclust_attr pv_attr
static int cob_ios_prepare(struct cob_req *cr, uint32_t idx)
M0_INTERNAL struct m0_rpc_session * m0_obj_container_id_to_session(struct m0_pool_version *pver, uint64_t container_id)
#define offsetof(typ, memb)
struct m0_fop_mod_rep c_mod_rep
M0_INTERNAL bool m0_sm_group_is_locked(const struct m0_sm_group *grp)
M0_INTERNAL void m0_poolmach_gob2cob(struct m0_poolmach *pm, const struct m0_fid *gfid, uint32_t idx, struct m0_fid *cob_fid)
M0_INTERNAL unsigned int m0_full_name_hash(const unsigned char *name, unsigned int len)
struct m0_be_tx_remid fmr_remid
M0_INTERNAL int m0__obj_namei_send(struct m0_op_obj *oo)
static struct m0_sm_group * grp
struct m0_fop_type m0_fop_cob_delete_fopt
struct m0_config * m0c_config
#define M0_IMPOSSIBLE(fmt,...)
M0_INTERNAL struct m0_reqh_service_ctx * m0_reqh_service_ctx_from_session(struct m0_rpc_session *session)
M0_INTERNAL struct m0_client * m0__entity_instance(const struct m0_entity *entity)
M0_BOB_DEFINE(M0_INTERNAL, &cr_bobtype, cob_req)