dm vdo thread-registry: rename all methods to reflect vdo-only use
authorMike Snitzer <snitzer@kernel.org>
Fri, 9 Feb 2024 20:04:34 +0000 (14:04 -0600)
committerMike Snitzer <snitzer@kernel.org>
Fri, 1 Mar 2024 14:26:20 +0000 (09:26 -0500)
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>
drivers/md/dm-vdo/memory-alloc.c
drivers/md/dm-vdo/thread-device.c
drivers/md/dm-vdo/thread-registry.c
drivers/md/dm-vdo/thread-registry.h

index 46dd5bda682544a3d50f501bce448bc3592c188e..3b2bda9248cbd70413c8d4c093b1db263003199c 100644 (file)
 
 /*
  * UDS and VDO keep track of which threads are allowed to allocate memory freely, and which threads
- * must be careful to not do a memory allocation that does an I/O request. The allocating_threads
- * threads_registry and its associated methods implement this tracking.
+ * must be careful to not do a memory allocation that does an I/O request. The 'allocating_threads'
+ * thread_registry and its associated methods implement this tracking.
  */
 static struct thread_registry allocating_threads;
 
 static bool allocations_allowed(void)
 {
-       const bool *pointer = uds_lookup_thread(&allocating_threads);
+       const bool *pointer = vdo_lookup_thread(&allocating_threads);
 
        return (pointer != NULL) ? *pointer : false;
 }
@@ -48,13 +48,13 @@ void uds_register_allocating_thread(struct registered_thread *new_thread,
                flag_ptr = &allocation_always_allowed;
        }
 
-       uds_register_thread(&allocating_threads, new_thread, flag_ptr);
+       vdo_register_thread(&allocating_threads, new_thread, flag_ptr);
 }
 
 /* Unregister the current thread as an allocating thread. */
 void uds_unregister_allocating_thread(void)
 {
-       uds_unregister_thread(&allocating_threads);
+       vdo_unregister_thread(&allocating_threads);
 }
 
 /*
@@ -384,7 +384,7 @@ int uds_duplicate_string(const char *string, const char *what, char **new_string
 void uds_memory_init(void)
 {
        spin_lock_init(&memory_stats.lock);
-       uds_initialize_thread_registry(&allocating_threads);
+       vdo_initialize_thread_registry(&allocating_threads);
 }
 
 void uds_memory_exit(void)
index b87de448a83b5084d8eda32ae7bdf0a9d2126543..2bf14b9f67f8adf7ee12da4f9f7d65a7be4e2a8d 100644 (file)
@@ -14,23 +14,23 @@ static struct thread_registry device_id_thread_registry;
 void uds_register_thread_device_id(struct registered_thread *new_thread,
                                   unsigned int *id_ptr)
 {
-       uds_register_thread(&device_id_thread_registry, new_thread, id_ptr);
+       vdo_register_thread(&device_id_thread_registry, new_thread, id_ptr);
 }
 
 void uds_unregister_thread_device_id(void)
 {
-       uds_unregister_thread(&device_id_thread_registry);
+       vdo_unregister_thread(&device_id_thread_registry);
 }
 
 int uds_get_thread_device_id(void)
 {
        const unsigned int *pointer;
 
-       pointer = uds_lookup_thread(&device_id_thread_registry);
+       pointer = vdo_lookup_thread(&device_id_thread_registry);
        return (pointer != NULL) ? *pointer : -1;
 }
 
 void uds_initialize_thread_device_registry(void)
 {
-       uds_initialize_thread_registry(&device_id_thread_registry);
+       vdo_initialize_thread_registry(&device_id_thread_registry);
 }
index 8c887158c22454ec6f0e133b8394283468c70a46..1314d2b6a26f5e337d3d95c3a44dc4b522c27eae 100644 (file)
  * their normal operation. For example, we do not want to invoke the logger while holding a lock.
  */
 
-void uds_initialize_thread_registry(struct thread_registry *registry)
+void vdo_initialize_thread_registry(struct thread_registry *registry)
 {
        INIT_LIST_HEAD(&registry->links);
        spin_lock_init(&registry->lock);
 }
 
 /* Register the current thread and associate it with a data pointer. */
-void uds_register_thread(struct thread_registry *registry,
+void vdo_register_thread(struct thread_registry *registry,
                         struct registered_thread *new_thread, const void *pointer)
 {
        struct registered_thread *thread;
@@ -51,7 +51,7 @@ void uds_register_thread(struct thread_registry *registry,
        }
 }
 
-void uds_unregister_thread(struct thread_registry *registry)
+void vdo_unregister_thread(struct thread_registry *registry)
 {
        struct registered_thread *thread;
        bool found_it = false;
@@ -74,7 +74,7 @@ void uds_unregister_thread(struct thread_registry *registry)
        }
 }
 
-const void *uds_lookup_thread(struct thread_registry *registry)
+const void *vdo_lookup_thread(struct thread_registry *registry)
 {
        struct registered_thread *thread;
        const void *result = NULL;
index f70f755568a17ab09cc396817a2fa0d7939e3f67..cc6d78312b9eb2975af605b02bd395a81cf64a2d 100644 (file)
@@ -3,8 +3,8 @@
  * Copyright 2023 Red Hat
  */
 
-#ifndef UDS_THREAD_REGISTRY_H
-#define UDS_THREAD_REGISTRY_H
+#ifndef VDO_THREAD_REGISTRY_H
+#define VDO_THREAD_REGISTRY_H
 
 #include <linux/list.h>
 #include <linux/spinlock.h>
@@ -20,13 +20,13 @@ struct registered_thread {
        struct task_struct *task;
 };
 
-void uds_initialize_thread_registry(struct thread_registry *registry);
+void vdo_initialize_thread_registry(struct thread_registry *registry);
 
-void uds_register_thread(struct thread_registry *registry,
+void vdo_register_thread(struct thread_registry *registry,
                         struct registered_thread *new_thread, const void *pointer);
 
-void uds_unregister_thread(struct thread_registry *registry);
+void vdo_unregister_thread(struct thread_registry *registry);
 
-const void *uds_lookup_thread(struct thread_registry *registry);
+const void *vdo_lookup_thread(struct thread_registry *registry);
 
-#endif /* UDS_THREAD_REGISTRY_H */
+#endif /* VDO_THREAD_REGISTRY_H */