dm vdo memory-alloc: rename functions
Subsystems (2)
Matthew Sakai
maintainercover dm vdo memory-alloc: rename functions
Mike Snitzer (2):
dm vdo memory-alloc: change from uds_ to vdo_ namespace dm vdo memory-alloc: rename vdo_do_allocation to __vdo_do_allocation
drivers/md/dm-vdo/action-manager.c | 2 +- drivers/md/dm-vdo/admin-state.c | 2 +- drivers/md/dm-vdo/block-map.c | 60 ++++++------ drivers/md/dm-vdo/data-vio.c | 24 ++--- drivers/md/dm-vdo/dedupe.c | 34 +++---- drivers/md/dm-vdo/dm-vdo-target.c | 56 +++++------ drivers/md/dm-vdo/dump.c | 2 +- drivers/md/dm-vdo/encodings.c | 4 +- drivers/md/dm-vdo/flush.c | 12 +-- drivers/md/dm-vdo/funnel-queue.c | 4 +- drivers/md/dm-vdo/funnel-workqueue.c | 30 +++--- drivers/md/dm-vdo/indexer/chapter-index.c | 6 +- drivers/md/dm-vdo/indexer/config.c | 4 +- drivers/md/dm-vdo/indexer/delta-index.c | 20 ++-- .../md/dm-vdo/indexer/funnel-requestqueue.c | 4 +- drivers/md/dm-vdo/indexer/geometry.c | 4 +- drivers/md/dm-vdo/indexer/index-layout.c | 58 ++++++------ drivers/md/dm-vdo/indexer/index-page-map.c | 20 ++-- drivers/md/dm-vdo/indexer/index-session.c | 6 +- drivers/md/dm-vdo/indexer/index.c | 26 +++--- drivers/md/dm-vdo/indexer/io-factory.c | 14 +-- drivers/md/dm-vdo/indexer/open-chapter.c | 8 +- drivers/md/dm-vdo/indexer/radix-sort.c | 4 +- drivers/md/dm-vdo/indexer/sparse-cache.c | 22 ++--- drivers/md/dm-vdo/indexer/volume-index.c | 16 ++-- drivers/md/dm-vdo/indexer/volume.c | 36 ++++---- drivers/md/dm-vdo/int-map.c | 14 +-- drivers/md/dm-vdo/io-submitter.c | 10 +- drivers/md/dm-vdo/logical-zone.c | 8 +- drivers/md/dm-vdo/memory-alloc.c | 38 ++++---- drivers/md/dm-vdo/memory-alloc.h | 74 +++++++-------- drivers/md/dm-vdo/message-stats.c | 4 +- drivers/md/dm-vdo/packer.c | 14 +-- drivers/md/dm-vdo/physical-zone.c | 16 ++-- drivers/md/dm-vdo/pool-sysfs.c | 2 +- drivers/md/dm-vdo/priority-table.c | 4 +- drivers/md/dm-vdo/recovery-journal.c | 36 ++++---- drivers/md/dm-vdo/repair.c | 24 ++--- drivers/md/dm-vdo/slab-depot.c | 80 ++++++++-------- drivers/md/dm-vdo/slab-depot.h | 2 +- drivers/md/dm-vdo/thread-utils.c | 10 +- drivers/md/dm-vdo/uds-sysfs.c | 4 +- drivers/md/dm-vdo/vdo.c | 92 +++++++++---------- drivers/md/dm-vdo/vio.c | 20 ++-- 44 files changed, 464 insertions(+), 466 deletions(-)
Signature · 1 line
2.42.0
Matthew Sakai
maintainerPATCH 2/2 dm vdo memory-alloc: rename vdo_do_allocation to __vdo_do_allocation
From: Mike Snitzer <[email protected]>
__vdo_do_allocation shouldn't be used outside of memory-alloc.h, so add hidden prefix.
Also, tabify the vdo_allocate_extended macro.
--- drivers/md/dm-vdo/memory-alloc.h | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-)
drivers/md/dm-vdo/memory-alloc.h +15 -15
@@ -37,8 +37,8 @@ int __must_check vdo_allocate_memory(size_t size, size_t align, const char *what* * Return: UDS_SUCCESS or an error code */ -static inline int vdo_do_allocation (size_t count,size_t size,size_t extra, -size_t align,const char *what,void *ptr) +static inline int __vdo_do_allocation (size_t count,size_t size,size_t extra, +size_t align,const char *what,void *ptr) {size_t total_size = count * size + extra;
@@ -68,7 +68,7 @@ static inline int vdo_do_allocation(size_t count, size_t size, size_t extra,* Return: UDS_SUCCESS or an error code */ #define vdo_allocate (COUNT ,TYPE ,WHAT ,PTR ) \ - vdo_do_allocation(COUNT, sizeof(TYPE), 0, __alignof__(TYPE), WHAT, PTR) + __vdo_do_allocation(COUNT, sizeof(TYPE), 0, __alignof__(TYPE), WHAT, PTR)/* * Allocate one object of an indicated type, followed by one or more elements of a second type,
@@ -83,18 +83,18 @@ static inline int vdo_do_allocation(size_t count, size_t size, size_t extra,* * Return: UDS_SUCCESS or an error code */ -#define vdo_allocate_extended (TYPE1 ,COUNT ,TYPE2 ,WHAT ,PTR ) \ - __extension__({ \ - int _result; \ - TYPE1 **_ptr = (PTR); \ - BUILD_BUG_ON(__alignof__(TYPE1) < __alignof__(TYPE2)); \ - _result = vdo_do_allocation(COUNT, \ - sizeof(TYPE2), \ - sizeof(TYPE1), \ - __alignof__(TYPE1), \ - WHAT, \ - _ptr); \ - _result; \ +#define vdo_allocate_extended (TYPE1 ,COUNT ,TYPE2 ,WHAT ,PTR ) \ + __extension__({ \ + int _result; \ + TYPE1 **_ptr = (PTR); \ + BUILD_BUG_ON(__alignof__(TYPE1) < __alignof__(TYPE2)); \ + _result = __vdo_do_allocation(COUNT, \ + sizeof(TYPE2), \ + sizeof(TYPE1), \ + __alignof__(TYPE1), \ + WHAT, \ + _ptr); \ + _result; \ })/*
Signature · 1 line
2.42.0
Matthew Sakai
maintainerPATCH 1/2 dm vdo memory-alloc: change from uds_ to vdo_ namespace
In reply to Matthew SakaiFrom: Mike Snitzer <[email protected]>
--- drivers/md/dm-vdo/action-manager.c | 2 +- drivers/md/dm-vdo/admin-state.c | 2 +- drivers/md/dm-vdo/block-map.c | 60 ++++++------ drivers/md/dm-vdo/data-vio.c | 24 ++--- drivers/md/dm-vdo/dedupe.c | 34 +++---- drivers/md/dm-vdo/dm-vdo-target.c | 56 +++++------ drivers/md/dm-vdo/dump.c | 2 +- drivers/md/dm-vdo/encodings.c | 4 +- drivers/md/dm-vdo/flush.c | 12 +-- drivers/md/dm-vdo/funnel-queue.c | 4 +- drivers/md/dm-vdo/funnel-workqueue.c | 30 +++--- drivers/md/dm-vdo/indexer/chapter-index.c | 6 +- drivers/md/dm-vdo/indexer/config.c | 4 +- drivers/md/dm-vdo/indexer/delta-index.c | 20 ++-- .../md/dm-vdo/indexer/funnel-requestqueue.c | 4 +- drivers/md/dm-vdo/indexer/geometry.c | 4 +- drivers/md/dm-vdo/indexer/index-layout.c | 58 ++++++------ drivers/md/dm-vdo/indexer/index-page-map.c | 20 ++-- drivers/md/dm-vdo/indexer/index-session.c | 6 +- drivers/md/dm-vdo/indexer/index.c | 26 +++--- drivers/md/dm-vdo/indexer/io-factory.c | 14 +-- drivers/md/dm-vdo/indexer/open-chapter.c | 8 +- drivers/md/dm-vdo/indexer/radix-sort.c | 4 +- drivers/md/dm-vdo/indexer/sparse-cache.c | 22 ++--- drivers/md/dm-vdo/indexer/volume-index.c | 16 ++-- drivers/md/dm-vdo/indexer/volume.c | 36 ++++---- drivers/md/dm-vdo/int-map.c | 14 +-- drivers/md/dm-vdo/io-submitter.c | 10 +- drivers/md/dm-vdo/logical-zone.c | 8 +- drivers/md/dm-vdo/memory-alloc.c | 38 ++++---- drivers/md/dm-vdo/memory-alloc.h | 52 +++++------ drivers/md/dm-vdo/message-stats.c | 4 +- drivers/md/dm-vdo/packer.c | 14 +-- drivers/md/dm-vdo/physical-zone.c | 16 ++-- drivers/md/dm-vdo/pool-sysfs.c | 2 +- drivers/md/dm-vdo/priority-table.c | 4 +- drivers/md/dm-vdo/recovery-journal.c | 36 ++++---- drivers/md/dm-vdo/repair.c | 24 ++--- drivers/md/dm-vdo/slab-depot.c | 80 ++++++++-------- drivers/md/dm-vdo/slab-depot.h | 2 +- drivers/md/dm-vdo/thread-utils.c | 10 +- drivers/md/dm-vdo/uds-sysfs.c | 4 +- drivers/md/dm-vdo/vdo.c | 92 +++++++++---------- drivers/md/dm-vdo/vio.c | 20 ++-- 44 files changed, 453 insertions(+), 455 deletions(-)
drivers/md/dm-vdo/action-manager.c +1 -1
@@ -107,7 +107,7 @@ int vdo_make_action_manager(zone_count_t zones, struct action_manager **manager_ptr) {struct action_manager *manager; - int result = uds_allocate(1, struct action_manager, __func__, &manager); + int result = vdo_allocate(1, struct action_manager, __func__, &manager);if (result !=VDO_SUCCESS )return result;
drivers/md/dm-vdo/admin-state.c +1 -1
@@ -206,7 +206,7 @@ bool vdo_finish_operation(struct admin_state *state, int result)if (!state->starting) {vdo_set_admin_state_code (state, state->next_state);if (state->waiter !=NULL ) -vdo_launch_completion (uds_forget (state->waiter)); +vdo_launch_completion (vdo_forget (state->waiter)); }return true;
drivers/md/dm-vdo/block-map.c +30 -30
169 lines not on this page · raw message
drivers/md/dm-vdo/data-vio.c +12 -12
@@ -789,20 +789,20 @@ static int initialize_data_vio(struct data_vio *data_vio, struct vdo *vdo)int result;BUILD_BUG_ON (VDO_BLOCK_SIZE >PAGE_SIZE ); - result =uds_allocate_memory (VDO_BLOCK_SIZE ,0 ,"data_vio data" , + result =vdo_allocate_memory (VDO_BLOCK_SIZE ,0 ,"data_vio data" , &data_vio->vio.data);if (result !=VDO_SUCCESS )return uds_log_error_strerror (result,"data_vio data allocation failure" ); - result =uds_allocate_memory (VDO_BLOCK_SIZE ,0 ,"compressed block" , + result =vdo_allocate_memory (VDO_BLOCK_SIZE ,0 ,"compressed block" , &data_vio->compression.block);if (result !=VDO_SUCCESS ) {return uds_log_error_strerror (result,"data_vio compressed block allocation failure" ); } - result =uds_allocate_memory (VDO_BLOCK_SIZE ,0 ,"vio scratch" , + result =vdo_allocate_memory (VDO_BLOCK_SIZE ,0 ,"vio scratch" , &data_vio->scratch_block);if (result !=VDO_SUCCESS ) return uds_log_error_strerror(result,
@@ -825,10 +825,10 @@ static void destroy_data_vio(struct data_vio *data_vio)if (data_vio ==NULL )return ; -vdo_free_bio (uds_forget (data_vio->vio.bio)); -uds_free (uds_forget (data_vio->vio.data)); -uds_free (uds_forget (data_vio->compression.block)); -uds_free (uds_forget (data_vio->scratch_block)); +vdo_free_bio (vdo_forget (data_vio->vio.bio)); +vdo_free (vdo_forget (data_vio->vio.data)); +vdo_free (vdo_forget (data_vio->compression.block)); +vdo_free (vdo_forget (data_vio->scratch_block)); }/**
@@ -845,7 +845,7 @@ int make_data_vio_pool(struct vdo *vdo, data_vio_count_t pool_size,struct data_vio_pool *pool;data_vio_count_t i; - result = uds_allocate_extended(struct data_vio_pool, pool_size, struct data_vio, + result = vdo_allocate_extended(struct data_vio_pool, pool_size, struct data_vio, __func__, &pool);if (result !=UDS_SUCCESS )return result;
@@ -867,7 +867,7 @@ int make_data_vio_pool(struct vdo *vdo, data_vio_count_t pool_size, result =uds_make_funnel_queue (&pool->queue);if (result !=UDS_SUCCESS ) { -free_data_vio_pool (uds_forget (pool)); +free_data_vio_pool (vdo_forget (pool));return result; }
@@ -924,8 +924,8 @@ void free_data_vio_pool(struct data_vio_pool *pool)destroy_data_vio (data_vio); } -uds_free_funnel_queue (uds_forget (pool->queue)); -uds_free (pool); +uds_free_funnel_queue (vdo_forget (pool->queue)); +vdo_free (pool); }static bool acquire_permit (struct limiter *limiter)
@@ -1431,7 +1431,7 @@ void release_data_vio_allocation_lock(struct data_vio *data_vio, bool reset) allocation->pbn =VDO_ZERO_BLOCK ;vdo_release_physical_zone_pbn_lock (allocation->zone, locked_pbn, -uds_forget (allocation->lock)); +vdo_forget (allocation->lock)); }/**
drivers/md/dm-vdo/dedupe.c +17 -17
@@ -700,7 +700,7 @@ static void unlock_duplicate_pbn(struct vdo_completion *completion) "must have a duplicate lock to release");vdo_release_physical_zone_pbn_lock (agent->duplicate.zone, agent->duplicate.pbn, -uds_forget (lock->duplicate_lock)); +vdo_forget (lock->duplicate_lock));if (lock->state ==VDO_HASH_LOCK_BYPASSING ) {complete_data_vio (completion);return ;
@@ -896,7 +896,7 @@ static int __must_check acquire_lock(struct hash_zone *zone, result =vdo_int_map_put (zone->hash_lock_map,hash_lock_key (new_lock), new_lock, (replace_lock !=NULL ), (void **) &lock);if (result !=VDO_SUCCESS ) { -return_hash_lock_to_pool (zone,uds_forget (new_lock)); +return_hash_lock_to_pool (zone,vdo_forget (new_lock));return result; }
@@ -915,7 +915,7 @@ static int __must_check acquire_lock(struct hash_zone *zone, lock->registered = true; }else {/* There's already a lock for the hash, so we don't need the borrowed lock. */ -return_hash_lock_to_pool (zone,uds_forget (new_lock)); +return_hash_lock_to_pool (zone,vdo_forget (new_lock)); } *lock_ptr = lock;
@@ -1980,7 +1980,7 @@ static void transfer_allocation_lock(struct data_vio *data_vio)* Since the lock is being transferred, the holder count doesn't change (and isn't even * safe to examine on this thread). */ - hash_lock->duplicate_lock =uds_forget (allocation->lock); + hash_lock->duplicate_lock =vdo_forget (allocation->lock); }/**
@@ -2025,7 +2025,7 @@ void vdo_share_compressed_write_lock(struct data_vio *data_vio,static void dedupe_kobj_release (struct kobject *directory) { -uds_free (container_of(directory ,struct hash_zones ,dedupe_directory )); +vdo_free (container_of(directory ,struct hash_zones ,dedupe_directory )); } static ssize_t dedupe_status_show(struct kobject *directory, struct attribute *attr,
@@ -2083,12 +2083,12 @@ static void start_uds_queue(void *ptr)*/ struct vdo_thread *thread =vdo_get_work_queue_owner (vdo_get_current_work_queue ()); -uds_register_allocating_thread (&thread->allocating_thread,NULL ); +vdo_register_allocating_thread (&thread->allocating_thread,NULL ); }static void finish_uds_queue (void *ptr__always_unused ) { -uds_unregister_allocating_thread (); +vdo_unregister_allocating_thread (); }static void close_index (struct hash_zones *zones)
@@ -2259,7 +2259,7 @@ static int initialize_index(struct vdo *vdo, struct hash_zones *zones) result =vdo_make_thread (vdo, vdo->thread_config.dedupe_thread, &uds_queue_type,1 ,NULL );if (result !=VDO_SUCCESS ) { -uds_destroy_index_session (uds_forget (zones->index_session)); +uds_destroy_index_session (vdo_forget (zones->index_session));uds_log_error ("UDS index queue initialization failed (%d)" , result);return result; }
@@ -2417,7 +2417,7 @@ static int __must_check initialize_zone(struct vdo *vdo, struct hash_zones *zonevdo_set_completion_callback (&zone->completion, timeout_index_operations_callback, zone->thread_id);INIT_LIST_HEAD (&zone->lock_pool); - result = uds_allocate(LOCK_POOL_CAPACITY, struct hash_lock, "hash_lock array", + result = vdo_allocate(LOCK_POOL_CAPACITY, struct hash_lock, "hash_lock array", &zone->lock_array);if (result !=VDO_SUCCESS )return result;
@@ -2471,14 +2471,14 @@ 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, zone_count, struct hash_zone, + result = vdo_allocate_extended(struct hash_zones, zone_count, struct hash_zone, __func__, &zones);if (result !=VDO_SUCCESS )return result; result =initialize_index (vdo, zones);if (result !=VDO_SUCCESS ) { -uds_free (zones); +vdo_free (zones);return result; }
@@ -2510,7 +2510,7 @@ void vdo_finish_dedupe_index(struct hash_zones *zones)if (zones ==NULL )return ; -uds_destroy_index_session (uds_forget (zones->index_session)); +uds_destroy_index_session (vdo_forget (zones->index_session)); }/**
@@ -2524,14 +2524,14 @@ void vdo_free_hash_zones(struct hash_zones *zones)if (zones ==NULL )return ; -uds_free (uds_forget (zones->manager)); +vdo_free (vdo_forget (zones->manager));for (i =0 ; i < zones->zone_count; i++) {struct hash_zone *zone = &zones->zones[i]; -uds_free_funnel_queue (uds_forget (zone->timed_out_complete)); -vdo_int_map_free (uds_forget (zone->hash_lock_map)); -uds_free (uds_forget (zone->lock_array)); +uds_free_funnel_queue (vdo_forget (zone->timed_out_complete)); +vdo_int_map_free (vdo_forget (zone->hash_lock_map)); +vdo_free (vdo_forget (zone->lock_array)); }if (zones->index_session !=NULL )
@@ -2539,7 +2539,7 @@ void vdo_free_hash_zones(struct hash_zones *zones)ratelimit_state_exit (&zones->ratelimiter);if (vdo_get_admin_state_code (&zones->state) ==VDO_ADMIN_STATE_NEW ) -uds_free (zones); +vdo_free (zones);else kobject_put (&zones->dedupe_directory); }
drivers/md/dm-vdo/dm-vdo-target.c +28 -28
205 lines not on this page · raw message
drivers/md/dm-vdo/dump.c +1 -1
@@ -79,7 +79,7 @@ static void do_dump(struct vdo *vdo, unsigned int dump_options_requested,if ((dump_options_requested &FLAG_SHOW_VDO_STATUS ) !=0 )vdo_dump_status (vdo); -uds_report_memory_usage (); +vdo_report_memory_usage ();uds_log_info ("end of %s dump" ,UDS_LOGGING_MODULE_NAME ); }
drivers/md/dm-vdo/encodings.c +2 -2
@@ -799,7 +799,7 @@ static int allocate_partition(struct layout *layout, u8 id,struct partition *partition;int result; - result = uds_allocate(1, struct partition, __func__, &partition); + result = vdo_allocate(1, struct partition, __func__, &partition);if (result !=UDS_SUCCESS )return result;
@@ -928,7 +928,7 @@ void vdo_uninitialize_layout(struct layout *layout)struct partition *part = layout->head; layout->head = part->next; -uds_free (part); +vdo_free (part); }memset (layout,0 ,sizeof (struct layout ));
drivers/md/dm-vdo/flush.c +6 -6
@@ -103,9 +103,9 @@ static void *allocate_flush(gfp_t gfp_mask, void *pool_data)struct vdo_flush *flush =NULL ;if ((gfp_mask &GFP_NOWAIT ) ==GFP_NOWAIT ) { - flush =uds_allocate_memory_nowait (sizeof (struct vdo_flush ), __func__); + flush =vdo_allocate_memory_nowait (sizeof (struct vdo_flush ), __func__); }else { - int result = uds_allocate(1, struct vdo_flush, __func__, &flush); + int result = vdo_allocate(1, struct vdo_flush, __func__, &flush);if (result !=VDO_SUCCESS )uds_log_error_strerror (result,"failed to allocate spare flush" );
@@ -123,7 +123,7 @@ static void *allocate_flush(gfp_t gfp_mask, void *pool_data)static void free_flush (void *element,void *pool_data__always_unused ) { -uds_free (element); +vdo_free (element); }/**
@@ -134,7 +134,7 @@ static void free_flush(void *element, void *pool_data __always_unused)*/ int vdo_make_flusher (struct vdo *vdo) { - int result = uds_allocate(1, struct flusher, __func__, &vdo->flusher); + int result = vdo_allocate(1, struct flusher, __func__, &vdo->flusher);if (result !=VDO_SUCCESS )return result;
@@ -162,8 +162,8 @@ void vdo_free_flusher(struct flusher *flusher)return ;if (flusher->flush_pool !=NULL ) -mempool_destroy (uds_forget (flusher->flush_pool)); -uds_free (flusher); +mempool_destroy (vdo_forget (flusher->flush_pool)); +vdo_free (flusher); }/**
drivers/md/dm-vdo/funnel-queue.c +2 -2
@@ -14,7 +14,7 @@ int uds_make_funnel_queue(struct funnel_queue **queue_ptr)int result;struct funnel_queue *queue; - result = uds_allocate(1, struct funnel_queue, "funnel queue", &queue); + result = vdo_allocate(1, struct funnel_queue, "funnel queue", &queue);if (result !=UDS_SUCCESS )return result;
@@ -32,7 +32,7 @@ int uds_make_funnel_queue(struct funnel_queue **queue_ptr)void uds_free_funnel_queue (struct funnel_queue *queue) { -uds_free (queue); +vdo_free (queue); }static struct funnel_queue_entry *get_oldest (struct funnel_queue *queue)
drivers/md/dm-vdo/funnel-workqueue.c +15 -15
@@ -276,8 +276,8 @@ static void free_simple_work_queue(struct simple_work_queue *queue)for (i =0 ; i <=VDO_WORK_Q_MAX_PRIORITY ; i++)uds_free_funnel_queue (queue->priority_lists[i]); -uds_free (queue->common.name); -uds_free (queue); +vdo_free (queue->common.name); +vdo_free (queue); }static void free_round_robin_work_queue (struct round_robin_work_queue *queue)
@@ -290,9 +290,9 @@ static void free_round_robin_work_queue(struct round_robin_work_queue *queue)for (i =0 ; i < count; i++)free_simple_work_queue (queue_table[i]); -uds_free (queue_table); -uds_free (queue->common.name); -uds_free (queue); +vdo_free (queue_table); +vdo_free (queue->common.name); +vdo_free (queue); }void vdo_free_work_queue (struct vdo_work_queue *queue)
@@ -323,7 +323,7 @@ static int make_simple_work_queue(const char *thread_name_prefix, const char *na"queue priority count %u within limit %u" , type->max_priority, VDO_WORK_Q_MAX_PRIORITY); - result = uds_allocate(1, struct simple_work_queue, "simple work queue", &queue); + result = vdo_allocate(1, struct simple_work_queue, "simple work queue", &queue);if (result !=UDS_SUCCESS )return result;
@@ -333,9 +333,9 @@ static int make_simple_work_queue(const char *thread_name_prefix, const char *na queue->common.owner = owner;init_waitqueue_head (&queue->waiting_worker_threads); - result =uds_duplicate_string (name,"queue name" , &queue->common.name); + result =vdo_duplicate_string (name,"queue name" , &queue->common.name);if (result !=VDO_SUCCESS ) { -uds_free (queue); +vdo_free (queue);return -ENOMEM ; }
@@ -399,15 +399,15 @@ int vdo_make_work_queue(const char *thread_name_prefix, const char *name,return result; } - result = uds_allocate(1, struct round_robin_work_queue, "round-robin work queue", + result = vdo_allocate(1, struct round_robin_work_queue, "round-robin work queue", &queue);if (result !=UDS_SUCCESS )return result; - result = uds_allocate(thread_count, struct simple_work_queue *, + result = vdo_allocate(thread_count, struct simple_work_queue *,"subordinate work queues" , &queue->service_queues);if (result !=UDS_SUCCESS ) { -uds_free (queue); +vdo_free (queue);return result; }
@@ -415,10 +415,10 @@ int vdo_make_work_queue(const char *thread_name_prefix, const char *name, queue->common.round_robin_mode = true; queue->common.owner = owner; - result =uds_duplicate_string (name,"queue name" , &queue->common.name); + result =vdo_duplicate_string (name,"queue name" , &queue->common.name);if (result !=VDO_SUCCESS ) { -uds_free (queue->service_queues); -uds_free (queue); +vdo_free (queue->service_queues); +vdo_free (queue);return -ENOMEM ; }
@@ -433,7 +433,7 @@ int vdo_make_work_queue(const char *thread_name_prefix, const char *name,if (result !=VDO_SUCCESS ) { queue->num_service_queues = i;/* Destroy previously created subordinates. */ -vdo_free_work_queue (uds_forget (*queue_ptr)); +vdo_free_work_queue (vdo_forget (*queue_ptr));return result; } }
drivers/md/dm-vdo/indexer/chapter-index.c +3 -3
@@ -20,7 +20,7 @@ int uds_make_open_chapter_index(struct open_chapter_index **chapter_index,size_t memory_size;struct open_chapter_index *index; - result = uds_allocate(1, struct open_chapter_index, "open chapter index", &index); + result = vdo_allocate(1, struct open_chapter_index, "open chapter index", &index);if (result !=UDS_SUCCESS )return result;
@@ -37,7 +37,7 @@ int uds_make_open_chapter_index(struct open_chapter_index **chapter_index, geometry->chapter_payload_bits, memory_size, 'm');if (result !=UDS_SUCCESS ) { -uds_free (index); +vdo_free (index);return result; }
@@ -52,7 +52,7 @@ void uds_free_open_chapter_index(struct open_chapter_index *chapter_index)return ;uds_uninitialize_delta_index (&chapter_index->delta_index); -uds_free (chapter_index); +vdo_free (chapter_index); }/* Re-initialize an open chapter index for a new chapter. */
drivers/md/dm-vdo/indexer/config.c +2 -2
@@ -325,7 +325,7 @@ int uds_make_configuration(const struct uds_parameters *params,if (result !=UDS_SUCCESS )return result; - result = uds_allocate(1, struct uds_configuration, __func__, &config); + result = vdo_allocate(1, struct uds_configuration, __func__, &config);if (result !=UDS_SUCCESS )return result;
@@ -356,7 +356,7 @@ void uds_free_configuration(struct uds_configuration *config) {if (config !=NULL ) {uds_free_index_geometry (config->geometry); -uds_free (config); +vdo_free (config); } }
drivers/md/dm-vdo/indexer/delta-index.c +10 -10
@@ -296,12 +296,12 @@ void uds_uninitialize_delta_index(struct delta_index *delta_index)return ;for (z =0 ; z < delta_index->zone_count; z++) { -uds_free (uds_forget (delta_index->delta_zones[z].new_offsets)); -uds_free (uds_forget (delta_index->delta_zones[z].delta_lists)); -uds_free (uds_forget (delta_index->delta_zones[z].memory)); +vdo_free (vdo_forget (delta_index->delta_zones[z].new_offsets)); +vdo_free (vdo_forget (delta_index->delta_zones[z].delta_lists)); +vdo_free (vdo_forget (delta_index->delta_zones[z].memory)); } -uds_free (delta_index->delta_zones); +vdo_free (delta_index->delta_zones);memset (delta_index,0 ,sizeof (struct delta_index )); }
@@ -311,17 +311,17 @@ static int initialize_delta_zone(struct delta_zone *delta_zone, size_t size, {int result; - result =uds_allocate (size, u8,"delta list" , &delta_zone->memory); + result =vdo_allocate (size, u8,"delta list" , &delta_zone->memory);if (result !=UDS_SUCCESS )return result; - result =uds_allocate (list_count +2 , u64,"delta list temp" , + result =vdo_allocate (list_count +2 , u64,"delta list temp" , &delta_zone->new_offsets);if (result !=UDS_SUCCESS )return result;/* Allocate the delta lists. */ - result = uds_allocate(list_count + 2, struct delta_list, "delta lists", + result = vdo_allocate(list_count + 2, struct delta_list, "delta lists", &delta_zone->delta_lists);if (result !=UDS_SUCCESS )return result;
@@ -352,7 +352,7 @@ int uds_initialize_delta_index(struct delta_index *delta_index, unsigned int zonunsigned int z;size_t zone_memory; - result = uds_allocate(zone_count, struct delta_zone, "Delta Index Zones", + result = vdo_allocate(zone_count, struct delta_zone, "Delta Index Zones", &delta_index->delta_zones);if (result !=UDS_SUCCESS )return result;
@@ -1047,7 +1047,7 @@ int uds_finish_restoring_delta_index(struct delta_index *delta_index,unsigned int z;u8 *data; - result =uds_allocate (DELTA_LIST_MAX_BYTE_COUNT , u8, __func__, &data); + result =vdo_allocate (DELTA_LIST_MAX_BYTE_COUNT , u8, __func__, &data);if (result !=UDS_SUCCESS )return result;
@@ -1062,7 +1062,7 @@ int uds_finish_restoring_delta_index(struct delta_index *delta_index, } } -uds_free (data); +vdo_free (data);return saved_result; }
drivers/md/dm-vdo/indexer/funnel-requestqueue.c +2 -2
@@ -198,7 +198,7 @@ int uds_make_request_queue(const char *queue_name,int result;struct uds_request_queue *queue; - result = uds_allocate(1, struct uds_request_queue, __func__, &queue); + result = vdo_allocate(1, struct uds_request_queue, __func__, &queue);if (result !=UDS_SUCCESS )return result;
@@ -275,5 +275,5 @@ void uds_request_queue_finish(struct uds_request_queue *queue)uds_free_funnel_queue (queue->main_queue);uds_free_funnel_queue (queue->retry_queue); -uds_free (queue); +vdo_free (queue); }
drivers/md/dm-vdo/indexer/geometry.c +2 -2
@@ -61,7 +61,7 @@ int uds_make_index_geometry(size_t bytes_per_page, u32 record_pages_per_chapter,int result;struct index_geometry *geometry; - result = uds_allocate(1, struct index_geometry, "geometry", &geometry); + result = vdo_allocate(1, struct index_geometry, "geometry", &geometry);if (result !=UDS_SUCCESS )return result;
@@ -121,7 +121,7 @@ int uds_copy_index_geometry(struct index_geometry *source,void uds_free_index_geometry (struct index_geometry *geometry) { -uds_free (geometry); +vdo_free (geometry); } u32 __must_check uds_map_to_physical_chapter(const struct index_geometry *geometry,
drivers/md/dm-vdo/indexer/index-layout.c +29 -29
222 lines not on this page · raw message
drivers/md/dm-vdo/indexer/index-page-map.c +10 -10
@@ -38,13 +38,13 @@ int uds_make_index_page_map(const struct index_geometry *geometry,int result;struct index_page_map *map; - result = uds_allocate(1, struct index_page_map, "page map", &map); + result = vdo_allocate(1, struct index_page_map, "page map", &map);if (result !=UDS_SUCCESS )return result; map->geometry = geometry; map->entries_per_chapter = geometry->index_pages_per_chapter -1 ; - result =uds_allocate (get_entry_count (geometry), u16,"Index Page Map Entries" , + result =vdo_allocate (get_entry_count (geometry), u16,"Index Page Map Entries" , &map->entries);if (result !=UDS_SUCCESS ) {uds_free_index_page_map (map);
@@ -58,8 +58,8 @@ int uds_make_index_page_map(const struct index_geometry *geometry,void uds_free_index_page_map (struct index_page_map *map) {if (map !=NULL ) { -uds_free (map->entries); -uds_free (map); +vdo_free (map->entries); +vdo_free (map); } }
@@ -118,7 +118,7 @@ int uds_write_index_page_map(struct index_page_map *map, struct buffered_writeru64 saved_size =uds_compute_index_page_map_save_size (map->geometry);u32 i; - result =uds_allocate (saved_size, u8,"page map data" , &buffer); + result =vdo_allocate (saved_size, u8,"page map data" , &buffer);if (result !=UDS_SUCCESS )return result;
@@ -129,7 +129,7 @@ int uds_write_index_page_map(struct index_page_map *map, struct buffered_writerencode_u16_le (buffer, &offset, map->entries[i]); result =uds_write_to_buffered_writer (writer, buffer, offset); -uds_free (buffer); +vdo_free (buffer);if (result !=UDS_SUCCESS )return result;
@@ -145,20 +145,20 @@ int uds_read_index_page_map(struct index_page_map *map, struct buffered_reader *u64 saved_size =uds_compute_index_page_map_save_size (map->geometry);u32 i; - result =uds_allocate (saved_size, u8,"page map data" , &buffer); + result =vdo_allocate (saved_size, u8,"page map data" , &buffer);if (result !=UDS_SUCCESS )return result; result =uds_read_from_buffered_reader (reader, buffer, saved_size);if (result !=UDS_SUCCESS ) { -uds_free (buffer); +vdo_free (buffer);return result; }memcpy (&magic, buffer,PAGE_MAP_MAGIC_LENGTH ); offset +=PAGE_MAP_MAGIC_LENGTH ;if (memcmp (magic,PAGE_MAP_MAGIC ,PAGE_MAP_MAGIC_LENGTH ) !=0 ) { -uds_free (buffer); +vdo_free (buffer);return UDS_CORRUPT_DATA ; }
@@ -166,7 +166,7 @@ int uds_read_index_page_map(struct index_page_map *map, struct buffered_reader *for (i =0 ; i <get_entry_count (map->geometry); i++)decode_u16_le (buffer, &offset, &map->entries[i]); -uds_free (buffer); +vdo_free (buffer);uds_log_debug ("read index page map, last update %llu" , (unsigned long long ) map->last_update);return UDS_SUCCESS ;
drivers/md/dm-vdo/indexer/index-session.c +3 -3
@@ -221,7 +221,7 @@ static int __must_check make_empty_index_session(struct uds_index_session **indeint result;struct uds_index_session *session; - result = uds_allocate(1, struct uds_index_session, __func__, &session); + result = vdo_allocate(1, struct uds_index_session, __func__, &session);if (result !=UDS_SUCCESS )return result;
@@ -233,7 +233,7 @@ static int __must_check make_empty_index_session(struct uds_index_session **inde result =uds_make_request_queue ("callbackW" , &handle_callbacks, &session->callback_queue);if (result !=UDS_SUCCESS ) { -uds_free (session); +vdo_free (session);return result; }
@@ -673,7 +673,7 @@ int uds_destroy_index_session(struct uds_index_session *index_session)uds_request_queue_finish (index_session->callback_queue); index_session->callback_queue =NULL ;uds_log_debug ("Destroyed index session" ); -uds_free (index_session); +vdo_free (index_session);return uds_status_to_errno (result); }
drivers/md/dm-vdo/indexer/index.c +13 -13
@@ -88,7 +88,7 @@ static int launch_zone_message(struct uds_zone_message message, unsigned int zonint result;struct uds_request *request; - result = uds_allocate(1, struct uds_request, __func__, &request); + result = vdo_allocate(1, struct uds_request, __func__, &request);if (result !=UDS_SUCCESS )return result;
@@ -623,7 +623,7 @@ static void execute_zone_request(struct uds_request *request) }/* Once the message is processed it can be freed. */ -uds_free (uds_forget (request)); +vdo_free (vdo_forget (request));return ; }
@@ -755,8 +755,8 @@ static void free_chapter_writer(struct chapter_writer *writer)stop_chapter_writer (writer);uds_free_open_chapter_index (writer->open_chapter_index); -uds_free (writer->collated_records); -uds_free (writer); +vdo_free (writer->collated_records); +vdo_free (writer); } static int make_chapter_writer(struct uds_index *index,
@@ -767,7 +767,7 @@ static int make_chapter_writer(struct uds_index *index,size_t collated_records_size = (sizeof (struct uds_volume_record ) * index->volume->geometry->records_per_chapter); - result = uds_allocate_extended(struct chapter_writer, index->zone_count, + result = vdo_allocate_extended(struct chapter_writer, index->zone_count, struct open_chapter_zone *, "Chapter Writer", &writer);if (result !=UDS_SUCCESS )
@@ -777,7 +777,7 @@ static int make_chapter_writer(struct uds_index *index,mutex_init (&writer->mutex);uds_init_cond (&writer->cond); - result =uds_allocate_cache_aligned (collated_records_size,"collated records" , + result =vdo_allocate_cache_aligned (collated_records_size,"collated records" , &writer->collated_records);if (result !=UDS_SUCCESS ) {free_chapter_writer (writer);
@@ -1118,7 +1118,7 @@ static void free_index_zone(struct index_zone *zone)uds_free_open_chapter (zone->open_chapter);uds_free_open_chapter (zone->writing_chapter); -uds_free (zone); +vdo_free (zone); }static int make_index_zone (struct uds_index *index,unsigned int zone_number)
@@ -1126,7 +1126,7 @@ static int make_index_zone(struct uds_index *index, unsigned int zone_number)int result;struct index_zone *zone; - result = uds_allocate(1, struct index_zone, "index zone", &zone); + result = vdo_allocate(1, struct index_zone, "index zone", &zone);if (result !=UDS_SUCCESS )return result;
@@ -1163,7 +1163,7 @@ int uds_make_index(struct uds_configuration *config, enum uds_open_index_type opu64 nonce;unsigned int z; - result = uds_allocate_extended(struct uds_index, config->zone_count, + result = vdo_allocate_extended(struct uds_index, config->zone_count, struct uds_request_queue *, "index", &index);if (result !=UDS_SUCCESS )return result;
@@ -1176,7 +1176,7 @@ int uds_make_index(struct uds_configuration *config, enum uds_open_index_type opreturn result; } - result = uds_allocate(index->zone_count, struct index_zone *, "zones", + result = vdo_allocate(index->zone_count, struct index_zone *, "zones", &index->zones);if (result !=UDS_SUCCESS ) {uds_free_index (index);
@@ -1289,12 +1289,12 @@ void uds_free_index(struct uds_index *index)if (index->zones !=NULL ) {for (i =0 ; i < index->zone_count; i++)free_index_zone (index->zones[i]); -uds_free (index->zones); +vdo_free (index->zones); }uds_free_volume (index->volume); -uds_free_index_layout (uds_forget (index->layout)); -uds_free (index); +uds_free_index_layout (vdo_forget (index->layout)); +vdo_free (index); }/* Wait for the chapter writer to complete any outstanding writes. */
drivers/md/dm-vdo/indexer/io-factory.c +7 -7
@@ -64,7 +64,7 @@ int uds_make_io_factory(struct block_device *bdev, struct io_factory **factory_pint result;struct io_factory *factory; - result = uds_allocate(1, struct io_factory, __func__, &factory); + result = vdo_allocate(1, struct io_factory, __func__, &factory);if (result !=UDS_SUCCESS )return result;
@@ -85,7 +85,7 @@ int uds_replace_storage(struct io_factory *factory, struct block_device *bdev)void uds_put_io_factory (struct io_factory *factory) {if (atomic_add_return (-1 , &factory->ref_count) <=0 ) -uds_free (factory); +vdo_free (factory); }size_t uds_get_writable_size (struct io_factory *factory)
@@ -129,7 +129,7 @@ void uds_free_buffered_reader(struct buffered_reader *reader)dm_bufio_client_destroy (reader->client);uds_put_io_factory (reader->factory); -uds_free (reader); +vdo_free (reader); }/* Create a buffered reader for an index region starting at offset. */
@@ -144,7 +144,7 @@ int uds_make_buffered_reader(struct io_factory *factory, off_t offset, u64 blockif (result !=UDS_SUCCESS )return result; - result = uds_allocate(1, struct buffered_reader, "buffered reader", &reader); + result = vdo_allocate(1, struct buffered_reader, "buffered reader", &reader);if (result !=UDS_SUCCESS ) {dm_bufio_client_destroy (client);return result;
@@ -177,7 +177,7 @@ static int position_reader(struct buffered_reader *reader, sector_t block_numberreturn UDS_OUT_OF_RANGE ;if (reader->buffer !=NULL ) -dm_bufio_release (uds_forget (reader->buffer)); +dm_bufio_release (vdo_forget (reader->buffer)); data =dm_bufio_read (reader->client, block_number, &buffer);if (IS_ERR (data))
@@ -282,7 +282,7 @@ int uds_make_buffered_writer(struct io_factory *factory, off_t offset, u64 blockif (result !=UDS_SUCCESS )return result; - result = uds_allocate(1, struct buffered_writer, "buffered writer", &writer); + result = vdo_allocate(1, struct buffered_writer, "buffered writer", &writer);if (result !=UDS_SUCCESS ) {dm_bufio_client_destroy (client);return result;
@@ -369,7 +369,7 @@ void uds_free_buffered_writer(struct buffered_writer *writer)dm_bufio_client_destroy (writer->client);uds_put_io_factory (writer->factory); -uds_free (writer); +vdo_free (writer); }/*
drivers/md/dm-vdo/indexer/open-chapter.c +4 -4
@@ -68,7 +68,7 @@ int uds_make_open_chapter(const struct index_geometry *geometry, unsigned int zosize_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, slot_count, + result = vdo_allocate_extended(struct open_chapter_zone, slot_count, struct open_chapter_zone_slot, "open chapter", &open_chapter);if (result !=UDS_SUCCESS )
@@ -76,7 +76,7 @@ int uds_make_open_chapter(const struct index_geometry *geometry, unsigned int zo open_chapter->slot_count = slot_count; open_chapter->capacity = capacity; - result =uds_allocate_cache_aligned (records_size (open_chapter),"record pages" , + result =vdo_allocate_cache_aligned (records_size (open_chapter),"record pages" , &open_chapter->records);if (result !=UDS_SUCCESS ) {uds_free_open_chapter (open_chapter);
@@ -194,8 +194,8 @@ void uds_remove_from_open_chapter(struct open_chapter_zone *open_chapter,void uds_free_open_chapter (struct open_chapter_zone *open_chapter) {if (open_chapter !=NULL ) { -uds_free (open_chapter->records); -uds_free (open_chapter); +vdo_free (open_chapter->records); +vdo_free (open_chapter); } }
drivers/md/dm-vdo/indexer/radix-sort.c +2 -2
@@ -211,7 +211,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, stack_size, struct task, + result = vdo_allocate_extended(struct radix_sorter, stack_size, struct task, __func__, &radix_sorter);if (result !=UDS_SUCCESS )return result;
@@ -224,7 +224,7 @@ int uds_make_radix_sorter(unsigned int count, struct radix_sorter **sorter)void uds_free_radix_sorter (struct radix_sorter *sorter) { -uds_free (sorter); +vdo_free (sorter); }/*
drivers/md/dm-vdo/indexer/sparse-cache.c +11 -11
@@ -222,12 +222,12 @@ static int __must_check initialize_cached_chapter_index(struct cached_chapter_in chapter->virtual_chapter =NO_CHAPTER ; chapter->index_pages_count = geometry->index_pages_per_chapter; - result = uds_allocate(chapter->index_pages_count, struct delta_index_page, + result = vdo_allocate(chapter->index_pages_count, struct delta_index_page, __func__, &chapter->index_pages);if (result !=UDS_SUCCESS )return result; - return uds_allocate(chapter->index_pages_count, struct dm_buffer *, + return vdo_allocate(chapter->index_pages_count, struct dm_buffer *,"sparse index volume pages" , &chapter->page_buffers); }
@@ -241,7 +241,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 =uds_allocate_cache_aligned (bytes,"search list" , &list); + result =vdo_allocate_cache_aligned (bytes,"search list" , &list);if (result !=UDS_SUCCESS )return result;
@@ -264,7 +264,7 @@ int uds_make_sparse_cache(const struct index_geometry *geometry, unsigned int caunsigned int bytes; bytes = (sizeof (struct sparse_cache ) + (capacity *sizeof (struct cached_chapter_index ))); - result =uds_allocate_cache_aligned (bytes,"sparse cache" , &cache); + result =vdo_allocate_cache_aligned (bytes,"sparse cache" , &cache);if (result !=UDS_SUCCESS )return result;
@@ -294,7 +294,7 @@ int uds_make_sparse_cache(const struct index_geometry *geometry, unsigned int ca }/* purge_search_list() needs some temporary lists for sorting. */ - result = uds_allocate(capacity * 2, struct cached_chapter_index *, + result = vdo_allocate(capacity * 2, struct cached_chapter_index *,"scratch entries" , &cache->scratch_entries);if (result !=UDS_SUCCESS ) goto out;
@@ -338,7 +338,7 @@ static void release_cached_chapter_index(struct cached_chapter_index *chapter)for (i =0 ; i < chapter->index_pages_count; i++) {if (chapter->page_buffers[i] !=NULL ) -dm_bufio_release (uds_forget (chapter->page_buffers[i])); +dm_bufio_release (vdo_forget (chapter->page_buffers[i])); } }
@@ -349,18 +349,18 @@ void uds_free_sparse_cache(struct sparse_cache *cache)if (cache ==NULL )return ; -uds_free (cache->scratch_entries); +vdo_free (cache->scratch_entries);for (i =0 ; i < cache->zone_count; i++) -uds_free (cache->search_lists[i]); +vdo_free (cache->search_lists[i]);for (i =0 ; i < cache->capacity; i++) {release_cached_chapter_index (&cache->chapters[i]); -uds_free (cache->chapters[i].index_pages); -uds_free (cache->chapters[i].page_buffers); +vdo_free (cache->chapters[i].index_pages); +vdo_free (cache->chapters[i].page_buffers); } -uds_free (cache); +vdo_free (cache); }/*
drivers/md/dm-vdo/indexer/volume-index.c +8 -8
@@ -279,8 +279,8 @@ static int compute_volume_sub_index_parameters(const struct uds_configuration *cstatic void uninitialize_volume_sub_index (struct volume_sub_index *sub_index) { -uds_free (uds_forget (sub_index->flush_chapters)); -uds_free (uds_forget (sub_index->zones)); +vdo_free (vdo_forget (sub_index->flush_chapters)); +vdo_free (vdo_forget (sub_index->zones));uds_uninitialize_delta_index (&sub_index->delta_index); }
@@ -290,11 +290,11 @@ void uds_free_volume_index(struct volume_index *volume_index)return ;if (volume_index->zones !=NULL ) -uds_free (uds_forget (volume_index->zones)); +vdo_free (vdo_forget (volume_index->zones));uninitialize_volume_sub_index (&volume_index->vi_non_hook);uninitialize_volume_sub_index (&volume_index->vi_hook); -uds_free (volume_index); +vdo_free (volume_index); }
@@ -1211,12 +1211,12 @@ static int initialize_volume_sub_index(const struct uds_configuration *config, (zone_count * sizeof(struct volume_sub_index_zone)));/* The following arrays are initialized to all zeros. */ - result =uds_allocate (params.list_count, u64,"first chapter to flush" , + result =vdo_allocate (params.list_count, u64,"first chapter to flush" , &sub_index->flush_chapters);if (result !=UDS_SUCCESS )return result; - return uds_allocate(zone_count, struct volume_sub_index_zone, + return vdo_allocate(zone_count, struct volume_sub_index_zone,"volume index zones" , &sub_index->zones); }
@@ -1228,7 +1228,7 @@ int uds_make_volume_index(const struct uds_configuration *config, u64 volume_nonstruct volume_index *volume_index;int result; - result = uds_allocate(1, struct volume_index, "volume index", &volume_index); + result = vdo_allocate(1, struct volume_index, "volume index", &volume_index);if (result !=UDS_SUCCESS )return result;
@@ -1249,7 +1249,7 @@ int uds_make_volume_index(const struct uds_configuration *config, u64 volume_non volume_index->sparse_sample_rate = config->sparse_sample_rate; - result = uds_allocate(config->zone_count, struct volume_index_zone, + result = vdo_allocate(config->zone_count, struct volume_index_zone,"volume index zones" , &volume_index->zones);if (result !=UDS_SUCCESS ) {uds_free_volume_index (volume_index);
drivers/md/dm-vdo/indexer/volume.c +18 -18
@@ -198,7 +198,7 @@ static void wait_for_pending_searches(struct page_cache *cache, u32 physical_pagstatic void release_page_buffer (struct cached_page *page) {if (page->buffer !=NULL ) -dm_bufio_release (uds_forget (page->buffer)); +dm_bufio_release (vdo_forget (page->buffer)); }static void clear_cache_page (struct page_cache *cache,struct cached_page *page)
@@ -1482,7 +1482,7 @@ int __must_check uds_replace_volume_storage(struct volume *volume,if (volume->sparse_cache !=NULL )uds_invalidate_sparse_cache (volume->sparse_cache);if (volume->client !=NULL ) -dm_bufio_client_destroy (uds_forget (volume->client)); +dm_bufio_client_destroy (vdo_forget (volume->client));return uds_open_volume_bufio (layout, volume->geometry->bytes_per_page, volume->reserved_buffers, &volume->client);
@@ -1507,22 +1507,22 @@ static int __must_check initialize_page_cache(struct page_cache *cache,if (result !=UDS_SUCCESS )return result; - result = uds_allocate(VOLUME_CACHE_MAX_QUEUED_READS, struct queued_read, + result = vdo_allocate(VOLUME_CACHE_MAX_QUEUED_READS, struct queued_read,"volume read queue" , &cache->read_queue);if (result !=UDS_SUCCESS )return result; - result = uds_allocate(cache->zone_count, struct search_pending_counter, + result = vdo_allocate(cache->zone_count, struct search_pending_counter,"Volume Cache Zones" , &cache->search_pending_counters);if (result !=UDS_SUCCESS )return result; - result =uds_allocate (cache->indexable_pages, u16,"page cache index" , + result =vdo_allocate (cache->indexable_pages, u16,"page cache index" , &cache->index);if (result !=UDS_SUCCESS )return result; - result = uds_allocate(cache->cache_slots, struct cached_page, "page cache cache", + result = vdo_allocate(cache->cache_slots, struct cached_page, "page cache cache", &cache->cache);if (result !=UDS_SUCCESS )return result;
@@ -1546,7 +1546,7 @@ int uds_make_volume(const struct uds_configuration *config, struct index_layoutunsigned int reserved_buffers;int result; - result = uds_allocate(1, struct volume, "volume", &volume); + result = vdo_allocate(1, struct volume, "volume", &volume);if (result !=UDS_SUCCESS )return result;
@@ -1583,7 +1583,7 @@ int uds_make_volume(const struct uds_configuration *config, struct index_layoutreturn result; } - result =uds_allocate (geometry->records_per_page, + result =vdo_allocate (geometry->records_per_page, const struct uds_volume_record *, "record pointers", &volume->record_pointers);if (result !=UDS_SUCCESS ) {
@@ -1624,7 +1624,7 @@ int uds_make_volume(const struct uds_configuration *config, struct index_layoutuds_init_cond (&volume->read_threads_read_done_cond);uds_init_cond (&volume->read_threads_cond); - result = uds_allocate(config->read_threads, struct thread *, "reader threads", + result = vdo_allocate(config->read_threads, struct thread *, "reader threads", &volume->reader_threads);if (result !=UDS_SUCCESS ) {uds_free_volume (volume);
@@ -1654,10 +1654,10 @@ static void uninitialize_page_cache(struct page_cache *cache)for (i =0 ; i < cache->cache_slots; i++)release_page_buffer (&cache->cache[i]); } -uds_free (cache->index); -uds_free (cache->cache); -uds_free (cache->search_pending_counters); -uds_free (cache->read_queue); +vdo_free (cache->index); +vdo_free (cache->cache); +vdo_free (cache->search_pending_counters); +vdo_free (cache->read_queue); }void uds_free_volume (struct volume *volume)
@@ -1675,7 +1675,7 @@ void uds_free_volume(struct volume *volume)mutex_unlock (&volume->read_threads_mutex);for (i =0 ; i < volume->read_thread_count; i++)vdo_join_threads (volume->reader_threads[i]); -uds_free (volume->reader_threads); +vdo_free (volume->reader_threads); volume->reader_threads =NULL ; }
@@ -1683,11 +1683,11 @@ void uds_free_volume(struct volume *volume)uninitialize_page_cache (&volume->page_cache);uds_free_sparse_cache (volume->sparse_cache);if (volume->client !=NULL ) -dm_bufio_client_destroy (uds_forget (volume->client)); +dm_bufio_client_destroy (vdo_forget (volume->client));uds_free_index_page_map (volume->index_page_map);uds_free_radix_sorter (volume->radix_sorter); -uds_free (volume->geometry); -uds_free (volume->record_pointers); -uds_free (volume); +vdo_free (volume->geometry); +vdo_free (volume->record_pointers); +vdo_free (volume); }
drivers/md/dm-vdo/int-map.c +7 -7
@@ -164,7 +164,7 @@ static int allocate_buckets(struct int_map *map, size_t capacity)* without have to wrap back around to element zero. */ map->bucket_count = capacity + (NEIGHBORHOOD -1 ); - return uds_allocate(map->bucket_count, struct bucket, + return vdo_allocate(map->bucket_count, struct bucket,"struct int_map buckets" , &map->buckets); }
@@ -182,7 +182,7 @@ int vdo_int_map_create(size_t initial_capacity, struct int_map **map_ptr)int result;size_t capacity; - result = uds_allocate(1, struct int_map, "struct int_map", &map); + result = vdo_allocate(1, struct int_map, "struct int_map", &map);if (result !=UDS_SUCCESS )return result;
@@ -197,7 +197,7 @@ int vdo_int_map_create(size_t initial_capacity, struct int_map **map_ptr) result =allocate_buckets (map, capacity);if (result !=UDS_SUCCESS ) { -vdo_int_map_free (uds_forget (map)); +vdo_int_map_free (vdo_forget (map));return result; }
@@ -217,8 +217,8 @@ void vdo_int_map_free(struct int_map *map)if (map ==NULL )return ; -uds_free (uds_forget (map->buckets)); -uds_free (uds_forget (map)); +vdo_free (vdo_forget (map->buckets)); +vdo_free (vdo_forget (map)); }/**
@@ -399,14 +399,14 @@ static int resize_buckets(struct int_map *map) result =vdo_int_map_put (map, entry->key, entry->value, true,NULL );if (result !=UDS_SUCCESS ) {/* Destroy the new partial map and restore the map from the stack. */ -uds_free (uds_forget (map->buckets)); +vdo_free (vdo_forget (map->buckets)); *map = old_map;return result; } }/* Destroy the old bucket array. */ -uds_free (uds_forget (old_map.buckets)); +vdo_free (vdo_forget (old_map.buckets));return UDS_SUCCESS ; }
drivers/md/dm-vdo/io-submitter.c +5 -5
@@ -380,7 +380,7 @@ int vdo_make_io_submitter(unsigned int thread_count, unsigned int rotation_interstruct io_submitter *io_submitter;int result; - result = uds_allocate_extended(struct io_submitter, thread_count, + result = vdo_allocate_extended(struct io_submitter, thread_count, struct bio_queue_data, "bio submission data", &io_submitter);if (result !=UDS_SUCCESS )
@@ -422,7 +422,7 @@ int vdo_make_io_submitter(unsigned int thread_count, unsigned int rotation_inter* Clean up the partially initialized bio-queue entirely and indicate that * initialization failed. */ -vdo_int_map_free (uds_forget (bio_queue_data->map)); +vdo_int_map_free (vdo_forget (bio_queue_data->map));uds_log_error ("bio queue initialization failed %d" , result);vdo_cleanup_io_submitter (io_submitter);vdo_free_io_submitter (io_submitter);
@@ -470,8 +470,8 @@ void vdo_free_io_submitter(struct io_submitter *io_submitter)for (i = io_submitter->num_bio_queues_used -1 ; i >=0 ; i--) { io_submitter->num_bio_queues_used--;/* vdo_destroy() will free the work queue, so just give up our reference to it. */ -uds_forget (io_submitter->bio_queue_data[i].queue); -vdo_int_map_free (uds_forget (io_submitter->bio_queue_data[i].map)); +vdo_forget (io_submitter->bio_queue_data[i].queue); +vdo_int_map_free (vdo_forget (io_submitter->bio_queue_data[i].map)); } -uds_free (io_submitter); +vdo_free (io_submitter); }
drivers/md/dm-vdo/logical-zone.c +4 -4
@@ -94,7 +94,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 = vdo_allocate_extended(struct logical_zones, zone_count, struct logical_zone, __func__, &zones);if (result !=VDO_SUCCESS )return result;
@@ -132,12 +132,12 @@ void vdo_free_logical_zones(struct logical_zones *zones)if (zones ==NULL )return ; -uds_free (uds_forget (zones->manager)); +vdo_free (vdo_forget (zones->manager));for (index =0 ; index < zones->zone_count; index++) -vdo_int_map_free (uds_forget (zones->zones[index].lbn_operations)); +vdo_int_map_free (vdo_forget (zones->zones[index].lbn_operations)); -uds_free (zones); +vdo_free (zones); }static inline void assert_on_zone_thread (struct logical_zone *zone,const char *what)
drivers/md/dm-vdo/memory-alloc.c +18 -20
@@ -37,7 +37,7 @@ static inline bool allocations_allowed(void)* @new_thread: registered_thread structure to use for the current thread * @flag_ptr: Location of the allocation-allowed flag */ -void uds_register_allocating_thread (struct registered_thread *new_thread, +void vdo_register_allocating_thread (struct registered_thread *new_thread,const bool *flag_ptr) {if (flag_ptr ==NULL ) {
@@ -50,7 +50,7 @@ void uds_register_allocating_thread(struct registered_thread *new_thread, }/* Unregister the current thread as an allocating thread. */ -void uds_unregister_allocating_thread (void ) +void vdo_unregister_allocating_thread (void ) {vdo_unregister_thread (&allocating_threads); }
@@ -148,7 +148,7 @@ static void remove_vmalloc_block(void *ptr)spin_unlock_irqrestore (&memory_stats.lock, flags);if (block !=NULL ) -uds_free (block); +vdo_free (block);else uds_log_info ("attempting to remove ptr %px not found in vmalloc list" , ptr); }
@@ -196,7 +196,7 @@ static inline bool use_kmalloc(size_t size)* * Return: UDS_SUCCESS or an error code */ -int uds_allocate_memory (size_t size,size_t align,const char *what,void *ptr) +int vdo_allocate_memory (size_t size,size_t align,const char *what,void *ptr) {/* * The __GFP_RETRY_MAYFAIL flag means the VM implementation will retry memory reclaim
@@ -245,8 +245,7 @@ int uds_allocate_memory(size_t size, size_t align, const char *what, void *ptr) }else {struct vmalloc_block_info *block; - if (uds_allocate(1, struct vmalloc_block_info, __func__, &block) == -UDS_SUCCESS ) { + if (vdo_allocate(1, struct vmalloc_block_info, __func__, &block) == UDS_SUCCESS) {/* * It is possible for __vmalloc to fail to allocate memory because there * are no pages available. A short sleep may allow the page reclaimer
@@ -259,7 +258,6 @@ int uds_allocate_memory(size_t size, size_t align, const char *what, void *ptr)*/ for (;;) { p =__vmalloc (size, gfp_flags | __GFP_NOWARN); -if (p !=NULL )break ;
@@ -273,7 +271,7 @@ int uds_allocate_memory(size_t size, size_t align, const char *what, void *ptr) }if (p ==NULL ) { -uds_free (block); +vdo_free (block); }else { block->ptr = p; block->size =PAGE_ALIGN (size);
@@ -304,7 +302,7 @@ int uds_allocate_memory(size_t size, size_t align, const char *what, void *ptr)* * Return: pointer to the allocated memory, or NULL if the required space is not available. */ -void *uds_allocate_memory_nowait (size_t size,const char *what__maybe_unused ) +void *vdo_allocate_memory_nowait (size_t size,const char *what__maybe_unused ) {void *p =kmalloc (size,GFP_NOWAIT | __GFP_ZERO);
@@ -314,7 +312,7 @@ void *uds_allocate_memory_nowait(size_t size, const char *what __maybe_unused)return p; } -void uds_free (void *ptr) +void vdo_free (void *ptr) {if (ptr !=NULL ) {if (is_vmalloc_addr (ptr)) {
@@ -339,18 +337,18 @@ void uds_free(void *ptr)* * Return: UDS_SUCCESS or an error code */ -int uds_reallocate_memory (void *ptr,size_t old_size,size_t size,const char *what, +int vdo_reallocate_memory (void *ptr,size_t old_size,size_t size,const char *what,void *new_ptr) {int result;if (size ==0 ) { -uds_free (ptr); +vdo_free (ptr); *(void **) new_ptr =NULL ;return UDS_SUCCESS ; } - result =uds_allocate (size, char, what, new_ptr); + result =vdo_allocate (size, char, what, new_ptr);if (result !=UDS_SUCCESS )return result;
@@ -359,18 +357,18 @@ int uds_reallocate_memory(void *ptr, size_t old_size, size_t size, const char *w size = old_size;memcpy (*((void **) new_ptr), ptr, size); -uds_free (ptr); +vdo_free (ptr); }return UDS_SUCCESS ; } -int uds_duplicate_string (const char *string,const char *what,char **new_string) +int vdo_duplicate_string (const char *string,const char *what,char **new_string) {int result;u8 *dup; - result =uds_allocate (strlen (string) +1 , u8, what, &dup); + result =vdo_allocate (strlen (string) +1 , u8, what, &dup);if (result !=UDS_SUCCESS )return result;
@@ -379,13 +377,13 @@ int uds_duplicate_string(const char *string, const char *what, char **new_stringreturn UDS_SUCCESS ; } -void uds_memory_init (void ) +void vdo_memory_init (void ) {spin_lock_init (&memory_stats.lock);vdo_initialize_thread_registry (&allocating_threads); } -void uds_memory_exit (void ) +void vdo_memory_exit (void ) { ASSERT_LOG_ONLY(memory_stats.kmalloc_bytes == 0, "kmalloc memory used (%zd bytes in %zd blocks) is returned to the kernel",
@@ -396,7 +394,7 @@ void uds_memory_exit(void)uds_log_debug ("peak usage %zd bytes" , memory_stats.peak_bytes); } -void uds_get_memory_stats (u64 *bytes_used,u64 *peak_bytes_used) +void vdo_get_memory_stats (u64 *bytes_used,u64 *peak_bytes_used) {unsigned long flags;
@@ -410,7 +408,7 @@ void uds_get_memory_stats(u64 *bytes_used, u64 *peak_bytes_used)* Report stats on any allocated memory that we're tracking. Not all allocation types are * guaranteed to be tracked in bytes (e.g., bios). */ -void uds_report_memory_usage (void ) +void vdo_report_memory_usage (void ) {unsigned long flags;u64 kmalloc_blocks;
drivers/md/dm-vdo/memory-alloc.h +26 -26
122 lines not on this page · raw message
drivers/md/dm-vdo/message-stats.c +2 -2
@@ -419,7 +419,7 @@ int vdo_write_stats(struct vdo *vdo, char *buf, unsigned int maxlen)struct vdo_statistics *stats;int result; - result = uds_allocate(1, struct vdo_statistics, __func__, &stats); + result = vdo_allocate(1, struct vdo_statistics, __func__, &stats);if (result !=UDS_SUCCESS ) {uds_log_error ("Cannot allocate memory to write VDO statistics" );return result;
@@ -427,6 +427,6 @@ int vdo_write_stats(struct vdo *vdo, char *buf, unsigned int maxlen)vdo_fetch_statistics (vdo, stats);write_vdo_statistics (NULL , stats,NULL , &buf, &maxlen); -uds_free (stats); +vdo_free (stats);return VDO_SUCCESS ; }
drivers/md/dm-vdo/packer.c +7 -7
@@ -120,7 +120,7 @@ static int __must_check make_bin(struct packer *packer)struct packer_bin *bin;int result; - result = uds_allocate_extended(struct packer_bin, VDO_MAX_COMPRESSION_SLOTS, + result = vdo_allocate_extended(struct packer_bin, VDO_MAX_COMPRESSION_SLOTS, struct vio *, __func__, &bin);if (result !=VDO_SUCCESS )return result;
@@ -146,7 +146,7 @@ int vdo_make_packer(struct vdo *vdo, block_count_t bin_count, struct packer **pablock_count_t i;int result; - result = uds_allocate(1, struct packer, __func__, &packer); + result = vdo_allocate(1, struct packer, __func__, &packer);if (result !=VDO_SUCCESS )return result;
@@ -168,7 +168,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, MAXIMUM_VDO_USER_VIOS / 2, + result = vdo_allocate_extended(struct packer_bin, MAXIMUM_VDO_USER_VIOS / 2, struct vio *, __func__, &packer->canceled_bin);if (result !=VDO_SUCCESS ) {vdo_free_packer (packer);
@@ -198,11 +198,11 @@ void vdo_free_packer(struct packer *packer)list_for_each_entry_safe (bin, tmp, &packer->bins, list) {list_del_init (&bin->list); -uds_free (bin); +vdo_free (bin); } -uds_free (uds_forget (packer->canceled_bin)); -uds_free (packer); +vdo_free (vdo_forget (packer->canceled_bin)); +vdo_free (packer); }/**
@@ -669,7 +669,7 @@ void vdo_remove_lock_holder_from_packer(struct vdo_completion *completion)assert_data_vio_in_packer_zone (data_vio); - lock_holder =uds_forget (data_vio->compression.lock_holder); + lock_holder =vdo_forget (data_vio->compression.lock_holder); bin = lock_holder->compression.bin;ASSERT_LOG_ONLY ((bin !=NULL ),"data_vio in packer has a bin" );
drivers/md/dm-vdo/physical-zone.c +8 -8
@@ -239,7 +239,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, capacity, idle_pbn_lock, + result = vdo_allocate_extended(struct pbn_lock_pool, capacity, idle_pbn_lock, __func__, &pool);if (result !=VDO_SUCCESS )return result;
@@ -270,7 +270,7 @@ static void free_pbn_lock_pool(struct pbn_lock_pool *pool)ASSERT_LOG_ONLY (pool->borrowed ==0 ,"All PBN locks must be returned to the pool before it is freed, but %zu locks are still on loan" , pool->borrowed); -uds_free (pool); +vdo_free (pool); }/**
@@ -344,7 +344,7 @@ static int initialize_zone(struct vdo *vdo, struct physical_zones *zones) zone->next = &zones->zones[(zone_number +1 ) % vdo->thread_config.physical_zone_count]; result =vdo_make_default_thread (vdo, zone->thread_id);if (result !=VDO_SUCCESS ) { -free_pbn_lock_pool (uds_forget (zone->lock_pool)); +free_pbn_lock_pool (vdo_forget (zone->lock_pool));vdo_int_map_free (zone->pbn_operations);return result; }
@@ -367,7 +367,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, zone_count, + result = vdo_allocate_extended(struct physical_zones, zone_count, struct physical_zone, __func__, &zones);if (result !=VDO_SUCCESS )return result;
@@ -398,11 +398,11 @@ void vdo_free_physical_zones(struct physical_zones *zones)for (index =0 ; index < zones->zone_count; index++) {struct physical_zone *zone = &zones->zones[index]; -free_pbn_lock_pool (uds_forget (zone->lock_pool)); -vdo_int_map_free (uds_forget (zone->pbn_operations)); +free_pbn_lock_pool (vdo_forget (zone->lock_pool)); +vdo_int_map_free (vdo_forget (zone->pbn_operations)); } -uds_free (zones); +vdo_free (zones); }/**
@@ -460,7 +460,7 @@ int vdo_attempt_physical_zone_pbn_lock(struct physical_zone *zone,if (lock !=NULL ) {/* The lock is already held, so we don't need the borrowed one. */ -return_pbn_lock_to_pool (zone->lock_pool,uds_forget (new_lock)); +return_pbn_lock_to_pool (zone->lock_pool,vdo_forget (new_lock)); result =ASSERT (lock->holder_count >0 ,"physical block %llu lock held" , (unsigned long long ) pbn);if (result !=VDO_SUCCESS )
drivers/md/dm-vdo/pool-sysfs.c +1 -1
@@ -110,7 +110,7 @@ static ssize_t pool_requests_maximum_show(struct vdo *vdo, char *buf)static void vdo_pool_release (struct kobject *directory) { -uds_free (container_of(directory ,struct vdo ,vdo_directory )); +vdo_free (container_of(directory ,struct vdo ,vdo_directory )); }static struct pool_attribute vdo_pool_compressing_attr = {
drivers/md/dm-vdo/priority-table.c +2 -2
@@ -60,7 +60,7 @@ int vdo_make_priority_table(unsigned int max_priority, struct priority_table **tif (max_priority >MAX_PRIORITY )return UDS_INVALID_ARGUMENT ; - result = uds_allocate_extended(struct priority_table, max_priority + 1, + result = vdo_allocate_extended(struct priority_table, max_priority + 1, struct bucket, __func__, &table);if (result !=VDO_SUCCESS )return result;
@@ -96,7 +96,7 @@ void vdo_free_priority_table(struct priority_table *table)*/ vdo_reset_priority_table (table); -uds_free (table); +vdo_free (table); }/**
drivers/md/dm-vdo/recovery-journal.c +18 -18
@@ -591,31 +591,31 @@ static int __must_check initialize_lock_counter(struct recovery_journal *journalstruct thread_config *config = &vdo->thread_config;struct lock_counter *counter = &journal->lock_counter; - result =uds_allocate (journal->size, u16, __func__, &counter->journal_counters); + result =vdo_allocate (journal->size, u16, __func__, &counter->journal_counters);if (result !=VDO_SUCCESS )return result; - result =uds_allocate (journal->size, atomic_t, __func__, + result =vdo_allocate (journal->size, atomic_t, __func__, &counter->journal_decrement_counts);if (result !=VDO_SUCCESS )return result; - result =uds_allocate (journal->size * config->logical_zone_count, u16, __func__, + result =vdo_allocate (journal->size * config->logical_zone_count, u16, __func__, &counter->logical_counters);if (result !=VDO_SUCCESS )return result; - result =uds_allocate (journal->size, atomic_t, __func__, + result =vdo_allocate (journal->size, atomic_t, __func__, &counter->logical_zone_counts);if (result !=VDO_SUCCESS )return result; - result =uds_allocate (journal->size * config->physical_zone_count, u16, __func__, + result =vdo_allocate (journal->size * config->physical_zone_count, u16, __func__, &counter->physical_counters);if (result !=VDO_SUCCESS )return result; - result =uds_allocate (journal->size, atomic_t, __func__, + result =vdo_allocate (journal->size, atomic_t, __func__, &counter->physical_zone_counts);if (result !=VDO_SUCCESS )return result;
@@ -670,14 +670,14 @@ static int initialize_recovery_block(struct vdo *vdo, struct recovery_journal *j* Allocate a full block for the journal block even though not all of the space is used * since the VIO needs to write a full disk block. */ - result =uds_allocate (VDO_BLOCK_SIZE , char, __func__, &data); + result =vdo_allocate (VDO_BLOCK_SIZE , char, __func__, &data);if (result !=VDO_SUCCESS )return result; result =allocate_vio_components (vdo,VIO_TYPE_RECOVERY_JOURNAL ,VIO_PRIORITY_HIGH , block,1 , data, &block->vio);if (result !=VDO_SUCCESS ) { -uds_free (data); +vdo_free (data);return result; }
@@ -709,7 +709,7 @@ int vdo_decode_recovery_journal(struct recovery_journal_state_7_0 state, nonce_tstruct recovery_journal *journal;int result; - result = uds_allocate_extended(struct recovery_journal, + result = vdo_allocate_extended(struct recovery_journal,RECOVERY_JOURNAL_RESERVED_BLOCKS , struct recovery_journal_block, __func__, &journal);
@@ -787,13 +787,13 @@ void vdo_free_recovery_journal(struct recovery_journal *journal)if (journal ==NULL )return ; -uds_free (uds_forget (journal->lock_counter.logical_zone_counts)); -uds_free (uds_forget (journal->lock_counter.physical_zone_counts)); -uds_free (uds_forget (journal->lock_counter.journal_counters)); -uds_free (uds_forget (journal->lock_counter.journal_decrement_counts)); -uds_free (uds_forget (journal->lock_counter.logical_counters)); -uds_free (uds_forget (journal->lock_counter.physical_counters)); -free_vio (uds_forget (journal->flush_vio)); +vdo_free (vdo_forget (journal->lock_counter.logical_zone_counts)); +vdo_free (vdo_forget (journal->lock_counter.physical_zone_counts)); +vdo_free (vdo_forget (journal->lock_counter.journal_counters)); +vdo_free (vdo_forget (journal->lock_counter.journal_decrement_counts)); +vdo_free (vdo_forget (journal->lock_counter.logical_counters)); +vdo_free (vdo_forget (journal->lock_counter.physical_counters)); +free_vio (vdo_forget (journal->flush_vio));/* * FIXME: eventually, the journal should be constructed in a quiescent state which
@@ -810,11 +810,11 @@ void vdo_free_recovery_journal(struct recovery_journal *journal)for (i =0 ; i <RECOVERY_JOURNAL_RESERVED_BLOCKS ; i++) {struct recovery_journal_block *block = &journal->blocks[i]; -uds_free (uds_forget (block->vio.data)); +vdo_free (vdo_forget (block->vio.data));free_vio_components (&block->vio); } -uds_free (journal); +vdo_free (journal); }/**
drivers/md/dm-vdo/repair.c +12 -12
@@ -226,7 +226,7 @@ static void uninitialize_vios(struct repair_completion *repair)while (repair->vio_count >0 )free_vio_components (&repair->vios[--repair->vio_count]); -uds_free (uds_forget (repair->vios)); +vdo_free (vdo_forget (repair->vios)); }static void free_repair_completion (struct repair_completion *repair)
@@ -241,9 +241,9 @@ static void free_repair_completion(struct repair_completion *repair) repair->completion.vdo->block_map->zones[0 ].page_cache.rebuilding = false;uninitialize_vios (repair); -uds_free (uds_forget (repair->journal_data)); -uds_free (uds_forget (repair->entries)); -uds_free (repair); +vdo_free (vdo_forget (repair->journal_data)); +vdo_free (vdo_forget (repair->entries)); +vdo_free (repair); }static void finish_repair (struct vdo_completion *completion)
@@ -262,7 +262,7 @@ static void finish_repair(struct vdo_completion *completion) repair->highest_tail, repair->logical_blocks_used, repair->block_map_data_blocks); -free_repair_completion (uds_forget (repair)); +free_repair_completion (vdo_forget (repair));if (vdo_state_requires_read_only_rebuild (vdo->load_state)) {uds_log_info ("Read-only rebuild complete" );
@@ -295,7 +295,7 @@ static void abort_repair(struct vdo_completion *completion)else uds_log_warning ("Recovery aborted" ); -free_repair_completion (uds_forget (repair)); +free_repair_completion (vdo_forget (repair));vdo_continue_completion (parent, result); }
@@ -1108,7 +1108,7 @@ static void recover_block_map(struct vdo_completion *completion)if (repair->block_map_entry_count ==0 ) {uds_log_info ("Replaying 0 recovery entries into block map" ); -uds_free (uds_forget (repair->journal_data)); +vdo_free (vdo_forget (repair->journal_data));launch_repair_completion (repair, load_slab_depot,VDO_ZONE_TYPE_ADMIN );return ; }
@@ -1418,7 +1418,7 @@ static int parse_journal_for_rebuild(struct repair_completion *repair)* packed_recovery_journal_entry from every valid journal block. */ count = ((repair->highest_tail - repair->block_map_head +1 ) * entries_per_block); - result = uds_allocate(count, struct numbered_block_mapping, __func__, + result = vdo_allocate(count, struct numbered_block_mapping, __func__, &repair->entries);if (result !=VDO_SUCCESS )return result;
@@ -1464,7 +1464,7 @@ static int extract_new_mappings(struct repair_completion *repair)* Allocate an array of numbered_block_mapping structs just large enough to transcribe * every packed_recovery_journal_entry from every valid journal block. */ - result = uds_allocate(repair->entry_count, struct numbered_block_mapping, + result = vdo_allocate(repair->entry_count, struct numbered_block_mapping, __func__, &repair->entries);if (result !=VDO_SUCCESS )return result;
@@ -1709,7 +1709,7 @@ void vdo_repair(struct vdo_completion *parent)uds_log_warning ("Device was dirty, rebuilding reference counts" ); } - result = uds_allocate_extended(struct repair_completion, page_count, + result = vdo_allocate_extended(struct repair_completion, page_count, struct vdo_page_completion, __func__, &repair);if (result !=VDO_SUCCESS ) {
@@ -1723,12 +1723,12 @@ void vdo_repair(struct vdo_completion *parent)prepare_repair_completion (repair, finish_repair,VDO_ZONE_TYPE_ADMIN ); repair->page_count = page_count; - result =uds_allocate (remaining *VDO_BLOCK_SIZE , char, __func__, + result =vdo_allocate (remaining *VDO_BLOCK_SIZE , char, __func__, &repair->journal_data);if (abort_on_error (result, repair))return ; - result = uds_allocate(vio_count, struct vio, __func__, &repair->vios); + result = vdo_allocate(vio_count, struct vio, __func__, &repair->vios);if (abort_on_error (result, repair))return ;
drivers/md/dm-vdo/slab-depot.c +40 -40
251 lines not on this page · raw message
drivers/md/dm-vdo/slab-depot.h +1 -1
@@ -241,7 +241,7 @@ struct vdo_slab {/* The number of free blocks */ u32 free_blocks;/* The array of reference counts */ -vdo_refcount_t *counters;/* use uds_allocate() to align data ptr */ +vdo_refcount_t *counters;/* use vdo_allocate() to align data ptr */ /* The saved block pointer and array indexes for the free block search */ struct search_cursor search_cursor;
drivers/md/dm-vdo/thread-utils.c +5 -5
@@ -66,9 +66,9 @@ static int thread_starter(void *arg)mutex_lock (&thread_mutex);hlist_add_head (&thread->thread_links, &thread_list);mutex_unlock (&thread_mutex); -uds_register_allocating_thread (&allocating_thread,NULL ); +vdo_register_allocating_thread (&allocating_thread,NULL ); thread->thread_function (thread->thread_data); -uds_unregister_allocating_thread (); +vdo_unregister_allocating_thread ();complete (&thread->thread_done);return 0 ; }
@@ -82,7 +82,7 @@ int vdo_create_thread(void (*thread_function)(void *), void *thread_data,struct thread *thread;int result; - result = uds_allocate(1, struct thread, __func__, &thread); + result = vdo_allocate(1, struct thread, __func__, &thread);if (result !=UDS_SUCCESS ) {uds_log_warning ("Error allocating memory for %s" , name);return result;
@@ -114,7 +114,7 @@ int vdo_create_thread(void (*thread_function)(void *), void *thread_data, }if (IS_ERR (task)) { -uds_free (thread); +vdo_free (thread);return PTR_ERR (task); }
@@ -130,5 +130,5 @@ void vdo_join_threads(struct thread *thread)mutex_lock (&thread_mutex);hlist_del (&thread->thread_links);mutex_unlock (&thread_mutex); -uds_free (thread); +vdo_free (thread); }
drivers/md/dm-vdo/uds-sysfs.c +2 -2
@@ -35,7 +35,7 @@ static char *buffer_to_string(const char *buf, size_t length) {char *string; -if (uds_allocate (length +1 , char, __func__, &string) !=UDS_SUCCESS ) +if (vdo_allocate (length +1 , char, __func__, &string) !=UDS_SUCCESS )return NULL ;memcpy (string, buf, length);
@@ -118,7 +118,7 @@ static ssize_t parameter_store(struct kobject *kobj, struct attribute *attr,return -ENOMEM ; pa->store_string (string); -uds_free (string); +vdo_free (string);return length; }
drivers/md/dm-vdo/vdo.c +46 -46
263 lines not on this page · raw message
drivers/md/dm-vdo/vio.c +10 -10
@@ -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, + result = vdo_allocate_extended(struct bio, size + 1, struct bio_vec,"bio" , &bio);if (result !=VDO_SUCCESS )return result;
@@ -72,7 +72,7 @@ void vdo_free_bio(struct bio *bio)return ;bio_uninit (bio); -uds_free (uds_forget (bio)); +vdo_free (vdo_forget (bio)); } int allocate_vio_components(struct vdo *vdo, enum vio_type vio_type,
@@ -129,7 +129,7 @@ int create_multi_block_metadata_vio(struct vdo *vdo, enum vio_type vio_type,* Metadata vios should use direct allocation and not use the buffer pool, which is * reserved for submissions from the linux block layer. */ - result = uds_allocate(1, struct vio, __func__, &vio); + result = vdo_allocate(1, struct vio, __func__, &vio);if (result !=VDO_SUCCESS ) {uds_log_error ("metadata vio allocation failure %d" , result);return result;
@@ -138,7 +138,7 @@ int create_multi_block_metadata_vio(struct vdo *vdo, enum vio_type vio_type, result =allocate_vio_components (vdo, vio_type, priority, parent, block_count, data, vio);if (result !=VDO_SUCCESS ) { -uds_free (vio); +vdo_free (vio);return result; }
@@ -156,7 +156,7 @@ void free_vio_components(struct vio *vio)return ;BUG_ON (is_data_vio (vio)); -vdo_free_bio (uds_forget (vio->bio)); +vdo_free_bio (vdo_forget (vio->bio)); }/**
@@ -166,7 +166,7 @@ void free_vio_components(struct vio *vio)void free_vio (struct vio *vio) {free_vio_components (vio); -uds_free (vio); +vdo_free (vio); }/* Set bio properties for a VDO read or write. */
@@ -316,7 +316,7 @@ int make_vio_pool(struct vdo *vdo, size_t pool_size, thread_id_t thread_id,char *ptr;int result; - result = uds_allocate_extended(struct vio_pool, pool_size, struct pooled_vio, + result = vdo_allocate_extended(struct vio_pool, pool_size, struct pooled_vio, __func__, &pool);if (result !=VDO_SUCCESS )return result;
@@ -325,7 +325,7 @@ int make_vio_pool(struct vdo *vdo, size_t pool_size, thread_id_t thread_id,INIT_LIST_HEAD (&pool->available);INIT_LIST_HEAD (&pool->busy); - result =uds_allocate (pool_size *VDO_BLOCK_SIZE , char, + result =vdo_allocate (pool_size *VDO_BLOCK_SIZE , char,"VIO pool buffer" , &pool->buffer);if (result !=VDO_SUCCESS ) {free_vio_pool (pool);
@@ -380,8 +380,8 @@ void free_vio_pool(struct vio_pool *pool)ASSERT_LOG_ONLY (pool->size ==0 ,"VIO pool must not have missing entries when being freed" ); -uds_free (uds_forget (pool->buffer)); -uds_free (pool); +vdo_free (vdo_forget (pool->buffer)); +vdo_free (pool); }/**
Signature · 1 line
2.42.0