Motr  M0
rm_internal.h File Reference
#include "lib/bob.h"
#include "lib/cookie.h"
#include "rm/rm.h"
Include dependency graph for rm_internal.h:

Go to the source code of this file.

Data Structures

struct  m0_rm_remote_incoming
 

Macros

#define __MOTR_RM_RM_INTERNAL_H__
 

Enumerations

enum  m0_file_credit { RM_FILE_LOCK = 1 }
 
enum  m0_rwlock_credit { RM_RW_READ_LOCK = 1, RM_RW_WRITE_LOCK = ~0ULL }
 
enum  { WAIT_TRY_FLAGS = RIF_LOCAL_WAIT | RIF_LOCAL_TRY }
 

Functions

M0_INTERNAL int m0_rm_pin_add (struct m0_rm_incoming *in, struct m0_rm_credit *credit, uint32_t flags)
 
M0_INTERNAL int granted_maybe_reserve (struct m0_rm_credit *granted, struct m0_rm_credit *to_cache)
 
M0_INTERNAL struct m0_rm_remotem0_rm_remote_find (struct m0_rm_remote_incoming *rem_in)
 
RM FOP interface.

Functions and data-structures used for interaction between RM core and RM fops (and fom)s.

M0_INTERNAL int m0_rm_borrow_commit (struct m0_rm_remote_incoming *bor)
 
M0_INTERNAL int m0_rm_revoke_commit (struct m0_rm_remote_incoming *rvk)
 
M0_INTERNAL int m0_rm_borrow_done (struct m0_rm_outgoing *out, struct m0_rm_loan *loan)
 
int m0_rm_revoke_done (struct m0_rm_outgoing *out)
 
int m0_rm_resource_owner_find (const struct m0_rm_resource *resource, struct m0_rm_owner **owner)
 
M0_INTERNAL int m0_rm_request_out (enum m0_rm_outgoing_type otype, struct m0_rm_incoming *in, struct m0_rm_loan *loan, struct m0_rm_credit *credit, struct m0_rm_remote *remote)
 
M0_INTERNAL void m0_rm_outgoing_send (struct m0_rm_outgoing *outgoing)
 
M0_INTERNAL int m0_rm_outgoing_init (struct m0_rm_outgoing *out, enum m0_rm_outgoing_type req_type, struct m0_rm_remote *other, struct m0_rm_credit *credit)
 
M0_INTERNAL void m0_rm_outgoing_fini (struct m0_rm_outgoing *out)
 
M0_INTERNAL int m0_rm_loan_init (struct m0_rm_loan *loan, const struct m0_rm_credit *credit, struct m0_rm_remote *creditor)
 
M0_INTERNAL void m0_rm_loan_fini (struct m0_rm_loan *loan)
 
M0_INTERNAL int m0_rm_loan_alloc (struct m0_rm_loan **loan, const struct m0_rm_credit *credit, struct m0_rm_remote *creditor)
 
M0_INTERNAL int m0_rm_owner_loan_debit (struct m0_rm_owner *owner, struct m0_rm_loan *paid_loan, struct m0_tl *list)
 
M0_INTERNAL int m0_rm_loan_settle (struct m0_rm_owner *owner, struct m0_rm_loan *loan)
 
M0_INTERNAL void m0_rm_outgoing_complete (struct m0_rm_outgoing *og)
 
M0_INTERNAL int m0_rm_reverse_session_get (struct m0_rm_remote_incoming *rem_in, struct m0_rm_remote *remote)
 

RM lists.

#define RM_OWNER_LISTS_FOR(owner, expr)
 
M0_EXTERN const struct m0_bob_type loan_bob
 
 M0_TL_DESCR_DECLARE (res, extern)
 
 M0_TL_DECLARE (res, M0_INTERNAL, struct m0_rm_resource)
 
 M0_TL_DESCR_DECLARE (m0_rm_ur, extern)
 
 M0_TL_DECLARE (m0_rm_ur, M0_INTERNAL, struct m0_rm_credit)
 
 M0_TL_DESCR_DECLARE (m0_remotes, extern)
 
 M0_TL_DECLARE (m0_remotes, M0_INTERNAL, struct m0_rm_remote)
 
 M0_TL_DESCR_DECLARE (m0_owners, extern)
 
 M0_TL_DECLARE (m0_owners, M0_INTERNAL, struct m0_rm_owner)
 
 M0_TL_DESCR_DECLARE (pr, extern)
 
 M0_TL_DECLARE (pr, M0_INTERNAL, struct m0_rm_pin)
 
 M0_TL_DESCR_DECLARE (pi, extern)
 
 M0_TL_DECLARE (pi, M0_INTERNAL, struct m0_rm_pin)
 
 M0_BOB_DECLARE (M0_INTERNAL, m0_rm_loan)
 
static enum m0_rm_incoming_state incoming_state (const struct m0_rm_incoming *in)
 
static struct m0_rm_resourceincoming_to_resource (struct m0_rm_incoming *in)
 
static enum m0_rm_owner_state owner_state (const struct m0_rm_owner *owner)
 
static struct m0_sm_groupresource_grp (const struct m0_rm_resource *res)
 
static struct m0_sm_groupowner_grp (const struct m0_rm_owner *owner)
 

Macro Definition Documentation

◆ __MOTR_RM_RM_INTERNAL_H__

#define __MOTR_RM_RM_INTERNAL_H__

Definition at line 25 of file rm_internal.h.

◆ RM_OWNER_LISTS_FOR

#define RM_OWNER_LISTS_FOR (   owner,
  expr 
)
Value:
({ \
struct m0_rm_owner *__o = (owner); \
int __i; \
int __j; \
\
(expr)(&__o->ro_borrowed); \
(expr)(&__o->ro_sublet); \
\
for (__i = 0; __i < ARRAY_SIZE(__o->ro_owned); __i++) \
(expr)(&__o->ro_owned[__i]); \
\
for (__i = 0; __i < ARRAY_SIZE(__o->ro_incoming); __i++) { \
for (__j = 0; __j < ARRAY_SIZE(__o->ro_incoming[__i]); __j++) \
(expr)(&__o->ro_incoming[__i][__j]); \
} \
\
for (__i = 0; __i < ARRAY_SIZE(__o->ro_outgoing); __i++) \
(expr)(&__o->ro_outgoing[__i]); \
})
#define ARRAY_SIZE(a)
Definition: misc.h:45

Execute "expr" against all credits lists in a given owner.

Definition at line 263 of file rm_internal.h.

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
WAIT_TRY_FLAGS 

Definition at line 41 of file rm_internal.h.

◆ m0_file_credit

Enumerator
RM_FILE_LOCK 

Definition at line 31 of file rm_internal.h.

◆ m0_rwlock_credit

Credit values for RW lock requests

Enumerator
RM_RW_READ_LOCK 
RM_RW_WRITE_LOCK 

Definition at line 36 of file rm_internal.h.

Function Documentation

◆ incoming_state()

static enum m0_rm_incoming_state incoming_state ( const struct m0_rm_incoming in)
inlinestatic

Definition at line 285 of file rm_internal.h.

Here is the caller graph for this function:

◆ incoming_to_resource()

static struct m0_rm_resource* incoming_to_resource ( struct m0_rm_incoming in)
inlinestatic

Definition at line 291 of file rm_internal.h.

Here is the caller graph for this function:

◆ M0_BOB_DECLARE()

M0_BOB_DECLARE ( M0_INTERNAL  ,
m0_rm_loan   
)

◆ M0_TL_DECLARE() [1/6]

M0_TL_DECLARE ( res  ,
M0_INTERNAL  ,
struct m0_rm_resource   
)

◆ M0_TL_DECLARE() [2/6]

M0_TL_DECLARE ( m0_rm_ur  ,
M0_INTERNAL  ,
struct m0_rm_credit   
)

◆ M0_TL_DECLARE() [3/6]

M0_TL_DECLARE ( m0_remotes  ,
M0_INTERNAL  ,
struct m0_rm_remote   
)

◆ M0_TL_DECLARE() [4/6]

M0_TL_DECLARE ( m0_owners  ,
M0_INTERNAL  ,
struct m0_rm_owner   
)

◆ M0_TL_DECLARE() [5/6]

M0_TL_DECLARE ( pr  ,
M0_INTERNAL  ,
struct m0_rm_pin   
)

◆ M0_TL_DECLARE() [6/6]

M0_TL_DECLARE ( pi  ,
M0_INTERNAL  ,
struct m0_rm_pin   
)

◆ M0_TL_DESCR_DECLARE() [1/6]

M0_TL_DESCR_DECLARE ( res  ,
extern   
)

◆ M0_TL_DESCR_DECLARE() [2/6]

M0_TL_DESCR_DECLARE ( m0_rm_ur  ,
extern   
)

◆ M0_TL_DESCR_DECLARE() [3/6]

M0_TL_DESCR_DECLARE ( m0_remotes  ,
extern   
)

◆ M0_TL_DESCR_DECLARE() [4/6]

M0_TL_DESCR_DECLARE ( m0_owners  ,
extern   
)

◆ M0_TL_DESCR_DECLARE() [5/6]

M0_TL_DESCR_DECLARE ( pr  ,
extern   
)

◆ M0_TL_DESCR_DECLARE() [6/6]

M0_TL_DESCR_DECLARE ( pi  ,
extern   
)

◆ owner_grp()

static struct m0_sm_group* owner_grp ( const struct m0_rm_owner owner)
inlinestatic

Definition at line 309 of file rm_internal.h.

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

◆ owner_state()

static enum m0_rm_owner_state owner_state ( const struct m0_rm_owner owner)
inlinestatic

Definition at line 297 of file rm_internal.h.

Here is the caller graph for this function:

◆ resource_grp()

static struct m0_sm_group* resource_grp ( const struct m0_rm_resource res)
inlinestatic

Definition at line 303 of file rm_internal.h.

Here is the caller graph for this function:

Variable Documentation

◆ loan_bob

M0_EXTERN const struct m0_bob_type loan_bob

Definition at line 257 of file rm_internal.h.