Lines Matching refs:s
124 void init_ro_spine(struct ro_spine *s, struct dm_btree_info *info) in init_ro_spine() argument
126 s->info = info; in init_ro_spine()
127 s->count = 0; in init_ro_spine()
128 s->nodes[0] = NULL; in init_ro_spine()
129 s->nodes[1] = NULL; in init_ro_spine()
132 void exit_ro_spine(struct ro_spine *s) in exit_ro_spine() argument
136 for (i = 0; i < s->count; i++) in exit_ro_spine()
137 unlock_block(s->info, s->nodes[i]); in exit_ro_spine()
140 int ro_step(struct ro_spine *s, dm_block_t new_child) in ro_step() argument
144 if (s->count == 2) { in ro_step()
145 unlock_block(s->info, s->nodes[0]); in ro_step()
146 s->nodes[0] = s->nodes[1]; in ro_step()
147 s->count--; in ro_step()
150 r = bn_read_lock(s->info, new_child, s->nodes + s->count); in ro_step()
152 s->count++; in ro_step()
157 void ro_pop(struct ro_spine *s) in ro_pop() argument
159 BUG_ON(!s->count); in ro_pop()
160 --s->count; in ro_pop()
161 unlock_block(s->info, s->nodes[s->count]); in ro_pop()
164 struct btree_node *ro_node(struct ro_spine *s) in ro_node() argument
168 BUG_ON(!s->count); in ro_node()
169 block = s->nodes[s->count - 1]; in ro_node()
176 void init_shadow_spine(struct shadow_spine *s, struct dm_btree_info *info) in init_shadow_spine() argument
178 s->info = info; in init_shadow_spine()
179 s->count = 0; in init_shadow_spine()
182 void exit_shadow_spine(struct shadow_spine *s) in exit_shadow_spine() argument
186 for (i = 0; i < s->count; i++) in exit_shadow_spine()
187 unlock_block(s->info, s->nodes[i]); in exit_shadow_spine()
190 int shadow_step(struct shadow_spine *s, dm_block_t b, in shadow_step() argument
195 if (s->count == 2) { in shadow_step()
196 unlock_block(s->info, s->nodes[0]); in shadow_step()
197 s->nodes[0] = s->nodes[1]; in shadow_step()
198 s->count--; in shadow_step()
201 r = bn_shadow(s->info, b, vt, s->nodes + s->count); in shadow_step()
203 if (!s->count) in shadow_step()
204 s->root = dm_block_location(s->nodes[0]); in shadow_step()
206 s->count++; in shadow_step()
212 struct dm_block *shadow_current(struct shadow_spine *s) in shadow_current() argument
214 BUG_ON(!s->count); in shadow_current()
216 return s->nodes[s->count - 1]; in shadow_current()
219 struct dm_block *shadow_parent(struct shadow_spine *s) in shadow_parent() argument
221 BUG_ON(s->count != 2); in shadow_parent()
223 return s->count == 2 ? s->nodes[0] : NULL; in shadow_parent()
226 int shadow_has_parent(struct shadow_spine *s) in shadow_has_parent() argument
228 return s->count >= 2; in shadow_has_parent()
231 dm_block_t shadow_root(struct shadow_spine *s) in shadow_root() argument
233 return s->root; in shadow_root()