Motr  M0
fd_internal.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 
23 #pragma once
24 #ifndef __MOTR_FD_INT_H__
25 #define __MOTR_FD_INT_H__
26 
27 #include "fd/fd.h"
28 #include "conf/obj.h" /* m0_conf_pver */
29 #include "lib/misc.h" /* uint16_t uint32_t */
30 
35  uint16_t ftc_depth;
39  int32_t ftc_child_idx;
43  uint32_t ftc_cnt;
47 };
48 
50 M0_INTERNAL int m0_fd__tile_init(struct m0_fd_tile *tile,
51  const struct m0_pdclust_attr *la_attr,
52  uint64_t *children_nr, uint64_t depth);
54 M0_INTERNAL void m0_fd__tile_populate(struct m0_fd_tile *tile);
55 
58 M0_INTERNAL int m0_fd__tree_root_create(struct m0_fd_tree *tree,
59  uint64_t root_children);
60 
64 M0_INTERNAL int m0_fd__tree_level_populate(const struct m0_conf_pver *pv,
65  struct m0_fd_tree *tree,
66  uint32_t level);
67 
68 
69 M0_INTERNAL int m0_fd__tree_node_init(struct m0_fd_tree *tree,
70  struct m0_fd_tree_node *node,
71  uint16_t child_nr,
72  const struct m0_fd__tree_cursor *cursor);
73 M0_INTERNAL void m0_fd__tree_node_fini(struct m0_fd_tree *tree,
74  struct m0_fd_tree_node *node);
75 
76 M0_INTERNAL int m0_fd__tree_cursor_init(struct m0_fd__tree_cursor *cursor,
77  const struct m0_fd_tree *tree,
78  uint16_t depth);
79 
80 M0_INTERNAL int m0_fd__tree_cursor_init_at(struct m0_fd__tree_cursor *cursor,
81  const struct m0_fd_tree *tree,
82  const struct m0_fd_tree_node *node,
83  uint32_t child_idx);
84 
85 M0_INTERNAL struct m0_fd_tree_node **
87 
88 M0_INTERNAL int m0_fd__tree_cursor_next(struct m0_fd__tree_cursor *cursor);
89 
90 
91 M0_INTERNAL int m0_fd__perm_cache_build(struct m0_fd_tree *tree);
92 
93 M0_INTERNAL void m0_fd__perm_cache_destroy(struct m0_fd_tree *tree);
94 
95 M0_INTERNAL bool m0_fd__tree_invariant(const struct m0_fd_tree *tree);
96 
97 M0_INTERNAL bool m0_fd__tree_node_invariant(const struct m0_fd_tree *tree,
98  const struct m0_fd_tree_node *node);
99 #endif
struct m0_pool_version * pv
Definition: dir.c:629
enum m0_trace_level level
Definition: trace.c:111
static struct net_test_cmd_node * node
Definition: commands.c:72
int32_t ftc_child_abs_idx
Definition: fd_internal.h:41
M0_INTERNAL bool m0_fd__tree_invariant(const struct m0_fd_tree *tree)
Definition: fd_tree.c:202
M0_INTERNAL int m0_fd__tree_cursor_next(struct m0_fd__tree_cursor *cursor)
Definition: fd_tree.c:142
M0_INTERNAL int m0_fd__tree_root_create(struct m0_fd_tree *tree, uint64_t root_children)
Definition: fd_tree.c:181
M0_INTERNAL bool m0_fd__tree_node_invariant(const struct m0_fd_tree *tree, const struct m0_fd_tree_node *node)
Definition: fd_tree.c:208
M0_INTERNAL int m0_fd__tree_level_populate(const struct m0_conf_pver *pv, struct m0_fd_tree *tree, uint32_t level)
Definition: fd.c:630
static unsigned depth
Definition: base.c:377
M0_INTERNAL void m0_fd__perm_cache_destroy(struct m0_fd_tree *tree)
Definition: fd.c:818
uint16_t ftc_depth
Definition: fd_internal.h:35
M0_INTERNAL void m0_fd__tile_populate(struct m0_fd_tile *tile)
Definition: fd.c:487
struct m0_fd_tree_node * ftc_node
Definition: fd_internal.h:37
struct m0_fd_tree * ftc_tree
Definition: fd_internal.h:33
int32_t ftc_child_idx
Definition: fd_internal.h:39
M0_INTERNAL int m0_fd__perm_cache_build(struct m0_fd_tree *tree)
Definition: fd.c:683
M0_INTERNAL int m0_fd__tree_node_init(struct m0_fd_tree *tree, struct m0_fd_tree_node *node, uint16_t child_nr, const struct m0_fd__tree_cursor *cursor)
Definition: fd_tree.c:31
M0_INTERNAL int m0_fd__tile_init(struct m0_fd_tile *tile, const struct m0_pdclust_attr *la_attr, uint64_t *children_nr, uint64_t depth)
Definition: fd.c:204
uint64_t ftc_path[M0_CONF_PVER_HEIGHT+1]
Definition: fd_internal.h:46
M0_INTERNAL void m0_fd__tree_node_fini(struct m0_fd_tree *tree, struct m0_fd_tree_node *node)
Definition: fd_tree.c:53
Definition: fd.h:199
Definition: fd.h:126
M0_INTERNAL int m0_fd__tree_cursor_init_at(struct m0_fd__tree_cursor *cursor, const struct m0_fd_tree *tree, const struct m0_fd_tree_node *node, uint32_t child_idx)
Definition: fd_tree.c:97
M0_INTERNAL int m0_fd__tree_cursor_init(struct m0_fd__tree_cursor *cursor, const struct m0_fd_tree *tree, uint16_t depth)
Definition: fd_tree.c:62
M0_INTERNAL struct m0_fd_tree_node ** m0_fd__tree_cursor_get(struct m0_fd__tree_cursor *cursor)
Definition: fd_tree.c:136