23 #define M0_TRACE_SUBSYSTEM M0_TRACE_SUBSYS_ISCS 79 .sd_name =
"load-arguments",
83 .sd_name =
"args-load-done",
87 .sd_name =
"comp-launch",
95 .sd_name =
"ret-val-done",
114 return fom->fo_fop->f_item.ri_session->s_conn->c_rpc_machine;
191 int next_phase0,
int next_phase1)
244 if (comp_req->
icr_rc != 0)
259 if (M0_IN(
rc, (0, -ENODATA)))
299 if (comp_req ==
NULL)
302 if (reply_isc ==
NULL) {
349 comp = m0_isc_htable_lookup(comp_ht,
fid);
352 return M0_ERR_INFO(-ENOENT,
"Computation not found");
357 return M0_ERR_INFO(-EINVAL,
"Computation is already" 368 m0_isc_htable_del(comp_ht, comp);
369 m0_isc_tlink_fini(comp);
403 .sd_name =
"prepare",
407 .sd_name =
"launch-computation",
411 .sd_name =
"computation-completes",
416 .sd_name =
"failure-in-launch",
421 .sd_name =
"computation-finalize",
427 .
scf_name =
"computation-execution-fom",
449 if (comp_req->
icr_rc != 0)
489 return _0C(comp_req !=
NULL) &&
508 return M0_ERR_INFO(-EINVAL,
"Service does not exist");
538 const struct m0_buf *comp_args,
539 const struct m0_fid *comp_fid,
580 int (*ftn)(
struct m0_buf *arg_in,
583 *comp_data,
int *
rc),
589 comp = m0_isc_htable_lookup(comp_ht,
fid);
591 return M0_ERR_INFO(-EEXIST,
"Computation %s already registered" 602 m0_isc_tlink_init(comp);
603 m0_isc_htable_add(comp_ht, comp);
612 *comp_data,
int *
rc),
614 const struct m0_fid *ftn_fid)
625 if (comp_name ==
NULL)
639 comp = m0_isc_htable_lookup(comp_ht,
fid);
679 comp = m0_isc_htable_lookup(comp_ht,
fid);
742 if (spiel_inst ==
NULL)
760 M0_CONF_ROOT_NODES_FID,
761 M0_CONF_NODE_PROCESSES_FID,
762 M0_CONF_PROCESS_SERVICES_FID);
770 if (
svc->cs_type != M0_CST_ISCS)
778 "process "FID_F, libpath,
824 return M0_ERR_INFO(-ENOMEM,
"failed to allocate buf");
851 if (iv->
ci_nr == 0) {
936 #undef M0_TRACE_SUBSYSTEM const struct m0_conf_obj_type * m0_conf_obj_type(const struct m0_conf_obj *obj)
M0_INTERNAL int m0_buf_copy_aligned(struct m0_buf *dst, const struct m0_buf *src, unsigned shift)
int m0_spiel_cmd_profile_set(struct m0_spiel *spiel, const char *profile_str)
static struct m0_rpc_machine * fom_rmach(const struct m0_fom *fom)
static struct m0_addb2_philter p
M0_INTERNAL void m0_chan_wait(struct m0_clink *link)
struct m0_sm_conf isc_sm_conf
static const struct m0_fom_type_ops comp_exec_fom_type_ops
M0_INTERNAL void m0_mutex_unlock(struct m0_mutex *mutex)
M0_INTERNAL void m0_chan_broadcast_lock(struct m0_chan *chan)
M0_INTERNAL void m0_stob_io_fini(struct m0_stob_io *io)
static int isc_fom_create(struct m0_fop *fop, struct m0_fom **out, struct m0_reqh *reqh)
M0_INTERNAL void m0_clink_init(struct m0_clink *link, m0_chan_cb_t cb)
M0_INTERNAL void m0_clink_del_lock(struct m0_clink *link)
M0_INTERNAL int m0_storage_dev_stob_find(struct m0_storage_devs *devs, struct m0_stob_id *sid, struct m0_stob **stob)
M0_INTERNAL void m0_storage_dev_stob_put(struct m0_storage_devs *devs, struct m0_stob *stob)
M0_INTERNAL const struct m0_cookie M0_COOKIE_NULL
static struct io_request req
int(* fo_tick)(struct m0_fom *fom)
struct m0_conf_obj rt_obj
#define M0_LOG(level,...)
M0_INTERNAL void m0_rpc_at_init(struct m0_rpc_at_buf *ab)
static void isc_comp_prepare(struct m0_isc_comp_req *comp_req, struct m0_fom *fom, int next_phase0, int next_phase1)
static void isc_fom_fini(struct m0_fom *fom)
const struct m0_conf_obj_type M0_CONF_SERVICE_TYPE
struct m0_rpc_at_buf fir_ret
void m0_spiel_fini(struct m0_spiel *spiel)
int(* fto_create)(struct m0_fop *fop, struct m0_fom **out, struct m0_reqh *reqh)
M0_INTERNAL bool m0_htable_is_init(const struct m0_htable *htable)
M0_INTERNAL void m0_buf_init(struct m0_buf *buf, void *data, uint32_t nob)
M0_INTERNAL int m0_conf_diter_next_sync(struct m0_conf_diter *it, bool(*filter)(const struct m0_conf_obj *obj))
void m0_spiel_rconfc_stop(struct m0_spiel *spiel)
M0_INTERNAL int m0_isc_comp_req_exec_sync(struct m0_isc_comp_req *comp_req)
void * m0_fop_data(const struct m0_fop *fop)
static struct m0_be_emap_cursor it
M0_INTERNAL void m0_indexvec_free(struct m0_indexvec *ivec)
M0_INTERNAL void m0_fom_wait_on(struct m0_fom *fom, struct m0_chan *chan, struct m0_fom_callback *cb)
struct m0_cookie fi_comp_cookie
M0_INTERNAL int m0_rpc_at_load(struct m0_rpc_at_buf *ab, struct m0_fom *fom, int next_phase)
M0_INTERNAL void m0_mutex_lock(struct m0_mutex *mutex)
const struct m0_fom_type_ops m0_fom_isc_type_ops
M0_INTERNAL bool m0_fid_is_set(const struct m0_fid *fid)
static void isc_spiel_destroy(struct m0_spiel *spiel)
M0_INTERNAL int m0_rpc_at_reply(struct m0_rpc_at_buf *in, struct m0_rpc_at_buf *out, struct m0_buf *repbuf, struct m0_fom *fom, int next_phase)
struct m0_fom_type ft_fom_type
M0_INTERNAL void m0_hbucket_unlock(struct m0_htable *htable, const void *key)
M0_INTERNAL int m0_confc_root_open(struct m0_confc *confc, struct m0_conf_root **root)
M0_INTERNAL uint32_t m0_stob_block_shift(struct m0_stob *stob)
static bool is_request_local(struct m0_isc_comp_req *comp_req)
static const struct m0_fom_ops isc_fom_ops
static const struct m0_sm_conf comp_exec_fom_states_conf
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)
M0_INTERNAL void m0_hbucket_lock(struct m0_htable *htable, const void *key)
static void bufvec_open(struct m0_bufvec *bv, uint32_t shift)
static int isc_comp_launch(struct m0_isc_comp_req *comp_req, struct m0_fom *fom, int next_phase)
struct m0_fop_type * f_type
static int comp_register(struct m0_htable *comp_ht, int(*ftn)(struct m0_buf *arg_in, struct m0_buf *args_out, struct m0_isc_comp_private *comp_data, int *rc), char *comp_name, const struct m0_fid *fid)
struct m0_fid icr_comp_fid
#define M0_ERR_INFO(rc, fmt,...)
struct m0_conf_root * root
return M0_ERR(-EOPNOTSUPP)
m0_bcount_t rm_bulk_cutoff
struct m0_reqh_service_type m0_iscs_type
M0_INTERNAL int64_t m0_isc_io_res(struct m0_stob_io *stio, char **buf)
struct m0_fop_type m0_fop_isc_rep_fopt
M0_INTERNAL struct m0_confc * m0_reqh2confc(struct m0_reqh *reqh)
#define M0_AMB(obj, ptr, field)
static int ce_fom_tick(struct m0_fom *fom)
M0_INTERNAL int m0_stob_io_prepare_and_launch(struct m0_stob_io *io, struct m0_stob *obj, struct m0_dtx *tx, struct m0_io_scope *scope)
struct m0_mutex icr_guard
int m0_fom_tick_generic(struct m0_fom *fom)
M0_INTERNAL int m0_isc_comp_state_probe(const struct m0_fid *fid)
struct m0_indexvec si_stob
void m0_fom_fini(struct m0_fom *fom)
static bool conf_obj_is_svc(const struct m0_conf_obj *obj)
static struct m0_stob * stob
M0_INTERNAL void m0_chan_init(struct m0_chan *chan, struct m0_mutex *ch_guard)
static struct m0_cob * cob
static void comp_unregister(struct m0_htable *comp_ht, const struct m0_fid *fid)
static int comp_ref_get(struct m0_htable *comp_ht, struct m0_isc_comp_req *req)
struct m0_reqh * icr_reqh
static struct m0_confc * confc
int(* ic_op)(struct m0_buf *args_in, struct m0_buf *result, struct m0_isc_comp_private *comp_data, int *rc)
static bool m0_is_aligned(uint64_t val, uint64_t alignment)
static void comp_ref_put(struct m0_htable *comp_ht, struct m0_isc_comp *comp)
M0_INTERNAL void m0_isc_fom_type_init(void)
struct m0_conf_obj * m0_conf_obj_grandparent(const struct m0_conf_obj *obj)
void m0_fom_phase_move(struct m0_fom *fom, int32_t rc, int phase)
static void isc_comp_cleanup(struct m0_fom *fom, int rc, int next_phase)
M0_INTERNAL void m0_fid_convert_cob2stob(const struct m0_fid *cob_fid, struct m0_stob_id *stob_id)
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 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)
struct m0_rpc_at_buf fi_args
M0_INTERNAL int m0_isc_lib_register(const char *libpath, struct m0_fid *profile, struct m0_reqh *reqh)
M0_INTERNAL void * m0_stob_addr_pack(const void *buf, uint32_t shift)
static int bufvec_alloc_init(struct m0_bufvec *bv, struct m0_io_indexvec *iiv, uint32_t shift)
M0_INTERNAL int m0_rpc_at_get(const struct m0_rpc_at_buf *ab, struct m0_buf *buf)
M0_INTERNAL int m0_stob_io_private_setup(struct m0_stob_io *io, struct m0_stob *obj)
struct m0_cookie icr_cookie
M0_INTERNAL int m0_rpc_at_reply_rc(struct m0_rpc_at_buf *out)
#define m0_cookie_of(cookie, type, field)
static size_t fom_home_locality(const struct m0_fom *fom)
M0_INTERNAL void m0_cookie_init(struct m0_cookie *cookie, const uint64_t *obj)
M0_INTERNAL void m0_buf_free(struct m0_buf *buf)
#define M0_CONF_CAST(ptr, type)
M0_INTERNAL int m0_isc_comp_req_exec(struct m0_isc_comp_req *comp_req)
M0_INTERNAL struct m0_htable * m0_isc_htable_get(void)
M0_INTERNAL int m0_buf_copy(struct m0_buf *dest, const struct m0_buf *src)
M0_INTERNAL struct m0_storage_devs * m0_cs_storage_devs_get(void)
M0_INTERNAL void m0_isc_comp_unregister(const struct m0_fid *fid)
static void ce_fom_fini(struct m0_fom *fom)
static void bufvec_pack(struct m0_bufvec *bv, uint32_t shift)
struct m0_fop * m0_fop_reply_alloc(struct m0_fop *req, struct m0_fop_type *rept)
struct m0_cookie fir_comp_cookie
void m0_clink_add_lock(struct m0_chan *chan, struct m0_clink *link)
enum m0_isc_comp_state ic_reg_state
M0_INTERNAL struct m0_conf_obj * m0_conf_diter_result(const struct m0_conf_diter *it)
struct m0_conf_obj pc_obj
static bool is_alignment_required(struct m0_isc_comp_req *comp_req)
#define m0_conf_diter_init(iter, confc, origin,...)
size_t(* fo_home_locality)(const struct m0_fom *fom)
static bool isc_comp_req_invariant(const struct m0_isc_comp_req *comp_req)
static void comp_cleanup(struct m0_htable *comp_ht, struct m0_isc_comp *comp)
M0_INTERNAL void m0_isc_comp_req_fini(struct m0_isc_comp_req *comp_req)
M0_INTERNAL struct m0_reqh_service * m0_reqh_service_find(const struct m0_reqh_service_type *st, const struct m0_reqh *reqh)
struct m0_sm_state_descr isc_fom_phases[]
static struct m0_fid profile
M0_INTERNAL void m0_isc_io_fini(struct m0_stob_io *stio)
int m0_spiel_rconfc_start(struct m0_spiel *spiel, m0_rconfc_cb_t expired_cb)
#define M0_FI_ENABLED(tag)
M0_INTERNAL void * m0_stob_addr_open(const void *buf, uint32_t shift)
#define M0_ALLOC_PTR(ptr)
struct m0_rpc_at_buf fi_ret
M0_INTERNAL void m0_conf_diter_fini(struct m0_conf_diter *it)
M0_INTERNAL m0_bcount_t m0_io_count(const struct m0_io_indexvec *io_info)
static struct m0_net_test_service svc
int m0_spiel_process_lib_load(struct m0_spiel *spl, const struct m0_fid *proc_fid, const char *libname)
M0_INTERNAL void m0_cookie_new(uint64_t *gen)
M0_INTERNAL void m0_rpc_at_fini(struct m0_rpc_at_buf *ab)
static struct m0_fop * fop
static const struct m0_fom_ops comp_exec_fom_ops
M0_INTERNAL void m0_fom_callback_cancel(struct m0_fom_callback *cb)
M0_INTERNAL void m0_fom_queue(struct m0_fom *fom)
M0_INTERNAL void m0_stob_io_init(struct m0_stob_io *io)
M0_INTERNAL void m0_confc_close(struct m0_conf_obj *obj)
M0_INTERNAL void m0_isc_comp_req_init(struct m0_isc_comp_req *comp_req, const struct m0_buf *comp_args, const struct m0_fid *comp_fid, const struct m0_cookie *comp_cookie, enum m0_isc_comp_req_type comp_req_type, struct m0_reqh *reqh)
static int isc_fom_tick(struct m0_fom *fom)
void m0_fom_phase_set(struct m0_fom *fom, int phase)
enum m0_isc_comp_req_type icr_req_type
M0_INTERNAL void * m0_alloc_aligned(size_t size, unsigned shift)
static int isc_spiel_prepare(struct m0_spiel *spiel, struct m0_fid *profile, struct m0_reqh *reqh)
M0_INTERNAL void m0_chan_fini_lock(struct m0_chan *chan)
M0_INTERNAL int m0_isc_comp_register(int(*ftn)(struct m0_buf *arg_in, struct m0_buf *args_out, struct m0_isc_comp_private *comp_data, int *rc), const char *f_name, const struct m0_fid *ftn_fid)
struct m0_ioseg * ci_iosegs
M0_INTERNAL void m0_bufvec_free2(struct m0_bufvec *bufvec)
struct m0_sm_state_descr comp_exec_fom_states[]
struct m0_isc_comp_private icr_comp_data
static struct m0_fom_type comp_exec_fom_type
int m0_spiel_init(struct m0_spiel *spiel, struct m0_reqh *reqh)
M0_INTERNAL int m0_bufvec_empty_alloc(struct m0_bufvec *bufvec, uint32_t num_segs)
M0_INTERNAL int m0_isc_io_launch(struct m0_stob_io *stio, struct m0_fid *cob, struct m0_io_indexvec *iv, struct m0_fom *fom)
enum m0_stob_io_opcode si_opcode