Motr  M0
Copy machine aggregation group
Collaboration diagram for Copy machine aggregation group:

Modules

 aggregtion group store fom
 

Data Structures

struct  m0_cm_ag_id
 
struct  m0_cm_aggr_group
 
struct  m0_cm_aggr_group_ops
 

Macros

#define M0_AG_F   U128X_F "::" U128X_F
 
#define M0_AG_P(ag)   U128_P(&((ag)->ai_hi)), U128_P(&((ag)->ai_lo))
 
#define ID_LOG(prefix, id)   M0_LOG(M0_DEBUG, prefix "=["M0_AG_F"]", M0_AG_P(id))
 
#define ID_INCOMING_LOG(prefix, id, has_incoming)
 
#define GRP_END_MARK_ID
 

Functions

struct m0_cm_ag_id M0_XCA_DOMAIN (rpc)
 
M0_INTERNAL void m0_cm_aggr_group_init (struct m0_cm_aggr_group *ag, struct m0_cm *cm, const struct m0_cm_ag_id *id, bool has_incoming, const struct m0_cm_aggr_group_ops *ag_ops)
 
M0_INTERNAL void m0_cm_aggr_group_fini (struct m0_cm_aggr_group *ag)
 
M0_INTERNAL void m0_cm_aggr_group_fini_and_progress (struct m0_cm_aggr_group *ag)
 
M0_INTERNAL int m0_cm_ag_id_cmp (const struct m0_cm_ag_id *id0, const struct m0_cm_ag_id *id1)
 
M0_INTERNAL void m0_cm_ag_id_copy (struct m0_cm_ag_id *dst, const struct m0_cm_ag_id *src)
 
M0_INTERNAL bool m0_cm_ag_id_is_set (const struct m0_cm_ag_id *id)
 
M0_INTERNAL struct m0_cm_aggr_groupm0_cm_aggr_group_locate (struct m0_cm *cm, const struct m0_cm_ag_id *id, bool has_incoming)
 
M0_INTERNAL int m0_cm_aggr_group_alloc (struct m0_cm *cm, const struct m0_cm_ag_id *id, bool has_incoming, struct m0_cm_aggr_group **out)
 
M0_INTERNAL void m0_cm_aggr_group_add (struct m0_cm *cm, struct m0_cm_aggr_group *ag, bool has_incoming)
 
M0_INTERNAL struct m0_cm_aggr_groupm0_cm_ag_in_hi (const struct m0_cm *cm)
 
M0_INTERNAL struct m0_cm_aggr_groupm0_cm_ag_in_lo (const struct m0_cm *cm)
 
M0_INTERNAL struct m0_cm_aggr_groupm0_cm_ag_out_hi (const struct m0_cm *cm)
 
M0_INTERNAL struct m0_cm_aggr_groupm0_cm_ag_out_lo (const struct m0_cm *cm)
 
M0_INTERNAL void m0_cm_ag_in_interval (const struct m0_cm *cm, struct m0_cm_sw *in_interval)
 
M0_INTERNAL void m0_cm_ag_out_interval (const struct m0_cm *cm, struct m0_cm_sw *out_interval)
 
M0_INTERNAL int m0_cm_ag_advance (struct m0_cm *cm)
 
M0_INTERNAL bool m0_cm_aggr_group_tlists_are_empty (struct m0_cm *cm)
 
M0_INTERNAL void m0_cm_ag_lock (struct m0_cm_aggr_group *ag)
 
M0_INTERNAL void m0_cm_ag_unlock (struct m0_cm_aggr_group *ag)
 
M0_INTERNAL bool m0_cm_ag_is_locked (struct m0_cm_aggr_group *ag)
 
M0_INTERNAL void m0_cm_ag_get (struct m0_cm_aggr_group *ag)
 
M0_INTERNAL void m0_cm_ag_put (struct m0_cm_aggr_group *ag)
 
M0_INTERNAL void m0_cm_ag_cp_add_locked (struct m0_cm_aggr_group *ag, struct m0_cm_cp *cp)
 
M0_INTERNAL void m0_cm_ag_cp_add (struct m0_cm_aggr_group *ag, struct m0_cm_cp *cp)
 
M0_INTERNAL void m0_cm_ag_cp_del (struct m0_cm_aggr_group *ag, struct m0_cm_cp *cp)
 
M0_INTERNAL bool m0_cm_ag_has_pending_cps (struct m0_cm_aggr_group *ag)
 
M0_INTERNAL void m0_cm_ag_fini_post (struct m0_cm_aggr_group *ag)
 
M0_INTERNAL bool m0_cm_ag_can_fini (struct m0_cm_aggr_group *ag)
 
 M0_TL_DESCR_DECLARE (aggr_grps_in, M0_EXTERN)
 
 M0_TL_DECLARE (aggr_grps_in, M0_INTERNAL, struct m0_cm_aggr_group)
 
 M0_TL_DESCR_DECLARE (aggr_grps_out, M0_EXTERN)
 
 M0_TL_DECLARE (aggr_grps_out, M0_INTERNAL, struct m0_cm_aggr_group)
 

Variables

struct m0_cm_aggr_group M0_XCA_DOMAIN
 
struct m0_bob_type aggr_grps_bob
 

Detailed Description

Macro Definition Documentation

◆ GRP_END_MARK_ID

#define GRP_END_MARK_ID
Value:
(struct m0_cm_ag_id) { \
.ai_hi = M0_UINT128((uint64_t)-1, (uint64_t)-1), \
.ai_lo = M0_UINT128((uint64_t)-1, (uint64_t)-1) \
}
#define M0_UINT128(hi, lo)
Definition: types.h:40
Definition: ag.h:49

Definition at line 62 of file ag.h.

◆ ID_INCOMING_LOG

#define ID_INCOMING_LOG (   prefix,
  id,
  has_incoming 
)
Value:
M0_LOG(M0_DEBUG, prefix "=["M0_AG_F"] has incoming: %d", \
M0_AG_P(id), !!(has_incoming));
#define M0_AG_P(ag)
Definition: ag.h:55
#define M0_LOG(level,...)
Definition: trace.h:167
static struct m0_uint128 prefix
Definition: extmap.c:45
#define M0_AG_F
Definition: ag.h:54

Definition at line 58 of file ag.h.

◆ ID_LOG

#define ID_LOG (   prefix,
  id 
)    M0_LOG(M0_DEBUG, prefix "=["M0_AG_F"]", M0_AG_P(id))

Definition at line 57 of file ag.h.

◆ M0_AG_F

#define M0_AG_F   U128X_F "::" U128X_F

Definition at line 54 of file ag.h.

◆ M0_AG_P

#define M0_AG_P (   ag)    U128_P(&((ag)->ai_hi)), U128_P(&((ag)->ai_lo))

Definition at line 55 of file ag.h.

Function Documentation

◆ m0_cm_ag_advance()

M0_INTERNAL int m0_cm_ag_advance ( struct m0_cm cm)

Advances the sliding window Hi as far as it can, by invoking m0_cm_ops:: cmo_ag_next() until it fails. For every next relevant (i.e. having incoming copy packets) aggregation group identifier an aggregation group is created and added to the m0_cm::cm_aggr_group_in list.

Definition at line 377 of file ag.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ m0_cm_ag_can_fini()

M0_INTERNAL bool m0_cm_ag_can_fini ( struct m0_cm_aggr_group ag)

Definition at line 538 of file ag.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ m0_cm_ag_cp_add()

M0_INTERNAL void m0_cm_ag_cp_add ( struct m0_cm_aggr_group ag,
struct m0_cm_cp cp 
)

Definition at line 510 of file ag.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ m0_cm_ag_cp_add_locked()

M0_INTERNAL void m0_cm_ag_cp_add_locked ( struct m0_cm_aggr_group ag,
struct m0_cm_cp cp 
)

Definition at line 502 of file ag.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ m0_cm_ag_cp_del()

M0_INTERNAL void m0_cm_ag_cp_del ( struct m0_cm_aggr_group ag,
struct m0_cm_cp cp 
)

Definition at line 520 of file ag.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ m0_cm_ag_fini_post()

M0_INTERNAL void m0_cm_ag_fini_post ( struct m0_cm_aggr_group ag)

Definition at line 533 of file ag.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ m0_cm_ag_get()

M0_INTERNAL void m0_cm_ag_get ( struct m0_cm_aggr_group ag)

Definition at line 488 of file ag.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ m0_cm_ag_has_pending_cps()

M0_INTERNAL bool m0_cm_ag_has_pending_cps ( struct m0_cm_aggr_group ag)

◆ m0_cm_ag_id_cmp()

M0_INTERNAL int m0_cm_ag_id_cmp ( const struct m0_cm_ag_id id0,
const struct m0_cm_ag_id id1 
)

3-way comparision function to compare two aggregation group IDs.

Return values
0if id0 = id1.
<0 if id0 < id1.
>0 if id0 > id1.

Definition at line 73 of file ag.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ m0_cm_ag_id_copy()

M0_INTERNAL void m0_cm_ag_id_copy ( struct m0_cm_ag_id dst,
const struct m0_cm_ag_id src 
)

Definition at line 83 of file ag.c.

Here is the caller graph for this function:

◆ m0_cm_ag_id_is_set()

M0_INTERNAL bool m0_cm_ag_id_is_set ( const struct m0_cm_ag_id id)

Definition at line 95 of file ag.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ m0_cm_ag_in_hi()

M0_INTERNAL struct m0_cm_aggr_group* m0_cm_ag_in_hi ( const struct m0_cm cm)

Returns the aggregation group with the highest aggregation group id from the m0_cm::cm_aggr_groups_in aggregation group list.

Precondition
cm != NULL && m0_cm_is_locked == true

Definition at line 403 of file ag.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ m0_cm_ag_in_interval()

M0_INTERNAL void m0_cm_ag_in_interval ( const struct m0_cm cm,
struct m0_cm_sw in_interval 
)

Returns the incoming aggregation groups interval [lo, hi] in the given .

Precondition
m0_cm_is_locked == true && in_interval != NULL

Definition at line 436 of file ag.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ m0_cm_ag_in_lo()

M0_INTERNAL struct m0_cm_aggr_group* m0_cm_ag_in_lo ( const struct m0_cm cm)

Returns the aggregation group with the lowest aggregation grou id from the m0_cm::cm_aggr_groups_in aggregation group list.

Precondition
cm != NULL && m0_cm_is_locked == true

Definition at line 412 of file ag.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ m0_cm_ag_is_locked()

M0_INTERNAL bool m0_cm_ag_is_locked ( struct m0_cm_aggr_group ag)

Definition at line 68 of file ag.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ m0_cm_ag_lock()

M0_INTERNAL void m0_cm_ag_lock ( struct m0_cm_aggr_group ag)

Definition at line 58 of file ag.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ m0_cm_ag_out_hi()

M0_INTERNAL struct m0_cm_aggr_group* m0_cm_ag_out_hi ( const struct m0_cm cm)

Definition at line 428 of file ag.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ m0_cm_ag_out_interval()

M0_INTERNAL void m0_cm_ag_out_interval ( const struct m0_cm cm,
struct m0_cm_sw out_interval 
)

Returns the outgoing aggregation groups interval [lo, hi] in the given .

Precondition
m0_cm_is_locked == true && out_interval != NULL

Definition at line 454 of file ag.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ m0_cm_ag_out_lo()

M0_INTERNAL struct m0_cm_aggr_group* m0_cm_ag_out_lo ( const struct m0_cm cm)

Definition at line 420 of file ag.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ m0_cm_ag_put()

M0_INTERNAL void m0_cm_ag_put ( struct m0_cm_aggr_group ag)

Definition at line 495 of file ag.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ m0_cm_ag_unlock()

M0_INTERNAL void m0_cm_ag_unlock ( struct m0_cm_aggr_group ag)

Definition at line 63 of file ag.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ m0_cm_aggr_group_add()

M0_INTERNAL void m0_cm_aggr_group_add ( struct m0_cm cm,
struct m0_cm_aggr_group ag,
bool  has_incoming 
)

Adds an aggregation group to a copy machine's, m0_cm::cm_aggr_groups_in or m0_cm::cm_aggr_groups_out list of aggregation groups depending on the given value of "has_incoming" parameter. Thus if "has_incoming == true" then the aggregation group is added to m0_cm::cm_aggr_groups_in, else to m0_cm:: cm_aggr_groups_out. Aggregation groups list are sorted lexicographically based on aggregation group ids.

Precondition
m0_cm_is_locked(cm) == true

Definition at line 301 of file ag.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ m0_cm_aggr_group_alloc()

M0_INTERNAL int m0_cm_aggr_group_alloc ( struct m0_cm cm,
const struct m0_cm_ag_id id,
bool  has_incoming,
struct m0_cm_aggr_group **  out 
)

Allocates the aggregation group by invoking m0_cm_ops::cmo_ag_alloc() and adds the aggregation group to m0_cm::cm_aggr_groups_in or m0_cm:: cm_aggr_groups_out list depending on the given "has_incoming" function parameter.

Definition at line 330 of file ag.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ m0_cm_aggr_group_fini()

M0_INTERNAL void m0_cm_aggr_group_fini ( struct m0_cm_aggr_group ag)

Definition at line 180 of file ag.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ m0_cm_aggr_group_fini_and_progress()

M0_INTERNAL void m0_cm_aggr_group_fini_and_progress ( struct m0_cm_aggr_group ag)

Definition at line 207 of file ag.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ m0_cm_aggr_group_init()

M0_INTERNAL void m0_cm_aggr_group_init ( struct m0_cm_aggr_group ag,
struct m0_cm cm,
const struct m0_cm_ag_id id,
bool  has_incoming,
const struct m0_cm_aggr_group_ops ag_ops 
)

Definition at line 153 of file ag.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ m0_cm_aggr_group_locate()

M0_INTERNAL struct m0_cm_aggr_group* m0_cm_aggr_group_locate ( struct m0_cm cm,
const struct m0_cm_ag_id id,
bool  has_incoming 
)

Searches for an aggregation group for the given "id" in m0_cm::cm_aggr_groups_in or m0_cm::cm_aggr_groups_out, depending on the value of "has_incoming" function parameter. Thus if has_incoming == true, then the given aggregation group has incoming copy packets from other replicas and it should be present and searched in m0_cm::cm_aggr_groups_in. If has_incoming == false, then the given aggregation group does not have any incoming copy packets, and thus can be found in m0_cm::cm_aggr_groups_out. There's also a possibility that initially it was discovered that the given aggregation group has incoming copy packets and thus was added to m0_cm:: cm_aggr_groups_in, later it was discovered that the given aggregation group also has outgoing copy packets from this copy machine replica, and the m0_cm_aggr_group_locate() was invoked in such a situation with has_incoming = false. Thus in this case as has_incoming == false, we look into m0_cm:: cm_aggr_groups_out first, if not found, we double check in m0_cm:: cm_aggr_groups_in list, if found in m0_cm::cm_aggr_groups_in list, and the aggregation group also has outgoing copy packets, then the aggregation group is also added to m0_cm::cm_aggr_groups_out list.

See also
struct m0_cm::cm_aggr_groups_in
struct m0_cm::cm_aggr_groups_out

Definition at line 262 of file ag.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ m0_cm_aggr_group_tlists_are_empty()

M0_INTERNAL bool m0_cm_aggr_group_tlists_are_empty ( struct m0_cm cm)

Definition at line 355 of file ag.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ M0_TL_DECLARE() [1/2]

M0_TL_DECLARE ( aggr_grps_in  ,
M0_INTERNAL  ,
struct m0_cm_aggr_group   
)

◆ M0_TL_DECLARE() [2/2]

M0_TL_DECLARE ( aggr_grps_out  ,
M0_INTERNAL  ,
struct m0_cm_aggr_group   
)

◆ M0_TL_DESCR_DECLARE() [1/2]

M0_TL_DESCR_DECLARE ( aggr_grps_in  ,
M0_EXTERN   
)

◆ M0_TL_DESCR_DECLARE() [2/2]

M0_TL_DESCR_DECLARE ( aggr_grps_out  ,
M0_EXTERN   
)

◆ M0_XCA_DOMAIN()

struct m0_cm_ag_id M0_XCA_DOMAIN ( rpc  )

Variable Documentation

◆ aggr_grps_bob

struct m0_bob_type aggr_grps_bob

◆ M0_XCA_DOMAIN

struct m0_cm_aggr_group M0_XCA_DOMAIN