aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/md/persistent-data/dm-btree-internal.h
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/md/persistent-data/dm-btree-internal.h')
-rw-r--r--drivers/md/persistent-data/dm-btree-internal.h16
1 files changed, 8 insertions, 8 deletions
diff --git a/drivers/md/persistent-data/dm-btree-internal.h b/drivers/md/persistent-data/dm-btree-internal.h
index 5709bfeab1e8..accbb05f17b6 100644
--- a/drivers/md/persistent-data/dm-btree-internal.h
+++ b/drivers/md/persistent-data/dm-btree-internal.h
@@ -36,13 +36,13 @@ struct node_header {
36 __le32 padding; 36 __le32 padding;
37} __packed; 37} __packed;
38 38
39struct node { 39struct btree_node {
40 struct node_header header; 40 struct node_header header;
41 __le64 keys[0]; 41 __le64 keys[0];
42} __packed; 42} __packed;
43 43
44 44
45void inc_children(struct dm_transaction_manager *tm, struct node *n, 45void inc_children(struct dm_transaction_manager *tm, struct btree_node *n,
46 struct dm_btree_value_type *vt); 46 struct dm_btree_value_type *vt);
47 47
48int new_block(struct dm_btree_info *info, struct dm_block **result); 48int new_block(struct dm_btree_info *info, struct dm_block **result);
@@ -64,7 +64,7 @@ struct ro_spine {
64void init_ro_spine(struct ro_spine *s, struct dm_btree_info *info); 64void init_ro_spine(struct ro_spine *s, struct dm_btree_info *info);
65int exit_ro_spine(struct ro_spine *s); 65int exit_ro_spine(struct ro_spine *s);
66int ro_step(struct ro_spine *s, dm_block_t new_child); 66int ro_step(struct ro_spine *s, dm_block_t new_child);
67struct node *ro_node(struct ro_spine *s); 67struct btree_node *ro_node(struct ro_spine *s);
68 68
69struct shadow_spine { 69struct shadow_spine {
70 struct dm_btree_info *info; 70 struct dm_btree_info *info;
@@ -98,17 +98,17 @@ int shadow_root(struct shadow_spine *s);
98/* 98/*
99 * Some inlines. 99 * Some inlines.
100 */ 100 */
101static inline __le64 *key_ptr(struct node *n, uint32_t index) 101static inline __le64 *key_ptr(struct btree_node *n, uint32_t index)
102{ 102{
103 return n->keys + index; 103 return n->keys + index;
104} 104}
105 105
106static inline void *value_base(struct node *n) 106static inline void *value_base(struct btree_node *n)
107{ 107{
108 return &n->keys[le32_to_cpu(n->header.max_entries)]; 108 return &n->keys[le32_to_cpu(n->header.max_entries)];
109} 109}
110 110
111static inline void *value_ptr(struct node *n, uint32_t index) 111static inline void *value_ptr(struct btree_node *n, uint32_t index)
112{ 112{
113 uint32_t value_size = le32_to_cpu(n->header.value_size); 113 uint32_t value_size = le32_to_cpu(n->header.value_size);
114 return value_base(n) + (value_size * index); 114 return value_base(n) + (value_size * index);
@@ -117,7 +117,7 @@ static inline void *value_ptr(struct node *n, uint32_t index)
117/* 117/*
118 * Assumes the values are suitably-aligned and converts to core format. 118 * Assumes the values are suitably-aligned and converts to core format.
119 */ 119 */
120static inline uint64_t value64(struct node *n, uint32_t index) 120static inline uint64_t value64(struct btree_node *n, uint32_t index)
121{ 121{
122 __le64 *values_le = value_base(n); 122 __le64 *values_le = value_base(n);
123 123
@@ -127,7 +127,7 @@ static inline uint64_t value64(struct node *n, uint32_t index)
127/* 127/*
128 * Searching for a key within a single node. 128 * Searching for a key within a single node.
129 */ 129 */
130int lower_bound(struct node *n, uint64_t key); 130int lower_bound(struct btree_node *n, uint64_t key);
131 131
132extern struct dm_block_validator btree_node_validator; 132extern struct dm_block_validator btree_node_validator;
133 133