Motr  M0
rconfc_internal.h
Go to the documentation of this file.
1 /* -*- C -*- */
2 /*
3  * Copyright (c) 2015-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_CONF_RCONFC_INTERNAL_H__
26 #define __MOTR_CONF_RCONFC_INTERNAL_H__
27 
28 #include "fid/fid.h" /* m0_fid */
29 #include "fop/fom.h" /* m0_fom */
30 #include "rm/rm_rwlock.h" /* m0_rm_rw_lock */
31 
43 };
44 
45 /* -------------- Read lock context ----------------- */
46 struct m0_rconfc;
47 
48 struct rlock_ctx {
53  char *rlc_rm_addr;
54  struct m0_fid rlc_rm_fid;
55  bool rlc_online;
65 };
66 
67 /* -------------- Quorum calculation context ----------------- */
68 
69 /*
70  * Version Item. Keeps version number along with counter.
71  */
72 struct ver_item {
73  uint64_t vi_ver;
74  uint32_t vi_count;
75 };
76 
77 enum {
79 };
80 
81 /*
82  * Version Accumulator. Keeps already found version items along with counter and
83  * total confd count.
84  */
85 struct ver_accm {
87  int va_count;
88  int va_total;
89 };
90 
91 /* -------------- Rconfc internals ----------------- */
92 
97 struct rconfc_link {
98  struct m0_confc rl_confc;
99  struct m0_rconfc *rl_rconfc;
102  struct m0_tlink rl_herd;
104  uint64_t rl_magic;
108  int rl_rc;
109  int rl_state;
110  bool rl_preserve;
111  struct m0_fom rl_fom;
114  /* XXX: intended for UT only */
115  void (*rl_on_state_cb)(struct rconfc_link *lnk);
118 };
119 
120 M0_INTERNAL void rconfc_herd_link_cleanup(struct rconfc_link *lnk);
121 /*
122  * made accessible for UT suites
123  */
124 M0_INTERNAL struct rconfc_link *rconfc_herd_find(struct m0_rconfc *rconfc,
125  const char *addr);
126 
131 #endif /* __MOTR_CONF_RCONFC_INTERNAL_H__ */
132 
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  */
struct m0_fid rlc_rm_fid
m0_time_t rlc_timeout
M0_INTERNAL void rconfc_herd_link_cleanup(struct rconfc_link *lnk)
Definition: rconfc.c:1572
uint64_t m0_time_t
Definition: time.h:37
struct m0_fid rlc_owner_fid
struct ver_item va_items[VERSION_ITEMS_TOTAL_MAX]
Definition: sm.h:504
struct m0_rm_owner rlc_owner
struct m0_rw_lockable rlc_rwlock
struct m0_rconfc * rlc_parent
struct m0_rm_remote rlc_creditor
confc_state
struct m0_rpc_machine * rlc_rmach
uint32_t vi_count
uint64_t vi_ver
struct m0_rm_resource_type rlc_rt
struct m0_rm_incoming rlc_req
char * rlc_rm_addr
struct m0_rm_domain rlc_dom
Definition: xcode.h:73
Definition: fom.h:481
struct m0_rpc_conn rlc_conn
Definition: fid.h:38
struct m0_clink rlc_clink
static struct m0_rconfc * rconfc(struct m0_client *m0c)
Definition: client_init.c:310
struct m0_rpc_session rlc_sess
M0_INTERNAL struct rconfc_link * rconfc_herd_find(struct m0_rconfc *rconfc, const char *addr)
Definition: rconfc.c:1603