25 #ifndef __MOTR_RM_RM_H__ 26 #define __MOTR_RM_RM_H__ 1718 const uint64_t rtype_id);
1957 #define M0_RM_REMOTE_GET(remote) \ 1959 struct m0_rm_remote *_r = (remote); \ 1960 int _c = m0_ref_read(&_r->rem_refcnt); \ 1961 M0_LOG(M0_DEBUG, "rm_remote=%p ref: %d -> %d", _r, _c, _c + 1); \ 1962 m0_ref_get(&_r->rem_refcnt); \ 1971 #define M0_RM_REMOTE_PUT(remote) \ 1974 struct m0_rm_remote *_r = (remote); \ 1975 struct m0_mutex *_m = &_r->rem_resource->r_mutex; \ 1976 m0_mutex_lock(_m); \ 1977 _c = m0_ref_read(&_r->rem_refcnt); \ 1978 M0_LOG(M0_DEBUG, "rm_remote=%p ref: %d -> %d", _r, _c, _c - 1); \ 1979 m0_ref_put(&_r->rem_refcnt); \ 1980 m0_mutex_unlock(_m); \ const struct m0_rm_credit_ops * cr_ops
M0_INTERNAL int m0_rm_owner_selfadd(struct m0_rm_owner *owner, struct m0_rm_credit *r)
struct m0_rm_resource * rem_resource
struct m0_rm_resource_type * r_type
void(* rio_conflict)(struct m0_rm_incoming *in)
bool(* rto_is)(const struct m0_rm_resource *resource, uint64_t id)
enum m0_rm_remote_state rem_state
int const char const void size_t int flags
struct m0_tlink rem_res_linkage
enum m0_rm_incoming_type rin_type
bool(* cro_intersects)(const struct m0_rm_credit *self, const struct m0_rm_credit *c1)
struct m0_clink rem_rev_sess_clink
static struct m0_rm_remote creditor
struct m0_rm_remote * ro_creditor
static struct buffer * cur(struct m0_addb2_mach *mach, m0_bcount_t space)
void(* rio_complete)(struct m0_rm_incoming *in, int32_t rc)
M0_INTERNAL int m0_rm_credit_decode(struct m0_rm_credit *credit, struct m0_buf *buf)
M0_INTERNAL struct m0_rm_resource_type * m0_rm_resource_type_lookup(const struct m0_rm_domain *dom, const uint64_t rtype_id)
const struct m0_uint128 m0_rm_group
struct m0_cookie rl_cookie
enum m0_rm_incoming_policy rin_policy
M0_INTERNAL int m0_rm_credit_dup(const struct m0_rm_credit *src_credit, struct m0_rm_credit **dest_credit)
struct m0_rm_ha_tracker rem_tracker
bool(* cro_conflicts)(const struct m0_rm_credit *self, const struct m0_rm_credit *c1)
struct m0_rm_incoming * rp_incoming
bool(* rto_eq)(const struct m0_rm_resource *resource0, const struct m0_rm_resource *resource1)
m0_bcount_t(* rto_len)(const struct m0_rm_resource *resource)
struct m0_queue rt_ha_events
struct m0_rm_resource_type * rd_types[M0_RM_RESOURCE_TYPE_ID_MAX]
M0_INTERNAL void m0_rm_domain_init(struct m0_rm_domain *dom)
M0_INTERNAL void m0_rm_remote_init(struct m0_rm_remote *rem, struct m0_rm_resource *res)
struct m0_tlink ro_owner_linkage
struct m0_rm_credit rin_want
struct m0_tlink r_linkage
struct m0_rpc_session * rem_session
int(* cro_copy)(struct m0_rm_credit *dst, const struct m0_rm_credit *self)
struct m0_rm_domain * rt_dom
void(* cro_free)(struct m0_rm_credit *self)
M0_INTERNAL int m0_rm_credit_encode(struct m0_rm_credit *credit, struct m0_buf *buf)
struct m0_rm_owner * cr_owner
M0_INTERNAL int m0_rm_owner_timedwait(struct m0_rm_owner *owner, uint64_t state, const m0_time_t abs_timeout)
const struct m0_rm_resource_ops * r_ops
M0_INTERNAL int m0_rm_resource_encode(struct m0_rm_resource *res, struct m0_buf *buf)
struct m0_rm_credit rl_credit
M0_INTERNAL void m0_rm_remote_owner_set(struct m0_rm_remote *rem, uint64_t id)
struct m0_rm_credit * rp_credit
bool(* cro_is_subset)(const struct m0_rm_credit *self, const struct m0_rm_credit *c1)
M0_INTERNAL void m0_rm_incoming_init(struct m0_rm_incoming *in, struct m0_rm_owner *owner, enum m0_rm_incoming_type type, enum m0_rm_incoming_policy policy, uint64_t flags)
struct m0_tl ro_incoming[M0_RM_REQUEST_PRIORITY_NR][OQS_NR]
struct m0_chan rem_signal
const struct m0_uint128 m0_rm_no_group
void(* rop_policy)(struct m0_rm_resource *resource, struct m0_rm_incoming *in)
M0_INTERNAL void m0_rm_owner_fini(struct m0_rm_owner *owner)
M0_INTERNAL void m0_rm_owner_init_rfid(struct m0_rm_owner *owner, const struct m0_uint128 *group, struct m0_rm_resource *res, struct m0_rm_remote *creditor)
struct m0_tl ro_outgoing[OQS_NR]
M0_INTERNAL int m0_rm_credit_copy(struct m0_rm_credit *dst, const struct m0_rm_credit *src)
const struct m0_rm_incoming_ops * rin_ops
static struct m0_stob_domain * dom
static struct rectype rt[]
void(* rop_resource_free)(struct m0_rm_resource *resource)
M0_INTERNAL void m0_rm_resource_initial_credit(const struct m0_rm_resource *resource, struct m0_rm_credit *credit)
void(* rop_credit_init)(struct m0_rm_resource *resource, struct m0_rm_credit *credit)
struct m0_thread rt_worker
int(* rto_decode)(struct m0_bufvec_cursor *cur, struct m0_rm_resource **resource)
struct m0_rm_remote * rl_other
M0_INTERNAL int m0_rm_net_locate(struct m0_rm_credit *credit, struct m0_rm_remote *other)
struct m0_rm_remote * rin_remote
M0_INTERNAL void m0_rm_resource_free(struct m0_rm_resource *res)
int(* cro_disjoin)(struct m0_rm_credit *self, const struct m0_rm_credit *c1, struct m0_rm_credit *intersection)
M0_INTERNAL void m0_rm_credit_put(struct m0_rm_incoming *in)
M0_INTERNAL void m0_rm_resource_add(struct m0_rm_resource_type *rtype, struct m0_rm_resource *res)
int(* rto_encode)(struct m0_bufvec_cursor *cur, const struct m0_rm_resource *resource)
M0_INTERNAL void m0_rm_credit_init(struct m0_rm_credit *credit, struct m0_rm_owner *owner)
M0_INTERNAL void m0_rm_remote_fini(struct m0_rm_remote *rem)
struct m0_tlink rp_credit_linkage
struct m0_tlink cr_linkage
M0_INTERNAL void m0_rm_owner_windup(struct m0_rm_owner *owner)
struct m0_tl ro_owned[OWOS_NR]
int(* cro_diff)(struct m0_rm_credit *self, const struct m0_rm_credit *c1)
m0_bcount_t(* cro_len)(const struct m0_rm_credit *self)
M0_INTERNAL void m0_rm_incoming_fini(struct m0_rm_incoming *in)
const struct m0_rm_resource_type_ops * rt_ops
M0_INTERNAL void m0_rm_owner_unlock(struct m0_rm_owner *owner)
M0_INTERNAL int m0_rm_type_register(struct m0_rm_domain *dom, struct m0_rm_resource_type *rt)
M0_INTERNAL void m0_rm_owner_creditor_reset(struct m0_rm_owner *owner, struct m0_rm_remote *creditor)
void(* cro_initial_capital)(struct m0_rm_credit *self)
struct m0_cookie rem_cookie
M0_INTERNAL void m0_rm_owner_lock(struct m0_rm_owner *owner)
struct m0_uint128 cr_group_id
M0_INTERNAL void m0_rm_type_deregister(struct m0_rm_resource_type *rt)
M0_INTERNAL void m0_rm_credit_fini(struct m0_rm_credit *credit)
struct m0_uint128 ro_group_id
M0_INTERNAL void m0_rm_owner_init(struct m0_rm_owner *owner, struct m0_fid *fid, const struct m0_uint128 *group, struct m0_rm_resource *res, struct m0_rm_remote *creditor)
struct m0_sm_group rt_sm_grp
int(* cro_decode)(struct m0_rm_credit *self, struct m0_bufvec_cursor *cur)
struct m0_mutex rt_queue_guard
struct m0_pdclust_src_addr src
struct m0_rm_reserve_prio rin_reserve
enum m0_rm_outgoing_type rog_type
M0_INTERNAL void m0_rm_domain_fini(struct m0_rm_domain *dom)
M0_INTERNAL void m0_rm_resource_del(struct m0_rm_resource *res)
struct m0_rm_loan rog_want
int(* cro_encode)(struct m0_rm_credit *self, struct m0_bufvec_cursor *cur)
M0_INTERNAL void m0_rm_credit_get(struct m0_rm_incoming *in)
struct m0_rm_resource * ro_resource
struct m0_tl rt_resources
int(* rop_credit_decode)(struct m0_rm_resource *resource, struct m0_rm_credit *credit, struct m0_bufvec_cursor *cur)
M0_INTERNAL struct m0_rm_resource * m0_rm_resource_find(const struct m0_rm_resource_type *rt, const struct m0_rm_resource *res)
int(* cro_join)(struct m0_rm_credit *self, const struct m0_rm_credit *c1)
struct m0_tlink rp_incoming_linkage