mirror of
https://github.com/torvalds/linux.git
synced 2026-06-01 11:03:43 +02:00
dm vdo: check for VDO_SUCCESS return value from memory-alloc functions
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>
This commit is contained in:
parent
97d3380396
commit
2de70388b3
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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),
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
||||
/*
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
||||
/*
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
|
|
|
|||
|
|
@ -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++) {
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
||||
/*
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user