Motr  M0
layout.h
Go to the documentation of this file.
1 /* -*- C -*- */
2 /*
3  * Copyright (c) 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_H__
26 #define __MOTR_LAYOUT_H__
27 
28 #include "client.h"
29 #include "client_internal.h"
30 #include "lib/types.h"
31 
100 struct m0_client_layout;
101 struct m0_op_layout;
102 
107 #define M0_OBJ_LAYOUT_ID(lid) (lid & 0x0000ffffffffffff)
108 #define M0_OBJ_LAYOUT_TYPE(lid) ((lid & 0xffff000000000000) >> 48UL)
109 #define M0_OBJ_LAYOUT_MAKE_LID(lid, type) \
110  ((uint64_t)lid | ((uint64_t)type << 48UL))
111 
112 extern const struct m0_op_layout_ops m0_op_layout_composite_ops;
113 extern const struct m0_client_layout_ops layout_composite_ops;
114 extern struct m0_fid composite_extent_rd_idx_fid;
115 extern struct m0_fid composite_extent_wr_idx_fid;
116 
120  struct m0_fid cl_pver;
121  uint64_t cl_lid;
122 };
123 
126  struct m0_fid pl_pver;
127  uint64_t pl_lid;
128  struct m0_fid pl_fid;
129 };
130 
135 
137  uint64_t ce_tlink_magic;
138 };
139 
142  uint64_t ccr_lid;
143 
147 
150  uint64_t ccr_tlink_magic;
151 };
152 
158  uint64_t ccl_nr_layers;
161 };
162 
167  int (*olo_launch) (struct m0_op_layout *ol);
169  int (*olo_copy_to_app)(struct m0_client_layout *to, void *data);
171  int (*olo_copy_from_app)(struct m0_client_layout *from, void *data);
172 };
173 
174 struct m0_op_layout {
176  uint64_t ol_magic;
177 
179  struct m0_ast_rc ol_ar;
180 
184 
185  const struct m0_op_layout_ops *ol_ops;
186 };
187 
188 extern const struct m0_bob_type ol_bobtype;
189 
192  uint64_t oci_magic;
193 
195  struct m0_op **oci_sub_ops;
196 
198 };
199 
200 M0_INTERNAL int m0_layout_op_launch(struct m0_op_layout *ol);
201 
202 M0_INTERNAL int m0_client__layout_get(struct m0_client_layout *layout);
203 M0_INTERNAL void m0_client__layout_put(struct m0_client_layout *layout);
204 
205 M0_INTERNAL int m0__composite_container_init(struct m0_client *cinst);
206 
207 M0_INTERNAL int m0__obj_layout_send(struct m0_obj *obj,
208  struct m0_op_layout *ol);
209 
210 M0_INTERNAL int m0__dix_layout_get_sync(struct m0_obj *obj,
211  struct m0_dix_layout *dlayout);
212 M0_INTERNAL struct m0_dix_cli *ent_dixc(const struct m0_entity *ent);
213 M0_INTERNAL struct m0_dix_cli *ol_dixc(const struct m0_op_layout *ol);
214 
215 #endif /* __MOTR_LAYOUT_H__ */
216 
217 /*
218  * Local variables:
219  * c-indentation-style: "K&R"
220  * c-basic-offset: 8
221  * tab-width: 8
222  * fill-column: 80
223  * scroll-step: 1
224  * End:
225  */
226 /*
227  * vim: tabstop=8 shiftwidth=8 noexpandtab textwidth=80 nowrap
228  */
struct m0_entity * ol_entity
Definition: layout.h:183
uint64_t ce_tlink_magic
Definition: layout.h:137
struct m0_mutex ccl_lock
Definition: layout.h:160
Definition: client.h:788
struct m0_sm_group * ol_sm_grp
Definition: layout.h:178
struct m0_mutex ccr_lock
Definition: layout.h:148
M0_INTERNAL void m0_client__layout_put(struct m0_client_layout *layout)
Definition: layout.c:288
struct m0_fid pl_fid
Definition: layout.h:128
struct m0_bufvec data
Definition: di.c:40
M0_INTERNAL struct m0_dix_cli * ent_dixc(const struct m0_entity *ent)
Definition: idx_dix.c:191
uint64_t m0_bindex_t
Definition: types.h:80
uint64_t m0_bcount_t
Definition: types.h:77
struct m0_fid composite_extent_wr_idx_fid
uint64_t cl_lid
Definition: layout.h:121
static struct foo * obj
Definition: tlist.c:302
struct m0_fid pl_pver
Definition: layout.h:126
int(* olo_launch)(struct m0_op_layout *ol)
Definition: layout.h:167
Definition: client.h:641
struct m0_fid composite_extent_rd_idx_fid
struct m0_uint128 cl_orig_id
Definition: layout.h:119
struct m0_tlink ccr_tlink
Definition: layout.h:149
const struct m0_bob_type ol_bobtype
Definition: layout.c:37
Definition: tlist.h:251
struct m0_client_layout * ol_layout
Definition: layout.h:181
struct m0_fid cl_pver
Definition: layout.h:120
struct m0_client_layout ccl_layout
Definition: layout.h:157
struct m0_op_common ol_oc
Definition: layout.h:175
struct m0_client_layout pl_layout
Definition: layout.h:125
const struct m0_client_layout_ops layout_composite_ops
struct m0_uint128 ce_id
Definition: layout.h:132
uint64_t ccr_lid
Definition: layout.h:142
struct m0_ast_rc ol_ar
Definition: layout.h:179
struct m0_client_layout cl_layout
Definition: layout.h:118
static struct m0_client cinst
Definition: sync.c:84
struct m0_tl ccl_layers
Definition: layout.h:159
struct m0_uint128 ccr_subobj
Definition: layout.h:141
int(* olo_copy_to_app)(struct m0_client_layout *to, void *data)
Definition: layout.h:169
struct m0_op ** oci_sub_ops
Definition: layout.h:195
M0_INTERNAL struct m0_dix_cli * ol_dixc(const struct m0_op_layout *ol)
Definition: idx_dix.c:196
Definition: fid.h:38
uint64_t ccr_tlink_magic
Definition: layout.h:150
const struct m0_op_layout_ops m0_op_layout_composite_ops
M0_INTERNAL int m0__obj_layout_send(struct m0_obj *obj, struct m0_op_layout *ol)
Definition: cob.c:2043
const struct m0_op_layout_ops * ol_ops
Definition: layout.h:185
m0_bcount_t ce_len
Definition: layout.h:134
struct m0_tl ccr_wr_exts
Definition: layout.h:146
m0_bindex_t ce_off
Definition: layout.h:133
int(* olo_copy_from_app)(struct m0_client_layout *from, void *data)
Definition: layout.h:171
struct m0_tl ccr_rd_exts
Definition: layout.h:145
uint64_t ol_magic
Definition: layout.h:176
struct m0_tlink ce_tlink
Definition: layout.h:136
M0_INTERNAL int m0_layout_op_launch(struct m0_op_layout *ol)
M0_INTERNAL int m0_client__layout_get(struct m0_client_layout *layout)
Definition: layout.c:276
struct m0_dirent * ent
Definition: dir.c:1029
uint64_t oci_magic
Definition: layout.h:192
M0_INTERNAL int m0__dix_layout_get_sync(struct m0_obj *obj, struct m0_dix_layout *dlayout)
Definition: mutex.h:47
M0_INTERNAL int m0__composite_container_init(struct m0_client *cinst)
struct m0_op_obj oci_oo
Definition: layout.h:191