Motr  M0
remote.h
Go to the documentation of this file.
1 /* -*- C -*- */
2 /*
3  * Copyright (c) 2013-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 
24 #pragma once
25 
26 #ifndef __MOTR_DTM_REMOTE_H__
27 #define __MOTR_DTM_REMOTE_H__
28 
29 
36 #include "lib/types.h" /* m0_uint128 */
37 #include "xcode/xcode_attr.h"
38 #include "dtm/update.h" /* m0_dtm_history_id */
39 #include "dtm/update_xc.h" /* m0_dtm_history_id_xc */
40 
41 /* import */
42 #include "dtm/fol.h"
43 struct m0_dtm_oper;
44 struct m0_dtm_update;
45 struct m0_rpc_conn;
46 struct m0_dtm_remote;
47 struct m0_reqh;
48 
49 /* export */
50 struct m0_dtm_remote;
51 struct m0_dtm_rpc_remote;
52 struct m0_dtm_remote_ops;
53 
54 struct m0_dtm_remote {
55  struct m0_uint128 re_id;
56  uint64_t re_instance;
57  const struct m0_dtm_remote_ops *re_ops;
59 };
60 
62  void (*reo_persistent)(struct m0_dtm_remote *rem,
63  struct m0_dtm_history *history);
64  void (*reo_fixed)(struct m0_dtm_remote *rem,
65  struct m0_dtm_history *history);
66  void (*reo_reset)(struct m0_dtm_remote *rem,
67  struct m0_dtm_history *history);
68  void (*reo_undo)(struct m0_dtm_remote *rem,
69  struct m0_dtm_history *history, m0_dtm_ver_t upto);
70  void (*reo_send)(struct m0_dtm_remote *rem,
71  struct m0_dtm_update *update);
72  void (*reo_resend)(struct m0_dtm_remote *rem,
73  struct m0_dtm_update *update);
74 };
75 
76 M0_INTERNAL void m0_dtm_remote_init(struct m0_dtm_remote *remote,
77  struct m0_uint128 *id,
78  struct m0_dtm *local);
79 M0_INTERNAL void m0_dtm_remote_fini(struct m0_dtm_remote *remote);
80 
81 M0_INTERNAL void m0_dtm_remote_add(struct m0_dtm_remote *rem,
82  struct m0_dtm_oper *oper,
83  struct m0_dtm_history *history,
84  struct m0_dtm_update *update);
85 
89 };
90 
91 M0_INTERNAL void m0_dtm_rpc_remote_init(struct m0_dtm_rpc_remote *remote,
92  struct m0_uint128 *id,
93  struct m0_dtm *local,
94  struct m0_rpc_conn *conn);
95 M0_INTERNAL void m0_dtm_rpc_remote_fini(struct m0_dtm_rpc_remote *remote);
96 
97 struct m0_dtm_notice {
99  uint64_t dno_ver;
100  uint8_t dno_opcode;
101 } M0_XCA_RECORD M0_XCA_DOMAIN(rpc);
102 
105  struct m0_reqh *lre_reqh;
106 };
107 
108 M0_INTERNAL void m0_dtm_local_remote_init(struct m0_dtm_local_remote *lre,
109  struct m0_uint128 *id,
110  struct m0_dtm *local,
111  struct m0_reqh *reqh);
112 M0_INTERNAL void m0_dtm_local_remote_fini(struct m0_dtm_local_remote *remote);
113 
116 #endif /* __MOTR_DTM_REMOTE_H__ */
117 
118 
119 /*
120  * Local variables:
121  * c-indentation-style: "K&R"
122  * c-basic-offset: 8
123  * tab-width: 8
124  * fill-column: 80
125  * scroll-step: 1
126  * End:
127  */
128 /*
129  * vim: tabstop=8 shiftwidth=8 noexpandtab textwidth=80 nowrap
130  */
uint8_t dno_opcode
Definition: remote.h:100
static struct m0_dtm_local_remote local
Definition: transmit.c:71
struct m0_dtm_fol_remote re_fol
Definition: remote.h:58
void(* reo_send)(struct m0_dtm_remote *rem, struct m0_dtm_update *update)
Definition: remote.h:70
void(* reo_persistent)(struct m0_dtm_remote *rem, struct m0_dtm_history *history)
Definition: remote.h:62
void(* reo_resend)(struct m0_dtm_remote *rem, struct m0_dtm_update *update)
Definition: remote.h:72
struct m0_dtm_remote rpr_rem
Definition: remote.h:87
M0_INTERNAL void m0_dtm_rpc_remote_fini(struct m0_dtm_rpc_remote *remote)
Definition: remote.c:97
M0_INTERNAL void m0_dtm_remote_add(struct m0_dtm_remote *rem, struct m0_dtm_oper *oper, struct m0_dtm_history *history, struct m0_dtm_update *update)
Definition: remote.c:65
struct m0_rpc_conn * rpr_conn
Definition: remote.h:88
struct m0_dtm_history_id dno_id
Definition: remote.h:98
struct m0_reqh * lre_reqh
Definition: remote.h:105
uint64_t dno_ver
Definition: remote.h:99
uint64_t m0_dtm_ver_t
Definition: nucleus.h:48
void(* reo_fixed)(struct m0_dtm_remote *rem, struct m0_dtm_history *history)
Definition: remote.h:64
Definition: reqh.h:94
struct m0_rpc_conn conn
Definition: fsync.c:96
void(* reo_undo)(struct m0_dtm_remote *rem, struct m0_dtm_history *history, m0_dtm_ver_t upto)
Definition: remote.h:68
struct m0_dtm_local_remote M0_XCA_DOMAIN
struct m0_uint128 re_id
Definition: remote.h:55
M0_INTERNAL void m0_dtm_rpc_remote_init(struct m0_dtm_rpc_remote *remote, struct m0_uint128 *id, struct m0_dtm *local, struct m0_rpc_conn *conn)
Definition: remote.c:87
struct m0_reqh reqh
Definition: rm_foms.c:48
static struct m0_rm_remote * remote
Definition: rm_fops.c:35
void(* reo_reset)(struct m0_dtm_remote *rem, struct m0_dtm_history *history)
Definition: remote.h:66
uint64_t re_instance
Definition: remote.h:56
const struct m0_dtm_remote_ops * re_ops
Definition: remote.h:57
M0_INTERNAL void m0_dtm_remote_init(struct m0_dtm_remote *remote, struct m0_uint128 *id, struct m0_dtm *local)
Definition: remote.c:73
M0_INTERNAL void m0_dtm_local_remote_fini(struct m0_dtm_local_remote *lre)
Definition: remote.c:276
Definition: dtm.h:529
M0_INTERNAL void m0_dtm_local_remote_init(struct m0_dtm_local_remote *lre, struct m0_uint128 *id, struct m0_dtm *local, struct m0_reqh *reqh)
Definition: remote.c:266
struct m0_dtm_remote lre_rem
Definition: remote.h:104
M0_INTERNAL void m0_dtm_remote_fini(struct m0_dtm_remote *remote)
Definition: remote.c:82