• Home
  • Raw
  • Download

Lines Matching refs:s

127 void init_ro_spine(struct ro_spine *s, struct dm_btree_info *info)  in init_ro_spine()  argument
129 s->info = info; in init_ro_spine()
130 s->count = 0; in init_ro_spine()
131 s->nodes[0] = NULL; in init_ro_spine()
132 s->nodes[1] = NULL; in init_ro_spine()
135 int exit_ro_spine(struct ro_spine *s) in exit_ro_spine() argument
139 for (i = 0; i < s->count; i++) { in exit_ro_spine()
140 int r2 = unlock_block(s->info, s->nodes[i]); in exit_ro_spine()
148 int ro_step(struct ro_spine *s, dm_block_t new_child) in ro_step() argument
152 if (s->count == 2) { in ro_step()
153 r = unlock_block(s->info, s->nodes[0]); in ro_step()
156 s->nodes[0] = s->nodes[1]; in ro_step()
157 s->count--; in ro_step()
160 r = bn_read_lock(s->info, new_child, s->nodes + s->count); in ro_step()
162 s->count++; in ro_step()
167 void ro_pop(struct ro_spine *s) in ro_pop() argument
169 BUG_ON(!s->count); in ro_pop()
170 --s->count; in ro_pop()
171 unlock_block(s->info, s->nodes[s->count]); in ro_pop()
174 struct btree_node *ro_node(struct ro_spine *s) in ro_node() argument
178 BUG_ON(!s->count); in ro_node()
179 block = s->nodes[s->count - 1]; in ro_node()
186 void init_shadow_spine(struct shadow_spine *s, struct dm_btree_info *info) in init_shadow_spine() argument
188 s->info = info; in init_shadow_spine()
189 s->count = 0; in init_shadow_spine()
192 int exit_shadow_spine(struct shadow_spine *s) in exit_shadow_spine() argument
196 for (i = 0; i < s->count; i++) { in exit_shadow_spine()
197 int r2 = unlock_block(s->info, s->nodes[i]); in exit_shadow_spine()
205 int shadow_step(struct shadow_spine *s, dm_block_t b, in shadow_step() argument
210 if (s->count == 2) { in shadow_step()
211 r = unlock_block(s->info, s->nodes[0]); in shadow_step()
214 s->nodes[0] = s->nodes[1]; in shadow_step()
215 s->count--; in shadow_step()
218 r = bn_shadow(s->info, b, vt, s->nodes + s->count); in shadow_step()
220 if (!s->count) in shadow_step()
221 s->root = dm_block_location(s->nodes[0]); in shadow_step()
223 s->count++; in shadow_step()
229 struct dm_block *shadow_current(struct shadow_spine *s) in shadow_current() argument
231 BUG_ON(!s->count); in shadow_current()
233 return s->nodes[s->count - 1]; in shadow_current()
236 struct dm_block *shadow_parent(struct shadow_spine *s) in shadow_parent() argument
238 BUG_ON(s->count != 2); in shadow_parent()
240 return s->count == 2 ? s->nodes[0] : NULL; in shadow_parent()
243 int shadow_has_parent(struct shadow_spine *s) in shadow_has_parent() argument
245 return s->count >= 2; in shadow_has_parent()
248 int shadow_root(struct shadow_spine *s) in shadow_root() argument
250 return s->root; in shadow_root()