Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

dm vdo thread-registry: rename all methods to reflect vdo-only use

Otherwise, uds_ prefix is misleading (vdo_ is the new catch-all for
code that is used by vdo-only or _both_ vdo and the indexer code).

Signed-off-by: Mike Snitzer <snitzer@kernel.org>
Signed-off-by: Matthew Sakai <msakai@redhat.com>

+21 -21
+6 -6
drivers/md/dm-vdo/memory-alloc.c
··· 15 15 16 16 /* 17 17 * UDS and VDO keep track of which threads are allowed to allocate memory freely, and which threads 18 - * must be careful to not do a memory allocation that does an I/O request. The allocating_threads 19 - * threads_registry and its associated methods implement this tracking. 18 + * must be careful to not do a memory allocation that does an I/O request. The 'allocating_threads' 19 + * thread_registry and its associated methods implement this tracking. 20 20 */ 21 21 static struct thread_registry allocating_threads; 22 22 23 23 static bool allocations_allowed(void) 24 24 { 25 - const bool *pointer = uds_lookup_thread(&allocating_threads); 25 + const bool *pointer = vdo_lookup_thread(&allocating_threads); 26 26 27 27 return (pointer != NULL) ? *pointer : false; 28 28 } ··· 48 48 flag_ptr = &allocation_always_allowed; 49 49 } 50 50 51 - uds_register_thread(&allocating_threads, new_thread, flag_ptr); 51 + vdo_register_thread(&allocating_threads, new_thread, flag_ptr); 52 52 } 53 53 54 54 /* Unregister the current thread as an allocating thread. */ 55 55 void uds_unregister_allocating_thread(void) 56 56 { 57 - uds_unregister_thread(&allocating_threads); 57 + vdo_unregister_thread(&allocating_threads); 58 58 } 59 59 60 60 /* ··· 384 384 void uds_memory_init(void) 385 385 { 386 386 spin_lock_init(&memory_stats.lock); 387 - uds_initialize_thread_registry(&allocating_threads); 387 + vdo_initialize_thread_registry(&allocating_threads); 388 388 } 389 389 390 390 void uds_memory_exit(void)
+4 -4
drivers/md/dm-vdo/thread-device.c
··· 14 14 void uds_register_thread_device_id(struct registered_thread *new_thread, 15 15 unsigned int *id_ptr) 16 16 { 17 - uds_register_thread(&device_id_thread_registry, new_thread, id_ptr); 17 + vdo_register_thread(&device_id_thread_registry, new_thread, id_ptr); 18 18 } 19 19 20 20 void uds_unregister_thread_device_id(void) 21 21 { 22 - uds_unregister_thread(&device_id_thread_registry); 22 + vdo_unregister_thread(&device_id_thread_registry); 23 23 } 24 24 25 25 int uds_get_thread_device_id(void) 26 26 { 27 27 const unsigned int *pointer; 28 28 29 - pointer = uds_lookup_thread(&device_id_thread_registry); 29 + pointer = vdo_lookup_thread(&device_id_thread_registry); 30 30 return (pointer != NULL) ? *pointer : -1; 31 31 } 32 32 33 33 void uds_initialize_thread_device_registry(void) 34 34 { 35 - uds_initialize_thread_registry(&device_id_thread_registry); 35 + vdo_initialize_thread_registry(&device_id_thread_registry); 36 36 }
+4 -4
drivers/md/dm-vdo/thread-registry.c
··· 14 14 * their normal operation. For example, we do not want to invoke the logger while holding a lock. 15 15 */ 16 16 17 - void uds_initialize_thread_registry(struct thread_registry *registry) 17 + void vdo_initialize_thread_registry(struct thread_registry *registry) 18 18 { 19 19 INIT_LIST_HEAD(&registry->links); 20 20 spin_lock_init(&registry->lock); 21 21 } 22 22 23 23 /* Register the current thread and associate it with a data pointer. */ 24 - void uds_register_thread(struct thread_registry *registry, 24 + void vdo_register_thread(struct thread_registry *registry, 25 25 struct registered_thread *new_thread, const void *pointer) 26 26 { 27 27 struct registered_thread *thread; ··· 51 51 } 52 52 } 53 53 54 - void uds_unregister_thread(struct thread_registry *registry) 54 + void vdo_unregister_thread(struct thread_registry *registry) 55 55 { 56 56 struct registered_thread *thread; 57 57 bool found_it = false; ··· 74 74 } 75 75 } 76 76 77 - const void *uds_lookup_thread(struct thread_registry *registry) 77 + const void *vdo_lookup_thread(struct thread_registry *registry) 78 78 { 79 79 struct registered_thread *thread; 80 80 const void *result = NULL;
+7 -7
drivers/md/dm-vdo/thread-registry.h
··· 3 3 * Copyright 2023 Red Hat 4 4 */ 5 5 6 - #ifndef UDS_THREAD_REGISTRY_H 7 - #define UDS_THREAD_REGISTRY_H 6 + #ifndef VDO_THREAD_REGISTRY_H 7 + #define VDO_THREAD_REGISTRY_H 8 8 9 9 #include <linux/list.h> 10 10 #include <linux/spinlock.h> ··· 20 20 struct task_struct *task; 21 21 }; 22 22 23 - void uds_initialize_thread_registry(struct thread_registry *registry); 23 + void vdo_initialize_thread_registry(struct thread_registry *registry); 24 24 25 - void uds_register_thread(struct thread_registry *registry, 25 + void vdo_register_thread(struct thread_registry *registry, 26 26 struct registered_thread *new_thread, const void *pointer); 27 27 28 - void uds_unregister_thread(struct thread_registry *registry); 28 + void vdo_unregister_thread(struct thread_registry *registry); 29 29 30 - const void *uds_lookup_thread(struct thread_registry *registry); 30 + const void *vdo_lookup_thread(struct thread_registry *registry); 31 31 32 - #endif /* UDS_THREAD_REGISTRY_H */ 32 + #endif /* VDO_THREAD_REGISTRY_H */