dm vdo int-map: remove unused parameter from vdo_int_map_create
authorBruce Johnston <bjohnsto@redhat.com>
Mon, 20 Nov 2023 22:29:56 +0000 (17:29 -0500)
committerMike Snitzer <snitzer@kernel.org>
Tue, 20 Feb 2024 18:43:16 +0000 (13:43 -0500)
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>
drivers/md/dm-vdo/block-map.c
drivers/md/dm-vdo/dedupe.c
drivers/md/dm-vdo/int-map.c
drivers/md/dm-vdo/int-map.h
drivers/md/dm-vdo/io-submitter.c
drivers/md/dm-vdo/logical-zone.c
drivers/md/dm-vdo/physical-zone.c

index 953819943cd326064b29c65772e43ce1523a5b19..f9f68e8d4b0ccd1e22a76df4f9a26a5b8bbe963c 100644 (file)
@@ -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;
 
index 1a04e699ed8fe823f4c2b0b0f76a95a54e596ead..b3ffb85518c3c76d3754e0f217899820fa755a5d 100644 (file)
@@ -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;
 
index 94f13df7a2e1127776669e5a164690cc3d8f9910..99ccbb1339c6c9a77892235369d06284335df00e 100644 (file)
@@ -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) {
index edafb7569f51353faade6e0cb58d8a74c5d31f17..1858ad7998877db1fe325620199beb44f5efe77e 100644 (file)
@@ -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);
 
index 9471b6caabe6057448cb202c17050fb3d8a01c16..74f33a3ddce57fbbe39b6a0b384c0d98ac5a23d2 100644 (file)
@@ -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) {
                        /*
index df69fb68db3dfb81a8d49eb3dced7f00ffe13c55..cfbf1701ca844aeb2d22bd4c3d17f865a11de405 100644 (file)
@@ -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;
 
index 8ecc80ecbb53e9a821cbfa55efa9a3dff32a9305..3bcf6f1ba77f2f66e9e65643cae278d17d568144 100644 (file)
@@ -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;