Motr
M0
|
#include "lib/tlist.h"
#include "lib/types.h"
#include "lib/cookie.h"
#include "lib/chan.h"
#include "fid/fid.h"
#include "net/net.h"
#include "sm/sm.h"
#include "rm/rm_ha.h"
Go to the source code of this file.
Data Structures | |
struct | m0_rm_domain |
struct | m0_rm_resource |
struct | m0_rm_resource_ops |
struct | m0_rm_resource_type |
struct | m0_rm_resource_type_ops |
struct | m0_rm_credit |
struct | m0_rm_credit_ops |
struct | m0_rm_remote |
struct | m0_rm_owner |
struct | m0_rm_loan |
struct | m0_rm_reserve_prio |
struct | m0_rm_incoming |
struct | m0_rm_incoming_ops |
struct | m0_rm_outgoing |
struct | m0_rm_pin |
Macros | |
#define | __MOTR_RM_RM_H__ |
#define | M0_RM_REMOTE_GET(remote) |
#define | M0_RM_REMOTE_PUT(remote) |
Functions | |
M0_INTERNAL void | m0_rm_domain_init (struct m0_rm_domain *dom) |
M0_INTERNAL void | m0_rm_domain_fini (struct m0_rm_domain *dom) |
M0_INTERNAL int | m0_rm_type_register (struct m0_rm_domain *dom, struct m0_rm_resource_type *rt) |
M0_INTERNAL void | m0_rm_type_deregister (struct m0_rm_resource_type *rt) |
M0_INTERNAL struct m0_rm_resource_type * | m0_rm_resource_type_lookup (const struct m0_rm_domain *dom, const uint64_t rtype_id) |
M0_INTERNAL struct m0_rm_resource * | m0_rm_resource_find (const struct m0_rm_resource_type *rt, const struct m0_rm_resource *res) |
M0_INTERNAL void | m0_rm_resource_add (struct m0_rm_resource_type *rtype, struct m0_rm_resource *res) |
M0_INTERNAL void | m0_rm_resource_del (struct m0_rm_resource *res) |
M0_INTERNAL void | m0_rm_resource_free (struct m0_rm_resource *res) |
M0_INTERNAL int | m0_rm_resource_encode (struct m0_rm_resource *res, struct m0_buf *buf) |
M0_INTERNAL void | m0_rm_resource_initial_credit (const struct m0_rm_resource *resource, struct m0_rm_credit *credit) |
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) |
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) |
M0_INTERNAL int | m0_rm_owner_selfadd (struct m0_rm_owner *owner, struct m0_rm_credit *r) |
M0_INTERNAL void | m0_rm_owner_windup (struct m0_rm_owner *owner) |
M0_INTERNAL void | m0_rm_owner_creditor_reset (struct m0_rm_owner *owner, struct m0_rm_remote *creditor) |
M0_INTERNAL int | m0_rm_owner_timedwait (struct m0_rm_owner *owner, uint64_t state, const m0_time_t abs_timeout) |
M0_INTERNAL void | m0_rm_owner_fini (struct m0_rm_owner *owner) |
M0_INTERNAL void | m0_rm_owner_lock (struct m0_rm_owner *owner) |
M0_INTERNAL void | m0_rm_owner_unlock (struct m0_rm_owner *owner) |
M0_INTERNAL void | m0_rm_credit_init (struct m0_rm_credit *credit, struct m0_rm_owner *owner) |
M0_INTERNAL void | m0_rm_credit_fini (struct m0_rm_credit *credit) |
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) |
M0_INTERNAL void | m0_rm_incoming_fini (struct m0_rm_incoming *in) |
M0_INTERNAL void | m0_rm_remote_init (struct m0_rm_remote *rem, struct m0_rm_resource *res) |
M0_INTERNAL void | m0_rm_remote_fini (struct m0_rm_remote *rem) |
M0_INTERNAL int | m0_rm_net_locate (struct m0_rm_credit *credit, struct m0_rm_remote *other) |
M0_INTERNAL void | m0_rm_remote_owner_set (struct m0_rm_remote *rem, uint64_t id) |
Credit helpers | |
M0_INTERNAL int | m0_rm_credit_dup (const struct m0_rm_credit *src_credit, struct m0_rm_credit **dest_credit) |
M0_INTERNAL int | m0_rm_credit_copy (struct m0_rm_credit *dst, const struct m0_rm_credit *src) |
M0_INTERNAL int | m0_rm_credit_encode (struct m0_rm_credit *credit, struct m0_buf *buf) |
M0_INTERNAL int | m0_rm_credit_decode (struct m0_rm_credit *credit, struct m0_buf *buf) |
Owner state machine | |
m0_rm_owner and m0_rm_incoming together form a state machine where basic resource management functionality is implemented. This state machine reacts to the following external events:
Any event is processed in a uniform manner:
Event handling is serialised by the owner lock. It is not legal to wait for networking or IO events under this lock. | |
M0_INTERNAL void | m0_rm_credit_get (struct m0_rm_incoming *in) |
M0_INTERNAL void | m0_rm_credit_put (struct m0_rm_incoming *in) |
Variables | |
const struct m0_uint128 | m0_rm_no_group |