Motr  M0
pvers.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2016-2020 Seagate Technology LLC and/or its Affiliates
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  *
16  * For any questions about this software or licensing,
17  * please email opensource@seagate.com or cortx-questions@seagate.com.
18  *
19  */
20 
21 #pragma once
22 #ifndef __MOTR_CONF_PVERS_H__
23 #define __MOTR_CONF_PVERS_H__
24 
25 #include "conf/obj.h" /* m0_conf_pver_kind */
26 #include "conf/confc.h" /* m0_confc */
27 
114  M0_CPS_HEALTHY, /* Failures == 0 */
115  M0_CPS_DEGRADED, /* Failures < K */
116  M0_CPS_CRITICAL, /* Failures == K */
117  M0_CPS_DAMAGED, /* Failures > K */
119 };
120 
126  struct m0_fid cpi_fid;
127 
130 
133 };
134 
147 int m0_conf_pver_status(struct m0_fid *fid,
148  struct m0_confc *confc,
149  struct m0_conf_pver_info *out_info);
150 
157 M0_INTERNAL int m0_conf_pver_find(const struct m0_conf_pool *pool,
158  const struct m0_fid *pver_to_skip,
159  struct m0_conf_pver **out);
160 
170 M0_INTERNAL int m0_conf_pver_find_by_fid(const struct m0_fid *fid,
171  const struct m0_conf_root *root,
172  struct m0_conf_pver **out);
173 
175 M0_INTERNAL int m0_conf_pver_formulaic_find(uint32_t fpver_id,
176  const struct m0_conf_root *root,
177  const struct m0_conf_pver **out);
178 
180 M0_INTERNAL int
182  const struct m0_conf_root *root,
183  const struct m0_conf_pver **out);
184 
191 M0_INTERNAL bool m0_conf_pver_is_clean(const struct m0_conf_pver *pver);
192 
202 M0_INTERNAL struct m0_fid m0_conf_pver_fid(enum m0_conf_pver_kind kind,
203  uint64_t container, uint64_t key);
204 
214 M0_INTERNAL int m0_conf_pver_fid_read(const struct m0_fid *fid,
215  enum m0_conf_pver_kind *kind,
216  uint64_t *container, uint64_t *key);
217 
225 M0_INTERNAL unsigned m0_conf_pver_level(const struct m0_conf_obj *obj);
226 
228 #endif /* __MOTR_CONF_PVERS_H__ */
M0_INTERNAL bool m0_conf_pver_is_clean(const struct m0_conf_pver *pver)
Definition: pvers.c:281
struct m0_container container
M0_INTERNAL unsigned m0_conf_pver_level(const struct m0_conf_obj *obj)
Definition: pvers.c:394
m0_conf_pver_kind
Definition: obj.h:516
static struct foo * obj
Definition: tlist.c:302
enum m0_conf_pver_state cpi_state
Definition: pvers.h:132
struct m0_fid fid
Definition: di.c:46
struct m0_pdclust_attr cpi_attr
Definition: pvers.h:129
m0_conf_pver_state
Definition: pvers.h:113
struct m0_conf_root * root
Definition: note.c:50
M0_INTERNAL int m0_conf_pver_formulaic_find(uint32_t fpver_id, const struct m0_conf_root *root, const struct m0_conf_pver **out)
Definition: pvers.c:231
static struct m0_confc * confc
Definition: file.c:94
struct m0_fid pver
Definition: idx_dix.c:74
M0_INTERNAL struct m0_fid m0_conf_pver_fid(enum m0_conf_pver_kind kind, uint64_t container, uint64_t key)
Definition: pvers.c:309
M0_INTERNAL int m0_conf_pver_fid_read(const struct m0_fid *fid, enum m0_conf_pver_kind *kind, uint64_t *container, uint64_t *key)
Definition: pvers.c:352
int m0_conf_pver_status(struct m0_fid *fid, struct m0_confc *confc, struct m0_conf_pver_info *out_info)
Definition: pvers.c:837
struct m0_fid cpi_fid
Definition: pvers.h:126
static struct m0_pool pool
Definition: iter_ut.c:58
Definition: fid.h:38
M0_INTERNAL int m0_conf_pver_find_by_fid(const struct m0_fid *fid, const struct m0_conf_root *root, struct m0_conf_pver **out)
Definition: pvers.c:219
#define out(...)
Definition: gen.c:41
M0_INTERNAL int m0_conf_pver_find(const struct m0_conf_pool *pool, const struct m0_fid *pver_to_skip, struct m0_conf_pver **out)
Definition: pvers.c:207
M0_INTERNAL int m0_conf_pver_formulaic_from_virtual(const struct m0_conf_pver *virtual, const struct m0_conf_root *root, const struct m0_conf_pver **out)
Definition: pvers.c:244
Definition: idx_mock.c:47