@@ -2482,7 +2482,7 @@ static int make_forest(struct block_map *map, block_count_t entries)
return VDO_SUCCESS;
}
- result = UDS_ALLOCATE_EXTENDED(struct forest, map->root_count,
+ result = uds_allocate_extended(struct forest, map->root_count,
struct block_map_tree, __func__,
&forest);
if (result != VDO_SUCCESS)
@@ -2709,7 +2709,7 @@ void vdo_traverse_forest(struct block_map *map,
struct cursors *cursors;
int result;
- result = UDS_ALLOCATE_EXTENDED(struct cursors,
+ result = uds_allocate_extended(struct cursors,
map->root_count,
struct cursor,
__func__,
@@ -2760,7 +2760,7 @@ static int __must_check initialize_block_map_zone(struct block_map *map,
zone->thread_id = vdo->thread_config.logical_threads[zone_number];
zone->block_map = map;
- result = UDS_ALLOCATE_EXTENDED(struct dirty_lists,
+ result = uds_allocate_extended(struct dirty_lists,
maximum_age,
dirty_era_t,
__func__,
@@ -2916,7 +2916,7 @@ int vdo_decode_block_map(struct block_map_state_2_0 state,
if (result != UDS_SUCCESS)
return result;
- result = UDS_ALLOCATE_EXTENDED(struct block_map,
+ result = uds_allocate_extended(struct block_map,
vdo->thread_config.logical_zone_count,
struct block_map_zone,
__func__,
@@ -844,7 +844,7 @@ int make_data_vio_pool(struct vdo *vdo,
struct data_vio_pool *pool;
data_vio_count_t i;
- result = UDS_ALLOCATE_EXTENDED(struct data_vio_pool,
+ result = uds_allocate_extended(struct data_vio_pool,
pool_size,
struct data_vio,
__func__,
@@ -2463,7 +2463,7 @@ int vdo_make_hash_zones(struct vdo *vdo, struct hash_zones **zones_ptr)
if (zone_count == 0)
return VDO_SUCCESS;
- result = UDS_ALLOCATE_EXTENDED(struct hash_zones,
+ result = uds_allocate_extended(struct hash_zones,
zone_count,
struct hash_zone,
__func__,
@@ -491,7 +491,7 @@ make_index_save_region_table(struct index_save_layout *isl, struct region_table
type = RH_TYPE_UNSAVED;
}
- result = UDS_ALLOCATE_EXTENDED(struct region_table,
+ result = uds_allocate_extended(struct region_table,
region_count,
struct layout_region,
"layout region table for ISL",
@@ -674,7 +674,7 @@ make_layout_region_table(struct index_layout *layout, struct region_table **tabl
struct region_table *table;
struct layout_region *lr;
- result = UDS_ALLOCATE_EXTENDED(struct region_table,
+ result = uds_allocate_extended(struct region_table,
region_count,
struct layout_region,
"layout region table",
@@ -1175,7 +1175,7 @@ load_region_table(struct buffered_reader *reader, struct region_table **table_pt
"unknown region table version %hu",
header.version);
- result = UDS_ALLOCATE_EXTENDED(struct region_table,
+ result = uds_allocate_extended(struct region_table,
header.region_count,
struct layout_region,
"single file layout region table",
@@ -767,7 +767,7 @@ static int make_chapter_writer(struct uds_index *index, struct chapter_writer **
size_t collated_records_size =
(sizeof(struct uds_volume_record) * index->volume->geometry->records_per_chapter);
- result = UDS_ALLOCATE_EXTENDED(struct chapter_writer,
+ result = uds_allocate_extended(struct chapter_writer,
index->zone_count,
struct open_chapter_zone *,
"Chapter Writer",
@@ -1178,7 +1178,7 @@ int uds_make_index(struct configuration *config,
u64 nonce;
unsigned int z;
- result = UDS_ALLOCATE_EXTENDED(struct uds_index,
+ result = uds_allocate_extended(struct uds_index,
config->zone_count,
struct uds_request_queue *,
"index",
@@ -382,7 +382,7 @@ int vdo_make_io_submitter(unsigned int thread_count,
struct io_submitter *io_submitter;
int result;
- result = UDS_ALLOCATE_EXTENDED(struct io_submitter,
+ result = uds_allocate_extended(struct io_submitter,
thread_count,
struct bio_queue_data,
"bio submission data",
@@ -95,7 +95,7 @@ int vdo_make_logical_zones(struct vdo *vdo, struct logical_zones **zones_ptr)
if (zone_count == 0)
return VDO_SUCCESS;
- result = UDS_ALLOCATE_EXTENDED(struct logical_zones, zone_count,
+ result = uds_allocate_extended(struct logical_zones, zone_count,
struct logical_zone, __func__, &zones);
if (result != VDO_SUCCESS)
return result;
@@ -112,7 +112,7 @@ int __must_check uds_reallocate_memory(void *ptr,
*
* Return: UDS_SUCCESS or an error code
*/
-#define UDS_ALLOCATE_EXTENDED(TYPE1, COUNT, TYPE2, WHAT, PTR) \
+#define uds_allocate_extended(TYPE1, COUNT, TYPE2, WHAT, PTR) \
__extension__({ \
int _result; \
TYPE1 **_ptr = (PTR); \
@@ -70,7 +70,7 @@ int uds_make_open_chapter(const struct geometry *geometry,
size_t capacity = geometry->records_per_chapter / zone_count;
size_t slot_count = (1 << bits_per(capacity * LOAD_RATIO));
- result = UDS_ALLOCATE_EXTENDED(struct open_chapter_zone,
+ result = uds_allocate_extended(struct open_chapter_zone,
slot_count,
struct open_chapter_zone_slot,
"open chapter",
@@ -123,7 +123,7 @@ static int __must_check make_bin(struct packer *packer)
struct packer_bin *bin;
int result;
- result = UDS_ALLOCATE_EXTENDED(struct packer_bin,
+ result = uds_allocate_extended(struct packer_bin,
VDO_MAX_COMPRESSION_SLOTS,
struct vio *,
__func__,
@@ -174,7 +174,7 @@ int vdo_make_packer(struct vdo *vdo, block_count_t bin_count, struct packer **pa
* bin must have a canceler for which it is waiting, and any canceler will only have
* canceled one lock holder at a time.
*/
- result = UDS_ALLOCATE_EXTENDED(struct packer_bin,
+ result = uds_allocate_extended(struct packer_bin,
MAXIMUM_VDO_USER_VIOS / 2,
struct vio *, __func__,
&packer->canceled_bin);
@@ -241,7 +241,7 @@ static int make_pbn_lock_pool(size_t capacity, struct pbn_lock_pool **pool_ptr)
struct pbn_lock_pool *pool;
int result;
- result = UDS_ALLOCATE_EXTENDED(struct pbn_lock_pool,
+ result = uds_allocate_extended(struct pbn_lock_pool,
capacity,
idle_pbn_lock,
__func__,
@@ -372,7 +372,7 @@ int vdo_make_physical_zones(struct vdo *vdo, struct physical_zones **zones_ptr)
if (zone_count == 0)
return VDO_SUCCESS;
- result = UDS_ALLOCATE_EXTENDED(struct physical_zones,
+ result = uds_allocate_extended(struct physical_zones,
zone_count,
struct physical_zone,
__func__,
@@ -62,7 +62,7 @@ int vdo_make_priority_table(unsigned int max_priority, struct priority_table **t
if (max_priority > MAX_PRIORITY)
return UDS_INVALID_ARGUMENT;
- result = UDS_ALLOCATE_EXTENDED(struct priority_table, max_priority + 1,
+ result = uds_allocate_extended(struct priority_table, max_priority + 1,
struct bucket, __func__, &table);
if (result != VDO_SUCCESS)
return result;
@@ -220,7 +220,7 @@ int uds_make_radix_sorter(unsigned int count, struct radix_sorter **sorter)
unsigned int stack_size = count / INSERTION_SORT_THRESHOLD;
struct radix_sorter *radix_sorter;
- result = UDS_ALLOCATE_EXTENDED(struct radix_sorter,
+ result = uds_allocate_extended(struct radix_sorter,
stack_size,
struct task,
__func__,
@@ -724,7 +724,7 @@ int vdo_decode_recovery_journal(struct recovery_journal_state_7_0 state,
struct recovery_journal *journal;
int result;
- result = UDS_ALLOCATE_EXTENDED(struct recovery_journal,
+ result = uds_allocate_extended(struct recovery_journal,
RECOVERY_JOURNAL_RESERVED_BLOCKS,
struct recovery_journal_block,
__func__,
@@ -1722,7 +1722,7 @@ void vdo_repair(struct vdo_completion *parent)
uds_log_warning("Device was dirty, rebuilding reference counts");
}
- result = UDS_ALLOCATE_EXTENDED(struct repair_completion,
+ result = uds_allocate_extended(struct repair_completion,
page_count,
struct vdo_page_completion,
__func__,
@@ -4264,7 +4264,7 @@ int vdo_decode_slab_depot(struct slab_depot_state_2_0 state,
"slab size must be a power of two");
slab_size_shift = ilog2(slab_size);
- result = UDS_ALLOCATE_EXTENDED(struct slab_depot,
+ result = uds_allocate_extended(struct slab_depot,
vdo->thread_config.physical_zone_count,
struct block_allocator,
__func__,
@@ -52,7 +52,7 @@ static int create_multi_block_bio(block_count_t size, struct bio **bio_ptr)
struct bio *bio = NULL;
int result;
- result = UDS_ALLOCATE_EXTENDED(struct bio, size + 1, struct bio_vec, "bio", &bio);
+ result = uds_allocate_extended(struct bio, size + 1, struct bio_vec, "bio", &bio);
if (result != VDO_SUCCESS)
return result;
@@ -334,7 +334,7 @@ int make_vio_pool(struct vdo *vdo,
char *ptr;
int result;
- result = UDS_ALLOCATE_EXTENDED(struct vio_pool,
+ result = uds_allocate_extended(struct vio_pool,
pool_size,
struct pooled_vio,
__func__,