diff options
| author | Mike Snitzer <snitzer@kernel.org> | 2024-02-09 12:08:09 -0600 |
|---|---|---|
| committer | Mike Snitzer <snitzer@kernel.org> | 2024-03-01 09:26:07 -0500 |
| commit | 650e3107bc5280855e602e8a24e4f50dd1779ae7 (patch) | |
| tree | 82f1c6d194a7c886fa5962ceed77941a3bc3acce /drivers/md/dm-vdo/thread-utils.c | |
| parent | fe6e4ccbe872bfcf2d8d6ce48f4ca7ca260d7102 (diff) | |
dm vdo thread-utils: further cleanup of thread functions
Change thread function prefix from "uds_" to "vdo_" and fix
vdo_join_threads() to return void.
Signed-off-by: Mike Snitzer <snitzer@kernel.org>
Signed-off-by: Matthew Sakai <msakai@redhat.com>
Diffstat (limited to 'drivers/md/dm-vdo/thread-utils.c')
| -rw-r--r-- | drivers/md/dm-vdo/thread-utils.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/drivers/md/dm-vdo/thread-utils.c b/drivers/md/dm-vdo/thread-utils.c index 30760b1c4d30..0b80247c7f1b 100644 --- a/drivers/md/dm-vdo/thread-utils.c +++ b/drivers/md/dm-vdo/thread-utils.c @@ -33,7 +33,7 @@ enum { }; /* Run a function once only, and record that fact in the atomic value. */ -void uds_perform_once(atomic_t *once, void (*function)(void)) +void vdo_perform_once(atomic_t *once, void (*function)(void)) { for (;;) { switch (atomic_cmpxchg(once, ONCE_NOT_DONE, ONCE_IN_PROGRESS)) { @@ -63,7 +63,7 @@ static int thread_starter(void *arg) struct thread *thread = arg; thread->thread_task = current; - uds_perform_once(&thread_once, thread_init); + vdo_perform_once(&thread_once, thread_init); mutex_lock(&thread_mutex); hlist_add_head(&thread->thread_links, &thread_list); mutex_unlock(&thread_mutex); @@ -74,7 +74,7 @@ static int thread_starter(void *arg) return 0; } -int uds_create_thread(void (*thread_function)(void *), void *thread_data, +int vdo_create_thread(void (*thread_function)(void *), void *thread_data, const char *name, struct thread **new_thread) { char *name_colon = strchr(name, ':'); @@ -123,7 +123,7 @@ int uds_create_thread(void (*thread_function)(void *), void *thread_data, return UDS_SUCCESS; } -int uds_join_threads(struct thread *thread) +void vdo_join_threads(struct thread *thread) { while (wait_for_completion_interruptible(&thread->thread_done)) fsleep(1000); @@ -132,5 +132,4 @@ int uds_join_threads(struct thread *thread) hlist_del(&thread->thread_links); mutex_unlock(&thread_mutex); uds_free(thread); - return UDS_SUCCESS; } |
