Motr  M0
iter.h
Go to the documentation of this file.
1 /* -*- C -*- */
2 /*
3  * Copyright (c) 2016-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_DIX_CM_ITER_H__
26 #define __MOTR_DIX_CM_ITER_H__
27 
28 #include "fop/fom.h" /* m0_fom */
29 #include "lib/buf.h" /* m0_buf */
30 #include "fid/fid.h" /* m0_fid */
31 #include "sm/sm.h" /* m0_sm_ast */
32 #include "dix/layout.h" /* m0_dix_ldesc */
33 #include "cas/ctg_store.h" /* m0_ctg_op */
34 
41 /* Import */
42 struct m0_dix_cm_type;
43 struct m0_reqh;
44 
52  struct m0_fom di_fom;
53 
56 
59 
67 
70 
73 
78 
83 
89 
91  struct m0_buf di_key;
92 
94  struct m0_buf di_val;
95 
98 
104 
109 
114 
119 
124 
130 
136 
139 
142 
145 
148 
150  bool di_stop;
151 
157 
160 
162  uint64_t *di_tgts;
163 
165  uint64_t di_tgts_cur;
166 
168  uint64_t di_tgts_nr;
169 
172 };
173 
179 M0_INTERNAL void m0_dix_cm_iter_type_register(struct m0_dix_cm_type *dcmt);
180 
192 M0_INTERNAL int m0_dix_cm_iter_start(struct m0_dix_cm_iter *iter,
193  struct m0_dix_cm_type *dcmt,
194  struct m0_reqh *reqh,
195  m0_bcount_t rpc_cutoff);
196 
205 M0_INTERNAL void m0_dix_cm_iter_next(struct m0_dix_cm_iter *iter);
206 
224 M0_INTERNAL int m0_dix_cm_iter_get(struct m0_dix_cm_iter *iter,
225  struct m0_buf *key,
226  struct m0_buf *val,
227  uint32_t *sdev_id);
228 
238 M0_INTERNAL void m0_dix_cm_iter_stop(struct m0_dix_cm_iter *iter);
239 
248 M0_INTERNAL
249 void m0_dix_cm_iter_cur_pos(struct m0_dix_cm_iter *iter,
250  struct m0_fid *cctg_fid,
251  uint64_t *cctg_proc_recs_nr);
252 
259 M0_INTERNAL
261  uint64_t *proc_recs_nr);
262 
264 #endif /* __MOTR_DIX_CM_ITER_H__ */
265 
266 /*
267  * Local variables:
268  * c-indentation-style: "K&R"
269  * c-basic-offset: 8
270  * tab-width: 8
271  * fill-column: 80
272  * scroll-step: 1
273  * End:
274  */
275 /*
276  * vim: tabstop=8 shiftwidth=8 noexpandtab textwidth=80 nowrap
277  */
struct m0_buf di_prev_key
Definition: iter.h:97
Definition: idx_mock.c:52
struct m0_clink di_meta_clink
Definition: iter.h:69
struct m0_long_lock_addb2 di_meta_lock_addb2
Definition: iter.h:141
M0_INTERNAL void m0_dix_cm_iter_next(struct m0_dix_cm_iter *iter)
Definition: iter.c:1458
struct m0_ctg_op di_ctg_op
Definition: iter.h:108
struct m0_fom di_fom
Definition: iter.h:52
uint64_t m0_bcount_t
Definition: types.h:77
Definition: sm.h:504
struct m0_fid di_prev_cctg_fid
Definition: iter.h:58
struct m0_long_lock_link di_meta_lock_link
Definition: iter.h:129
uint64_t * di_tgts
Definition: iter.h:162
struct m0_long_lock_link di_lock_link
Definition: iter.h:123
Definition: buf.h:37
M0_INTERNAL void m0_dix_cm_iter_cur_pos(struct m0_dix_cm_iter *iter, struct m0_fid *cctg_fid, uint64_t *cctg_proc_recs_nr)
Definition: iter.c:1537
uint64_t di_cctg_processed_recs_nr
Definition: iter.h:77
M0_INTERNAL void m0_dix_cm_iter_processed_num(struct m0_dix_cm_iter *iter, uint64_t *proc_recs_nr)
Definition: iter.c:1546
struct m0_long_lock_addb2 di_lock_addb2
Definition: iter.h:138
M0_INTERNAL void m0_dix_cm_iter_stop(struct m0_dix_cm_iter *iter)
Definition: iter.c:1525
m0_bcount_t di_cutoff
Definition: iter.h:171
struct m0_buf di_key
Definition: iter.h:91
uint64_t di_tgts_nr
Definition: iter.h:168
bool di_stop
Definition: iter.h:150
struct m0_ctg_op di_ctidx_op
Definition: iter.h:103
Definition: reqh.h:94
struct m0_cas_ctg * di_cctg
Definition: iter.h:72
Definition: chan.h:229
uint64_t di_processed_recs_nr
Definition: iter.h:82
struct m0_dix_ldesc di_ldesc
Definition: iter.h:88
Definition: fom.h:481
struct m0_long_lock_link di_del_lock_link
Definition: iter.h:135
struct m0_mutex di_ch_guard
Definition: iter.h:159
struct m0_reqh reqh
Definition: rm_foms.c:48
Definition: fid.h:38
struct m0_buf di_val
Definition: iter.h:94
struct m0_sm_ast di_ast
Definition: iter.h:147
int di_ctg_del_op_rc
Definition: iter.h:118
struct m0_long_lock_addb2 di_del_lock_addb2
Definition: iter.h:144
M0_INTERNAL void m0_dix_cm_iter_type_register(struct m0_dix_cm_type *dcmt)
Definition: iter.c:1419
bool di_meta_modified
Definition: iter.h:66
struct m0_fid di_cctg_fid
Definition: iter.h:55
M0_INTERNAL int m0_dix_cm_iter_get(struct m0_dix_cm_iter *iter, struct m0_buf *key, struct m0_buf *val, uint32_t *sdev_id)
Definition: iter.c:1465
struct m0_ctg_op di_ctg_del_op
Definition: iter.h:113
uint64_t di_tgts_cur
Definition: iter.h:165
Definition: mutex.h:47
struct m0_chan di_completed
Definition: iter.h:156
M0_INTERNAL int m0_dix_cm_iter_start(struct m0_dix_cm_iter *iter, struct m0_dix_cm_type *dcmt, struct m0_reqh *reqh, m0_bcount_t rpc_cutoff)
Definition: iter.c:1429
Definition: idx_mock.c:47