[PATCH 12/13] dm vdo thread-registry: rename all methods to reflect vdo-only use

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Mike Snitzer <snitzer@xxxxxxxxxx>

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@xxxxxxxxxx>
Signed-off-by: Matthew Sakai <msakai@xxxxxxxxxx>
---
 drivers/md/dm-vdo/memory-alloc.c    | 12 ++++++------
 drivers/md/dm-vdo/thread-device.c   |  8 ++++----
 drivers/md/dm-vdo/thread-registry.c |  8 ++++----
 drivers/md/dm-vdo/thread-registry.h | 14 +++++++-------
 4 files changed, 21 insertions(+), 21 deletions(-)

diff --git a/drivers/md/dm-vdo/memory-alloc.c b/drivers/md/dm-vdo/memory-alloc.c
index 46dd5bda6825..3b2bda9248cb 100644
--- a/drivers/md/dm-vdo/memory-alloc.c
+++ b/drivers/md/dm-vdo/memory-alloc.c
@@ -15,14 +15,14 @@
 
 /*
  * 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)
diff --git a/drivers/md/dm-vdo/thread-device.c b/drivers/md/dm-vdo/thread-device.c
index b87de448a83b..2bf14b9f67f8 100644
--- a/drivers/md/dm-vdo/thread-device.c
+++ b/drivers/md/dm-vdo/thread-device.c
@@ -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);
 }
diff --git a/drivers/md/dm-vdo/thread-registry.c b/drivers/md/dm-vdo/thread-registry.c
index 8c887158c224..1314d2b6a26f 100644
--- a/drivers/md/dm-vdo/thread-registry.c
+++ b/drivers/md/dm-vdo/thread-registry.c
@@ -14,14 +14,14 @@
  * 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;
diff --git a/drivers/md/dm-vdo/thread-registry.h b/drivers/md/dm-vdo/thread-registry.h
index f70f755568a1..cc6d78312b9e 100644
--- a/drivers/md/dm-vdo/thread-registry.h
+++ b/drivers/md/dm-vdo/thread-registry.h
@@ -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 */
-- 
2.42.0





[Index of Archives]     [DM Crypt]     [Fedora Desktop]     [ATA RAID]     [Fedora Marketing]     [Fedora Packaging]     [Fedora SELinux]     [Yosemite Discussion]     [KDE Users]     [Fedora Docs]

  Powered by Linux