Motr  M0
service.h
Go to the documentation of this file.
1 /* -*- C -*- */
2 /*
3  * Copyright (c) 2021 Seagate Technology LLC and/or its Affiliates
4  *
5  * Licensed under the Apache License, Version 2.0 (the "License");
6  * you may not use this file except in compliance with the License.
7  * You may obtain a copy of the License at
8  *
9  * http://www.apache.org/licenses/LICENSE-2.0
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  *
17  * For any questions about this software or licensing,
18  * please email opensource@seagate.com or cortx-questions@seagate.com.
19  *
20  */
21 
22 
23 #pragma once
24 
25 #ifndef __MOTR_DTM0_SERVICE_H__
26 #define __MOTR_DTM0_SERVICE_H__
27 
28 #include "reqh/reqh_service.h"
29 #include "dtm0/clk_src.h"
30 
31 struct m0_be_dtm0_log;
32 struct dtm0_req_fop;
33 struct m0_be_queue;
34 
39 };
40 
48  uint64_t dos_magix;
51  /*
52  * A queue for DTM_TEST message for drlink UTs.
53  * The UTs are fully responsible for the queue init/fini/get.
54  * DTM_TEST fom puts dtm0_req_fop::dtr_txr::dtd_id::dti_fid to the
55  * queue.
56  */
58 };
59 
61 
62 M0_INTERNAL int m0_dtm0_stype_init(void);
63 M0_INTERNAL void m0_dtm0_stype_fini(void);
64 
65 M0_INTERNAL int
66 m0_dtm_client_service_start(struct m0_reqh *reqh, struct m0_fid *cli_srv_fid,
67  struct m0_reqh_service **out);
68 M0_INTERNAL void m0_dtm_client_service_stop(struct m0_reqh_service *svc);
69 
70 M0_INTERNAL int m0_dtm0_service_process_connect(struct m0_reqh_service *s,
71  struct m0_fid *remote_srv,
72  const char *remote_ep,
73  bool async);
74 M0_INTERNAL int
76  struct m0_fid *remote_srv);
77 
78 M0_INTERNAL struct m0_rpc_session *
80  const struct m0_fid *remote_srv);
81 
82 M0_INTERNAL bool m0_dtm0_is_a_volatile_dtm(struct m0_reqh_service *service);
83 M0_INTERNAL bool m0_dtm0_is_a_persistent_dtm(struct m0_reqh_service *service);
84 
85 M0_INTERNAL struct m0_dtm0_service *
86 m0_dtm0_service_find(const struct m0_reqh *reqh);
87 
89 M0_INTERNAL struct m0_dtm0_service *m0_dtm0_fom2service(struct m0_fom *fom);
90 
91 M0_INTERNAL bool m0_dtm0_in_ut(void);
92 
93 #endif /* __MOTR_DTM0_SERVICE_H__ */
94 
95 /*
96  * Local variables:
97  * c-indentation-style: "K&R"
98  * c-basic-offset: 8
99  * tab-width: 8
100  * fill-column: 80
101  * scroll-step: 1
102  * End:
103  */
104 /*
105  * vim: tabstop=8 shiftwidth=8 noexpandtab textwidth=80 nowrap
106  */
M0_INTERNAL struct m0_dtm0_service * m0_dtm0_service_find(const struct m0_reqh *reqh)
Definition: service.c:406
uint64_t dos_magix
Definition: service.h:48
struct m0_be_queue * dos_ut_queue
Definition: service.h:57
M0_INTERNAL struct m0_rpc_session * m0_dtm0_service_process_session_get(struct m0_reqh_service *s, const struct m0_fid *remote_srv)
Definition: service.c:222
M0_INTERNAL bool m0_dtm0_is_a_persistent_dtm(struct m0_reqh_service *service)
Definition: service.c:399
M0_INTERNAL bool m0_dtm0_in_ut(void)
Definition: service.c:415
struct m0_be_dtm0_log * dos_log
Definition: service.h:50
enum m0_dtm0_service_origin dos_origin
Definition: service.h:47
M0_INTERNAL int m0_dtm0_service_process_connect(struct m0_reqh_service *s, struct m0_fid *remote_srv, const char *remote_ep, bool async)
Definition: service.c:158
m0_dtm0_service_origin
Definition: service.h:35
Definition: tlist.h:251
M0_INTERNAL int m0_dtm0_stype_init(void)
Definition: service.c:374
struct m0_dtm0_clk_src dos_clk_src
Definition: service.h:49
Definition: reqh.h:94
Definition: dump.c:103
M0_INTERNAL struct m0_dtm0_service * m0_dtm0_fom2service(struct m0_fom *fom)
Definition: service.c:88
struct m0_reqh_service_type dtm0_service_type
Definition: service.c:60
Definition: fom.h:481
struct m0_reqh reqh
Definition: rm_foms.c:48
M0_INTERNAL bool m0_dtm0_is_a_volatile_dtm(struct m0_reqh_service *service)
Definition: service.c:393
Definition: fid.h:38
struct m0_tl dos_processes
Definition: service.h:46
static struct m0_net_test_service svc
Definition: service.c:34
#define out(...)
Definition: gen.c:41
static struct m0_addb2_source * s
Definition: consumer.c:39
static struct m0_reqh_service * service[REQH_IN_UT_MAX]
Definition: long_lock_ut.c:46
struct m0_reqh_service dos_generic
Definition: service.h:45
M0_INTERNAL void m0_dtm_client_service_stop(struct m0_reqh_service *svc)
Definition: service.c:139
M0_INTERNAL void m0_dtm0_stype_fini(void)
Definition: service.c:385
M0_INTERNAL int m0_dtm_client_service_start(struct m0_reqh *reqh, struct m0_fid *cli_srv_fid, struct m0_reqh_service **out)
Definition: service.c:113
M0_INTERNAL int m0_dtm0_service_process_disconnect(struct m0_reqh_service *s, struct m0_fid *remote_srv)
Definition: service.c:209