Motr  M0
policy.h
Go to the documentation of this file.
1 /* -*- C -*- */
2 /*
3  * Copyright (c) 2017-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 #pragma once
23 #ifndef __MOTR_POOL_POLICY_H__
24 #define __MOTR_POOL_POLICY_H__
25 
26 #include "lib/tlist.h"
27 #include "xcode/xcode.h" /* M0_XCA_ENUM */
28 
35 struct m0_pool;
36 struct m0_pool_version;
37 struct m0_pools_common;
38 
43 } M0_XCA_ENUM;
44 
48  const struct m0_pver_policy_ops *pp_ops;
49 };
50 
54 };
55 
57  uint64_t ppt_magic;
58  const char *ppt_name;
62 };
63 
67  int (*ppo_init)(struct m0_pver_policy *pver_policy);
68 
70  void (*ppo_fini)(struct m0_pver_policy *pver_policy);
71 
78  const struct m0_pool *pool,
79  struct m0_pool_version **pver);
80 };
81 
85  struct m0_tl pp_types;
88 };
89 
90 M0_INTERNAL int m0_pver_policies_init(void);
91 M0_INTERNAL void m0_pver_policies_fini(void);
92 
94 M0_INTERNAL struct m0_pver_policy_type *
96 
98 M0_INTERNAL int m0_pver_policy_types_nr(void);
99 
101 M0_INTERNAL int m0_pver_policy_type_register(struct m0_pver_policy_type *type);
102 
104 M0_INTERNAL
106 
108 #endif /* __MOTR_POOL_POLICY_H__ */
109 
110 /*
111  * Local variables:
112  * c-indentation-style: "K&R"
113  * c-basic-offset: 8
114  * tab-width: 8
115  * fill-column: 80
116  * scroll-step: 1
117  * End:
118  */
M0_INTERNAL int m0_pver_policy_types_nr(void)
Definition: policy.c:147
const struct m0_pver_policy_ops * pp_ops
Definition: policy.h:48
void(* ppo_fini)(struct m0_pver_policy *pver_policy)
Definition: policy.h:70
int(* ppo_get)(struct m0_pools_common *pc, const struct m0_pool *pool, struct m0_pool_version **pver)
Definition: policy.h:77
enum m0_pver_policy_code ppt_code
Definition: policy.h:59
static struct m0_pools_common pc
Definition: iter_ut.c:59
struct m0_tlink ppt_link
Definition: policy.h:61
M0_INTERNAL struct m0_pver_policy_type * m0_pver_policy_type_find(enum m0_pver_policy_code code)
Definition: policy.c:141
int(* ppto_create)(struct m0_pver_policy **out)
Definition: policy.h:53
m0_pver_policy_code
Definition: policy.h:40
struct m0_fid pver
Definition: idx_dix.c:74
struct m0_tl pp_types
Definition: policy.h:85
enum m0_pver_policy_code M0_XCA_ENUM
Definition: tlist.h:251
M0_INTERNAL int m0_pver_policy_type_register(struct m0_pver_policy_type *type)
Definition: policy.c:153
const struct m0_pver_policy_type_ops * ppt_ops
Definition: policy.h:60
struct m0_pver_policy pp_cur_policy
Definition: policy.h:87
static struct m0_pool pool
Definition: iter_ut.c:58
int(* ppo_init)(struct m0_pver_policy *pver_policy)
Definition: policy.h:67
uint64_t ppt_magic
Definition: policy.h:57
M0_INTERNAL void m0_pver_policy_type_deregister(struct m0_pver_policy_type *type)
Definition: policy.c:160
const struct m0_pver_policy_type * pp_type
Definition: policy.h:47
Definition: pool.h:80
#define out(...)
Definition: gen.c:41
int type
Definition: dir.c:1031
M0_INTERNAL void m0_pver_policies_fini(void)
Definition: policy.c:180
const char * ppt_name
Definition: policy.h:58
M0_INTERNAL int m0_pver_policies_init(void)
Definition: policy.c:165