23 #define M0_TRACE_SUBSYSTEM M0_TRACE_SUBSYS_RPC 117 .sd_name =
"ServicesStop",
122 .sd_name =
"Stopped",
131 .
scf_name =
"Request Handler States",
160 return M0_RC(-EINVAL);
199 M0_LOG(
M0_DEBUG,
"number of mdservices =%d", (
unsigned int)mds_nr);
219 M0_LOG(
M0_DEBUG,
"device index %d id %d -> ctx=%p session=%p", idx,
246 m0_reqh_lockers_init(
reqh);
306 m0_reqh_lockers_fini(
reqh);
342 uint64_t
key,
bool mkfs,
bool force,
370 uint64_t
key,
bool mkfs,
bool force,
454 return M0_ERR(-ECONNREFUSED);
472 return M0_ERR(-ESHUTDOWN);
484 svc->rs_ops->rso_fop_accept !=
NULL)
485 return (*
svc->rs_ops->rso_fop_accept)(
svc,
fop);
486 return M0_ERR(-ESHUTDOWN);
489 svc->rs_ops->rso_fop_accept !=
NULL)
490 return (*
svc->rs_ops->rso_fop_accept)(
svc,
fop);
491 return M0_ERR(-ESHUTDOWN);
493 return M0_ERR(-ESHUTDOWN);
503 static const char msg[] =
"No service running.";
511 if (
rep->gr_msg.s_buf !=
NULL) {
512 rep->gr_msg.s_len =
sizeof msg;
513 memcpy(
rep->gr_msg.s_buf, msg,
rep->gr_msg.s_len);
539 reply->ffr_fop = req_fop;
568 "Service shutdown.");
763 #undef M0_TRACE_SUBSYSTEM
M0_INTERNAL struct m0_layout * m0_layout_find(struct m0_layout_domain *dom, uint64_t lid)
M0_INTERNAL int m0_reqh_service_state_get(const struct m0_reqh_service *s)
struct m0_layout_instance * pc_md_pool_linst
struct m0_poolmach_state * pm_state
static struct m0_fid gob_fid
static const struct m0_sm_conf m0_reqh_sm_conf
M0_INTERNAL void m0_reqh_be_fini(struct m0_reqh *reqh)
M0_INTERNAL void m0_chan_wait(struct m0_clink *link)
struct m0_be_seg * rhia_db
static int disallowed_fop_tick(struct m0_fom *fom, void *data, int *phase)
M0_INTERNAL void m0_fol_fini(struct m0_fol *fol)
M0_INTERNAL void m0_reqh_services_terminate(struct m0_reqh *reqh)
M0_INTERNAL int m0_reqh_service_types_init(void)
M0_INTERNAL void m0_mutex_unlock(struct m0_mutex *mutex)
struct m0_reqh_service_type m0_rpc_service_type
void m0_addb2_sys_net_stop(struct m0_addb2_sys *sys)
M0_INTERNAL uint64_t m0_fid_hash(const struct m0_fid *fid)
M0_INTERNAL void m0_reqh_service_stop(struct m0_reqh_service *service)
struct m0_ha_domain rh_hadom
M0_INTERNAL void m0_clink_init(struct m0_clink *link, m0_chan_cb_t cb)
struct m0_pools_common * rhia_pc
M0_INTERNAL void m0_clink_del_lock(struct m0_clink *link)
void m0_addb2_sys_sm_stop(struct m0_addb2_sys *sys)
struct m0_mdstore * rh_mdstore
M0_EXTERN struct m0_reqh_service_type m0_cas_service_type
M0_INTERNAL int m0_layout_domain_init(struct m0_layout_domain *dom)
void m0_addb2_sys_sm_start(struct m0_addb2_sys *sys)
struct m0_chan rh_conf_cache_ready_async
struct m0_pool_version * pv
struct m0_poolmach pv_mach
#define M0_LOG(level,...)
M0_INTERNAL void m0_reqh_layouts_cleanup(struct m0_reqh *reqh)
M0_INTERNAL int m0_reqh_fop_handle(struct m0_reqh *reqh, struct m0_fop *fop)
M0_INTERNAL void m0_reqh_service_prepare_to_stop(struct m0_reqh_service *service)
const struct m0_conf_obj_type * m0_conf_fid_type(const struct m0_fid *fid)
enum m0_trace_level level
M0_INTERNAL const uint64_t M0_HA_EPOCH_NONE
int(* fto_create)(struct m0_fop *fop, struct m0_fom **out, struct m0_reqh *reqh)
M0_INTERNAL void m0_layout_domain_fini(struct m0_layout_domain *dom)
M0_INTERNAL void m0_rwlock_write_lock(struct m0_rwlock *lock)
struct m0_chan rh_conf_cache_ready
struct m0_pool * pc_md_pool
void * m0_fop_data(const struct m0_fop *fop)
M0_INTERNAL void m0_reqhs_fini(void)
void m0_addb2_sys_attach(struct m0_addb2_sys *sys, struct m0_addb2_sys *src)
#define container_of(ptr, type, member)
M0_INTERNAL void m0_mutex_lock(struct m0_mutex *mutex)
M0_INTERNAL void m0_reqh_fini(struct m0_reqh *reqh)
struct m0_rwlock rh_rwlock
struct m0_fop_getxattr_rep * rep
struct m0_reqh_service * rh_rpc_service
M0_INTERNAL int m0_reqh_addb2_init(struct m0_reqh *reqh, const char *location, uint64_t key, bool mkfs, bool force, m0_bcount_t size)
static void __reqh_fini(struct m0_reqh *reqh)
M0_INTERNAL void m0_sm_group_fini(struct m0_sm_group *grp)
static struct m0_pools_common pc
M0_INTERNAL int m0_layout_instance_build(struct m0_layout *l, const struct m0_fid *fid, struct m0_layout_instance **out)
struct m0_fom_type ft_fom_type
M0_INTERNAL struct m0_reqh_service_type * m0_reqh_service_type_find(const char *sname)
M0_INTERNAL bool m0_rpc_item_is_request(const struct m0_rpc_item *item)
M0_INTERNAL void m0_rwlock_init(struct m0_rwlock *lock)
struct m0_pooldev * pst_devices_array
M0_INTERNAL void m0_reqh_shutdown_wait(struct m0_reqh *reqh)
M0_INTERNAL void m0_ha_domain_fini(struct m0_ha_domain *dom)
M0_INTERNAL void m0_sm_group_unlock(struct m0_sm_group *grp)
M0_INTERNAL struct m0_fid * m0_reqh2profile(struct m0_reqh *reqh)
struct m0_fop_type * f_type
M0_INTERNAL bool m0_reqh_invariant(const struct m0_reqh *reqh)
struct m0_mutex rh_guard_async
#define M0_ERR_INFO(rc, fmt,...)
return M0_ERR(-EOPNOTSUPP)
M0_INTERNAL const char * m0_fop_name(const struct m0_fop *fop)
uint32_t pc_md_redundancy
M0_INTERNAL uint64_t m0_pool_version2layout_id(const struct m0_fid *pv_fid, uint64_t lid)
M0_INTERNAL struct m0_confc * m0_reqh2confc(struct m0_reqh *reqh)
M0_INTERNAL bool m0_fom_domain_is_idle_for(const struct m0_reqh_service *svc)
static const struct socktype stype[]
void m0_addb2_sys_detach(struct m0_addb2_sys *sys)
M0_INTERNAL int m0_reqh_conf_setup(struct m0_reqh *reqh, struct m0_confc_args *args)
M0_INTERNAL void m0_chan_init(struct m0_chan *chan, struct m0_mutex *ch_guard)
M0_TL_DESCR_DEFINE(m0_reqh_svc, "reqh service", M0_INTERNAL, struct m0_reqh_service, rs_linkage, rs_magix, M0_REQH_SVC_MAGIC, M0_REQH_SVC_HEAD_MAGIC)
M0_INTERNAL void m0_sm_group_init(struct m0_sm_group *grp)
void m0_sm_state_set(struct m0_sm *mach, int state)
M0_INTERNAL void m0_reqh_service_fini(struct m0_reqh_service *service)
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)
M0_INTERNAL int m0_reqh_init(struct m0_reqh *reqh, const struct m0_reqh_init_args *reqh_args)
struct m0_tl rh_rpc_machines
M0_INTERNAL void m0_fol_init(struct m0_fol *fol)
M0_INTERNAL bool m0_reqh_service_invariant(const struct m0_reqh_service *svc)
M0_INTERNAL void m0_reqh_shutdown(struct m0_reqh *reqh)
struct m0_fop * m0_fop_get(struct m0_fop *fop)
M0_BOB_DEFINE(M0_INTERNAL, &rqsvc_bob, m0_reqh_service)
M0_INTERNAL int m0_reqh_mdpool_layout_build(struct m0_reqh *reqh)
void * m0_alloc(size_t size)
M0_INTERNAL void m0_mutex_init(struct m0_mutex *mutex)
M0_INTERNAL uint64_t m0_reqh_nr_localities(const struct m0_reqh *reqh)
struct m0_reqh_service_type m0_ha_link_service_type
struct m0_pdclust_instance pi
M0_INTERNAL int m0_reqhs_init(void)
M0_INTERNAL void m0_ha_domain_init(struct m0_ha_domain *dom, uint64_t epoch)
struct m0_pools_common * pv_pc
struct m0_layout_domain rh_ldom
struct m0_mdstore * rhia_mdstore
M0_INTERNAL void m0_reqh_post_storage_fini_svcs_stop(struct m0_reqh *reqh)
M0_INTERNAL void m0_rwlock_write_unlock(struct m0_rwlock *lock)
void m0_rpc_reply_post(struct m0_rpc_item *request, struct m0_rpc_item *reply)
struct m0_pool_device_to_service * pc_dev2svc
static struct m0_clink clink[RDWR_REQUEST_MAX]
M0_INTERNAL int m0_fid_sscanf(const char *s, struct m0_fid *fid)
M0_INTERNAL int m0_reqh_fop_allow(struct m0_reqh *reqh, struct m0_fop *fop)
M0_INTERNAL int m0_layout_standard_types_register(struct m0_layout_domain *dom)
static struct fdmi_ctx ctx
struct m0_fop_type m0_fop_generic_reply_fopt
M0_INTERNAL void m0_reqh_idle_wait(struct m0_reqh *reqh)
M0_INTERNAL bool m0_fom_domain_invariant(const struct m0_fom_domain *dom)
static struct m0_bob_type rqsvc_bob
const struct m0_fom_type_ops * ft_ops
M0_INTERNAL int m0_reqh_state_get(struct m0_reqh *reqh)
struct m0_fop * m0_fop_reply_alloc(struct m0_fop *req, struct m0_fop_type *rept)
struct m0_reqh_service_ctx * pds_ctx
void m0_clink_add_lock(struct m0_chan *chan, struct m0_clink *link)
M0_INTERNAL void m0_reqh_start(struct m0_reqh *reqh)
struct m0_pdclust_tgt_addr tgt
M0_INTERNAL struct m0_reqh_service * m0_reqh_service_find(const struct m0_reqh_service_type *st, const struct m0_reqh *reqh)
static struct m0_fid profile
M0_INTERNAL void m0_reqh_service_types_fini(void)
M0_LOCKERS_DEFINE(M0_INTERNAL, m0_reqh, rh_lockers)
M0_INTERNAL void m0_layout_domain_cleanup(struct m0_layout_domain *dom)
const struct m0_reqh_service_type * rs_type
static void __reqh_svcs_stop(struct m0_reqh *reqh, unsigned level)
M0_INTERNAL void m0_sm_init(struct m0_sm *mach, const struct m0_sm_conf *conf, uint32_t state, struct m0_sm_group *grp)
struct m0_chan rh_conf_cache_exp
#define M0_ALLOC_PTR(ptr)
struct m0_sm_group rh_sm_grp
int m0_addb2_sys_stor_start(struct m0_addb2_sys *sys, const char *location, uint64_t key, bool mkfs, bool force, m0_bcount_t size)
M0_INTERNAL struct m0_fom_domain * m0_fom_dom(void)
M0_INTERNAL struct m0_addb2_sys * m0_addb2_global_get(void)
static struct m0_net_test_service svc
static struct m0_sm_state_descr m0_reqh_sm_descr[]
M0_INTERNAL void m0_mutex_fini(struct m0_mutex *mutex)
M0_INTERNAL void m0_clink_fini(struct m0_clink *link)
M0_TL_DEFINE(m0_reqh_svc, M0_INTERNAL, struct m0_reqh_service)
struct m0_pools_common * rh_pools
M0_INTERNAL void m0_reqh_pre_storage_fini_svcs_stop(struct m0_reqh *reqh)
static struct m0_fop * fop
M0_INTERNAL void m0_rwlock_read_lock(struct m0_rwlock *lock)
struct m0_reqh_service_type m0_ha_entrypoint_service_type
M0_INTERNAL void m0_rwlock_fini(struct m0_rwlock *lock)
M0_INTERNAL void m0_layout_standard_types_unregister(struct m0_layout_domain *dom)
M0_INTERNAL void m0_reqh_idle_wait_for(struct m0_reqh *reqh, struct m0_reqh_service *service)
struct m0_be_seg * rh_beseg
M0_INTERNAL void m0_sm_group_lock(struct m0_sm_group *grp)
int m0_addb2_sys_net_start(struct m0_addb2_sys *sys)
M0_INTERNAL void m0_fom_queue(struct m0_fom *fom)
static struct m0_be_seg * seg
static struct m0_rconfc * rconfc(struct m0_client *m0c)
M0_INTERNAL void m0_reqh_services_prepare_to_stop(struct m0_reqh *reqh, unsigned level)
struct m0_fom_simple ffr_sfom
struct m0_addb2_sys * fd_addb2_sys
M0_INTERNAL void m0_chan_fini(struct m0_chan *chan)
struct m0_rconfc rh_rconfc
M0_INTERNAL void m0_confc_ready_cb(struct m0_rconfc *rconfc)
M0_INTERNAL void m0_layout_instance_fini(struct m0_layout_instance *li)
static void reqh_state_set(struct m0_reqh *reqh, enum m0_reqh_states state)
M0_INTERNAL struct m0_pdclust_instance * m0_layout_instance_to_pdi(const struct m0_layout_instance *li)
static void disallowed_fop_free(struct m0_fom_simple *sfom)
M0_INTERNAL int m0_rconfc_init(struct m0_rconfc *rconfc, const struct m0_fid *profile, struct m0_sm_group *sm_group, struct m0_rpc_machine *rmach, m0_rconfc_cb_t expired_cb, m0_rconfc_cb_t ready_cb)
M0_INTERNAL void m0_rwlock_read_unlock(struct m0_rwlock *lock)
const struct m0_conf_obj_type M0_CONF_PROCESS_TYPE
M0_INTERNAL void m0_layout_put(struct m0_layout *l)
M0_INTERNAL void m0_confc_expired_cb(struct m0_rconfc *rconfc)
M0_INTERNAL bool m0_fid_is_valid(const struct m0_fid *fid)
M0_INTERNAL void m0_fd_fwd_map(struct m0_pdclust_instance *pi, const struct m0_pdclust_src_addr *src, struct m0_pdclust_tgt_addr *tgt)
static void fop_disallowed(struct m0_reqh *reqh, struct m0_fop *req_fop, int rc)
static struct m0_dtm_oper_descr reply
void m0_addb2_sys_stor_stop(struct m0_addb2_sys *sys)
M0_INTERNAL void m0_reqh_addb2_fini(struct m0_reqh *reqh)
#define m0_tl_for(name, head, obj)
M0_INTERNAL void m0_chan_fini_lock(struct m0_chan *chan)
M0_INTERNAL int m0_reqh_be_init(struct m0_reqh *reqh, struct m0_be_seg *seg)
#define M0_FOM_SIMPLE_POST(s, r, c, t, f, d, l)
static struct m0_reqh_init_args reqh_args
struct m0_rpc_item f_item
const struct m0_reqh_service_type * ft_rstype
M0_INTERNAL int m0_reqh_services_state_count(struct m0_reqh *reqh, int state)
struct m0_pdclust_attr pv_attr
static struct m0_reqh_service * service[REQH_IN_UT_MAX]
struct m0_pdclust_src_addr src
M0_INTERNAL void m0_bob_type_tlist_init(struct m0_bob_type *bt, const struct m0_tl_descr *td)
struct m0_rpc_conn * s_conn
const struct m0_fid * rhia_fid
M0_INTERNAL void m0_sm_fini(struct m0_sm *mach)