62 while ((datum & 0x01) == 0) {
106 return res_id == ring->
rs_id;
112 return (
m0_bcount_t)
sizeof(uint64_t) +
sizeof(uint64_t);
124 sizeof rings->
rs_id);
131 static uint64_t res_id;
140 rings->
rs_id = res_id;
216 dest->cr_datum =
src->cr_datum;
217 dest->cr_owner =
src->cr_owner;
244 return dest->cr_datum != 0;
245 return (
dest->cr_datum &
src->cr_datum) ==
src->cr_datum;
308 rings_rtype->
rt_id = 0;
312 self->rd_rt = rings_rtype;
351 self->rd_owner = owner;
362 self->rd_credit.cr_datum =
ALLRINGS;
const struct m0_rm_credit_ops * cr_ops
static void rings_owner_set(struct rm_ut_data *self)
M0_INTERNAL int m0_xcode_encdec(struct m0_xcode_obj *obj, struct m0_bufvec_cursor *cur, enum m0_xcode_what what)
struct m0_rm_resource_type * r_type
const struct m0_xcode_type * xo_type
const struct m0_rm_resource_ops rings_ops
static bool rings_resources_are_equal(const struct m0_rm_resource *c0, const struct m0_rm_resource *c1)
bool(* cro_intersects)(const struct m0_rm_credit *self, const struct m0_rm_credit *c1)
static struct buffer * cur(struct m0_addb2_mach *mach, m0_bcount_t space)
static int rings_credit_decode(struct m0_rm_credit *credit, struct m0_bufvec_cursor *cur)
void(* rio_complete)(struct m0_rm_incoming *in, int32_t rc)
static m0_bcount_t rings_resource_len(const struct m0_rm_resource *resource)
const struct m0_rm_credit_ops rings_credit_ops
bool(* rto_eq)(const struct m0_rm_resource *resource0, const struct m0_rm_resource *resource1)
const struct m0_rm_incoming_ops rings_incoming_ops
static bool rings_resource_is(const struct m0_rm_resource *res, uint64_t res_id)
static bool rings_conflicts(const struct m0_rm_credit *c0, const struct m0_rm_credit *c1)
#define container_of(ptr, type, member)
struct m0_rm_credit rin_want
static int rings_credit_join(struct m0_rm_credit *c0, const struct m0_rm_credit *c1)
static const struct rm_ut_data_ops rings_ut_data_ops
const struct m0_rm_resource_type_ops rings_rtype_ops
M0_INTERNAL int m0_xcode_length(struct m0_xcode_ctx *ctx)
static int rings_credit_diff(struct m0_rm_credit *c0, const struct m0_rm_credit *c1)
const struct m0_rm_resource_ops * r_ops
static void rings_initial_capital(struct m0_rm_credit *self)
static bool rings_credit_intersects(const struct m0_rm_credit *c0, const struct m0_rm_credit *c1)
M0_INTERNAL m0_bcount_t m0_bufvec_cursor_copyfrom(struct m0_bufvec_cursor *scur, void *ddata, m0_bcount_t num_bytes)
struct m0_rm_credit * rp_credit
static m0_bcount_t rings_credit_len(const struct m0_rm_credit *credit)
#define M0_FID_TINIT(type, container, key)
const struct m0_uint128 m0_rm_no_group
static void rings_datum_set(struct rm_ut_data *self)
M0_INTERNAL void m0_rm_owner_fini(struct m0_rm_owner *owner)
static int rings_credit_encode(struct m0_rm_credit *credit, struct m0_bufvec_cursor *cur)
void(* rtype_set)(struct rm_ut_data *self)
static int rings_resource_encode(struct m0_bufvec_cursor *cur, const struct m0_rm_resource *resource)
struct m0_rm_resource_type rings_resource_type
struct m0_pdclust_instance pi
static void rings_policy(struct m0_rm_resource *resource, struct m0_rm_incoming *in)
static void rings_incoming_complete(struct m0_rm_incoming *in, int32_t rc)
static void rings_credit_free(struct m0_rm_credit *credit)
static int rings_resource_decode(struct m0_bufvec_cursor *cur, struct m0_rm_resource **resource)
static int rings_disjoin(struct m0_rm_credit *src, const struct m0_rm_credit *dest, struct m0_rm_credit *intersection)
static void rings_incoming_conflict(struct m0_rm_incoming *in)
static int rings_credit_encdec(struct m0_rm_credit *credit, struct m0_bufvec_cursor *cur, enum m0_xcode_what what)
M0_INTERNAL void m0_rm_resource_add(struct m0_rm_resource_type *rtype, struct m0_rm_resource *res)
#define M0_FI_ENABLED(tag)
#define M0_ALLOC_PTR(ptr)
static void rings_owner_unset(struct rm_ut_data *self)
static bool rings_is_subset(const struct m0_rm_credit *src, const struct m0_rm_credit *dest)
M0_INTERNAL m0_bcount_t m0_bufvec_cursor_copyto(struct m0_bufvec_cursor *dcur, void *sdata, m0_bcount_t num_bytes)
static void rings_res_unset(struct rm_ut_data *self)
const struct m0_rm_resource_type_ops * rt_ops
M0_INTERNAL int m0_rm_type_register(struct m0_rm_domain *dom, struct m0_rm_resource_type *rt)
void rings_utdata_ops_set(struct rm_ut_data *data)
#define M0_XCODE_OBJ(type, ptr)
struct m0_rm_resource rs_resource
static void rings_rtype_set(struct rm_ut_data *self)
M0_INTERNAL void m0_xcode_ctx_init(struct m0_xcode_ctx *ctx, const struct m0_xcode_obj *obj)
static void rings_rtype_unset(struct rm_ut_data *self)
M0_INTERNAL void m0_rm_type_deregister(struct m0_rm_resource_type *rt)
static void rings_res_set(struct rm_ut_data *self)
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)
#define m0_tl_for(name, head, obj)
const struct m0_xcode_type M0_XT_U64
static int rings_credit_copy(struct m0_rm_credit *dest, const struct m0_rm_credit *src)
struct m0_pdclust_src_addr src
static void rings_credit_init(struct m0_rm_resource *resource, struct m0_rm_credit *credit)
M0_INTERNAL void m0_rm_resource_del(struct m0_rm_resource *res)
void rings_resource_free(struct m0_rm_resource *resource)
int(* rop_credit_decode)(struct m0_rm_resource *resource, struct m0_rm_credit *credit, struct m0_bufvec_cursor *cur)