Motr  M0
client.h
Go to the documentation of this file.
1 /* -*- C -*- */
2 /*
3  * Copyright (c) 2016-2020 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_DIX_CLIENT_H__
26 #define __MOTR_DIX_CLIENT_H__
27 
157 #include "lib/chan.h" /* m0_clink */
158 #include "sm/sm.h" /* m0_sm */
159 #include "dix/layout.h" /* m0_dix_ldesc */
160 #include "dix/meta.h" /* m0_dix_meta_req */
161 
162 /* Import */
163 struct m0_pools_common;
164 struct m0_layout_domain;
165 struct m0_rpc_session;
166 struct m0_be_tx_remid;
167 struct m0_dix_req;
168 struct m0_pool_version;
169 struct m0_fid;
170 struct m0_dtm0_service;
171 
180 };
181 
182 struct m0_dix_cli {
183  struct m0_sm dx_sm;
196 
202  void (*dx_sync_rec_update)(struct m0_dix_req *,
203  struct m0_rpc_session *,
204  struct m0_be_tx_remid *);
205 };
206 
223 M0_INTERNAL int m0_dix_cli_init(struct m0_dix_cli *cli,
224  struct m0_sm_group *sm_group,
225  struct m0_pools_common *pc,
226  struct m0_layout_domain *ldom,
227  const struct m0_fid *pver);
228 
230 M0_INTERNAL void m0_dix_cli_lock(struct m0_dix_cli *cli);
231 
233 M0_INTERNAL bool m0_dix_cli_is_locked(const struct m0_dix_cli *cli);
234 
236 M0_INTERNAL void m0_dix_cli_unlock(struct m0_dix_cli *cli);
237 
247 M0_INTERNAL void m0_dix_cli_start(struct m0_dix_cli *cli);
248 
254 M0_INTERNAL int m0_dix_cli_start_sync(struct m0_dix_cli *cli);
255 
267 M0_INTERNAL void m0_dix_cli_bootstrap(struct m0_dix_cli *cli);
268 
275 M0_INTERNAL void m0_dix_cli_bootstrap_lock(struct m0_dix_cli *cli);
276 
282 M0_INTERNAL void m0_dix_cli_stop(struct m0_dix_cli *cli);
283 
287 M0_INTERNAL void m0_dix_cli_stop_lock(struct m0_dix_cli *cli);
288 
294 M0_INTERNAL void m0_dix_cli_fini(struct m0_dix_cli *cli);
295 
299 M0_INTERNAL void m0_dix_cli_fini_lock(struct m0_dix_cli *cli);
300 
303 #endif /* __MOTR_DIX_CLIENT_H__ */
304 
305 /*
306  * Local variables:
307  * c-indentation-style: "K&R"
308  * c-basic-offset: 8
309  * tab-width: 8
310  * fill-column: 80
311  * scroll-step: 1
312  * End:
313  */
314 /*
315  * vim: tabstop=8 shiftwidth=8 noexpandtab textwidth=80 nowrap
316  */
M0_INTERNAL void m0_dix_cli_stop_lock(struct m0_dix_cli *cli)
Definition: client.c:261
struct m0_dix_meta_req dx_mreq
Definition: client.h:186
M0_INTERNAL bool m0_dix_cli_is_locked(const struct m0_dix_cli *cli)
Definition: client.c:105
Definition: sm.h:504
struct m0_pool_version * dx_pver
Definition: client.h:190
void(* dx_sync_rec_update)(struct m0_dix_req *, struct m0_rpc_session *, struct m0_be_tx_remid *)
Definition: client.h:202
struct m0_clink dx_clink
Definition: client.h:184
static struct m0_pools_common pc
Definition: iter_ut.c:59
struct m0_dtm0_service * dx_dtms
Definition: client.h:195
M0_INTERNAL void m0_dix_cli_unlock(struct m0_dix_cli *cli)
Definition: client.c:99
M0_INTERNAL void m0_dix_cli_fini(struct m0_dix_cli *cli)
Definition: client.c:268
M0_INTERNAL void m0_dix_cli_lock(struct m0_dix_cli *cli)
Definition: client.c:93
struct m0_dix_ldesc dx_ldescr
Definition: client.h:194
M0_INTERNAL int m0_dix_cli_start_sync(struct m0_dix_cli *cli)
Definition: client.c:221
struct m0_fid pver
Definition: idx_dix.c:74
struct m0_dix_ldesc dx_root
Definition: client.h:192
struct m0_sm dx_sm
Definition: client.h:183
M0_INTERNAL void m0_dix_cli_start(struct m0_dix_cli *cli)
Definition: client.c:214
struct m0_dix_ldesc dx_layout
Definition: client.h:193
struct m0_layout_domain * dx_ldom
Definition: client.h:188
M0_INTERNAL int m0_dix_cli_init(struct m0_dix_cli *cli, struct m0_sm_group *sm_group, struct m0_pools_common *pc, struct m0_layout_domain *ldom, const struct m0_fid *pver)
Definition: client.c:130
struct m0_pools_common * dx_pc
Definition: client.h:187
M0_INTERNAL void m0_dix_cli_bootstrap_lock(struct m0_dix_cli *cli)
Definition: client.c:245
struct m0_sm_ast dx_ast
Definition: client.h:191
m0_dix_cli_state
Definition: client.h:172
Definition: fid.h:38
Definition: sm.h:301
M0_INTERNAL void m0_dix_cli_bootstrap(struct m0_dix_cli *cli)
Definition: client.c:237
M0_INTERNAL void m0_dix_cli_fini_lock(struct m0_dix_cli *cli)
Definition: client.c:278
M0_INTERNAL void m0_dix_cli_stop(struct m0_dix_cli *cli)
Definition: client.c:253