RMS provides service management API for resource manager. RMS will be registered with Motr request handler and the service will provide interfaces to resource manager, like identification of owner, borrow or revoke requests &c.
More...
RMS provides service management API for resource manager. RMS will be registered with Motr request handler and the service will provide interfaces to resource manager, like identification of owner, borrow or revoke requests &c.
Data Structures
RMS will be represented by an instance of m0_reqh_rm_service, which will be a wrapper to contain m0_reqh_service. RMS will be registered during Motr server initialisation and request handler service specific routines will be provided. RMS has following components associated with it:
It will be simply assumed that the request handler that runs confd also runs resource manager service. Note that there will be multiple resource manager services running in the system, but we need one for boot-strapping to access confd. The locations of other resource manager services can be obtained from confd.
Subroutines
Following new API's are introduced:
- Todo:
- All the creditors for the resources reside inside RM service; i.e. RM service will be the creditor for all currently available resource types. When specific resource types are implemented, this can be changed.
◆ M0_TRACE_SUBSYSTEM
#define M0_TRACE_SUBSYSTEM M0_TRACE_SUBSYS_RM |
◆ M0_BOB_DEFINE()
◆ m0_rm_svc_domain_get()
◆ m0_rm_svc_owner_create()
Creates an owner for resource type description from resbuf. Adds the resource to the domain maintained by m0_reqh_rm_service.
- Precondition
- service != NULL
-
resbuf != NULL
Definition at line 224 of file rm_service.c.
◆ m0_rms_register()
M0_INTERNAL int m0_rms_register |
( |
void |
| ) |
|
Register resource manager service
- Todo:
- Contact confd and take list of resource types for this resource manager.
Definition at line 93 of file rm_service.c.
◆ m0_rms_unregister()
M0_INTERNAL void m0_rms_unregister |
( |
void |
| ) |
|
Unregister resource manager service
Definition at line 109 of file rm_service.c.
◆ rms_allocate()
◆ rms_fini()
◆ rms_resources_free()
◆ rms_start()
Register various resource types
Definition at line 153 of file rm_service.c.
◆ rms_stop()
◆ rmsvc_owner()
◆ m0_rms_type [1/2]
Initial value:= {
.rst_name = "M0_CST_RMS",
.rst_typecode = M0_CST_RMS,
}
static const struct m0_reqh_service_type_ops rms_type_ops
Definition at line 69 of file rm_service.c.
◆ m0_rms_type [2/2]
◆ owner_fid_type
Initial value:= {
.ft_id = 'O',
.ft_name = "rm owner fid"
}
Definition at line 85 of file rm_service.c.
◆ rms_bob
Initial value:= {
.bt_name = "rm service",
}
#define offsetof(typ, memb)
Definition at line 76 of file rm_service.c.
◆ rms_ops
Initial value:= {
}
static int rms_start(struct m0_reqh_service *service)
int m0_reqh_service_async_start_simple(struct m0_reqh_service_start_async_ctx *asc)
static void rms_stop(struct m0_reqh_service *service)
static void rms_fini(struct m0_reqh_service *service)
RM Service operations.
Definition at line 62 of file rm_service.c.
◆ rms_type_ops
Initial value:= {
}
static int rms_allocate(struct m0_reqh_service **service, const struct m0_reqh_service_type *stype)
RM Service type operations.
Definition at line 55 of file rm_service.c.