Motr
M0
|
![]() |
Modules | |
Request handler service | |
Data Structures | |
struct | disallowed_fop_reply |
struct | m0_reqh |
struct | m0_reqh_init_args |
struct | reqh_ut_balloc |
Macros | |
#define | M0_REQH_INIT(reqh, ...) |
#define | CLIENT_ENDPOINT_ADDR "0@lo:12345:34:*" |
#define | SERVER_ENDPOINT_ADDR "0@lo:12345:34:1" |
#define | SERVER_DB_NAME "reqh_ut_stob/sdb" |
#define | SERVER_BDOM_LOCATION "linuxstob:./reqh_fom_ut" |
#define | SERVER_BDOM_KEY 0xBAC570BD |
Enumerations | |
enum | { DEFAULT_ADDB2_RECORD_SIZE = 128ULL << 20, MIN_ADDB2_RECORD_SIZE = 10ULL << 20, MAX_ADDB2_RECORD_SIZE = 10ULL << 30, DEFAULT_CLIENT_ADDB2_RECORD_SIZE = 128ULL << 20 } |
enum | m0_reqh_states { M0_REQH_ST_INIT, M0_REQH_ST_NORMAL, M0_REQH_ST_DRAIN, M0_REQH_ST_SVCS_STOP, M0_REQH_ST_STOPPED, M0_REQH_ST_NR } |
enum | { CLIENT_COB_DOM_ID = 101, MAX_RPCS_IN_FLIGHT = 32, MAX_RETRIES = 5 } |
Functions | |
M0_TL_DESCR_DEFINE (m0_reqh_svc, "reqh service", M0_INTERNAL, struct m0_reqh_service, rs_linkage, rs_magix, M0_REQH_SVC_MAGIC, M0_REQH_SVC_HEAD_MAGIC) | |
M0_TL_DEFINE (m0_reqh_svc, M0_INTERNAL, struct m0_reqh_service) | |
M0_BOB_DEFINE (M0_INTERNAL, &rqsvc_bob, m0_reqh_service) | |
M0_TL_DESCR_DEFINE (m0_reqh_rpc_mach, "rpc machines",, struct m0_rpc_machine, rm_rh_linkage, rm_magix, M0_RPC_MACHINE_MAGIC, M0_REQH_RPC_MACH_HEAD_MAGIC) | |
M0_TL_DEFINE (m0_reqh_rpc_mach,, struct m0_rpc_machine) | |
M0_LOCKERS_DEFINE (M0_INTERNAL, m0_reqh, rh_lockers) | |
static void | __reqh_fini (struct m0_reqh *reqh) |
M0_INTERNAL bool | m0_reqh_invariant (const struct m0_reqh *reqh) |
M0_INTERNAL int | m0_reqh_mdpool_layout_build (struct m0_reqh *reqh) |
M0_INTERNAL void | m0_reqh_layouts_cleanup (struct m0_reqh *reqh) |
M0_INTERNAL struct m0_rpc_session * | m0_reqh_mdpool_service_index_to_session (const struct m0_reqh *reqh, const struct m0_fid *gob_fid, uint32_t index) |
M0_INTERNAL int | m0_reqh_init (struct m0_reqh *reqh, const struct m0_reqh_init_args *reqh_args) |
M0_INTERNAL int | m0_reqh_be_init (struct m0_reqh *reqh, struct m0_be_seg *seg) |
M0_INTERNAL void | m0_reqh_be_fini (struct m0_reqh *reqh) |
M0_INTERNAL void | m0_reqh_fini (struct m0_reqh *reqh) |
M0_INTERNAL void | m0_reqhs_fini (void) |
M0_INTERNAL int | m0_reqhs_init (void) |
M0_INTERNAL int | m0_reqh_addb2_init (struct m0_reqh *reqh, const char *location, uint64_t key, bool mkfs, bool force, m0_bcount_t size) |
M0_INTERNAL void | m0_reqh_addb2_fini (struct m0_reqh *reqh) |
M0_INTERNAL int | m0_reqh_state_get (struct m0_reqh *reqh) |
static void | reqh_state_set (struct m0_reqh *reqh, enum m0_reqh_states state) |
M0_INTERNAL int | m0_reqh_services_state_count (struct m0_reqh *reqh, int state) |
M0_INTERNAL int | m0_reqh_fop_allow (struct m0_reqh *reqh, struct m0_fop *fop) |
static int | disallowed_fop_tick (struct m0_fom *fom, void *data, int *phase) |
static void | disallowed_fop_free (struct m0_fom_simple *sfom) |
static void | fop_disallowed (struct m0_reqh *reqh, struct m0_fop *req_fop, int rc) |
M0_INTERNAL int | m0_reqh_fop_handle (struct m0_reqh *reqh, struct m0_fop *fop) |
M0_INTERNAL void | m0_reqh_idle_wait_for (struct m0_reqh *reqh, struct m0_reqh_service *service) |
M0_INTERNAL void | m0_reqh_idle_wait (struct m0_reqh *reqh) |
M0_INTERNAL void | m0_reqh_services_prepare_to_stop (struct m0_reqh *reqh, unsigned level) |
M0_INTERNAL void | m0_reqh_shutdown (struct m0_reqh *reqh) |
M0_INTERNAL void | m0_reqh_shutdown_wait (struct m0_reqh *reqh) |
static void | __reqh_svcs_stop (struct m0_reqh *reqh, unsigned level) |
M0_INTERNAL void | m0_reqh_services_terminate (struct m0_reqh *reqh) |
M0_INTERNAL void | m0_reqh_pre_storage_fini_svcs_stop (struct m0_reqh *reqh) |
M0_INTERNAL void | m0_reqh_post_storage_fini_svcs_stop (struct m0_reqh *reqh) |
M0_INTERNAL void | m0_reqh_start (struct m0_reqh *reqh) |
M0_INTERNAL uint64_t | m0_reqh_nr_localities (const struct m0_reqh *reqh) |
M0_INTERNAL int | m0_reqh_conf_setup (struct m0_reqh *reqh, struct m0_confc_args *args) |
M0_INTERNAL struct m0_confc * | m0_reqh2confc (struct m0_reqh *reqh) |
M0_INTERNAL struct m0_fid * | m0_reqh2profile (struct m0_reqh *reqh) |
M0_LOCKERS_DECLARE (M0_EXTERN, m0_reqh, 256) | |
M0_INTERNAL int | m0_reqh_addb2_submit (struct m0_reqh *reqh, struct m0_addb2_trace_obj *tobj) |
M0_TL_DESCR_DECLARE (m0_reqh_svc, M0_EXTERN) | |
M0_TL_DECLARE (m0_reqh_svc, M0_INTERNAL, struct m0_reqh_service) | |
M0_BOB_DECLARE (M0_EXTERN, m0_reqh_service) | |
M0_TL_DESCR_DECLARE (m0_reqh_rpc_mach, extern) | |
M0_TL_DECLARE (m0_reqh_rpc_mach,, struct m0_rpc_machine) | |
static struct reqh_ut_balloc * | getballoc (struct m0_ad_balloc *ballroom) |
static int | reqh_ut_balloc_init (struct m0_ad_balloc *ballroom, struct m0_be_seg *db, uint32_t bshift, m0_bindex_t container_size, m0_bcount_t groupsize, m0_bcount_t spare_reserve) |
static void | reqh_ut_balloc_fini (struct m0_ad_balloc *ballroom) |
static int | reqh_ut_balloc_alloc (struct m0_ad_balloc *ballroom, struct m0_dtx *tx, m0_bcount_t count, struct m0_ext *out, uint64_t alloc_zone) |
static int | reqh_ut_balloc_free (struct m0_ad_balloc *ballroom, struct m0_dtx *tx, struct m0_ext *ext) |
static int | reqh_ut_reserve_extent (struct m0_ad_balloc *ballroom, struct m0_be_tx *tx, struct m0_ext *ext, uint64_t alloc_zone) |
struct m0_stob_domain * | reqh_ut_stob_domain_find (void) |
static int | server_init (const char *stob_path, const char *srv_db_name, struct m0_net_domain *net_dom, uint64_t back_key, struct m0_stob_domain **bdom) |
static void | server_fini (struct m0_stob_domain *bdom, uint64_t back_key) |
static void | fop_send (struct m0_fop *fop, struct m0_rpc_session *session) |
static void | create_send (struct m0_rpc_session *session) |
static void | read_send (struct m0_rpc_session *session) |
static void | write_send (struct m0_rpc_session *session) |
void | test_reqh (void) |
Variables | |
static struct m0_bob_type | rqsvc_bob |
struct m0_reqh_service_type | m0_rpc_service_type |
static struct m0_sm_state_descr | m0_reqh_sm_descr [] |
static const struct m0_sm_conf | m0_reqh_sm_conf |
struct m0_reqh_service_type | m0_ha_entrypoint_service_type |
struct m0_reqh_service_type | m0_ha_link_service_type |
M0_EXTERN struct m0_reqh_service_type | m0_cas_service_type |
static struct m0_stob_domain * | sdom |
static struct m0_mdstore | srv_mdstore |
static struct m0_cob_domain_id | srv_cob_dom_id |
static struct m0_rpc_machine | srv_rpc_mach |
static struct m0_be_ut_backend | ut_be |
static struct m0_be_ut_seg | ut_seg |
static struct m0_reqh_service * | reqh_ut_service |
static struct m0_reqh_service * | fdmi_ut_service |
static struct m0_reqh | reqh |
static const struct m0_ad_balloc_ops | reqh_ut_balloc_ops |
struct reqh_ut_balloc | rb |
static struct m0_net_buffer_pool | app_pool |
struct m0_ut_suite | reqh_ut |
Request handler provides non-blocking infrastructure for fop execution. There typically is a single request handler instance per address space, once the request handler is initialised and ready to serve requests, it accepts a fop (file operation packet), interprets it by interacting with other sub systems and executes the desired file system operation.
For every incoming fop, request handler creates a corresponding fom (file operation state machine), fop is executed in this fom context. For every fom, request handler performs some standard operations such as authentication, locating resources for its execution, authorisation of file operation by the user, &c. Once all the standard phases are completed, the fop specific operation is executed.
#define CLIENT_ENDPOINT_ADDR "0@lo:12345:34:*" |
Server side structures and objects
Definition at line 61 of file reqh_fom_ut.c.
#define M0_REQH_INIT | ( | reqh, | |
... | |||
) |
#define SERVER_BDOM_KEY 0xBAC570BD |
Definition at line 65 of file reqh_fom_ut.c.
#define SERVER_BDOM_LOCATION "linuxstob:./reqh_fom_ut" |
Definition at line 64 of file reqh_fom_ut.c.
#define SERVER_DB_NAME "reqh_ut_stob/sdb" |
Definition at line 63 of file reqh_fom_ut.c.
#define SERVER_ENDPOINT_ADDR "0@lo:12345:34:1" |
Definition at line 62 of file reqh_fom_ut.c.
anonymous enum |
anonymous enum |
Enumerator | |
---|---|
CLIENT_COB_DOM_ID | |
MAX_RPCS_IN_FLIGHT | |
MAX_RETRIES |
Definition at line 67 of file reqh_fom_ut.c.
enum m0_reqh_states |
|
static |
|
static |
|
static |
Sends create fop request.
Definition at line 353 of file reqh_fom_ut.c.
|
static |
|
static |
|
static |
Definition at line 341 of file reqh_fom_ut.c.
|
static |
M0_BOB_DECLARE | ( | M0_EXTERN | , |
m0_reqh_service | |||
) |
M0_BOB_DEFINE | ( | M0_INTERNAL | , |
& | rqsvc_bob, | ||
m0_reqh_service | |||
) |
M0_LOCKERS_DECLARE | ( | M0_EXTERN | , |
m0_reqh | , | ||
256 | |||
) |
M0_LOCKERS_DEFINE | ( | M0_INTERNAL | , |
m0_reqh | , | ||
rh_lockers | |||
) |
M0_INTERNAL void m0_reqh_addb2_fini | ( | struct m0_reqh * | reqh | ) |
M0_INTERNAL int m0_reqh_addb2_init | ( | struct m0_reqh * | reqh, |
const char * | location, | ||
uint64_t | key, | ||
bool | mkfs, | ||
bool | force, | ||
m0_bcount_t | size | ||
) |
M0_INTERNAL int m0_reqh_addb2_submit | ( | struct m0_reqh * | reqh, |
struct m0_addb2_trace_obj * | tobj | ||
) |
M0_INTERNAL void m0_reqh_be_fini | ( | struct m0_reqh * | reqh | ) |
M0_INTERNAL int m0_reqh_conf_setup | ( | struct m0_reqh * | reqh, |
struct m0_confc_args * | args | ||
) |
M0_INTERNAL void m0_reqh_fini | ( | struct m0_reqh * | reqh | ) |
Destructor for request handler, no fop will be further executed in the address space belonging to this request handler.
reqh,request | handler to be finalised |
Definition at line 320 of file reqh.c.
Submit fop for request handler processing. Request handler initialises fom corresponding to this fop, finds appropriate locality to execute this fom, and enqueues the fom into its runq. Fop processing results are reported by other means (ADDB, reply fops, error messages, etc.) so this function returns nothing.
reqh,request | handler processing the fop |
fop,fop | to be executed |
Definition at line 546 of file reqh.c.
M0_INTERNAL void m0_reqh_idle_wait | ( | struct m0_reqh * | reqh | ) |
Waits on the request handler channel (m0_reqh::rh_sd_signal) until the FOM domain (m0_fom_dom()) is idle.
Definition at line 606 of file reqh.c.
M0_INTERNAL void m0_reqh_idle_wait_for | ( | struct m0_reqh * | reqh, |
struct m0_reqh_service * | service | ||
) |
M0_INTERNAL int m0_reqh_init | ( | struct m0_reqh * | reqh, |
const struct m0_reqh_init_args * | args | ||
) |
Initialises request handler instance provided by the caller.
reqh | Request handler instance to be initialised |
Definition at line 227 of file reqh.c.
M0_INTERNAL bool m0_reqh_invariant | ( | const struct m0_reqh * | reqh | ) |
M0_INTERNAL void m0_reqh_layouts_cleanup | ( | struct m0_reqh * | reqh | ) |
M0_INTERNAL int m0_reqh_mdpool_layout_build | ( | struct m0_reqh * | reqh | ) |
M0_INTERNAL struct m0_rpc_session * m0_reqh_mdpool_service_index_to_session | ( | const struct m0_reqh * | reqh, |
const struct m0_fid * | gfid, | ||
uint32_t | index | ||
) |
Returns the remote rpc session of the service in mdpool on which meta data cob is present.
index | index of the remote service in mdpool. |
Definition at line 177 of file reqh.c.
M0_INTERNAL uint64_t m0_reqh_nr_localities | ( | const struct m0_reqh * | reqh | ) |
M0_INTERNAL void m0_reqh_post_storage_fini_svcs_stop | ( | struct m0_reqh * | reqh | ) |
M0_INTERNAL void m0_reqh_pre_storage_fini_svcs_stop | ( | struct m0_reqh * | reqh | ) |
M0_INTERNAL void m0_reqh_services_prepare_to_stop | ( | struct m0_reqh * | reqh, |
unsigned | level | ||
) |
M0_INTERNAL int m0_reqh_services_state_count | ( | struct m0_reqh * | reqh, |
int | state | ||
) |
M0_INTERNAL void m0_reqh_services_terminate | ( | struct m0_reqh * | reqh | ) |
Stops and finalises all the services registered with a request handler, but not the management service.
Definition at line 675 of file reqh.c.
M0_INTERNAL void m0_reqh_shutdown | ( | struct m0_reqh * | reqh | ) |
Initiates the termination of services.
reqh | request handler to be shutdown |
Definition at line 636 of file reqh.c.
M0_INTERNAL void m0_reqh_shutdown_wait | ( | struct m0_reqh * | reqh | ) |
Initiates the termination of services and then wait for FOMs to terminate.
reqh | request handler to be shutdown |
Definition at line 647 of file reqh.c.
M0_INTERNAL void m0_reqh_start | ( | struct m0_reqh * | reqh | ) |
Notify the request handler that normal operation should commence.
The subroutine does not enforce that a management service is configured because UTs frequently do not require this.
Definition at line 711 of file reqh.c.
M0_INTERNAL int m0_reqh_state_get | ( | struct m0_reqh * | reqh | ) |
M0_INTERNAL void m0_reqhs_fini | ( | void | ) |
M0_INTERNAL int m0_reqhs_init | ( | void | ) |
M0_TL_DECLARE | ( | m0_reqh_svc | , |
M0_INTERNAL | , | ||
struct m0_reqh_service | |||
) |
M0_TL_DECLARE | ( | m0_reqh_rpc_mach | , |
struct m0_rpc_machine | |||
) |
M0_TL_DEFINE | ( | m0_reqh_svc | , |
M0_INTERNAL | , | ||
struct m0_reqh_service | |||
) |
M0_TL_DEFINE | ( | m0_reqh_rpc_mach | , |
struct m0_rpc_machine | |||
) |
M0_TL_DESCR_DECLARE | ( | m0_reqh_svc | , |
M0_EXTERN | |||
) |
Descriptor for tlist of request handler services.
M0_TL_DESCR_DECLARE | ( | m0_reqh_rpc_mach | , |
extern | |||
) |
Descriptor for tlist of rpc machines.
M0_TL_DESCR_DEFINE | ( | m0_reqh_svc | , |
"reqh service" | , | ||
M0_INTERNAL | , | ||
struct m0_reqh_service | , | ||
rs_linkage | , | ||
rs_magix | , | ||
M0_REQH_SVC_MAGIC | , | ||
M0_REQH_SVC_HEAD_MAGIC | |||
) |
Tlist descriptor for reqh services.
M0_TL_DESCR_DEFINE | ( | m0_reqh_rpc_mach | , |
"rpc machines" | , | ||
struct m0_rpc_machine | , | ||
rm_rh_linkage | , | ||
rm_magix | , | ||
M0_RPC_MACHINE_MAGIC | , | ||
M0_REQH_RPC_MACH_HEAD_MAGIC | |||
) |
Tlist descriptor for rpc machines.
|
static |
Sends read fop request.
Definition at line 369 of file reqh_fom_ut.c.
|
static |
|
static |
|
static |
|
static |
Definition at line 138 of file reqh_fom_ut.c.
|
static |
|
static |
Definition at line 144 of file reqh_fom_ut.c.
struct m0_stob_domain* reqh_ut_stob_domain_find | ( | void | ) |
|
static |
Definition at line 292 of file reqh_fom_ut.c.
|
static |
Definition at line 174 of file reqh_fom_ut.c.
void test_reqh | ( | void | ) |
Test function for reqh ut
Definition at line 409 of file reqh_fom_ut.c.
|
static |
Sends write fop request.
Definition at line 385 of file reqh_fom_ut.c.
|
static |
Definition at line 167 of file reqh_fom_ut.c.
|
static |
Definition at line 80 of file reqh_fom_ut.c.
M0_EXTERN struct m0_reqh_service_type m0_cas_service_type |
struct m0_reqh_service_type m0_ha_entrypoint_service_type |
Definition at line 135 of file entrypoint.c.
struct m0_reqh_service_type m0_ha_link_service_type |
Definition at line 263 of file link_service.c.
|
static |
Request handler state machine configuration.
|
static |
Request handler state machine description
struct m0_reqh_service_type m0_rpc_service_type |
struct reqh_ut_balloc rb |
Definition at line 159 of file reqh_fom_ut.c.
|
static |
Global reqh object
Definition at line 85 of file reqh_fom_ut.c.
struct m0_ut_suite reqh_ut |
Definition at line 472 of file reqh_fom_ut.c.
|
static |
Definition at line 151 of file reqh_fom_ut.c.
|
static |
Definition at line 79 of file reqh_fom_ut.c.
|
static |
|
static |
Definition at line 73 of file reqh_fom_ut.c.
|
static |
Definition at line 75 of file reqh_fom_ut.c.
|
static |
Definition at line 74 of file reqh_fom_ut.c.
|
static |
Definition at line 76 of file reqh_fom_ut.c.
|
static |
Definition at line 77 of file reqh_fom_ut.c.
|
static |
Definition at line 78 of file reqh_fom_ut.c.