aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/md
diff options
context:
space:
mode:
authorBruce Johnston <bjohnsto@redhat.com>2023-11-20 17:29:56 -0500
committerMike Snitzer <snitzer@kernel.org>2024-02-20 13:43:16 -0500
commit9165dac82273579b150bb56f76c6cf3222eb1a58 (patch)
tree109c7c2019f8e8a59cdb4eeac8bac45532d15153 /drivers/md
parentffb8d9654100804998223ba2659044279cc6bc46 (diff)
downloadlinux-9165dac82273579b150bb56f76c6cf3222eb1a58.tar.gz
dm vdo int-map: remove unused parameter from vdo_int_map_create
Reviewed-by: Matthew Sakai <msakai@redhat.com> Signed-off-by: Bruce Johnston <bjohnsto@redhat.com> Signed-off-by: Matthew Sakai <msakai@redhat.com> Signed-off-by: Mike Snitzer <snitzer@kernel.org>
Diffstat (limited to 'drivers/md')
-rw-r--r--drivers/md/dm-vdo/block-map.c6
-rw-r--r--drivers/md/dm-vdo/dedupe.c2
-rw-r--r--drivers/md/dm-vdo/int-map.c13
-rw-r--r--drivers/md/dm-vdo/int-map.h3
-rw-r--r--drivers/md/dm-vdo/io-submitter.c2
-rw-r--r--drivers/md/dm-vdo/logical-zone.c2
-rw-r--r--drivers/md/dm-vdo/physical-zone.c2
7 files changed, 10 insertions, 20 deletions
diff --git a/drivers/md/dm-vdo/block-map.c b/drivers/md/dm-vdo/block-map.c
index 953819943cd32..f9f68e8d4b0cc 100644
--- a/drivers/md/dm-vdo/block-map.c
+++ b/drivers/md/dm-vdo/block-map.c
@@ -232,7 +232,7 @@ static int __must_check allocate_cache_components(struct vdo_page_cache *cache)
if (result != UDS_SUCCESS)
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)
return result;
@@ -1347,7 +1347,7 @@ int vdo_invalidate_page_cache(struct vdo_page_cache *cache)
/* Reset the page map by re-allocating it. */
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,
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)
return result;
diff --git a/drivers/md/dm-vdo/dedupe.c b/drivers/md/dm-vdo/dedupe.c
index 1a04e699ed8fe..b3ffb85518c3c 100644
--- a/drivers/md/dm-vdo/dedupe.c
+++ b/drivers/md/dm-vdo/dedupe.c
@@ -2404,7 +2404,7 @@ static int __must_check initialize_zone(struct vdo *vdo, struct hash_zones *zone
data_vio_count_t i;
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)
return result;
diff --git a/drivers/md/dm-vdo/int-map.c b/drivers/md/dm-vdo/int-map.c
index 94f13df7a2e11..99ccbb1339c6c 100644
--- a/drivers/md/dm-vdo/int-map.c
+++ b/drivers/md/dm-vdo/int-map.c
@@ -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.
* @initial_capacity: The number of entries the map should initially be capable of holding (zero
* 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.
*
* Return: UDS_SUCCESS or an error code.
*/
-int vdo_int_map_create(size_t initial_capacity, unsigned int initial_load,
- struct int_map **map_ptr)
+int vdo_int_map_create(size_t initial_capacity, struct int_map **map_ptr)
{
struct int_map *map;
int result;
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);
if (result != UDS_SUCCESS)
return result;
@@ -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
* 80% load we need a capacity of 1250)
*/
- capacity = capacity * 100 / initial_load;
+ capacity = capacity * 100 / DEFAULT_LOAD;
result = allocate_buckets(map, capacity);
if (result != UDS_SUCCESS) {
diff --git a/drivers/md/dm-vdo/int-map.h b/drivers/md/dm-vdo/int-map.h
index edafb7569f513..1858ad7998877 100644
--- a/drivers/md/dm-vdo/int-map.h
+++ b/drivers/md/dm-vdo/int-map.h
@@ -23,8 +23,7 @@
struct int_map;
-int __must_check vdo_int_map_create(size_t initial_capacity, unsigned int initial_load,
- struct int_map **map_ptr);
+int __must_check vdo_int_map_create(size_t initial_capacity, struct int_map **map_ptr);
void vdo_int_map_free(struct int_map *map);
diff --git a/drivers/md/dm-vdo/io-submitter.c b/drivers/md/dm-vdo/io-submitter.c
index 9471b6caabe60..74f33a3ddce57 100644
--- a/drivers/md/dm-vdo/io-submitter.c
+++ b/drivers/md/dm-vdo/io-submitter.c
@@ -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,
* 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);
if (result != 0) {
/*
diff --git a/drivers/md/dm-vdo/logical-zone.c b/drivers/md/dm-vdo/logical-zone.c
index df69fb68db3df..cfbf1701ca844 100644
--- a/drivers/md/dm-vdo/logical-zone.c
+++ b/drivers/md/dm-vdo/logical-zone.c
@@ -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];
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)
return result;
diff --git a/drivers/md/dm-vdo/physical-zone.c b/drivers/md/dm-vdo/physical-zone.c
index 8ecc80ecbb53e..3bcf6f1ba77f2 100644
--- a/drivers/md/dm-vdo/physical-zone.c
+++ b/drivers/md/dm-vdo/physical-zone.c
@@ -330,7 +330,7 @@ static int initialize_zone(struct vdo *vdo, struct physical_zones *zones)
zone_count_t zone_number = zones->zone_count;
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)
return result;