Commit 9165dac8 authored by Bruce Johnston's avatar Bruce Johnston Committed by Mike Snitzer

dm vdo int-map: remove unused parameter from vdo_int_map_create

Reviewed-by: default avatarMatthew Sakai <msakai@redhat.com>
Signed-off-by: default avatarBruce Johnston <bjohnsto@redhat.com>
Signed-off-by: default avatarMatthew Sakai <msakai@redhat.com>
Signed-off-by: default avatarMike Snitzer <snitzer@kernel.org>
parent ffb8d965
...@@ -232,7 +232,7 @@ static int __must_check allocate_cache_components(struct vdo_page_cache *cache) ...@@ -232,7 +232,7 @@ static int __must_check allocate_cache_components(struct vdo_page_cache *cache)
if (result != UDS_SUCCESS) if (result != UDS_SUCCESS)
return result; return result;
result = vdo_int_map_create(cache->page_count, 0, &cache->page_map); result = vdo_int_map_create(cache->page_count, &cache->page_map);
if (result != UDS_SUCCESS) if (result != UDS_SUCCESS)
return result; return result;
...@@ -1347,7 +1347,7 @@ int vdo_invalidate_page_cache(struct vdo_page_cache *cache) ...@@ -1347,7 +1347,7 @@ int vdo_invalidate_page_cache(struct vdo_page_cache *cache)
/* Reset the page map by re-allocating it. */ /* Reset the page map by re-allocating it. */
vdo_int_map_free(uds_forget(cache->page_map)); vdo_int_map_free(uds_forget(cache->page_map));
return vdo_int_map_create(cache->page_count, 0, &cache->page_map); return vdo_int_map_create(cache->page_count, &cache->page_map);
} }
/** /**
...@@ -2751,7 +2751,7 @@ static int __must_check initialize_block_map_zone(struct block_map *map, ...@@ -2751,7 +2751,7 @@ static int __must_check initialize_block_map_zone(struct block_map *map,
INIT_LIST_HEAD(&zone->dirty_lists->eras[i][VDO_CACHE_PAGE]); INIT_LIST_HEAD(&zone->dirty_lists->eras[i][VDO_CACHE_PAGE]);
} }
result = vdo_int_map_create(VDO_LOCK_MAP_CAPACITY, 0, &zone->loading_pages); result = vdo_int_map_create(VDO_LOCK_MAP_CAPACITY, &zone->loading_pages);
if (result != VDO_SUCCESS) if (result != VDO_SUCCESS)
return result; return result;
......
...@@ -2404,7 +2404,7 @@ static int __must_check initialize_zone(struct vdo *vdo, struct hash_zones *zone ...@@ -2404,7 +2404,7 @@ static int __must_check initialize_zone(struct vdo *vdo, struct hash_zones *zone
data_vio_count_t i; data_vio_count_t i;
struct hash_zone *zone = &zones->zones[zone_number]; struct hash_zone *zone = &zones->zones[zone_number];
result = vdo_int_map_create(VDO_LOCK_MAP_CAPACITY, 0, &zone->hash_lock_map); result = vdo_int_map_create(VDO_LOCK_MAP_CAPACITY, &zone->hash_lock_map);
if (result != VDO_SUCCESS) if (result != VDO_SUCCESS)
return result; return result;
......
...@@ -174,25 +174,16 @@ static int allocate_buckets(struct int_map *map, size_t capacity) ...@@ -174,25 +174,16 @@ static int allocate_buckets(struct int_map *map, size_t capacity)
* vdo_int_map_create() - Allocate and initialize an int_map. * vdo_int_map_create() - Allocate and initialize an int_map.
* @initial_capacity: The number of entries the map should initially be capable of holding (zero * @initial_capacity: The number of entries the map should initially be capable of holding (zero
* tells the map to use its own small default). * tells the map to use its own small default).
* @initial_load: The load factor of the map, expressed as an integer percentage (typically in the
* range 50 to 90, with zero telling the map to use its own default).
* @map_ptr: Output, a pointer to hold the new int_map. * @map_ptr: Output, a pointer to hold the new int_map.
* *
* Return: UDS_SUCCESS or an error code. * Return: UDS_SUCCESS or an error code.
*/ */
int vdo_int_map_create(size_t initial_capacity, unsigned int initial_load, int vdo_int_map_create(size_t initial_capacity, struct int_map **map_ptr)
struct int_map **map_ptr)
{ {
struct int_map *map; struct int_map *map;
int result; int result;
size_t capacity; size_t capacity;
/* Use the default initial load if the caller did not specify one. */
if (initial_load == 0)
initial_load = DEFAULT_LOAD;
if (initial_load > 100)
return UDS_INVALID_ARGUMENT;
result = uds_allocate(1, struct int_map, "struct int_map", &map); result = uds_allocate(1, struct int_map, "struct int_map", &map);
if (result != UDS_SUCCESS) if (result != UDS_SUCCESS)
return result; return result;
...@@ -204,7 +195,7 @@ int vdo_int_map_create(size_t initial_capacity, unsigned int initial_load, ...@@ -204,7 +195,7 @@ int vdo_int_map_create(size_t initial_capacity, unsigned int initial_load,
* Scale up the capacity by the specified initial load factor. (i.e to hold 1000 entries at * Scale up the capacity by the specified initial load factor. (i.e to hold 1000 entries at
* 80% load we need a capacity of 1250) * 80% load we need a capacity of 1250)
*/ */
capacity = capacity * 100 / initial_load; capacity = capacity * 100 / DEFAULT_LOAD;
result = allocate_buckets(map, capacity); result = allocate_buckets(map, capacity);
if (result != UDS_SUCCESS) { if (result != UDS_SUCCESS) {
......
...@@ -23,8 +23,7 @@ ...@@ -23,8 +23,7 @@
struct int_map; struct int_map;
int __must_check vdo_int_map_create(size_t initial_capacity, unsigned int initial_load, int __must_check vdo_int_map_create(size_t initial_capacity, struct int_map **map_ptr);
struct int_map **map_ptr);
void vdo_int_map_free(struct int_map *map); void vdo_int_map_free(struct int_map *map);
......
...@@ -401,7 +401,7 @@ int vdo_make_io_submitter(unsigned int thread_count, unsigned int rotation_inter ...@@ -401,7 +401,7 @@ int vdo_make_io_submitter(unsigned int thread_count, unsigned int rotation_inter
* uneven. So for now, we'll assume that all requests *may* wind up on one thread, * uneven. So for now, we'll assume that all requests *may* wind up on one thread,
* and thus all in the same map. * and thus all in the same map.
*/ */
result = vdo_int_map_create(max_requests_active * 2, 0, result = vdo_int_map_create(max_requests_active * 2,
&bio_queue_data->map); &bio_queue_data->map);
if (result != 0) { if (result != 0) {
/* /*
......
...@@ -57,7 +57,7 @@ static int initialize_zone(struct logical_zones *zones, zone_count_t zone_number ...@@ -57,7 +57,7 @@ static int initialize_zone(struct logical_zones *zones, zone_count_t zone_number
struct logical_zone *zone = &zones->zones[zone_number]; struct logical_zone *zone = &zones->zones[zone_number];
zone_count_t allocation_zone_number; zone_count_t allocation_zone_number;
result = vdo_int_map_create(VDO_LOCK_MAP_CAPACITY, 0, &zone->lbn_operations); result = vdo_int_map_create(VDO_LOCK_MAP_CAPACITY, &zone->lbn_operations);
if (result != VDO_SUCCESS) if (result != VDO_SUCCESS)
return result; return result;
......
...@@ -330,7 +330,7 @@ static int initialize_zone(struct vdo *vdo, struct physical_zones *zones) ...@@ -330,7 +330,7 @@ static int initialize_zone(struct vdo *vdo, struct physical_zones *zones)
zone_count_t zone_number = zones->zone_count; zone_count_t zone_number = zones->zone_count;
struct physical_zone *zone = &zones->zones[zone_number]; struct physical_zone *zone = &zones->zones[zone_number];
result = vdo_int_map_create(VDO_LOCK_MAP_CAPACITY, 0, &zone->pbn_operations); result = vdo_int_map_create(VDO_LOCK_MAP_CAPACITY, &zone->pbn_operations);
if (result != VDO_SUCCESS) if (result != VDO_SUCCESS)
return result; return result;
......
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