summaryrefslogtreecommitdiff
path: root/drivers/md/dm-vdo/int-map.c
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/dm-vdo/int-map.c
parentffb8d9654100804998223ba2659044279cc6bc46 (diff)
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/dm-vdo/int-map.c')
-rw-r--r--drivers/md/dm-vdo/int-map.c13
1 files changed, 2 insertions, 11 deletions
diff --git a/drivers/md/dm-vdo/int-map.c b/drivers/md/dm-vdo/int-map.c
index 94f13df7a2e1..99ccbb1339c6 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) {