Commit b06d5c37 authored by Mike Snitzer's avatar Mike Snitzer

dm vdo block-map: rename struct cursors member to 'completion'

'completion' is more informative name for a 'struct vdo_completion'
than 'parent'.
Signed-off-by: default avatarMike Snitzer <snitzer@kernel.org>
Signed-off-by: default avatarMatthew Sakai <msakai@redhat.com>
parent 3ccf136a
...@@ -98,7 +98,7 @@ struct cursors { ...@@ -98,7 +98,7 @@ struct cursors {
struct block_map_zone *zone; struct block_map_zone *zone;
struct vio_pool *pool; struct vio_pool *pool;
vdo_entry_callback_fn entry_callback; vdo_entry_callback_fn entry_callback;
struct vdo_completion *parent; struct vdo_completion *completion;
root_count_t active_roots; root_count_t active_roots;
struct cursor cursors[]; struct cursor cursors[];
}; };
...@@ -2501,7 +2501,7 @@ static void replace_forest(struct block_map *map) ...@@ -2501,7 +2501,7 @@ static void replace_forest(struct block_map *map)
static void finish_cursor(struct cursor *cursor) static void finish_cursor(struct cursor *cursor)
{ {
struct cursors *cursors = cursor->parent; struct cursors *cursors = cursor->parent;
struct vdo_completion *parent = cursors->parent; struct vdo_completion *completion = cursors->completion;
return_vio_to_pool(cursors->pool, uds_forget(cursor->vio)); return_vio_to_pool(cursors->pool, uds_forget(cursor->vio));
if (--cursors->active_roots > 0) if (--cursors->active_roots > 0)
...@@ -2509,7 +2509,7 @@ static void finish_cursor(struct cursor *cursor) ...@@ -2509,7 +2509,7 @@ static void finish_cursor(struct cursor *cursor)
uds_free(cursors); uds_free(cursors);
vdo_finish_completion(parent); vdo_finish_completion(completion);
} }
static void traverse(struct cursor *cursor); static void traverse(struct cursor *cursor);
...@@ -2595,12 +2595,10 @@ static void traverse(struct cursor *cursor) ...@@ -2595,12 +2595,10 @@ static void traverse(struct cursor *cursor)
if (cursor->height < VDO_BLOCK_MAP_TREE_HEIGHT - 1) { if (cursor->height < VDO_BLOCK_MAP_TREE_HEIGHT - 1) {
int result = cursor->parent->entry_callback(location.pbn, int result = cursor->parent->entry_callback(location.pbn,
cursor->parent->parent); cursor->parent->completion);
if (result != VDO_SUCCESS) { if (result != VDO_SUCCESS) {
page->entries[level->slot] = UNMAPPED_BLOCK_MAP_ENTRY; page->entries[level->slot] = UNMAPPED_BLOCK_MAP_ENTRY;
vdo_write_tree_page(tree_page, vdo_write_tree_page(tree_page, cursor->parent->zone);
cursor->parent->zone);
continue; continue;
} }
} }
...@@ -2676,10 +2674,10 @@ static struct boundary compute_boundary(struct block_map *map, root_count_t root ...@@ -2676,10 +2674,10 @@ static struct boundary compute_boundary(struct block_map *map, root_count_t root
/** /**
* vdo_traverse_forest() - Walk the entire forest of a block map. * vdo_traverse_forest() - Walk the entire forest of a block map.
* @callback: A function to call with the pbn of each allocated node in the forest. * @callback: A function to call with the pbn of each allocated node in the forest.
* @parent: The completion to notify on each traversed PBN, and when the traversal is complete. * @completion: The completion to notify on each traversed PBN, and when traversal completes.
*/ */
void vdo_traverse_forest(struct block_map *map, vdo_entry_callback_fn callback, void vdo_traverse_forest(struct block_map *map, vdo_entry_callback_fn callback,
struct vdo_completion *parent) struct vdo_completion *completion)
{ {
root_count_t root; root_count_t root;
struct cursors *cursors; struct cursors *cursors;
...@@ -2688,14 +2686,14 @@ void vdo_traverse_forest(struct block_map *map, vdo_entry_callback_fn callback, ...@@ -2688,14 +2686,14 @@ void vdo_traverse_forest(struct block_map *map, vdo_entry_callback_fn callback,
result = uds_allocate_extended(struct cursors, map->root_count, result = uds_allocate_extended(struct cursors, map->root_count,
struct cursor, __func__, &cursors); struct cursor, __func__, &cursors);
if (result != VDO_SUCCESS) { if (result != VDO_SUCCESS) {
vdo_fail_completion(parent, result); vdo_fail_completion(completion, result);
return; return;
} }
cursors->zone = &map->zones[0]; cursors->zone = &map->zones[0];
cursors->pool = cursors->zone->vio_pool; cursors->pool = cursors->zone->vio_pool;
cursors->entry_callback = callback; cursors->entry_callback = callback;
cursors->parent = parent; cursors->completion = completion;
cursors->active_roots = map->root_count; cursors->active_roots = map->root_count;
for (root = 0; root < map->root_count; root++) { for (root = 0; root < map->root_count; root++) {
struct cursor *cursor = &cursors->cursors[root]; struct cursor *cursor = &cursors->cursors[root];
......
...@@ -313,7 +313,7 @@ physical_block_number_t vdo_find_block_map_page_pbn(struct block_map *map, ...@@ -313,7 +313,7 @@ physical_block_number_t vdo_find_block_map_page_pbn(struct block_map *map,
void vdo_write_tree_page(struct tree_page *page, struct block_map_zone *zone); void vdo_write_tree_page(struct tree_page *page, struct block_map_zone *zone);
void vdo_traverse_forest(struct block_map *map, vdo_entry_callback_fn callback, void vdo_traverse_forest(struct block_map *map, vdo_entry_callback_fn callback,
struct vdo_completion *parent); struct vdo_completion *completion);
int __must_check vdo_decode_block_map(struct block_map_state_2_0 state, int __must_check vdo_decode_block_map(struct block_map_state_2_0 state,
block_count_t logical_blocks, struct vdo *vdo, block_count_t logical_blocks, struct vdo *vdo,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment