Motr  M0
diter.h
Go to the documentation of this file.
1 /* -*- C -*- */
2 /*
3  * Copyright (c) 2015-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_CONF_DITER_H__
24 #define __MOTR_CONF_DITER_H__
25 
26 #include "conf/confc.h"
27 
138 
148 };
149 
166 };
167 
178  /* See m0_diter_lvl_mode for values. */
181  uint32_t dl_lvl;
183  uint32_t dl_nr_open;
188  uint32_t dl_nr_read;
189 };
190 
204  uint32_t di_phase;
212  struct m0_chan di_wait;
214  /* Total number of configuration directory levels to iterate. */
215  uint32_t di_nr_lvls;
217  uint32_t di_lvl;
226  bool di_locked;
227 };
228 
235 #define m0_conf_diter_init(iter, confc, origin, ...) \
236  m0_conf__diter_init(iter, confc, origin, \
237  M0_COUNT_PARAMS(__VA_ARGS__) + 1, \
238  (const struct m0_fid []){ \
239  __VA_ARGS__, M0_FID0 })
240 
241 M0_INTERNAL int m0_conf__diter_init(struct m0_conf_diter *it,
242  struct m0_confc *confc,
243  struct m0_conf_obj *origin,
244  uint32_t nr_lvls,
245  const struct m0_fid *path);
246 M0_INTERNAL void m0_conf_diter_fini(struct m0_conf_diter *it);
247 
249 M0_INTERNAL void m0_conf_diter_locked_set(struct m0_conf_diter *it,
250  bool locked);
251 
263 M0_INTERNAL int
265  bool (*filter)(const struct m0_conf_obj *obj));
266 
267 M0_INTERNAL int
269  bool (*filter)(const struct m0_conf_obj *obj));
270 
272 M0_INTERNAL void m0_conf_diter_wait_arm(struct m0_conf_diter *it,
273  struct m0_clink *clink);
274 
275 M0_INTERNAL struct m0_conf_obj *m0_conf_diter_result(const struct m0_conf_diter *it);
276 
277 M0_INTERNAL void m0_conf_diter_lvl_init(struct m0_conf_diter_lvl *l,
278  struct m0_conf_diter *it,
279  struct m0_confc *confc, uint32_t lvl,
280  const struct m0_fid *path);
281 
282 M0_INTERNAL void m0_conf_diter_lvl_fini(struct m0_conf_diter_lvl *l);
283 
285 #endif /* __MOTR_CONF_DITER_H__ */
struct m0_conf_obj * lc_result
Definition: diter.h:165
m0_diter_lvl_mode
Definition: diter.h:144
struct m0_conf_obj * di_origin
Definition: diter.h:200
struct m0_confc_ctx lc_ctx
Definition: diter.h:160
struct m0_chan di_wait
Definition: diter.h:212
struct m0_confc * di_confc
Definition: diter.h:198
uint32_t di_lvl
Definition: diter.h:217
M0_INTERNAL int m0_conf_diter_next_sync(struct m0_conf_diter *it, bool(*filter)(const struct m0_conf_obj *obj))
Definition: diter.c:555
static struct m0_be_emap_cursor it
Definition: extmap.c:46
uint32_t dl_nr_read
Definition: diter.h:188
uint32_t dl_nr_open
Definition: diter.h:183
static struct foo * obj
Definition: tlist.c:302
Definition: filter.py:1
static struct m0_confc * confc
Definition: file.c:94
struct m0_conf_diter_lvl_ctx dl_cctx[M0_DLM_NR]
Definition: diter.h:177
M0_INTERNAL void m0_conf_diter_wait_arm(struct m0_conf_diter *it, struct m0_clink *clink)
Definition: diter.c:337
uint32_t dl_lvl
Definition: diter.h:181
M0_INTERNAL int m0_conf_diter_next(struct m0_conf_diter *it, bool(*filter)(const struct m0_conf_obj *obj))
Definition: diter.c:532
Definition: chan.h:229
static struct m0_clink clink[RDWR_REQUEST_MAX]
struct m0_conf_diter * dl_di
Definition: diter.h:170
static struct m0_clink l[NR]
Definition: chan.c:37
enum m0_diter_lvl_mode dl_mode
Definition: diter.h:179
M0_INTERNAL void m0_conf_diter_locked_set(struct m0_conf_diter *it, bool locked)
Definition: diter.c:331
M0_INTERNAL void m0_conf_diter_lvl_fini(struct m0_conf_diter_lvl *l)
Definition: diter.c:229
M0_INTERNAL struct m0_conf_obj * m0_conf_diter_result(const struct m0_conf_diter *it)
Definition: diter.c:576
Definition: fid.h:38
M0_INTERNAL void m0_conf_diter_fini(struct m0_conf_diter *it)
Definition: diter.c:313
struct m0_clink di_clink
Definition: diter.h:206
M0_INTERNAL void m0_conf_diter_lvl_init(struct m0_conf_diter_lvl *l, struct m0_conf_diter *it, struct m0_confc *confc, uint32_t lvl, const struct m0_fid *path)
Definition: diter.c:210
bool di_locked
Definition: diter.h:226
uint32_t di_nr_lvls
Definition: diter.h:215
Definition: mutex.h:47
M0_INTERNAL int m0_conf__diter_init(struct m0_conf_diter *it, struct m0_confc *confc, struct m0_conf_obj *origin, uint32_t nr_lvls, const struct m0_fid *path)
Definition: diter.c:282
struct m0_fid dl_rel_fid
Definition: diter.h:172
struct m0_conf_diter_lvl * di_lvls
Definition: diter.h:202
uint32_t di_phase
Definition: diter.h:204
struct m0_mutex di_wait_mutex
Definition: diter.h:213