Motr  M0
layout_internal.h
Go to the documentation of this file.
1 /* -*- C -*- */
2 /*
3  * Copyright (c) 2012-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_LAYOUT_LAYOUT_INTERNAL_H__
26 #define __MOTR_LAYOUT_LAYOUT_INTERNAL_H__
27 
33 /* import */
34 struct m0_layout_domain;
35 struct m0_layout;
36 struct m0_layout_ops;
37 struct m0_layout_type;
38 struct m0_layout_enum;
39 struct m0_layout_enum_ops;
40 struct m0_layout_enum_type;
41 struct m0_striped_layout;
42 struct m0_layout_instance;
44 struct m0_fid;
45 
46 enum {
48  LID_NONE = 0,
49 
52 
59 
60  /*
61  * Simulation for m0_table_init() facing error in
62  * m0_layout_domain_init().
63  */
65 
66  /*
67  * Simulation for lto_register() facing error in
68  * m0_layout_type_register().
69  */
70  LTO_REG_ERR = -502,
71 
72  /*
73  * Simulation for leto_register() facing error in
74  * m0_layout_enum_type_register().
75  */
76  LETO_REG_ERR = -503,
77 
78  /*
79  * Simulation for lo_decode() facing error in
80  * m0_layout_decode().
81  */
82  LO_DECODE_ERR = -504,
83 
84  /*
85  * Simulation for lo_encode() facing error in
86  * m0_layout_encode().
87  */
88  LO_ENCODE_ERR = -505,
89 
90  /*
91  * Simulation for m0_table_update() facing error in
92  * m0_layout_update().
93  */
95 };
96 
97 M0_INTERNAL bool m0_layout__domain_invariant(const struct m0_layout_domain
98  *dom);
99 M0_INTERNAL bool m0_layout__allocated_invariant(const struct m0_layout *l);
100 M0_INTERNAL bool m0_layout__invariant(const struct m0_layout *l);
101 M0_INTERNAL bool m0_layout__enum_invariant(const struct m0_layout_enum *le);
102 M0_INTERNAL bool m0_layout__striped_allocated_invariant(const struct
104 M0_INTERNAL bool m0_layout__striped_invariant(const struct m0_striped_layout
105  *stl);
106 
107 M0_INTERNAL struct m0_layout *m0_layout__list_lookup(const struct
109  uint64_t lid,
110  bool ref_increment);
111 
112 M0_INTERNAL void m0_layout__init(struct m0_layout *l,
113  struct m0_layout_domain *dom,
114  uint64_t lid,
115  struct m0_layout_type *type,
116  const struct m0_layout_ops *ops);
117 M0_INTERNAL void m0_layout__fini(struct m0_layout *l);
118 M0_INTERNAL void m0_layout__populate(struct m0_layout *l, uint32_t user_count);
119 M0_INTERNAL void m0_layout__delete(struct m0_layout *l);
120 
121 M0_INTERNAL void m0_layout__striped_init(struct m0_striped_layout *stl,
122  struct m0_layout_domain *dom,
123  uint64_t lid,
124  struct m0_layout_type *type,
125  const struct m0_layout_ops *ops);
126 M0_INTERNAL void m0_layout__striped_fini(struct m0_striped_layout *stl);
127 M0_INTERNAL void m0_layout__striped_populate(struct m0_striped_layout *str_l,
128  struct m0_layout_enum *e,
129  uint32_t user_count);
130 M0_INTERNAL void m0_layout__striped_delete(struct m0_striped_layout *stl);
131 
132 M0_INTERNAL void m0_layout__enum_init(struct m0_layout_domain *dom,
133  struct m0_layout_enum *le,
134  struct m0_layout_enum_type *et,
135  const struct m0_layout_enum_ops *ops);
136 M0_INTERNAL void m0_layout__enum_fini(struct m0_layout_enum *le);
137 
138 M0_INTERNAL void m0_layout__log(const char *fn_name,
139  const char *err_msg,
140  uint64_t lid,
141  int rc);
142 
144  *dom);
145 
146 M0_INTERNAL void m0_layout__instance_init(struct m0_layout_instance *li,
147  const struct m0_fid *gfid,
148  struct m0_layout *l,
149  const struct m0_layout_instance_ops
150  *ops);
151 M0_INTERNAL void m0_layout__instance_fini(struct m0_layout_instance *li);
152 M0_INTERNAL bool m0_layout__instance_invariant(const struct m0_layout_instance
153  *li);
154 
157 /* __MOTR_LAYOUT_LAYOUT_INTERNAL_H__ */
158 #endif
159 
160 /*
161  * Local variables:
162  * c-indentation-style: "K&R"
163  * c-basic-offset: 8
164  * tab-width: 8
165  * fill-column: 80
166  * scroll-step: 1
167  * End:
168  */
M0_INTERNAL void m0_layout__striped_init(struct m0_striped_layout *stl, struct m0_layout_domain *dom, uint64_t lid, struct m0_layout_type *type, const struct m0_layout_ops *ops)
Definition: layout.c:400
M0_INTERNAL bool m0_layout__instance_invariant(const struct m0_layout_instance *li)
Definition: layout.c:198
uint64_t m0_bcount_t
Definition: types.h:77
M0_INTERNAL bool m0_layout__striped_allocated_invariant(const struct m0_striped_layout *stl)
Definition: layout.c:181
M0_INTERNAL bool m0_layout__enum_invariant(const struct m0_layout_enum *e)
Definition: layout.c:170
M0_INTERNAL void m0_layout__fini(struct m0_layout *l)
Definition: layout.c:388
M0_INTERNAL void m0_layout__enum_fini(struct m0_layout_enum *le)
Definition: layout.c:507
M0_INTERNAL void m0_layout__striped_delete(struct m0_striped_layout *stl)
Definition: layout.c:452
M0_INTERNAL m0_bcount_t m0_layout__enum_max_recsize(struct m0_layout_domain *dom)
Definition: layout.c:527
M0_INTERNAL void m0_layout__enum_init(struct m0_layout_domain *dom, struct m0_layout_enum *le, struct m0_layout_enum_type *let, const struct m0_layout_enum_ops *ops)
Definition: layout.c:480
static struct m0_stob_domain * dom
Definition: storage.c:38
M0_INTERNAL void m0_layout__instance_init(struct m0_layout_instance *li, const struct m0_fid *gfid, struct m0_layout *l, const struct m0_layout_instance_ops *ops)
Definition: layout.c:1089
M0_INTERNAL void m0_layout__striped_fini(struct m0_striped_layout *str_l)
Definition: layout.c:466
M0_INTERNAL bool m0_layout__domain_invariant(const struct m0_layout_domain *dom)
Definition: layout.c:131
M0_INTERNAL bool m0_layout__striped_invariant(const struct m0_striped_layout *stl)
Definition: layout.c:189
M0_INTERNAL void m0_layout__log(const char *fn_name, const char *err_msg, uint64_t lid, int rc)
Definition: layout.c:586
M0_INTERNAL void m0_layout__instance_fini(struct m0_layout_instance *li)
Definition: layout.c:1106
static struct m0_clink l[NR]
Definition: chan.c:37
M0_INTERNAL void m0_layout__striped_populate(struct m0_striped_layout *str_l, struct m0_layout_enum *e, uint32_t user_count)
Definition: layout.c:427
M0_INTERNAL bool m0_layout__allocated_invariant(const struct m0_layout *l)
Definition: layout.c:147
Definition: fid.h:38
M0_INTERNAL void m0_layout__delete(struct m0_layout *l)
Definition: layout.c:376
M0_INTERNAL bool m0_layout__invariant(const struct m0_layout *l)
Definition: layout.c:155
M0_INTERNAL void m0_layout__init(struct m0_layout *l, struct m0_layout_domain *dom, uint64_t lid, struct m0_layout_type *lt, const struct m0_layout_ops *ops)
Definition: layout.c:321
int type
Definition: dir.c:1031
struct m0_fid gfid
Definition: dir.c:626
struct m0_fom_ops ops
Definition: io_foms.c:623
static struct m0_addb2_source * s
Definition: consumer.c:39
M0_INTERNAL void m0_layout__populate(struct m0_layout *l, uint32_t user_count)
Definition: layout.c:355
M0_INTERNAL struct m0_layout * m0_layout__list_lookup(const struct m0_layout_domain *dom, uint64_t lid, bool ref_increment)
Definition: layout.c:282
int32_t rc
Definition: trigger_fop.h:47