]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
dm vdo: check for VDO_SUCCESS return value from memory-alloc functions
authorMike Snitzer <snitzer@kernel.org>
Tue, 13 Feb 2024 18:06:53 +0000 (12:06 -0600)
committerMike Snitzer <snitzer@kernel.org>
Mon, 4 Mar 2024 20:07:56 +0000 (15:07 -0500)
VDO_SUCCESS and UDS_SUCCESS were used interchangably, update all
callers of VDO's memory-alloc functions to consistently check for
VDO_SUCCESS.

Signed-off-by: Mike Snitzer <snitzer@kernel.org>
Signed-off-by: Matthew Sakai <msakai@redhat.com>
28 files changed:
drivers/md/dm-vdo/block-map.c
drivers/md/dm-vdo/data-vio.c
drivers/md/dm-vdo/dm-vdo-target.c
drivers/md/dm-vdo/encodings.c
drivers/md/dm-vdo/funnel-queue.c
drivers/md/dm-vdo/funnel-workqueue.c
drivers/md/dm-vdo/indexer/chapter-index.c
drivers/md/dm-vdo/indexer/config.c
drivers/md/dm-vdo/indexer/delta-index.c
drivers/md/dm-vdo/indexer/funnel-requestqueue.c
drivers/md/dm-vdo/indexer/geometry.c
drivers/md/dm-vdo/indexer/index-layout.c
drivers/md/dm-vdo/indexer/index-page-map.c
drivers/md/dm-vdo/indexer/index-session.c
drivers/md/dm-vdo/indexer/index.c
drivers/md/dm-vdo/indexer/io-factory.c
drivers/md/dm-vdo/indexer/open-chapter.c
drivers/md/dm-vdo/indexer/radix-sort.c
drivers/md/dm-vdo/indexer/sparse-cache.c
drivers/md/dm-vdo/indexer/volume-index.c
drivers/md/dm-vdo/indexer/volume.c
drivers/md/dm-vdo/int-map.c
drivers/md/dm-vdo/io-submitter.c
drivers/md/dm-vdo/message-stats.c
drivers/md/dm-vdo/slab-depot.c
drivers/md/dm-vdo/thread-utils.c
drivers/md/dm-vdo/uds-sysfs.c
drivers/md/dm-vdo/vdo.c

index b09974ad41d29e4cd6a8cc317f7ac57a49cde9ef..c4719fb30f86d87cd55c25efe01415da643197ef 100644 (file)
@@ -223,11 +223,11 @@ static int __must_check allocate_cache_components(struct vdo_page_cache *cache)
 
        result = vdo_allocate(cache->page_count, struct page_info, "page infos",
                              &cache->infos);
-       if (result != UDS_SUCCESS)
+       if (result != VDO_SUCCESS)
                return result;
 
        result = vdo_allocate_memory(size, VDO_BLOCK_SIZE, "cache pages", &cache->pages);
-       if (result != UDS_SUCCESS)
+       if (result != VDO_SUCCESS)
                return result;
 
        result = vdo_int_map_create(cache->page_count, &cache->page_map);
@@ -2874,7 +2874,7 @@ int vdo_decode_block_map(struct block_map_state_2_0 state, block_count_t logical
        result = vdo_allocate_extended(struct block_map,
                                       vdo->thread_config.logical_zone_count,
                                       struct block_map_zone, __func__, &map);
-       if (result != UDS_SUCCESS)
+       if (result != VDO_SUCCESS)
                return result;
 
        map->vdo = vdo;
index dcdd767e40e5bbdecb92e75e58a1be026578eb68..3d5054e61330320a452c877f835876a0059a9d19 100644 (file)
@@ -847,7 +847,7 @@ int make_data_vio_pool(struct vdo *vdo, data_vio_count_t pool_size,
 
        result = vdo_allocate_extended(struct data_vio_pool, pool_size, struct data_vio,
                                       __func__, &pool);
-       if (result != UDS_SUCCESS)
+       if (result != VDO_SUCCESS)
                return result;
 
        ASSERT_LOG_ONLY((discard_limit <= pool_size),
index 86c30fbd75ca4ec72332a0128a4d46ef1a07c23e..90ba379f8d3e8b48ae75cbd020f13b4cf4ebeae3 100644 (file)
@@ -280,7 +280,7 @@ static int split_string(const char *string, char separator, char ***substring_ar
 
        result = vdo_allocate(substring_count + 1, char *, "string-splitting array",
                              &substrings);
-       if (result != UDS_SUCCESS)
+       if (result != VDO_SUCCESS)
                return result;
 
        for (s = string; *s != 0; s++) {
@@ -289,7 +289,7 @@ static int split_string(const char *string, char separator, char ***substring_ar
 
                        result = vdo_allocate(length + 1, char, "split string",
                                              &substrings[current_substring]);
-                       if (result != UDS_SUCCESS) {
+                       if (result != VDO_SUCCESS) {
                                free_string_array(substrings);
                                return result;
                        }
@@ -310,7 +310,7 @@ static int split_string(const char *string, char separator, char ***substring_ar
 
        result = vdo_allocate(length + 1, char, "split string",
                              &substrings[current_substring]);
-       if (result != UDS_SUCCESS) {
+       if (result != VDO_SUCCESS) {
                free_string_array(substrings);
                return result;
        }
@@ -1527,7 +1527,7 @@ static size_t get_bit_array_size(unsigned int bit_count)
  * Since the array is initially NULL, this also initializes the array the first time we allocate an
  * instance number.
  *
- * Return: UDS_SUCCESS or an error code from the allocation
+ * Return: VDO_SUCCESS or an error code from the allocation
  */
 static int grow_bit_array(void)
 {
@@ -1540,19 +1540,19 @@ static int grow_bit_array(void)
                                       get_bit_array_size(instances.bit_count),
                                       get_bit_array_size(new_count),
                                       "instance number bit array", &new_words);
-       if (result != UDS_SUCCESS)
+       if (result != VDO_SUCCESS)
                return result;
 
        instances.bit_count = new_count;
        instances.words = new_words;
-       return UDS_SUCCESS;
+       return VDO_SUCCESS;
 }
 
 /**
  * allocate_instance() - Allocate an instance number.
  * @instance_ptr: A point to hold the instance number
  *
- * Return: UDS_SUCCESS or an error code
+ * Return: VDO_SUCCESS or an error code
  *
  * This function must be called while holding the instances lock.
  */
@@ -1564,7 +1564,7 @@ static int allocate_instance(unsigned int *instance_ptr)
        /* If there are no unallocated instances, grow the bit array. */
        if (instances.count >= instances.bit_count) {
                result = grow_bit_array();
-               if (result != UDS_SUCCESS)
+               if (result != VDO_SUCCESS)
                        return result;
        }
 
@@ -1587,7 +1587,7 @@ static int allocate_instance(unsigned int *instance_ptr)
        instances.count++;
        instances.next = instance + 1;
        *instance_ptr = instance;
-       return UDS_SUCCESS;
+       return VDO_SUCCESS;
 }
 
 static int construct_new_vdo_registered(struct dm_target *ti, unsigned int argc,
index 56d94339d2afee063c89a397909f783b1a40b647..a97771fe0a43c62924dfba46949990974a46bae9 100644 (file)
@@ -800,7 +800,7 @@ static int allocate_partition(struct layout *layout, u8 id,
        int result;
 
        result = vdo_allocate(1, struct partition, __func__, &partition);
-       if (result != UDS_SUCCESS)
+       if (result != VDO_SUCCESS)
                return result;
 
        partition->id = id;
index 67f7b52ecc868d345f8b842e8cad6b6ef89e16e7..ce0e801fd9550ad9edf2a8141bb4b7f566d953e2 100644 (file)
@@ -15,7 +15,7 @@ int uds_make_funnel_queue(struct funnel_queue **queue_ptr)
        struct funnel_queue *queue;
 
        result = vdo_allocate(1, struct funnel_queue, "funnel queue", &queue);
-       if (result != UDS_SUCCESS)
+       if (result != VDO_SUCCESS)
                return result;
 
        /*
index ebf8dce670861dbd842b0d4bd0841bb86024b0d4..a88f5c93eae537023ba37a802f28b9c7bedd753b 100644 (file)
@@ -324,7 +324,7 @@ static int make_simple_work_queue(const char *thread_name_prefix, const char *na
                        VDO_WORK_Q_MAX_PRIORITY);
 
        result = vdo_allocate(1, struct simple_work_queue, "simple work queue", &queue);
-       if (result != UDS_SUCCESS)
+       if (result != VDO_SUCCESS)
                return result;
 
        queue->private = private;
@@ -401,12 +401,12 @@ int vdo_make_work_queue(const char *thread_name_prefix, const char *name,
 
        result = vdo_allocate(1, struct round_robin_work_queue, "round-robin work queue",
                              &queue);
-       if (result != UDS_SUCCESS)
+       if (result != VDO_SUCCESS)
                return result;
 
        result = vdo_allocate(thread_count, struct simple_work_queue *,
                              "subordinate work queues", &queue->service_queues);
-       if (result != UDS_SUCCESS) {
+       if (result != VDO_SUCCESS) {
                vdo_free(queue);
                return result;
        }
index 9477150362ae34c92c8468bf0a104df149d2f7fb..68d86028dbb7c41a5b2e326e0ddc394dbf8d6048 100644 (file)
@@ -21,7 +21,7 @@ int uds_make_open_chapter_index(struct open_chapter_index **chapter_index,
        struct open_chapter_index *index;
 
        result = vdo_allocate(1, struct open_chapter_index, "open chapter index", &index);
-       if (result != UDS_SUCCESS)
+       if (result != VDO_SUCCESS)
                return result;
 
        /*
index cd20ee8b9a02467c8cbb0745d8a26c740e77edef..5da39043b9aeb7534e1d0a24013f65f012932e1e 100644 (file)
@@ -326,7 +326,7 @@ int uds_make_configuration(const struct uds_parameters *params,
                return result;
 
        result = vdo_allocate(1, struct uds_configuration, __func__, &config);
-       if (result != UDS_SUCCESS)
+       if (result != VDO_SUCCESS)
                return result;
 
        result = uds_make_index_geometry(DEFAULT_BYTES_PER_PAGE, record_pages_per_chapter,
index 11f7b85b671068ab0c5b8b63e4930f08794827e7..5bba9a48c5a080b184a2c4b619cc537d84edf05a 100644 (file)
@@ -312,18 +312,18 @@ static int initialize_delta_zone(struct delta_zone *delta_zone, size_t size,
        int result;
 
        result = vdo_allocate(size, u8, "delta list", &delta_zone->memory);
-       if (result != UDS_SUCCESS)
+       if (result != VDO_SUCCESS)
                return result;
 
        result = vdo_allocate(list_count + 2, u64, "delta list temp",
                              &delta_zone->new_offsets);
-       if (result != UDS_SUCCESS)
+       if (result != VDO_SUCCESS)
                return result;
 
        /* Allocate the delta lists. */
        result = vdo_allocate(list_count + 2, struct delta_list, "delta lists",
                              &delta_zone->delta_lists);
-       if (result != UDS_SUCCESS)
+       if (result != VDO_SUCCESS)
                return result;
 
        compute_coding_constants(mean_delta, &delta_zone->min_bits,
@@ -354,7 +354,7 @@ int uds_initialize_delta_index(struct delta_index *delta_index, unsigned int zon
 
        result = vdo_allocate(zone_count, struct delta_zone, "Delta Index Zones",
                              &delta_index->delta_zones);
-       if (result != UDS_SUCCESS)
+       if (result != VDO_SUCCESS)
                return result;
 
        delta_index->zone_count = zone_count;
@@ -1048,7 +1048,7 @@ int uds_finish_restoring_delta_index(struct delta_index *delta_index,
        u8 *data;
 
        result = vdo_allocate(DELTA_LIST_MAX_BYTE_COUNT, u8, __func__, &data);
-       if (result != UDS_SUCCESS)
+       if (result != VDO_SUCCESS)
                return result;
 
        for (z = 0; z < reader_count; z++) {
index 95a402ec31c959834fa2613b0d673e40ef36741e..eee7b980960fe0486e87f49a1f35379c7284d5b3 100644 (file)
@@ -199,7 +199,7 @@ int uds_make_request_queue(const char *queue_name,
        struct uds_request_queue *queue;
 
        result = vdo_allocate(1, struct uds_request_queue, __func__, &queue);
-       if (result != UDS_SUCCESS)
+       if (result != VDO_SUCCESS)
                return result;
 
        queue->processor = processor;
index c735e6cb4425e27fa630ec6f76730f4198636760..c0575612e820ba2e1570b947c64af718cd0cfe2f 100644 (file)
@@ -62,7 +62,7 @@ int uds_make_index_geometry(size_t bytes_per_page, u32 record_pages_per_chapter,
        struct index_geometry *geometry;
 
        result = vdo_allocate(1, struct index_geometry, "geometry", &geometry);
-       if (result != UDS_SUCCESS)
+       if (result != VDO_SUCCESS)
                return result;
 
        geometry->bytes_per_page = bytes_per_page;
index c1bcff03cc55f87f957e30c66d97a5b1600f521d..01e0db4184aae0512ed5985eaf8556910d6fd325 100644 (file)
@@ -487,7 +487,7 @@ static int __must_check make_index_save_region_table(struct index_save_layout *i
        result = vdo_allocate_extended(struct region_table, region_count,
                                       struct layout_region,
                                       "layout region table for ISL", &table);
-       if (result != UDS_SUCCESS)
+       if (result != VDO_SUCCESS)
                return result;
 
        lr = &table->regions[0];
@@ -546,7 +546,7 @@ static int __must_check write_index_save_header(struct index_save_layout *isl,
        size_t offset = 0;
 
        result = vdo_allocate(table->encoded_size, u8, "index save data", &buffer);
-       if (result != UDS_SUCCESS)
+       if (result != VDO_SUCCESS)
                return result;
 
        encode_region_table(buffer, &offset, table);
@@ -670,7 +670,7 @@ static int __must_check make_layout_region_table(struct index_layout *layout,
        result = vdo_allocate_extended(struct region_table, region_count,
                                       struct layout_region, "layout region table",
                                       &table);
-       if (result != UDS_SUCCESS)
+       if (result != VDO_SUCCESS)
                return result;
 
        lr = &table->regions[0];
@@ -716,7 +716,7 @@ static int __must_check write_layout_header(struct index_layout *layout,
        size_t offset = 0;
 
        result = vdo_allocate(table->encoded_size, u8, "layout data", &buffer);
-       if (result != UDS_SUCCESS)
+       if (result != VDO_SUCCESS)
                return result;
 
        encode_region_table(buffer, &offset, table);
@@ -807,7 +807,7 @@ static int create_index_layout(struct index_layout *layout, struct uds_configura
 
        result = vdo_allocate(sizes.save_count, struct index_save_layout, __func__,
                              &layout->index.saves);
-       if (result != UDS_SUCCESS)
+       if (result != VDO_SUCCESS)
                return result;
 
        initialize_layout(layout, &sizes);
@@ -1165,7 +1165,7 @@ static int __must_check load_region_table(struct buffered_reader *reader,
        result = vdo_allocate_extended(struct region_table, header.region_count,
                                       struct layout_region,
                                       "single file layout region table", &table);
-       if (result != UDS_SUCCESS)
+       if (result != VDO_SUCCESS)
                return result;
 
        table->header = header;
@@ -1202,7 +1202,7 @@ static int __must_check read_super_block_data(struct buffered_reader *reader,
        size_t offset = 0;
 
        result = vdo_allocate(saved_size, u8, "super block data", &buffer);
-       if (result != UDS_SUCCESS)
+       if (result != VDO_SUCCESS)
                return result;
 
        result = uds_read_from_buffered_reader(reader, buffer, saved_size);
@@ -1337,7 +1337,7 @@ static int __must_check reconstitute_layout(struct index_layout *layout,
 
        result = vdo_allocate(layout->super.max_saves, struct index_save_layout,
                              __func__, &layout->index.saves);
-       if (result != UDS_SUCCESS)
+       if (result != VDO_SUCCESS)
                return result;
 
        layout->total_blocks = table->header.region_blocks;
@@ -1696,7 +1696,7 @@ int uds_make_index_layout(struct uds_configuration *config, bool new_layout,
                return result;
 
        result = vdo_allocate(1, struct index_layout, __func__, &layout);
-       if (result != UDS_SUCCESS)
+       if (result != VDO_SUCCESS)
                return result;
 
        result = create_layout_factory(layout, config);
index ddb6d843cbd9b62f9ff8d06ae6baec8b744d14c2..c5d1b999584633e1df6580063956b5702cb52cf2 100644 (file)
@@ -39,14 +39,14 @@ int uds_make_index_page_map(const struct index_geometry *geometry,
        struct index_page_map *map;
 
        result = vdo_allocate(1, struct index_page_map, "page map", &map);
-       if (result != UDS_SUCCESS)
+       if (result != VDO_SUCCESS)
                return result;
 
        map->geometry = geometry;
        map->entries_per_chapter = geometry->index_pages_per_chapter - 1;
        result = vdo_allocate(get_entry_count(geometry), u16, "Index Page Map Entries",
                              &map->entries);
-       if (result != UDS_SUCCESS) {
+       if (result != VDO_SUCCESS) {
                uds_free_index_page_map(map);
                return result;
        }
@@ -119,7 +119,7 @@ int uds_write_index_page_map(struct index_page_map *map, struct buffered_writer
        u32 i;
 
        result = vdo_allocate(saved_size, u8, "page map data", &buffer);
-       if (result != UDS_SUCCESS)
+       if (result != VDO_SUCCESS)
                return result;
 
        memcpy(buffer, PAGE_MAP_MAGIC, PAGE_MAP_MAGIC_LENGTH);
@@ -146,7 +146,7 @@ int uds_read_index_page_map(struct index_page_map *map, struct buffered_reader *
        u32 i;
 
        result = vdo_allocate(saved_size, u8, "page map data", &buffer);
-       if (result != UDS_SUCCESS)
+       if (result != VDO_SUCCESS)
                return result;
 
        result = uds_read_from_buffered_reader(reader, buffer, saved_size);
index 0f920a58302107474c83ec639e437d400147d0bf..22445dcb3fe018962fd434817b6d560af01132a7 100644 (file)
@@ -222,7 +222,7 @@ static int __must_check make_empty_index_session(struct uds_index_session **inde
        struct uds_index_session *session;
 
        result = vdo_allocate(1, struct uds_index_session, __func__, &session);
-       if (result != UDS_SUCCESS)
+       if (result != VDO_SUCCESS)
                return result;
 
        mutex_init(&session->request_mutex);
index c576033b8a53f1f4f6f944fc994c7b078b227322..243a9deab4deb815c668974ab1c7f14b6c106403 100644 (file)
@@ -89,7 +89,7 @@ static int launch_zone_message(struct uds_zone_message message, unsigned int zon
        struct uds_request *request;
 
        result = vdo_allocate(1, struct uds_request, __func__, &request);
-       if (result != UDS_SUCCESS)
+       if (result != VDO_SUCCESS)
                return result;
 
        request->index = index;
@@ -770,7 +770,7 @@ static int make_chapter_writer(struct uds_index *index,
        result = vdo_allocate_extended(struct chapter_writer, index->zone_count,
                                       struct open_chapter_zone *, "Chapter Writer",
                                       &writer);
-       if (result != UDS_SUCCESS)
+       if (result != VDO_SUCCESS)
                return result;
 
        writer->index = index;
@@ -779,7 +779,7 @@ static int make_chapter_writer(struct uds_index *index,
 
        result = vdo_allocate_cache_aligned(collated_records_size, "collated records",
                                            &writer->collated_records);
-       if (result != UDS_SUCCESS) {
+       if (result != VDO_SUCCESS) {
                free_chapter_writer(writer);
                return result;
        }
@@ -1127,7 +1127,7 @@ static int make_index_zone(struct uds_index *index, unsigned int zone_number)
        struct index_zone *zone;
 
        result = vdo_allocate(1, struct index_zone, "index zone", &zone);
-       if (result != UDS_SUCCESS)
+       if (result != VDO_SUCCESS)
                return result;
 
        result = uds_make_open_chapter(index->volume->geometry, index->zone_count,
@@ -1165,7 +1165,7 @@ int uds_make_index(struct uds_configuration *config, enum uds_open_index_type op
 
        result = vdo_allocate_extended(struct uds_index, config->zone_count,
                                       struct uds_request_queue *, "index", &index);
-       if (result != UDS_SUCCESS)
+       if (result != VDO_SUCCESS)
                return result;
 
        index->zone_count = config->zone_count;
@@ -1178,7 +1178,7 @@ int uds_make_index(struct uds_configuration *config, enum uds_open_index_type op
 
        result = vdo_allocate(index->zone_count, struct index_zone *, "zones",
                              &index->zones);
-       if (result != UDS_SUCCESS) {
+       if (result != VDO_SUCCESS) {
                uds_free_index(index);
                return result;
        }
index 749c950c0189f8a0f027d4aafced1b237d1fdfac..0dcf6d5966538e7d60de9b5a1624c2c3bb2afa25 100644 (file)
@@ -65,7 +65,7 @@ int uds_make_io_factory(struct block_device *bdev, struct io_factory **factory_p
        struct io_factory *factory;
 
        result = vdo_allocate(1, struct io_factory, __func__, &factory);
-       if (result != UDS_SUCCESS)
+       if (result != VDO_SUCCESS)
                return result;
 
        factory->bdev = bdev;
@@ -145,7 +145,7 @@ int uds_make_buffered_reader(struct io_factory *factory, off_t offset, u64 block
                return result;
 
        result = vdo_allocate(1, struct buffered_reader, "buffered reader", &reader);
-       if (result != UDS_SUCCESS) {
+       if (result != VDO_SUCCESS) {
                dm_bufio_client_destroy(client);
                return result;
        }
@@ -283,7 +283,7 @@ int uds_make_buffered_writer(struct io_factory *factory, off_t offset, u64 block
                return result;
 
        result = vdo_allocate(1, struct buffered_writer, "buffered writer", &writer);
-       if (result != UDS_SUCCESS) {
+       if (result != VDO_SUCCESS) {
                dm_bufio_client_destroy(client);
                return result;
        }
index 4a4dc94915dd80b5383a034fb700c0d94e049496..46b7bc1ac3246aaf0cdd9d35943584b812cbf36c 100644 (file)
@@ -71,14 +71,14 @@ int uds_make_open_chapter(const struct index_geometry *geometry, unsigned int zo
        result = vdo_allocate_extended(struct open_chapter_zone, slot_count,
                                       struct open_chapter_zone_slot, "open chapter",
                                       &open_chapter);
-       if (result != UDS_SUCCESS)
+       if (result != VDO_SUCCESS)
                return result;
 
        open_chapter->slot_count = slot_count;
        open_chapter->capacity = capacity;
        result = vdo_allocate_cache_aligned(records_size(open_chapter), "record pages",
                                            &open_chapter->records);
-       if (result != UDS_SUCCESS) {
+       if (result != VDO_SUCCESS) {
                uds_free_open_chapter(open_chapter);
                return result;
        }
index 74ea18b8e9be0ed39a532c9dfab0fed7e5940643..66b8c706a1ef9a19c5aea930af5914bdfa29b1a5 100644 (file)
@@ -213,7 +213,7 @@ int uds_make_radix_sorter(unsigned int count, struct radix_sorter **sorter)
 
        result = vdo_allocate_extended(struct radix_sorter, stack_size, struct task,
                                       __func__, &radix_sorter);
-       if (result != UDS_SUCCESS)
+       if (result != VDO_SUCCESS)
                return result;
 
        radix_sorter->count = count;
index e297ba2d6cebae6e029cdab2005ba5b99f8a6d77..28920167827c4198399f4ecc64de48d57155f397 100644 (file)
@@ -224,7 +224,7 @@ static int __must_check initialize_cached_chapter_index(struct cached_chapter_in
 
        result = vdo_allocate(chapter->index_pages_count, struct delta_index_page,
                              __func__, &chapter->index_pages);
-       if (result != UDS_SUCCESS)
+       if (result != VDO_SUCCESS)
                return result;
 
        return vdo_allocate(chapter->index_pages_count, struct dm_buffer *,
@@ -242,7 +242,7 @@ static int __must_check make_search_list(struct sparse_cache *cache,
        bytes = (sizeof(struct search_list) +
                 (cache->capacity * sizeof(struct cached_chapter_index *)));
        result = vdo_allocate_cache_aligned(bytes, "search list", &list);
-       if (result != UDS_SUCCESS)
+       if (result != VDO_SUCCESS)
                return result;
 
        list->capacity = cache->capacity;
@@ -265,7 +265,7 @@ int uds_make_sparse_cache(const struct index_geometry *geometry, unsigned int ca
 
        bytes = (sizeof(struct sparse_cache) + (capacity * sizeof(struct cached_chapter_index)));
        result = vdo_allocate_cache_aligned(bytes, "sparse cache", &cache);
-       if (result != UDS_SUCCESS)
+       if (result != VDO_SUCCESS)
                return result;
 
        cache->geometry = geometry;
@@ -296,7 +296,7 @@ int uds_make_sparse_cache(const struct index_geometry *geometry, unsigned int ca
        /* purge_search_list() needs some temporary lists for sorting. */
        result = vdo_allocate(capacity * 2, struct cached_chapter_index *,
                              "scratch entries", &cache->scratch_entries);
-       if (result != UDS_SUCCESS)
+       if (result != VDO_SUCCESS)
                goto out;
 
        *cache_ptr = cache;
index 1a762e6dd70992661a4af5645795b76c1a1dc19e..1cc9ac4fe5108e91b29f6864a19353494fe77478 100644 (file)
@@ -1213,7 +1213,7 @@ static int initialize_volume_sub_index(const struct uds_configuration *config,
        /* The following arrays are initialized to all zeros. */
        result = vdo_allocate(params.list_count, u64, "first chapter to flush",
                              &sub_index->flush_chapters);
-       if (result != UDS_SUCCESS)
+       if (result != VDO_SUCCESS)
                return result;
 
        return vdo_allocate(zone_count, struct volume_sub_index_zone,
@@ -1229,7 +1229,7 @@ int uds_make_volume_index(const struct uds_configuration *config, u64 volume_non
        int result;
 
        result = vdo_allocate(1, struct volume_index, "volume index", &volume_index);
-       if (result != UDS_SUCCESS)
+       if (result != VDO_SUCCESS)
                return result;
 
        volume_index->zone_count = config->zone_count;
@@ -1251,7 +1251,7 @@ int uds_make_volume_index(const struct uds_configuration *config, u64 volume_non
 
        result = vdo_allocate(config->zone_count, struct volume_index_zone,
                              "volume index zones", &volume_index->zones);
-       if (result != UDS_SUCCESS) {
+       if (result != VDO_SUCCESS) {
                uds_free_volume_index(volume_index);
                return result;
        }
index 2d8901732f5d19d63704c6a9e87b58b01fe03115..959dd82ef665d1e14e91585d654a0e4c9a13bab4 100644 (file)
@@ -1509,22 +1509,22 @@ static int __must_check initialize_page_cache(struct page_cache *cache,
 
        result = vdo_allocate(VOLUME_CACHE_MAX_QUEUED_READS, struct queued_read,
                              "volume read queue", &cache->read_queue);
-       if (result != UDS_SUCCESS)
+       if (result != VDO_SUCCESS)
                return result;
 
        result = vdo_allocate(cache->zone_count, struct search_pending_counter,
                              "Volume Cache Zones", &cache->search_pending_counters);
-       if (result != UDS_SUCCESS)
+       if (result != VDO_SUCCESS)
                return result;
 
        result = vdo_allocate(cache->indexable_pages, u16, "page cache index",
                              &cache->index);
-       if (result != UDS_SUCCESS)
+       if (result != VDO_SUCCESS)
                return result;
 
        result = vdo_allocate(cache->cache_slots, struct cached_page, "page cache cache",
                              &cache->cache);
-       if (result != UDS_SUCCESS)
+       if (result != VDO_SUCCESS)
                return result;
 
        /* Initialize index values to invalid values. */
@@ -1547,7 +1547,7 @@ int uds_make_volume(const struct uds_configuration *config, struct index_layout
        int result;
 
        result = vdo_allocate(1, struct volume, "volume", &volume);
-       if (result != UDS_SUCCESS)
+       if (result != VDO_SUCCESS)
                return result;
 
        volume->nonce = uds_get_volume_nonce(layout);
@@ -1586,7 +1586,7 @@ int uds_make_volume(const struct uds_configuration *config, struct index_layout
        result = vdo_allocate(geometry->records_per_page,
                              const struct uds_volume_record *, "record pointers",
                              &volume->record_pointers);
-       if (result != UDS_SUCCESS) {
+       if (result != VDO_SUCCESS) {
                uds_free_volume(volume);
                return result;
        }
@@ -1626,7 +1626,7 @@ int uds_make_volume(const struct uds_configuration *config, struct index_layout
 
        result = vdo_allocate(config->read_threads, struct thread *, "reader threads",
                              &volume->reader_threads);
-       if (result != UDS_SUCCESS) {
+       if (result != VDO_SUCCESS) {
                uds_free_volume(volume);
                return result;
        }
index 0bd742ecbe2e277766f7fce59a2773f1f88a3295..9849d12f2a36040285b9f38b4687a3bc7e54f18a 100644 (file)
@@ -152,7 +152,7 @@ static u64 hash_key(u64 key)
  * @map: The map to initialize.
  * @capacity: The initial capacity of the map.
  *
- * Return: UDS_SUCCESS or an error code.
+ * Return: VDO_SUCCESS or an error code.
  */
 static int allocate_buckets(struct int_map *map, size_t capacity)
 {
@@ -174,7 +174,7 @@ static int allocate_buckets(struct int_map *map, size_t capacity)
  *                    tells the map to use its own small default).
  * @map_ptr: Output, a pointer to hold the new int_map.
  *
- * Return: UDS_SUCCESS or an error code.
+ * Return: VDO_SUCCESS or an error code.
  */
 int vdo_int_map_create(size_t initial_capacity, struct int_map **map_ptr)
 {
@@ -183,7 +183,7 @@ int vdo_int_map_create(size_t initial_capacity, struct int_map **map_ptr)
        size_t capacity;
 
        result = vdo_allocate(1, struct int_map, "struct int_map", &map);
-       if (result != UDS_SUCCESS)
+       if (result != VDO_SUCCESS)
                return result;
 
        /* Use the default capacity if the caller did not specify one. */
@@ -196,13 +196,13 @@ int vdo_int_map_create(size_t initial_capacity, struct int_map **map_ptr)
        capacity = capacity * 100 / DEFAULT_LOAD;
 
        result = allocate_buckets(map, capacity);
-       if (result != UDS_SUCCESS) {
+       if (result != VDO_SUCCESS) {
                vdo_int_map_free(vdo_forget(map));
                return result;
        }
 
        *map_ptr = map;
-       return UDS_SUCCESS;
+       return VDO_SUCCESS;
 }
 
 /**
@@ -368,7 +368,7 @@ void *vdo_int_map_get(struct int_map *map, u64 key)
  *
  * Resizes and rehashes all the existing entries, storing them in the new buckets.
  *
- * Return: UDS_SUCCESS or an error code.
+ * Return: VDO_SUCCESS or an error code.
  */
 static int resize_buckets(struct int_map *map)
 {
@@ -384,7 +384,7 @@ static int resize_buckets(struct int_map *map)
        uds_log_info("%s: attempting resize from %zu to %zu, current size=%zu",
                     __func__, map->capacity, new_capacity, map->size);
        result = allocate_buckets(map, new_capacity);
-       if (result != UDS_SUCCESS) {
+       if (result != VDO_SUCCESS) {
                *map = old_map;
                return result;
        }
@@ -407,7 +407,7 @@ static int resize_buckets(struct int_map *map)
 
        /* Destroy the old bucket array. */
        vdo_free(vdo_forget(old_map.buckets));
-       return UDS_SUCCESS;
+       return VDO_SUCCESS;
 }
 
 /**
@@ -647,7 +647,7 @@ int vdo_int_map_put(struct int_map *map, u64 key, void *new_value, bool update,
                 * large maps).
                 */
                result = resize_buckets(map);
-               if (result != UDS_SUCCESS)
+               if (result != VDO_SUCCESS)
                        return result;
 
                /*
index 23549b7e9e6d60a2d4b92533f6b5705d3b4c547c..b0f1ba810cd0c63655edbaad76f11318e11d83cf 100644 (file)
@@ -383,7 +383,7 @@ int vdo_make_io_submitter(unsigned int thread_count, unsigned int rotation_inter
        result = vdo_allocate_extended(struct io_submitter, thread_count,
                                       struct bio_queue_data, "bio submission data",
                                       &io_submitter);
-       if (result != UDS_SUCCESS)
+       if (result != VDO_SUCCESS)
                return result;
 
        io_submitter->bio_queue_rotation_interval = rotation_interval;
index ec24fff2a21b0675cc2e4312e9589a12eb2bc3b1..18c9d2af8aed346ac2487dece5f812f20fbf9d46 100644 (file)
@@ -420,7 +420,7 @@ int vdo_write_stats(struct vdo *vdo, char *buf, unsigned int maxlen)
        int result;
 
        result = vdo_allocate(1, struct vdo_statistics, __func__, &stats);
-       if (result != UDS_SUCCESS) {
+       if (result != VDO_SUCCESS) {
                uds_log_error("Cannot allocate memory to write VDO statistics");
                return result;
        }
index 2d2cccf89edb6a283991172ac90c7b99c8714f56..97208c9e006285a2fcfa6f8589e1ef0abcde6b5e 100644 (file)
@@ -2379,7 +2379,7 @@ static int allocate_slab_counters(struct vdo_slab *slab)
        bytes = (slab->reference_block_count * COUNTS_PER_BLOCK) + (2 * BYTES_PER_WORD);
        result = vdo_allocate(bytes, vdo_refcount_t, "ref counts array",
                              &slab->counters);
-       if (result != UDS_SUCCESS) {
+       if (result != VDO_SUCCESS) {
                vdo_free(vdo_forget(slab->reference_blocks));
                return result;
        }
index ad768278445992abaa616de7c544e2505ff0b020..b4aa71fffdbfe566e587cb0eb7be603bcfa4da24 100644 (file)
@@ -83,7 +83,7 @@ int vdo_create_thread(void (*thread_function)(void *), void *thread_data,
        int result;
 
        result = vdo_allocate(1, struct thread, __func__, &thread);
-       if (result != UDS_SUCCESS) {
+       if (result != VDO_SUCCESS) {
                uds_log_warning("Error allocating memory for %s", name);
                return result;
        }
index d1d5a30b3717f30abd3a578378bf76c460266005..753d81d6f207bbe562e5f009cb32e514ffbc7aae 100644 (file)
@@ -35,7 +35,7 @@ static char *buffer_to_string(const char *buf, size_t length)
 {
        char *string;
 
-       if (vdo_allocate(length + 1, char, __func__, &string) != UDS_SUCCESS)
+       if (vdo_allocate(length + 1, char, __func__, &string) != VDO_SUCCESS)
                return NULL;
 
        memcpy(string, buf, length);
index ae62f260c5ec8691c21ad3e283232c6b7925a2e5..b4dd0634a5cb8c850f102c541746b16e050f1a21 100644 (file)
@@ -545,7 +545,7 @@ int vdo_make(unsigned int instance, struct device_config *config, char **reason,
        *reason = "Unspecified error";
 
        result = vdo_allocate(1, struct vdo, __func__, &vdo);
-       if (result != UDS_SUCCESS) {
+       if (result != VDO_SUCCESS) {
                *reason = "Cannot allocate VDO";
                return result;
        }