Motr  M0
sw.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 #pragma once
24 
25 #ifndef __MOTR_CM_SW_H__
26 #define __MOTR_CM_SW_H__
27 
28 #include "lib/types.h"
29 
30 #include "cm/ag.h"
31 #include "cm/ag_xc.h"
32 #include "xcode/xcode_attr.h"
33 #include "fop/fop.h"
34 
42 struct m0_rpc_conn;
43 struct m0_cm_type;
44 
45 struct m0_cm_sw {
48 } M0_XCA_RECORD M0_XCA_DOMAIN(rpc);
49 
52  uint32_t ep_size;
53  char *ep;
54 } M0_XCA_SEQUENCE M0_XCA_DOMAIN(rpc);
55 
63 
64  uint64_t swo_sender_id;
65 
68 
71 
74 
75  uint32_t swo_cm_status;
76 } M0_XCA_RECORD M0_XCA_DOMAIN(rpc);
77 
79  int swr_rc;
80 } M0_XCA_RECORD M0_XCA_DOMAIN(rpc);
81 
83  struct m0_fom swu_fom;
84  struct m0_cm_sw swu_sw;
86 };
87 
88 M0_INTERNAL int m0_cm_sw_onwire_init(struct m0_cm *cm, struct m0_cm_sw_onwire *sw_onwire,
89  uint64_t proxy_id, const char *ep,
90  const struct m0_cm_sw *sw,
91  const struct m0_cm_sw *out_interval);
92 
93 M0_INTERNAL void m0_cm_sw_set(struct m0_cm_sw *dst,
94  const struct m0_cm_ag_id *lo,
95  const struct m0_cm_ag_id *hi);
96 
97 M0_INTERNAL void m0_cm_sw_copy(struct m0_cm_sw *dst,
98  const struct m0_cm_sw *src);
99 
100 M0_INTERNAL bool m0_cm_sw_is_set(const struct m0_cm_sw *sw);
101 M0_INTERNAL bool m0_cm_sw_cmp(const struct m0_cm_sw *sw0,
102  const struct m0_cm_sw *sw1);
109 M0_INTERNAL int m0_cm_sw_local_update(struct m0_cm *cm);
110 
117 M0_INTERNAL int m0_cm_sw_remote_update(struct m0_cm *cm);
118 
119 M0_INTERNAL void m0_cm_sw_update_init(struct m0_cm_type *cmtype);
120 
125 M0_INTERNAL void m0_cm_sw_update_start(struct m0_cm *cm);
126 M0_INTERNAL void m0_cm_sw_update_complete(struct m0_cm *cm);
127 
128 M0_INTERNAL void m0_cm_sw_update_fom_wakeup(struct m0_cm_sw_update *swu);
129 
132 #endif /* __MOTR_CM_SW_H__ */
133 /*
134  * Local variables:
135  * c-indentation-style: "K&R"
136  * c-basic-offset: 8
137  * tab-width: 8
138  * fill-column: 80
139  * scroll-step: 1
140  * End:
141  */
Definition: sw.h:45
static struct m0_bufvec dst
Definition: xform.c:61
struct m0_cm_sw swo_in_interval
Definition: sw.h:70
m0_time_t swo_cm_epoch
Definition: sw.h:62
struct m0_cm_ag_id sw_hi
Definition: sw.h:47
uint64_t m0_time_t
Definition: time.h:37
M0_INTERNAL void m0_cm_sw_update_complete(struct m0_cm *cm)
struct m0_cm_local_ep swo_cm_ep
Definition: sw.h:67
M0_INTERNAL void m0_cm_sw_update_start(struct m0_cm *cm)
static struct m0_cm * cm
Definition: cm.c:63
Definition: sock.c:754
struct m0_cm_sw_update M0_XCA_DOMAIN
M0_INTERNAL void m0_cm_sw_set(struct m0_cm_sw *dst, const struct m0_cm_ag_id *lo, const struct m0_cm_ag_id *hi)
Definition: sw.c:57
uint32_t ep_size
Definition: sw.h:52
M0_INTERNAL void m0_cm_sw_copy(struct m0_cm_sw *dst, const struct m0_cm_sw *src)
Definition: sw.c:67
M0_INTERNAL bool m0_cm_sw_is_set(const struct m0_cm_sw *sw)
Definition: sw.c:45
char * ep
Definition: sw.h:53
M0_INTERNAL int m0_cm_sw_onwire_init(struct m0_cm *cm, struct m0_cm_sw_onwire *sw_onwire, uint64_t proxy_id, const char *ep, const struct m0_cm_sw *sw, const struct m0_cm_sw *out_interval)
Definition: sw.c:76
struct m0_cm_ag_id sw_lo
Definition: sw.h:46
struct m0_cm_sw swo_out_interval
Definition: sw.h:73
bool swu_is_complete
Definition: sw.h:85
struct m0_fom swu_fom
Definition: sw.h:83
Definition: fom.h:481
Definition: cm.h:143
M0_INTERNAL void m0_cm_sw_update_fom_wakeup(struct m0_cm_sw_update *swu)
M0_INTERNAL int m0_cm_sw_remote_update(struct m0_cm *cm)
Definition: sw.c:130
Definition: cm.h:166
M0_INTERNAL void m0_cm_sw_update_init(struct m0_cm_type *cmtype)
struct m0_cm_sw swu_sw
Definition: sw.h:84
uint32_t swo_cm_status
Definition: sw.h:75
uint64_t swo_sender_id
Definition: sw.h:64
M0_INTERNAL bool m0_cm_sw_cmp(const struct m0_cm_sw *sw0, const struct m0_cm_sw *sw1)
Definition: sw.c:51
struct m0_pdclust_src_addr src
Definition: fd.c:108
static void hi(void)
Definition: nucleus.c:93
Definition: ag.h:49
M0_INTERNAL int m0_cm_sw_local_update(struct m0_cm *cm)
Definition: sw.c:117