Skip to contentSkip to conversation

dm vdo: move functions to vdo_ namespace

PATCH New Matthew Sakai 1 participant 4 messages Mar 2, 2024

Subsystems (2)
lore
Share & tools
lore

Matthew Sakai

author maintainer
#0 lore raw

cover dm vdo: move functions to vdo_ namespace

Mike Snitzer (3):
dm vdo funnel-queue: change from uds_ to vdo_ namespace dm vdo logger: change from uds_ to vdo_ namespace dm vdo string-utils: change from uds_ to vdo_ namespace

Signature · 1 line
2.42.0
author maintainer
#1 lore raw

PATCH 1/3 dm vdo funnel-queue: change from uds_ to vdo_ namespace

From: Mike Snitzer <[email protected]>

Also return VDO_SUCCESS from vdo_make_funnel_queue.

---
 drivers/md/dm-vdo/data-vio.c                  | 12 ++++-----
 drivers/md/dm-vdo/dedupe.c                    | 10 +++----
 drivers/md/dm-vdo/funnel-queue.c              | 18 ++++++-------
 drivers/md/dm-vdo/funnel-queue.h              | 26 +++++++++----------
 drivers/md/dm-vdo/funnel-workqueue.c          | 10 +++----
 .../md/dm-vdo/indexer/funnel-requestqueue.c   | 22 ++++++++--------
 6 files changed, 49 insertions(+), 49 deletions(-)
drivers/md/dm-vdo/data-vio.c +6 -6
index 51c49fad1b8b..2b0d42c77e05 100644
@@ -718,7 +718,7 @@ static void process_release_callback(struct vdo_completion *completion)
 
 	for (processed = 0; processed < DATA_VIO_RELEASE_BATCH_SIZE; processed++) {
 		struct data_vio *data_vio;
-		struct funnel_queue_entry *entry = uds_funnel_queue_poll(pool->queue);
+		struct funnel_queue_entry *entry = vdo_funnel_queue_poll(pool->queue);
 
 		if (entry == NULL)
 			break;
@@ -748,7 +748,7 @@ static void process_release_callback(struct vdo_completion *completion)
 	/* Pairs with the barrier in schedule_releases(). */
 	smp_mb();
 
-	reschedule = !uds_is_funnel_queue_empty(pool->queue);
+	reschedule = !vdo_is_funnel_queue_empty(pool->queue);
 	drained = (!reschedule &&
 		   vdo_is_state_draining(&pool->state) &&
 		   check_for_drain_complete_locked(pool));
@@ -865,8 +865,8 @@ int make_data_vio_pool(struct vdo *vdo, data_vio_count_t pool_size,
 			       process_release_callback, vdo->thread_config.cpu_thread,
 			       NULL);
 
-	result = uds_make_funnel_queue(&pool->queue);
-	if (result != UDS_SUCCESS) {
+	result = vdo_make_funnel_queue(&pool->queue);
+	if (result != VDO_SUCCESS) {
 		free_data_vio_pool(vdo_forget(pool));
 		return result;
 	}
@@ -924,7 +924,7 @@ void free_data_vio_pool(struct data_vio_pool *pool)
 		destroy_data_vio(data_vio);
 	}
 
-	uds_free_funnel_queue(vdo_forget(pool->queue));
+	vdo_free_funnel_queue(vdo_forget(pool->queue));
 	vdo_free(pool);
 }
 
@@ -1283,7 +1283,7 @@ static void finish_cleanup(struct data_vio *data_vio)
 	    (completion->result != VDO_SUCCESS)) {
 		struct data_vio_pool *pool = completion->vdo->data_vio_pool;
 
-		uds_funnel_queue_put(pool->queue, &completion->work_queue_entry_link);
+		vdo_funnel_queue_put(pool->queue, &completion->work_queue_entry_link);
 		schedule_releases(pool);
 		return;
 	}
drivers/md/dm-vdo/dedupe.c +5 -5
index 8550a9a7958b..c031ab01054d 100644
@@ -2246,7 +2246,7 @@ static void finish_index_operation(struct uds_request *request)
 				    atomic_read(&context->state));
 	}
 
-	uds_funnel_queue_put(context->zone->timed_out_complete, &context->queue_entry);
+	vdo_funnel_queue_put(context->zone->timed_out_complete, &context->queue_entry);
 }
 
 /**
@@ -2275,7 +2275,7 @@ static void check_for_drain_complete(struct hash_zone *zone)
 		struct dedupe_context *context;
 		struct funnel_queue_entry *entry;
 
-		entry = uds_funnel_queue_poll(zone->timed_out_complete);
+		entry = vdo_funnel_queue_poll(zone->timed_out_complete);
 		if (entry == NULL)
 			break;
 
@@ -2373,7 +2373,7 @@ static int __must_check initialize_zone(struct vdo *vdo, struct hash_zones *zone
 
 	INIT_LIST_HEAD(&zone->available);
 	INIT_LIST_HEAD(&zone->pending);
-	result = uds_make_funnel_queue(&zone->timed_out_complete);
+	result = vdo_make_funnel_queue(&zone->timed_out_complete);
 	if (result != VDO_SUCCESS)
 		return result;
 
@@ -2475,7 +2475,7 @@ void vdo_free_hash_zones(struct hash_zones *zones)
 	for (i = 0; i < zones->zone_count; i++) {
 		struct hash_zone *zone = &zones->zones[i];
 
-		uds_free_funnel_queue(vdo_forget(zone->timed_out_complete));
+		vdo_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));
 	}
@@ -2875,7 +2875,7 @@ static struct dedupe_context * __must_check acquire_context(struct hash_zone *zo
 		return context;
 	}
 
-	entry = uds_funnel_queue_poll(zone->timed_out_complete);
+	entry = vdo_funnel_queue_poll(zone->timed_out_complete);
 	return ((entry == NULL) ?
 		NULL : container_of(entry, struct dedupe_context, queue_entry));
 }
drivers/md/dm-vdo/funnel-queue.c +9 -9
index ce0e801fd955..a63b2f2bfd7d 100644
@@ -9,7 +9,7 @@
 #include "memory-alloc.h"
 #include "permassert.h"
 
-int uds_make_funnel_queue(struct funnel_queue **queue_ptr)
+int vdo_make_funnel_queue(struct funnel_queue **queue_ptr)
 {
 	int result;
 	struct funnel_queue *queue;
@@ -27,10 +27,10 @@ int uds_make_funnel_queue(struct funnel_queue **queue_ptr)
 	queue->oldest = &queue->stub;
 
 	*queue_ptr = queue;
-	return UDS_SUCCESS;
+	return VDO_SUCCESS;
 }
 
-void uds_free_funnel_queue(struct funnel_queue *queue)
+void vdo_free_funnel_queue(struct funnel_queue *queue)
 {
 	vdo_free(queue);
 }
@@ -40,7 +40,7 @@ static struct funnel_queue_entry *get_oldest(struct funnel_queue *queue)
 	/*
 	 * Barrier requirements: We need a read barrier between reading a "next" field pointer
 	 * value and reading anything it points to. There's an accompanying barrier in
-	 * uds_funnel_queue_put() between its caller setting up the entry and making it visible.
+	 * vdo_funnel_queue_put() between its caller setting up the entry and making it visible.
 	 */
 	struct funnel_queue_entry *oldest = queue->oldest;
 	struct funnel_queue_entry *next = READ_ONCE(oldest->next);
@@ -80,7 +80,7 @@ static struct funnel_queue_entry *get_oldest(struct funnel_queue *queue)
 		 * Put the stub entry back on the queue, ensuring a successor will eventually be
 		 * seen.
 		 */
-		uds_funnel_queue_put(queue, &queue->stub);
+		vdo_funnel_queue_put(queue, &queue->stub);
 
 		/* Check again for a successor. */
 		next = READ_ONCE(oldest->next);
@@ -100,7 +100,7 @@ static struct funnel_queue_entry *get_oldest(struct funnel_queue *queue)
  * Poll a queue, removing the oldest entry if the queue is not empty. This function must only be
  * called from a single consumer thread.
  */
-struct funnel_queue_entry *uds_funnel_queue_poll(struct funnel_queue *queue)
+struct funnel_queue_entry *vdo_funnel_queue_poll(struct funnel_queue *queue)
 {
 	struct funnel_queue_entry *oldest = get_oldest(queue);
 
@@ -134,7 +134,7 @@ struct funnel_queue_entry *uds_funnel_queue_poll(struct funnel_queue *queue)
  * or more entries being added such that the list view is incomplete, this function will report the
  * queue as empty.
  */
-bool uds_is_funnel_queue_empty(struct funnel_queue *queue)
+bool vdo_is_funnel_queue_empty(struct funnel_queue *queue)
 {
 	return get_oldest(queue) == NULL;
 }
@@ -143,9 +143,9 @@ bool uds_is_funnel_queue_empty(struct funnel_queue *queue)
  * Check whether the funnel queue is idle or not. If the queue has entries available to be
  * retrieved, it is not idle. If the queue is in a transition state with one or more entries being
  * added such that the list view is incomplete, it may not be possible to retrieve an entry with
- * the uds_funnel_queue_poll() function, but the queue will not be considered idle.
+ * the vdo_funnel_queue_poll() function, but the queue will not be considered idle.
  */
-bool uds_is_funnel_queue_idle(struct funnel_queue *queue)
+bool vdo_is_funnel_queue_idle(struct funnel_queue *queue)
 {
 	/*
 	 * Oldest is not the stub, so there's another entry, though if next is NULL we can't
drivers/md/dm-vdo/funnel-queue.h +13 -13
index 88a30c593fdc..bde0f1deff98 100644
@@ -3,8 +3,8 @@
  * Copyright 2023 Red Hat
  */
 
-#ifndef UDS_FUNNEL_QUEUE_H
-#define UDS_FUNNEL_QUEUE_H
+#ifndef VDO_FUNNEL_QUEUE_H
+#define VDO_FUNNEL_QUEUE_H
 
 #include <linux/atomic.h>
 #include <linux/cache.h>
@@ -25,19 +25,19 @@
  * the queue entries, and pointers to those structures are used exclusively by the queue. No macros
  * are defined to template the queue, so the offset of the funnel_queue_entry in the records placed
  * in the queue must all be the same so the client can derive their structure pointer from the
- * entry pointer returned by uds_funnel_queue_poll().
+ * entry pointer returned by vdo_funnel_queue_poll().
  *
  * Callers are wholly responsible for allocating and freeing the entries. Entries may be freed as
  * soon as they are returned since this queue is not susceptible to the "ABA problem" present in
  * many lock-free data structures. The queue is dynamically allocated to ensure cache-line
  * alignment, but no other dynamic allocation is used.
  *
- * The algorithm is not actually 100% lock-free. There is a single point in uds_funnel_queue_put()
+ * The algorithm is not actually 100% lock-free. There is a single point in vdo_funnel_queue_put()
  * at which a preempted producer will prevent the consumers from seeing items added to the queue by
  * later producers, and only if the queue is short enough or the consumer fast enough for it to
  * reach what was the end of the queue at the time of the preemption.
  *
- * The consumer function, uds_funnel_queue_poll(), will return NULL when the queue is empty. To
+ * The consumer function, vdo_funnel_queue_poll(), will return NULL when the queue is empty. To
  * wait for data to consume, spin (if safe) or combine the queue with a struct event_count to
  * signal the presence of new entries.
  */
@@ -51,7 +51,7 @@ struct funnel_queue_entry {
 /*
  * The dynamically allocated queue structure, which is allocated on a cache line boundary so the
  * producer and consumer fields in the structure will land on separate cache lines. This should be
- * consider opaque but it is exposed here so uds_funnel_queue_put() can be inlined.
+ * consider opaque but it is exposed here so vdo_funnel_queue_put() can be inlined.
  */
 struct __aligned(L1_CACHE_BYTES) funnel_queue {
 	/*
@@ -67,9 +67,9 @@ struct __aligned(L1_CACHE_BYTES) funnel_queue {
 	struct funnel_queue_entry stub;
 };
 
-int __must_check uds_make_funnel_queue(struct funnel_queue **queue_ptr);
+int __must_check vdo_make_funnel_queue(struct funnel_queue **queue_ptr);
 
-void uds_free_funnel_queue(struct funnel_queue *queue);
+void vdo_free_funnel_queue(struct funnel_queue *queue);
 
 /*
  * Put an entry on the end of the queue.
@@ -79,7 +79,7 @@ void uds_free_funnel_queue(struct funnel_queue *queue);
  * from the pointer that passed in here, so every entry in the queue must have the struct
  * funnel_queue_entry at the same offset within the client's structure.
  */
-static inline void uds_funnel_queue_put(struct funnel_queue *queue,
+static inline void vdo_funnel_queue_put(struct funnel_queue *queue,
 					struct funnel_queue_entry *entry)
 {
 	struct funnel_queue_entry *previous;
@@ -101,10 +101,10 @@ static inline void uds_funnel_queue_put(struct funnel_queue *queue,
 	WRITE_ONCE(previous->next, entry);
 }
 
-struct funnel_queue_entry *__must_check uds_funnel_queue_poll(struct funnel_queue *queue);
+struct funnel_queue_entry *__must_check vdo_funnel_queue_poll(struct funnel_queue *queue);
 
-bool __must_check uds_is_funnel_queue_empty(struct funnel_queue *queue);
+bool __must_check vdo_is_funnel_queue_empty(struct funnel_queue *queue);
 
-bool __must_check uds_is_funnel_queue_idle(struct funnel_queue *queue);
+bool __must_check vdo_is_funnel_queue_idle(struct funnel_queue *queue);
 
-#endif /* UDS_FUNNEL_QUEUE_H */
+#endif /* VDO_FUNNEL_QUEUE_H */
drivers/md/dm-vdo/funnel-workqueue.c +5 -5
index 03296e7fec12..cf04cdef0750 100644
@@ -98,7 +98,7 @@ static struct vdo_completion *poll_for_completion(struct simple_work_queue *queu
 	int i;
 
 	for (i = queue->common.type->max_priority; i >= 0; i--) {
-		struct funnel_queue_entry *link = uds_funnel_queue_poll(queue->priority_lists[i]);
+		struct funnel_queue_entry *link = vdo_funnel_queue_poll(queue->priority_lists[i]);
 
 		if (link != NULL)
 			return container_of(link, struct vdo_completion, work_queue_entry_link);
@@ -123,7 +123,7 @@ static void enqueue_work_queue_completion(struct simple_work_queue *queue,
 	completion->my_queue = &queue->common;
 
 	/* Funnel queue handles the synchronization for the put. */
-	uds_funnel_queue_put(queue->priority_lists[completion->priority],
+	vdo_funnel_queue_put(queue->priority_lists[completion->priority],
 			     &completion->work_queue_entry_link);
 
 	/*
@@ -275,7 +275,7 @@ static void free_simple_work_queue(struct simple_work_queue *queue)
 	unsigned int i;
 
 	for (i = 0; i <= VDO_WORK_Q_MAX_PRIORITY; i++)
-		uds_free_funnel_queue(queue->priority_lists[i]);
+		vdo_free_funnel_queue(queue->priority_lists[i]);
 	vdo_free(queue->common.name);
 	vdo_free(queue);
 }
@@ -340,8 +340,8 @@ static int make_simple_work_queue(const char *thread_name_prefix, const char *na
 	}
 
 	for (i = 0; i <= type->max_priority; i++) {
-		result = uds_make_funnel_queue(&queue->priority_lists[i]);
-		if (result != UDS_SUCCESS) {
+		result = vdo_make_funnel_queue(&queue->priority_lists[i]);
+		if (result != VDO_SUCCESS) {
 			free_simple_work_queue(queue);
 			return result;
 		}
drivers/md/dm-vdo/indexer/funnel-requestqueue.c +11 -11
index 84c7c1ae1333..1a5735375ddc 100644
@@ -69,11 +69,11 @@ static inline struct uds_request *poll_queues(struct uds_request_queue *queue)
 {
 	struct funnel_queue_entry *entry;
 
-	entry = uds_funnel_queue_poll(queue->retry_queue);
+	entry = vdo_funnel_queue_poll(queue->retry_queue);
 	if (entry != NULL)
 		return container_of(entry, struct uds_request, queue_link);
 
-	entry = uds_funnel_queue_poll(queue->main_queue);
+	entry = vdo_funnel_queue_poll(queue->main_queue);
 	if (entry != NULL)
 		return container_of(entry, struct uds_request, queue_link);
 
@@ -82,8 +82,8 @@ static inline struct uds_request *poll_queues(struct uds_request_queue *queue)
 
 static inline bool are_queues_idle(struct uds_request_queue *queue)
 {
-	return uds_is_funnel_queue_idle(queue->retry_queue) &&
-	       uds_is_funnel_queue_idle(queue->main_queue);
+	return vdo_is_funnel_queue_idle(queue->retry_queue) &&
+	       vdo_is_funnel_queue_idle(queue->main_queue);
 }
 
 /*
@@ -207,14 +207,14 @@ int uds_make_request_queue(const char *queue_name,
 	atomic_set(&queue->dormant, false);
 	init_waitqueue_head(&queue->wait_head);
 
-	result = uds_make_funnel_queue(&queue->main_queue);
-	if (result != UDS_SUCCESS) {
+	result = vdo_make_funnel_queue(&queue->main_queue);
+	if (result != VDO_SUCCESS) {
 		uds_request_queue_finish(queue);
 		return result;
 	}
 
-	result = uds_make_funnel_queue(&queue->retry_queue);
-	if (result != UDS_SUCCESS) {
+	result = vdo_make_funnel_queue(&queue->retry_queue);
+	if (result != VDO_SUCCESS) {
 		uds_request_queue_finish(queue);
 		return result;
 	}
@@ -244,7 +244,7 @@ void uds_request_queue_enqueue(struct uds_request_queue *queue,
 	bool unbatched = request->unbatched;
 
 	sub_queue = request->requeued ? queue->retry_queue : queue->main_queue;
-	uds_funnel_queue_put(sub_queue, &request->queue_link);
+	vdo_funnel_queue_put(sub_queue, &request->queue_link);
 
 	/*
 	 * We must wake the worker thread when it is dormant. A read fence isn't needed here since
@@ -273,7 +273,7 @@ void uds_request_queue_finish(struct uds_request_queue *queue)
 		vdo_join_threads(queue->thread);
 	}
 
-	uds_free_funnel_queue(queue->main_queue);
-	uds_free_funnel_queue(queue->retry_queue);
+	vdo_free_funnel_queue(queue->main_queue);
+	vdo_free_funnel_queue(queue->retry_queue);
 	vdo_free(queue);
 }
Signature · 1 line
2.42.0
author maintainer
#2 lore raw

PATCH 2/3 dm vdo logger: change from uds_ to vdo_ namespace

In reply to Matthew Sakai

From: Mike Snitzer <[email protected]>

Rename all uds_log_* to vdo_log_*.

---
 drivers/md/dm-vdo/admin-state.c            |   8 +-
 drivers/md/dm-vdo/block-map.c              |  20 +--
 drivers/md/dm-vdo/data-vio.c               |  18 +--
 drivers/md/dm-vdo/dedupe.c                 |  36 +++---
 drivers/md/dm-vdo/dm-vdo-target.c          | 144 ++++++++++-----------
 drivers/md/dm-vdo/dump.c                   |  14 +-
 drivers/md/dm-vdo/encodings.c              |  26 ++--
 drivers/md/dm-vdo/errors.c                 |   6 +-
 drivers/md/dm-vdo/errors.h                 |   4 +-
 drivers/md/dm-vdo/flush.c                  |   8 +-
 drivers/md/dm-vdo/funnel-workqueue.c       |   2 +-
 drivers/md/dm-vdo/indexer/chapter-index.c  |   4 +-
 drivers/md/dm-vdo/indexer/config.c         |  48 +++----
 drivers/md/dm-vdo/indexer/delta-index.c    |  50 +++----
 drivers/md/dm-vdo/indexer/index-layout.c   |  82 ++++++------
 drivers/md/dm-vdo/indexer/index-page-map.c |   2 +-
 drivers/md/dm-vdo/indexer/index-session.c  |  44 +++----
 drivers/md/dm-vdo/indexer/index.c          |  52 ++++----
 drivers/md/dm-vdo/indexer/io-factory.c     |   2 +-
 drivers/md/dm-vdo/indexer/open-chapter.c   |   6 +-
 drivers/md/dm-vdo/indexer/volume-index.c   |  46 +++----
 drivers/md/dm-vdo/indexer/volume.c         |  64 ++++-----
 drivers/md/dm-vdo/int-map.c                |   2 +-
 drivers/md/dm-vdo/io-submitter.c           |   4 +-
 drivers/md/dm-vdo/logger.c                 |  52 ++++----
 drivers/md/dm-vdo/logger.h                 |  84 ++++++------
 drivers/md/dm-vdo/logical-zone.c           |   4 +-
 drivers/md/dm-vdo/memory-alloc.c           |  14 +-
 drivers/md/dm-vdo/message-stats.c          |   2 +-
 drivers/md/dm-vdo/packer.c                 |   6 +-
 drivers/md/dm-vdo/permassert.c             |   4 +-
 drivers/md/dm-vdo/physical-zone.c          |   6 +-
 drivers/md/dm-vdo/recovery-journal.c       |  16 +--
 drivers/md/dm-vdo/repair.c                 |  46 +++----
 drivers/md/dm-vdo/slab-depot.c             |  54 ++++----
 drivers/md/dm-vdo/status-codes.c           |   6 +-
 drivers/md/dm-vdo/thread-utils.c           |   2 +-
 drivers/md/dm-vdo/vdo.c                    |  14 +-
 drivers/md/dm-vdo/vio.c                    |  10 +-
 39 files changed, 506 insertions(+), 506 deletions(-)
drivers/md/dm-vdo/admin-state.c +4 -4
index d695af42d140..3f9dba525154 100644
@@ -228,12 +228,12 @@ static int __must_check begin_operation(struct admin_state *state,
 	const struct admin_state_code *next_state = get_next_state(state, operation);
 
 	if (next_state == NULL) {
-		result = uds_log_error_strerror(VDO_INVALID_ADMIN_STATE,
+		result = vdo_log_error_strerror(VDO_INVALID_ADMIN_STATE,
 						"Can't start %s from %s",
 						operation->name,
 						vdo_get_admin_state_code(state)->name);
 	} else if (state->waiter != NULL) {
-		result = uds_log_error_strerror(VDO_COMPONENT_BUSY,
+		result = vdo_log_error_strerror(VDO_COMPONENT_BUSY,
 						"Can't start %s with extant waiter",
 						operation->name);
 	} else {
@@ -291,7 +291,7 @@ static bool check_code(bool valid, const struct admin_state_code *code, const ch
 	if (valid)
 		return true;
 
-	result = uds_log_error_strerror(VDO_INVALID_ADMIN_STATE,
+	result = vdo_log_error_strerror(VDO_INVALID_ADMIN_STATE,
 					"%s is not a %s", code->name, what);
 	if (waiter != NULL)
 		vdo_continue_completion(waiter, result);
@@ -334,7 +334,7 @@ bool vdo_start_draining(struct admin_state *state,
 	}
 
 	if (!code->normal) {
-		uds_log_error_strerror(VDO_INVALID_ADMIN_STATE, "can't start %s from %s",
+		vdo_log_error_strerror(VDO_INVALID_ADMIN_STATE, "can't start %s from %s",
 				       operation->name, code->name);
 		vdo_continue_completion(waiter, VDO_INVALID_ADMIN_STATE);
 		return false;
drivers/md/dm-vdo/block-map.c +10 -10
index b70294d8bb61..e79156dc7cc9 100644
@@ -264,7 +264,7 @@ static void report_cache_pressure(struct vdo_page_cache *cache)
 	ADD_ONCE(cache->stats.cache_pressure, 1);
 	if (cache->waiter_count > cache->page_count) {
 		if ((cache->pressure_report % LOG_INTERVAL) == 0)
-			uds_log_info("page cache pressure %u", cache->stats.cache_pressure);
+			vdo_log_info("page cache pressure %u", cache->stats.cache_pressure);
 
 		if (++cache->pressure_report >= DISPLAY_INTERVAL)
 			cache->pressure_report = 0;
@@ -483,7 +483,7 @@ static void complete_with_page(struct page_info *info,
 	bool available = vdo_page_comp->writable ? is_present(info) : is_valid(info);
 
 	if (!available) {
-		uds_log_error_strerror(VDO_BAD_PAGE,
+		vdo_log_error_strerror(VDO_BAD_PAGE,
 				       "Requested cache page %llu in state %s is not %s",
 				       (unsigned long long) info->pbn,
 				       get_page_state_name(info->state),
@@ -563,7 +563,7 @@ static void set_persistent_error(struct vdo_page_cache *cache, const char *conte
 	struct vdo *vdo = cache->vdo;
 
 	if ((result != VDO_READ_ONLY) && !vdo_is_read_only(vdo)) {
-		uds_log_error_strerror(result, "VDO Page Cache persistent error: %s",
+		vdo_log_error_strerror(result, "VDO Page Cache persistent error: %s",
 				       context);
 		vdo_enter_read_only_mode(vdo, result);
 	}
@@ -704,7 +704,7 @@ static void page_is_loaded(struct vdo_completion *completion)
 	validity = vdo_validate_block_map_page(page, nonce, info->pbn);
 	if (validity == VDO_BLOCK_MAP_PAGE_BAD) {
 		physical_block_number_t pbn = vdo_get_block_map_page_pbn(page);
-		int result = uds_log_error_strerror(VDO_BAD_PAGE,
+		int result = vdo_log_error_strerror(VDO_BAD_PAGE,
 						    "Expected page %llu but got page %llu instead",
 						    (unsigned long long) info->pbn,
 						    (unsigned long long) pbn);
@@ -894,7 +894,7 @@ static void allocate_free_page(struct page_info *info)
 
 	if (!vdo_waitq_has_waiters(&cache->free_waiters)) {
 		if (cache->stats.cache_pressure > 0) {
-			uds_log_info("page cache pressure relieved");
+			vdo_log_info("page cache pressure relieved");
 			WRITE_ONCE(cache->stats.cache_pressure, 0);
 		}
 
@@ -1012,7 +1012,7 @@ static void handle_page_write_error(struct vdo_completion *completion)
 
 	/* If we're already read-only, write failures are to be expected. */
 	if (result != VDO_READ_ONLY) {
-		uds_log_ratelimit(uds_log_error,
+		vdo_log_ratelimit(vdo_log_error,
 				  "failed to write block map page %llu",
 				  (unsigned long long) info->pbn);
 	}
@@ -1397,7 +1397,7 @@ bool vdo_copy_valid_page(char *buffer, nonce_t nonce,
 	}
 
 	if (validity == VDO_BLOCK_MAP_PAGE_BAD) {
-		uds_log_error_strerror(VDO_BAD_PAGE,
+		vdo_log_error_strerror(VDO_BAD_PAGE,
 				       "Expected page %llu but got page %llu instead",
 				       (unsigned long long) pbn,
 				       (unsigned long long) vdo_get_block_map_page_pbn(loaded));
@@ -1785,7 +1785,7 @@ static void continue_with_loaded_page(struct data_vio *data_vio,
 		vdo_unpack_block_map_entry(&page->entries[slot.block_map_slot.slot]);
 
 	if (is_invalid_tree_entry(vdo_from_data_vio(data_vio), &mapping, lock->height)) {
-		uds_log_error_strerror(VDO_BAD_MAPPING,
+		vdo_log_error_strerror(VDO_BAD_MAPPING,
 				       "Invalid block map tree PBN: %llu with state %u for page index %u at height %u",
 				       (unsigned long long) mapping.pbn, mapping.state,
 				       lock->tree_slots[lock->height - 1].page_index,
@@ -2263,7 +2263,7 @@ void vdo_find_block_map_slot(struct data_vio *data_vio)
 	/* The page at this height has been allocated and loaded. */
 	mapping = vdo_unpack_block_map_entry(&page->entries[tree_slot.block_map_slot.slot]);
 	if (is_invalid_tree_entry(vdo_from_data_vio(data_vio), &mapping, lock->height)) {
-		uds_log_error_strerror(VDO_BAD_MAPPING,
+		vdo_log_error_strerror(VDO_BAD_MAPPING,
 				       "Invalid block map tree PBN: %llu with state %u for page index %u at height %u",
 				       (unsigned long long) mapping.pbn, mapping.state,
 				       lock->tree_slots[lock->height - 1].page_index,
@@ -3140,7 +3140,7 @@ static int __must_check set_mapped_location(struct data_vio *data_vio,
 	 * Log the corruption even if we wind up ignoring it for write VIOs, converting all cases
 	 * to VDO_BAD_MAPPING.
 	 */
-	uds_log_error_strerror(VDO_BAD_MAPPING,
+	vdo_log_error_strerror(VDO_BAD_MAPPING,
 			       "PBN %llu with state %u read from the block map was invalid",
 			       (unsigned long long) mapped.pbn, mapped.state);
 
drivers/md/dm-vdo/data-vio.c +9 -9
index 2b0d42c77e05..94f6f1ccfb7d 100644
@@ -792,25 +792,25 @@ static int initialize_data_vio(struct data_vio *data_vio, struct vdo *vdo)
 	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,
+		return vdo_log_error_strerror(result,
 					      "data_vio data allocation failure");
 
 	result = vdo_allocate_memory(VDO_BLOCK_SIZE, 0, "compressed block",
 				     &data_vio->compression.block);
 	if (result != VDO_SUCCESS) {
-		return uds_log_error_strerror(result,
+		return vdo_log_error_strerror(result,
 					      "data_vio compressed block allocation failure");
 	}
 
 	result = vdo_allocate_memory(VDO_BLOCK_SIZE, 0, "vio scratch",
 				     &data_vio->scratch_block);
 	if (result != VDO_SUCCESS)
-		return uds_log_error_strerror(result,
+		return vdo_log_error_strerror(result,
 					      "data_vio scratch allocation failure");
 
 	result = vdo_create_bio(&bio);
 	if (result != VDO_SUCCESS)
-		return uds_log_error_strerror(result,
+		return vdo_log_error_strerror(result,
 					      "data_vio data bio allocation failure");
 
 	vdo_initialize_completion(&data_vio->decrement_completion, vdo,
@@ -1025,7 +1025,7 @@ void resume_data_vio_pool(struct data_vio_pool *pool, struct vdo_completion *com
 
 static void dump_limiter(const char *name, struct limiter *limiter)
 {
-	uds_log_info("%s: %u of %u busy (max %u), %s", name, limiter->busy,
+	vdo_log_info("%s: %u of %u busy (max %u), %s", name, limiter->busy,
 		     limiter->limit, limiter->max_busy,
 		     ((bio_list_empty(&limiter->waiters) &&
 		       bio_list_empty(&limiter->new_waiters)) ?
@@ -1323,7 +1323,7 @@ static void perform_cleanup_stage(struct data_vio *data_vio,
 		if ((data_vio->recovery_sequence_number > 0) &&
 		    (READ_ONCE(vdo->read_only_notifier.read_only_error) == VDO_SUCCESS) &&
 		    (data_vio->vio.completion.result != VDO_READ_ONLY))
-			uds_log_warning("VDO not read-only when cleaning data_vio with RJ lock");
+			vdo_log_warning("VDO not read-only when cleaning data_vio with RJ lock");
 		fallthrough;
 
 	case VIO_RELEASE_LOGICAL:
@@ -1353,7 +1353,7 @@ static void enter_read_only_mode(struct vdo_completion *completion)
 	if (completion->result != VDO_READ_ONLY) {
 		struct data_vio *data_vio = as_data_vio(completion);
 
-		uds_log_error_strerror(completion->result,
+		vdo_log_error_strerror(completion->result,
 				       "Preparing to enter read-only mode: data_vio for LBN %llu (becoming mapped to %llu, previously mapped to %llu, allocated %llu) is completing with a fatal error after operation %s",
 				       (unsigned long long) data_vio->logical.lbn,
 				       (unsigned long long) data_vio->new_mapped.pbn,
@@ -1449,14 +1449,14 @@ int uncompress_data_vio(struct data_vio *data_vio,
 						       &fragment_offset, &fragment_size);
 
 	if (result != VDO_SUCCESS) {
-		uds_log_debug("%s: compressed fragment error %d", __func__, result);
+		vdo_log_debug("%s: compressed fragment error %d", __func__, result);
 		return result;
 	}
 
 	size = LZ4_decompress_safe((block->data + fragment_offset), buffer,
 				   fragment_size, VDO_BLOCK_SIZE);
 	if (size != VDO_BLOCK_SIZE) {
-		uds_log_debug("%s: lz4 error", __func__);
+		vdo_log_debug("%s: lz4 error", __func__);
 		return VDO_INVALID_FRAGMENT;
 	}
 
drivers/md/dm-vdo/dedupe.c +18 -18
index c031ab01054d..117266e1b3ae 100644
@@ -1287,7 +1287,7 @@ static bool acquire_provisional_reference(struct data_vio *agent, struct pbn_loc
 	if (result == VDO_SUCCESS)
 		return true;
 
-	uds_log_warning_strerror(result,
+	vdo_log_warning_strerror(result,
 				 "Error acquiring provisional reference for dedupe candidate; aborting dedupe");
 	agent->is_duplicate = false;
 	vdo_release_physical_zone_pbn_lock(agent->duplicate.zone,
@@ -1614,7 +1614,7 @@ static bool decode_uds_advice(struct dedupe_context *context)
 
 	version = encoding->data[offset++];
 	if (version != UDS_ADVICE_VERSION) {
-		uds_log_error("invalid UDS advice version code %u", version);
+		vdo_log_error("invalid UDS advice version code %u", version);
 		return false;
 	}
 
@@ -1625,7 +1625,7 @@ static bool decode_uds_advice(struct dedupe_context *context)
 
 	/* Don't use advice that's clearly meaningless. */
 	if ((advice->state == VDO_MAPPING_STATE_UNMAPPED) || (advice->pbn == VDO_ZERO_BLOCK)) {
-		uds_log_debug("Invalid advice from deduplication server: pbn %llu, state %u. Giving up on deduplication of logical block %llu",
+		vdo_log_debug("Invalid advice from deduplication server: pbn %llu, state %u. Giving up on deduplication of logical block %llu",
 			      (unsigned long long) advice->pbn, advice->state,
 			      (unsigned long long) data_vio->logical.lbn);
 		atomic64_inc(&vdo->stats.invalid_advice_pbn_count);
@@ -1634,7 +1634,7 @@ static bool decode_uds_advice(struct dedupe_context *context)
 
 	result = vdo_get_physical_zone(vdo, advice->pbn, &advice->zone);
 	if ((result != VDO_SUCCESS) || (advice->zone == NULL)) {
-		uds_log_debug("Invalid physical block number from deduplication server: %llu, giving up on deduplication of logical block %llu",
+		vdo_log_debug("Invalid physical block number from deduplication server: %llu, giving up on deduplication of logical block %llu",
 			      (unsigned long long) advice->pbn,
 			      (unsigned long long) data_vio->logical.lbn);
 		atomic64_inc(&vdo->stats.invalid_advice_pbn_count);
@@ -2053,7 +2053,7 @@ static void close_index(struct hash_zones *zones)
 	result = uds_close_index(zones->index_session);
 
 	if (result != UDS_SUCCESS)
-		uds_log_error_strerror(result, "Error closing index");
+		vdo_log_error_strerror(result, "Error closing index");
 	spin_lock(&zones->lock);
 	zones->index_state = IS_CLOSED;
 	zones->error_flag |= result != UDS_SUCCESS;
@@ -2080,7 +2080,7 @@ static void open_index(struct hash_zones *zones)
 	result = uds_open_index(create_flag ? UDS_CREATE : UDS_LOAD,
 				&zones->parameters, zones->index_session);
 	if (result != UDS_SUCCESS)
-		uds_log_error_strerror(result, "Error opening index");
+		vdo_log_error_strerror(result, "Error opening index");
 
 	spin_lock(&zones->lock);
 	if (!create_flag) {
@@ -2104,7 +2104,7 @@ static void open_index(struct hash_zones *zones)
 		zones->index_target = IS_CLOSED;
 		zones->error_flag = true;
 		spin_unlock(&zones->lock);
-		uds_log_info("Setting UDS index target state to error");
+		vdo_log_info("Setting UDS index target state to error");
 		spin_lock(&zones->lock);
 	}
 	/*
@@ -2160,7 +2160,7 @@ static void report_dedupe_timeouts(struct hash_zones *zones, unsigned int timeou
 		u64 unreported = atomic64_read(&zones->timeouts);
 
 		unreported -= zones->reported_timeouts;
-		uds_log_debug("UDS index timeout on %llu requests",
+		vdo_log_debug("UDS index timeout on %llu requests",
 			      (unsigned long long) unreported);
 		zones->reported_timeouts += unreported;
 	}
@@ -2207,7 +2207,7 @@ static int initialize_index(struct vdo *vdo, struct hash_zones *zones)
 				 1, NULL);
 	if (result != VDO_SUCCESS) {
 		uds_destroy_index_session(vdo_forget(zones->index_session));
-		uds_log_error("UDS index queue initialization failed (%d)", result);
+		vdo_log_error("UDS index queue initialization failed (%d)", result);
 		return result;
 	}
 
@@ -2502,7 +2502,7 @@ static void initiate_suspend_index(struct admin_state *state)
 
 		result = uds_suspend_index_session(zones->index_session, save);
 		if (result != UDS_SUCCESS)
-			uds_log_error_strerror(result, "Error suspending dedupe index");
+			vdo_log_error_strerror(result, "Error suspending dedupe index");
 	}
 
 	vdo_finish_draining(state);
@@ -2585,7 +2585,7 @@ static void resume_index(void *context, struct vdo_completion *parent)
 	zones->parameters.bdev = config->owned_device->bdev;
 	result = uds_resume_index_session(zones->index_session, zones->parameters.bdev);
 	if (result != UDS_SUCCESS)
-		uds_log_error_strerror(result, "Error resuming dedupe index");
+		vdo_log_error_strerror(result, "Error resuming dedupe index");
 
 	spin_lock(&zones->lock);
 	vdo_resume_if_quiescent(&zones->state);
@@ -2665,7 +2665,7 @@ static void get_index_statistics(struct hash_zones *zones,
 
 	result = uds_get_index_session_stats(zones->index_session, &index_stats);
 	if (result != UDS_SUCCESS) {
-		uds_log_error_strerror(result, "Error reading index stats");
+		vdo_log_error_strerror(result, "Error reading index stats");
 		return;
 	}
 
@@ -2750,7 +2750,7 @@ static void dump_hash_lock(const struct hash_lock *lock)
 	 * unambiguous. 'U' indicates a lock not registered in the map.
 	 */
 	state = get_hash_lock_state_name(lock->state);
-	uds_log_info("  hl %px: %3.3s %c%llu/%u rc=%u wc=%zu agt=%px",
+	vdo_log_info("  hl %px: %3.3s %c%llu/%u rc=%u wc=%zu agt=%px",
 		     lock, state, (lock->registered ? 'D' : 'U'),
 		     (unsigned long long) lock->duplicate.pbn,
 		     lock->duplicate.state, lock->reference_count,
@@ -2784,11 +2784,11 @@ static void dump_hash_zone(const struct hash_zone *zone)
 	data_vio_count_t i;
 
 	if (zone->hash_lock_map == NULL) {
-		uds_log_info("struct hash_zone %u: NULL map", zone->zone_number);
+		vdo_log_info("struct hash_zone %u: NULL map", zone->zone_number);
 		return;
 	}
 
-	uds_log_info("struct hash_zone %u: mapSize=%zu",
+	vdo_log_info("struct hash_zone %u: mapSize=%zu",
 		     zone->zone_number, vdo_int_map_size(zone->hash_lock_map));
 	for (i = 0; i < LOCK_POOL_CAPACITY; i++)
 		dump_hash_lock(&zone->lock_array[i]);
@@ -2808,9 +2808,9 @@ void vdo_dump_hash_zones(struct hash_zones *zones)
 	target = (zones->changing ? index_state_to_string(zones, zones->index_target) : NULL);
 	spin_unlock(&zones->lock);
 
-	uds_log_info("UDS index: state: %s", state);
+	vdo_log_info("UDS index: state: %s", state);
 	if (target != NULL)
-		uds_log_info("UDS index: changing to state: %s", target);
+		vdo_log_info("UDS index: changing to state: %s", target);
 
 	for (zone = 0; zone < zones->zone_count; zone++)
 		dump_hash_zone(&zones->zones[zone]);
@@ -2957,7 +2957,7 @@ static void set_target_state(struct hash_zones *zones, enum index_state target,
 	spin_unlock(&zones->lock);
 
 	if (old_state != new_state)
-		uds_log_info("Setting UDS index target state to %s", new_state);
+		vdo_log_info("Setting UDS index target state to %s", new_state);
 }
 
 const char *vdo_get_dedupe_index_state_name(struct hash_zones *zones)
drivers/md/dm-vdo/dm-vdo-target.c +72 -72

493 lines not on this page · raw message

drivers/md/dm-vdo/dump.c +7 -7
index 52ee9a72781c..00e575d7d773 100644
@@ -58,12 +58,12 @@ static void do_dump(struct vdo *vdo, unsigned int dump_options_requested,
 	u32 active, maximum;
 	s64 outstanding;
 
-	uds_log_info("%s dump triggered via %s", UDS_LOGGING_MODULE_NAME, why);
+	vdo_log_info("%s dump triggered via %s", VDO_LOGGING_MODULE_NAME, why);
 	active = get_data_vio_pool_active_requests(vdo->data_vio_pool);
 	maximum = get_data_vio_pool_maximum_requests(vdo->data_vio_pool);
 	outstanding = (atomic64_read(&vdo->stats.bios_submitted) -
 		       atomic64_read(&vdo->stats.bios_completed));
-	uds_log_info("%u device requests outstanding (max %u), %lld bio requests outstanding, device '%s'",
+	vdo_log_info("%u device requests outstanding (max %u), %lld bio requests outstanding, device '%s'",
 		     active, maximum, outstanding,
 		     vdo_get_device_name(vdo->device_config->owning_target));
 	if (((dump_options_requested & FLAG_SHOW_QUEUES) != 0) && (vdo->threads != NULL)) {
@@ -80,7 +80,7 @@ static void do_dump(struct vdo *vdo, unsigned int dump_options_requested,
 		vdo_dump_status(vdo);
 
 	vdo_report_memory_usage();
-	uds_log_info("end of %s dump", UDS_LOGGING_MODULE_NAME);
+	vdo_log_info("end of %s dump", VDO_LOGGING_MODULE_NAME);
 }
 
 static int parse_dump_options(unsigned int argc, char *const *argv,
@@ -114,7 +114,7 @@ static int parse_dump_options(unsigned int argc, char *const *argv,
 			}
 		}
 		if (j == ARRAY_SIZE(option_names)) {
-			uds_log_warning("dump option name '%s' unknown", argv[i]);
+			vdo_log_warning("dump option name '%s' unknown", argv[i]);
 			options_okay = false;
 		}
 	}
@@ -159,13 +159,13 @@ static void dump_vio_waiters(struct vdo_wait_queue *waitq, char *wait_on)
 
 	data_vio = vdo_waiter_as_data_vio(first);
 
-	uds_log_info("      %s is locked. Waited on by: vio %px pbn %llu lbn %llu d-pbn %llu lastOp %s",
+	vdo_log_info("      %s is locked. Waited on by: vio %px pbn %llu lbn %llu d-pbn %llu lastOp %s",
 		     wait_on, data_vio, data_vio->allocation.pbn, data_vio->logical.lbn,
 		     data_vio->duplicate.pbn, get_data_vio_operation_name(data_vio));
 
 	for (waiter = first->next_waiter; waiter != first; waiter = waiter->next_waiter) {
 		data_vio = vdo_waiter_as_data_vio(waiter);
-		uds_log_info("     ... and : vio %px pbn %llu lbn %llu d-pbn %llu lastOp %s",
+		vdo_log_info("     ... and : vio %px pbn %llu lbn %llu d-pbn %llu lastOp %s",
 			     data_vio, data_vio->allocation.pbn, data_vio->logical.lbn,
 			     data_vio->duplicate.pbn,
 			     get_data_vio_operation_name(data_vio));
@@ -258,7 +258,7 @@ void dump_data_vio(void *data)
 
 	encode_vio_dump_flags(data_vio, flags_dump_buffer);
 
-	uds_log_info("	vio %px %s%s %s %s%s", data_vio,
+	vdo_log_info("	vio %px %s%s %s %s%s", data_vio,
 		     vio_block_number_dump_buffer,
 		     vio_flush_generation_buffer,
 		     get_data_vio_operation_name(data_vio),
drivers/md/dm-vdo/encodings.c +13 -13
index ebb0a4edd109..a34ea0229d53 100644
@@ -146,7 +146,7 @@ static int __must_check validate_version(struct version_number expected_version,
 					 const char *component_name)
 {
 	if (!vdo_are_same_version(expected_version, actual_version)) {
-		return uds_log_error_strerror(VDO_UNSUPPORTED_VERSION,
+		return vdo_log_error_strerror(VDO_UNSUPPORTED_VERSION,
 					      "%s version mismatch, expected %d.%d, got %d.%d",
 					      component_name,
 					      expected_version.major_version,
@@ -179,7 +179,7 @@ int vdo_validate_header(const struct header *expected_header,
 	int result;
 
 	if (expected_header->id != actual_header->id) {
-		return uds_log_error_strerror(VDO_INCORRECT_COMPONENT,
+		return vdo_log_error_strerror(VDO_INCORRECT_COMPONENT,
 					      "%s ID mismatch, expected %d, got %d",
 					      name, expected_header->id,
 					      actual_header->id);
@@ -192,7 +192,7 @@ int vdo_validate_header(const struct header *expected_header,
 
 	if ((expected_header->size > actual_header->size) ||
 	    (exact_size && (expected_header->size < actual_header->size))) {
-		return uds_log_error_strerror(VDO_UNSUPPORTED_VERSION,
+		return vdo_log_error_strerror(VDO_UNSUPPORTED_VERSION,
 					      "%s size mismatch, expected %zu, got %zu",
 					      name, expected_header->size,
 					      actual_header->size);
@@ -653,7 +653,7 @@ int vdo_configure_slab_depot(const struct partition *partition,
 	physical_block_number_t last_block;
 	block_count_t slab_size = slab_config.slab_blocks;
 
-	uds_log_debug("slabDepot %s(block_count=%llu, first_block=%llu, slab_size=%llu, zone_count=%u)",
+	vdo_log_debug("slabDepot %s(block_count=%llu, first_block=%llu, slab_size=%llu, zone_count=%u)",
 		      __func__, (unsigned long long) partition->count,
 		      (unsigned long long) partition->offset,
 		      (unsigned long long) slab_size, zone_count);
@@ -677,7 +677,7 @@ int vdo_configure_slab_depot(const struct partition *partition,
 		.zone_count = zone_count,
 	};
 
-	uds_log_debug("slab_depot last_block=%llu, total_data_blocks=%llu, slab_count=%zu, left_over=%llu",
+	vdo_log_debug("slab_depot last_block=%llu, total_data_blocks=%llu, slab_count=%zu, left_over=%llu",
 		      (unsigned long long) last_block,
 		      (unsigned long long) total_data_blocks, slab_count,
 		      (unsigned long long) (partition->count - (last_block - partition->offset)));
@@ -875,7 +875,7 @@ int vdo_initialize_layout(block_count_t size, physical_block_number_t offset,
 		(offset + block_map_blocks + journal_blocks + summary_blocks);
 
 	if (necessary_size > size)
-		return uds_log_error_strerror(VDO_NO_SPACE,
+		return vdo_log_error_strerror(VDO_NO_SPACE,
 					      "Not enough space to make a VDO");
 
 	*layout = (struct layout) {
@@ -1045,7 +1045,7 @@ static int decode_layout(u8 *buffer, size_t *offset, physical_block_number_t sta
 	layout->num_partitions = layout_header.partition_count;
 
 	if (layout->num_partitions > VDO_PARTITION_COUNT) {
-		return uds_log_error_strerror(VDO_UNKNOWN_PARTITION,
+		return vdo_log_error_strerror(VDO_UNKNOWN_PARTITION,
 					      "layout has extra partitions");
 	}
 
@@ -1070,7 +1070,7 @@ static int decode_layout(u8 *buffer, size_t *offset, physical_block_number_t sta
 		result = vdo_get_partition(layout, REQUIRED_PARTITIONS[i], &partition);
 		if (result != VDO_SUCCESS) {
 			vdo_uninitialize_layout(layout);
-			return uds_log_error_strerror(result,
+			return vdo_log_error_strerror(result,
 						      "layout is missing required partition %u",
 						      REQUIRED_PARTITIONS[i]);
 		}
@@ -1080,7 +1080,7 @@ static int decode_layout(u8 *buffer, size_t *offset, physical_block_number_t sta
 
 	if (start != size) {
 		vdo_uninitialize_layout(layout);
-		return uds_log_error_strerror(UDS_BAD_STATE,
+		return vdo_log_error_strerror(UDS_BAD_STATE,
 					      "partitions do not cover the layout");
 	}
 
@@ -1253,7 +1253,7 @@ int vdo_validate_config(const struct vdo_config *config,
 		return VDO_OUT_OF_RANGE;
 
 	if (physical_block_count != config->physical_blocks) {
-		uds_log_error("A physical size of %llu blocks was specified, not the %llu blocks configured in the vdo super block",
+		vdo_log_error("A physical size of %llu blocks was specified, not the %llu blocks configured in the vdo super block",
 			      (unsigned long long) physical_block_count,
 			      (unsigned long long) config->physical_blocks);
 		return VDO_PARAMETER_MISMATCH;
@@ -1266,7 +1266,7 @@ int vdo_validate_config(const struct vdo_config *config,
 			return result;
 
 		if (logical_block_count != config->logical_blocks) {
-			uds_log_error("A logical size of %llu blocks was specified, but that differs from the %llu blocks configured in the vdo super block",
+			vdo_log_error("A logical size of %llu blocks was specified, but that differs from the %llu blocks configured in the vdo super block",
 				      (unsigned long long) logical_block_count,
 				      (unsigned long long) config->logical_blocks);
 			return VDO_PARAMETER_MISMATCH;
@@ -1390,7 +1390,7 @@ int vdo_validate_component_states(struct vdo_component_states *states,
 				  block_count_t logical_size)
 {
 	if (geometry_nonce != states->vdo.nonce) {
-		return uds_log_error_strerror(VDO_BAD_NONCE,
+		return vdo_log_error_strerror(VDO_BAD_NONCE,
 					      "Geometry nonce %llu does not match superblock nonce %llu",
 					      (unsigned long long) geometry_nonce,
 					      (unsigned long long) states->vdo.nonce);
@@ -1463,7 +1463,7 @@ int vdo_decode_super_block(u8 *buffer)
 		 * We can't check release version or checksum until we know the content size, so we
 		 * have to assume a version mismatch on unexpected values.
 		 */
-		return uds_log_error_strerror(VDO_UNSUPPORTED_VERSION,
+		return vdo_log_error_strerror(VDO_UNSUPPORTED_VERSION,
 					      "super block contents too large: %zu",
 					      header.size);
 	}
drivers/md/dm-vdo/errors.c +3 -3
index 3b5fddad8ddf..8b2d22381274 100644
@@ -215,8 +215,8 @@ const char *uds_string_error_name(int errnum, char *buf, size_t buflen)
  */
 int uds_status_to_errno(int error)
 {
-	char error_name[UDS_MAX_ERROR_NAME_SIZE];
-	char error_message[UDS_MAX_ERROR_MESSAGE_SIZE];
+	char error_name[VDO_MAX_ERROR_NAME_SIZE];
+	char error_message[VDO_MAX_ERROR_MESSAGE_SIZE];
 
 	/* 0 is success, and negative values are already system error codes. */
 	if (likely(error <= 0))
@@ -248,7 +248,7 @@ int uds_status_to_errno(int error)
 
 	default:
 		/* Translate an unexpected error into something generic. */
-		uds_log_info("%s: mapping status code %d (%s: %s) to -EIO",
+		vdo_log_info("%s: mapping status code %d (%s: %s) to -EIO",
 			     __func__, error,
 			     uds_string_error_name(error, error_name,
 						   sizeof(error_name)),
drivers/md/dm-vdo/errors.h +2 -2
index c6c085b26a0e..24e0e745fd5f 100644
@@ -51,8 +51,8 @@ enum uds_status_codes {
 };
 
 enum {
-	UDS_MAX_ERROR_NAME_SIZE = 80,
-	UDS_MAX_ERROR_MESSAGE_SIZE = 128,
+	VDO_MAX_ERROR_NAME_SIZE = 80,
+	VDO_MAX_ERROR_MESSAGE_SIZE = 128,
 };
 
 struct error_info {
drivers/md/dm-vdo/flush.c +4 -4
index e03679e4d1ba..57e87f0d7069 100644
@@ -108,7 +108,7 @@ static void *allocate_flush(gfp_t gfp_mask, void *pool_data)
 		int result = vdo_allocate(1, struct vdo_flush, __func__, &flush);
 
 		if (result != VDO_SUCCESS)
-			uds_log_error_strerror(result, "failed to allocate spare flush");
+			vdo_log_error_strerror(result, "failed to allocate spare flush");
 	}
 
 	if (flush != NULL) {
@@ -349,11 +349,11 @@ void vdo_complete_flushes(struct flusher *flusher)
  */
 void vdo_dump_flusher(const struct flusher *flusher)
 {
-	uds_log_info("struct flusher");
-	uds_log_info("  flush_generation=%llu first_unacknowledged_generation=%llu",
+	vdo_log_info("struct flusher");
+	vdo_log_info("  flush_generation=%llu first_unacknowledged_generation=%llu",
 		     (unsigned long long) flusher->flush_generation,
 		     (unsigned long long) flusher->first_unacknowledged_generation);
-	uds_log_info("  notifiers queue is %s; pending_flushes queue is %s",
+	vdo_log_info("  notifiers queue is %s; pending_flushes queue is %s",
 		     (vdo_waitq_has_waiters(&flusher->notifiers) ? "not empty" : "empty"),
 		     (vdo_waitq_has_waiters(&flusher->pending_flushes) ? "not empty" : "empty"));
 }
drivers/md/dm-vdo/funnel-workqueue.c +1 -1
index cf04cdef0750..ae11941c90a9 100644
@@ -485,7 +485,7 @@ static void dump_simple_work_queue(struct simple_work_queue *queue)
 		thread_status = atomic_read(&queue->idle) ? "idle" : "running";
 	}
 
-	uds_log_info("workQ %px (%s) %s (%c)", &queue->common, queue->common.name,
+	vdo_log_info("workQ %px (%s) %s (%c)", &queue->common, queue->common.name,
 		     thread_status, task_state_report);
 
 	/* ->waiting_worker_threads wait queue status? anyone waiting? */
drivers/md/dm-vdo/indexer/chapter-index.c +2 -2
index 47e4ed234242..7e32a25d3f2f 100644
@@ -166,7 +166,7 @@ int uds_pack_open_chapter_index_page(struct open_chapter_index *chapter_index,
 
 		if (removals == 0) {
 			uds_get_delta_index_stats(delta_index, &stats);
-			uds_log_warning("The chapter index for chapter %llu contains %llu entries with %llu collisions",
+			vdo_log_warning("The chapter index for chapter %llu contains %llu entries with %llu collisions",
 					(unsigned long long) chapter_number,
 					(unsigned long long) stats.record_count,
 					(unsigned long long) stats.collision_count);
@@ -198,7 +198,7 @@ int uds_pack_open_chapter_index_page(struct open_chapter_index *chapter_index,
 	}
 
 	if (removals > 0) {
-		uds_log_warning("To avoid chapter index page overflow in chapter %llu, %u entries were removed from the chapter index",
+		vdo_log_warning("To avoid chapter index page overflow in chapter %llu, %u entries were removed from the chapter index",
 				(unsigned long long) chapter_number, removals);
 	}
 
drivers/md/dm-vdo/indexer/config.c +24 -24

137 lines not on this page · raw message

drivers/md/dm-vdo/indexer/delta-index.c +25 -25

194 lines not on this page · raw message

drivers/md/dm-vdo/indexer/index-layout.c +41 -41

311 lines not on this page · raw message

drivers/md/dm-vdo/indexer/index-page-map.c +1 -1
index c5d1b9995846..00b44e07d0c1 100644
@@ -167,7 +167,7 @@ int uds_read_index_page_map(struct index_page_map *map, struct buffered_reader *
 		decode_u16_le(buffer, &offset, &map->entries[i]);
 
 	vdo_free(buffer);
-	uds_log_debug("read index page map, last update %llu",
+	vdo_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 +22 -22

159 lines not on this page · raw message

drivers/md/dm-vdo/indexer/index.c +26 -26

196 lines not on this page · raw message

drivers/md/dm-vdo/indexer/io-factory.c +1 -1
index 0dcf6d596653..515765d35794 100644
@@ -365,7 +365,7 @@ void uds_free_buffered_writer(struct buffered_writer *writer)
 	flush_previous_buffer(writer);
 	result = -dm_bufio_write_dirty_buffers(writer->client);
 	if (result != UDS_SUCCESS)
-		uds_log_warning_strerror(result, "%s: failed to sync storage", __func__);
+		vdo_log_warning_strerror(result, "%s: failed to sync storage", __func__);
 
 	dm_bufio_client_destroy(writer->client);
 	uds_put_io_factory(writer->factory);
drivers/md/dm-vdo/indexer/open-chapter.c +3 -3
index 46b7bc1ac324..4a67bcadaae0 100644
@@ -259,14 +259,14 @@ static int fill_delta_chapter_index(struct open_chapter_zone **chapter_zones,
 			overflow_count++;
 			break;
 		default:
-			uds_log_error_strerror(result,
+			vdo_log_error_strerror(result,
 					       "failed to build open chapter index");
 			return result;
 		}
 	}
 
 	if (overflow_count > 0)
-		uds_log_warning("Failed to add %d entries to chapter index",
+		vdo_log_warning("Failed to add %d entries to chapter index",
 				overflow_count);
 
 	return UDS_SUCCESS;
@@ -417,7 +417,7 @@ int uds_load_open_chapter(struct uds_index *index, struct buffered_reader *reade
 		return result;
 
 	if (memcmp(OPEN_CHAPTER_VERSION, version, sizeof(version)) != 0) {
-		return uds_log_error_strerror(UDS_CORRUPT_DATA,
+		return vdo_log_error_strerror(UDS_CORRUPT_DATA,
 					      "Invalid open chapter version: %.*s",
 					      (int) sizeof(version), version);
 	}
drivers/md/dm-vdo/indexer/volume-index.c +23 -23

182 lines not on this page · raw message

drivers/md/dm-vdo/indexer/volume.c +32 -32

249 lines not on this page · raw message

drivers/md/dm-vdo/int-map.c +1 -1
index a909a11204c1..3aa438f84ea1 100644
@@ -381,7 +381,7 @@ static int resize_buckets(struct int_map *map)
 	/* Re-initialize the map to be empty and 50% larger. */
 	size_t new_capacity = map->capacity / 2 * 3;
 
-	uds_log_info("%s: attempting resize from %zu to %zu, current size=%zu",
+	vdo_log_info("%s: attempting resize from %zu to %zu, current size=%zu",
 		     __func__, map->capacity, new_capacity, map->size);
 	result = allocate_buckets(map, new_capacity);
 	if (result != VDO_SUCCESS) {
drivers/md/dm-vdo/io-submitter.c +2 -2
index 61bb48068c3a..9a3716bb3c05 100644
@@ -408,7 +408,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.
 			 */
-			uds_log_error("bio map initialization failed %d", result);
+			vdo_log_error("bio map initialization failed %d", result);
 			vdo_cleanup_io_submitter(io_submitter);
 			vdo_free_io_submitter(io_submitter);
 			return result;
@@ -423,7 +423,7 @@ int vdo_make_io_submitter(unsigned int thread_count, unsigned int rotation_inter
 			 * initialization failed.
 			 */
 			vdo_int_map_free(vdo_forget(bio_queue_data->map));
-			uds_log_error("bio queue initialization failed %d", result);
+			vdo_log_error("bio queue initialization failed %d", result);
 			vdo_cleanup_io_submitter(io_submitter);
 			vdo_free_io_submitter(io_submitter);
 			return result;
drivers/md/dm-vdo/logger.c +26 -26

138 lines not on this page · raw message

drivers/md/dm-vdo/logger.h +42 -42

134 lines not on this page · raw message

drivers/md/dm-vdo/logical-zone.c +2 -2
index 300f9d2d2d5c..258bc55e419b 100644
@@ -363,8 +363,8 @@ struct physical_zone *vdo_get_next_allocation_zone(struct logical_zone *zone)
  */
 void vdo_dump_logical_zone(const struct logical_zone *zone)
 {
-	uds_log_info("logical_zone %u", zone->zone_number);
-	uds_log_info("  flush_generation=%llu oldest_active_generation=%llu notification_generation=%llu notifying=%s ios_in_flush_generation=%llu",
+	vdo_log_info("logical_zone %u", zone->zone_number);
+	vdo_log_info("  flush_generation=%llu oldest_active_generation=%llu notification_generation=%llu notifying=%s ios_in_flush_generation=%llu",
 		     (unsigned long long) READ_ONCE(zone->flush_generation),
 		     (unsigned long long) READ_ONCE(zone->oldest_active_generation),
 		     (unsigned long long) READ_ONCE(zone->notification_generation),
drivers/md/dm-vdo/memory-alloc.c +7 -7
index 62bb717c4c50..185f259c7245 100644
@@ -150,7 +150,7 @@ static void remove_vmalloc_block(void *ptr)
 	if (block != NULL)
 		vdo_free(block);
 	else
-		uds_log_info("attempting to remove ptr %px not found in vmalloc list", ptr);
+		vdo_log_info("attempting to remove ptr %px not found in vmalloc list", ptr);
 }
 
 /*
@@ -284,7 +284,7 @@ int vdo_allocate_memory(size_t size, size_t align, const char *what, void *ptr)
 		memalloc_noio_restore(noio_flags);
 
 	if (unlikely(p == NULL)) {
-		uds_log_error("Could not allocate %zu bytes for %s in %u msecs",
+		vdo_log_error("Could not allocate %zu bytes for %s in %u msecs",
 			      size, what, jiffies_to_msecs(jiffies - start_time));
 		return -ENOMEM;
 	}
@@ -391,7 +391,7 @@ void vdo_memory_exit(void)
 	VDO_ASSERT_LOG_ONLY(memory_stats.vmalloc_bytes == 0,
 			    "vmalloc memory used (%zd bytes in %zd blocks) is returned to the kernel",
 			    memory_stats.vmalloc_bytes, memory_stats.vmalloc_blocks);
-	uds_log_debug("peak usage %zd bytes", memory_stats.peak_bytes);
+	vdo_log_debug("peak usage %zd bytes", memory_stats.peak_bytes);
 }
 
 void vdo_get_memory_stats(u64 *bytes_used, u64 *peak_bytes_used)
@@ -426,13 +426,13 @@ void vdo_report_memory_usage(void)
 	peak_usage = memory_stats.peak_bytes;
 	spin_unlock_irqrestore(&memory_stats.lock, flags);
 	total_bytes = kmalloc_bytes + vmalloc_bytes;
-	uds_log_info("current module memory tracking (actual allocation sizes, not requested):");
-	uds_log_info("  %llu bytes in %llu kmalloc blocks",
+	vdo_log_info("current module memory tracking (actual allocation sizes, not requested):");
+	vdo_log_info("  %llu bytes in %llu kmalloc blocks",
 		     (unsigned long long) kmalloc_bytes,
 		     (unsigned long long) kmalloc_blocks);
-	uds_log_info("  %llu bytes in %llu vmalloc blocks",
+	vdo_log_info("  %llu bytes in %llu vmalloc blocks",
 		     (unsigned long long) vmalloc_bytes,
 		     (unsigned long long) vmalloc_blocks);
-	uds_log_info("  total %llu bytes, peak usage %llu bytes",
+	vdo_log_info("  total %llu bytes, peak usage %llu bytes",
 		     (unsigned long long) total_bytes, (unsigned long long) peak_usage);
 }
drivers/md/dm-vdo/message-stats.c +1 -1
index 18c9d2af8aed..2802cf92922b 100644
@@ -421,7 +421,7 @@ int vdo_write_stats(struct vdo *vdo, char *buf, unsigned int maxlen)
 
 	result = vdo_allocate(1, struct vdo_statistics, __func__, &stats);
 	if (result != VDO_SUCCESS) {
-		uds_log_error("Cannot allocate memory to write VDO statistics");
+		vdo_log_error("Cannot allocate memory to write VDO statistics");
 		return result;
 	}
 
drivers/md/dm-vdo/packer.c +3 -3
index 4d45243161a6..16cf29b4c90a 100644
@@ -748,7 +748,7 @@ static void dump_packer_bin(const struct packer_bin *bin, bool canceled)
 		/* Don't dump empty bins. */
 		return;
 
-	uds_log_info("	  %sBin slots_used=%u free_space=%zu",
+	vdo_log_info("	  %sBin slots_used=%u free_space=%zu",
 		     (canceled ? "Canceled" : ""), bin->slots_used, bin->free_space);
 
 	/*
@@ -767,8 +767,8 @@ void vdo_dump_packer(const struct packer *packer)
 {
 	struct packer_bin *bin;
 
-	uds_log_info("packer");
-	uds_log_info("	flushGeneration=%llu state %s  packer_bin_count=%llu",
+	vdo_log_info("packer");
+	vdo_log_info("	flushGeneration=%llu state %s  packer_bin_count=%llu",
 		     (unsigned long long) packer->flush_generation,
 		     vdo_get_admin_state_code(&packer->state)->name,
 		     (unsigned long long) packer->size);
drivers/md/dm-vdo/permassert.c +2 -2
index 6fe49c4b7e51..bf9eccea1cb3 100644
@@ -15,10 +15,10 @@ int vdo_assertion_failed(const char *expression_string, const char *file_name,
 
 	va_start(args, format);
 
-	uds_log_embedded_message(UDS_LOG_ERR, UDS_LOGGING_MODULE_NAME, "assertion \"",
+	vdo_log_embedded_message(VDO_LOG_ERR, VDO_LOGGING_MODULE_NAME, "assertion \"",
 				 format, args, "\" (%s) failed at %s:%d",
 				 expression_string, file_name, line_number);
-	uds_log_backtrace(UDS_LOG_ERR);
+	vdo_log_backtrace(VDO_LOG_ERR);
 
 	va_end(args);
 
drivers/md/dm-vdo/physical-zone.c +3 -3
index 6678f472fb44..2fee3a7c1191 100644
@@ -163,7 +163,7 @@ static void release_pbn_lock_provisional_reference(struct pbn_lock *lock,
 
 	result = vdo_release_block_reference(allocator, locked_pbn);
 	if (result != VDO_SUCCESS) {
-		uds_log_error_strerror(result,
+		vdo_log_error_strerror(result,
 				       "Failed to release reference to %s physical block %llu",
 				       lock->implementation->release_reason,
 				       (unsigned long long) locked_pbn);
@@ -294,7 +294,7 @@ static int __must_check borrow_pbn_lock_from_pool(struct pbn_lock_pool *pool,
 	idle_pbn_lock *idle;
 
 	if (pool->borrowed >= pool->capacity)
-		return uds_log_error_strerror(VDO_LOCK_ERROR,
+		return vdo_log_error_strerror(VDO_LOCK_ERROR,
 					      "no free PBN locks left to borrow");
 	pool->borrowed += 1;
 
@@ -499,7 +499,7 @@ static int allocate_and_lock_block(struct allocation *allocation)
 
 	if (lock->holder_count > 0) {
 		/* This block is already locked, which should be impossible. */
-		return uds_log_error_strerror(VDO_LOCK_ERROR,
+		return vdo_log_error_strerror(VDO_LOCK_ERROR,
 					      "Newly allocated block %llu was spuriously locked (holder_count=%u)",
 					      (unsigned long long) allocation->pbn,
 					      lock->holder_count);
drivers/md/dm-vdo/recovery-journal.c +8 -8
index 6df373b88042..ee6321a3e523 100644
@@ -804,7 +804,7 @@ void vdo_free_recovery_journal(struct recovery_journal *journal)
 				    "journal being freed has no active tail blocks");
 	} else if (!vdo_is_state_saved(&journal->state) &&
 		   !list_empty(&journal->active_tail_blocks)) {
-		uds_log_warning("journal being freed has uncommitted entries");
+		vdo_log_warning("journal being freed has uncommitted entries");
 	}
 
 	for (i = 0; i < RECOVERY_JOURNAL_RESERVED_BLOCKS; i++) {
@@ -1305,7 +1305,7 @@ static void handle_write_error(struct vdo_completion *completion)
 	struct recovery_journal *journal = block->journal;
 
 	vio_record_metadata_io_error(as_vio(completion));
-	uds_log_error_strerror(completion->result,
+	vdo_log_error_strerror(completion->result,
 			       "cannot write recovery journal block %llu",
 			       (unsigned long long) block->sequence_number);
 	enter_journal_read_only_mode(journal, completion->result);
@@ -1719,7 +1719,7 @@ vdo_get_recovery_journal_statistics(const struct recovery_journal *journal)
  */
 static void dump_recovery_block(const struct recovery_journal_block *block)
 {
-	uds_log_info("    sequence number %llu; entries %u; %s; %zu entry waiters; %zu commit waiters",
+	vdo_log_info("    sequence number %llu; entries %u; %s; %zu entry waiters; %zu commit waiters",
 		     (unsigned long long) block->sequence_number, block->entry_count,
 		     (block->committing ? "committing" : "waiting"),
 		     vdo_waitq_num_waiters(&block->entry_waiters),
@@ -1736,8 +1736,8 @@ void vdo_dump_recovery_journal_statistics(const struct recovery_journal *journal
 	const struct recovery_journal_block *block;
 	struct recovery_journal_statistics stats = vdo_get_recovery_journal_statistics(journal);
 
-	uds_log_info("Recovery Journal");
-	uds_log_info("	block_map_head=%llu slab_journal_head=%llu last_write_acknowledged=%llu tail=%llu block_map_reap_head=%llu slab_journal_reap_head=%llu disk_full=%llu slab_journal_commits_requested=%llu entry_waiters=%zu",
+	vdo_log_info("Recovery Journal");
+	vdo_log_info("	block_map_head=%llu slab_journal_head=%llu last_write_acknowledged=%llu tail=%llu block_map_reap_head=%llu slab_journal_reap_head=%llu disk_full=%llu slab_journal_commits_requested=%llu entry_waiters=%zu",
 		     (unsigned long long) journal->block_map_head,
 		     (unsigned long long) journal->slab_journal_head,
 		     (unsigned long long) journal->last_write_acknowledged,
@@ -1747,16 +1747,16 @@ void vdo_dump_recovery_journal_statistics(const struct recovery_journal *journal
 		     (unsigned long long) stats.disk_full,
 		     (unsigned long long) stats.slab_journal_commits_requested,
 		     vdo_waitq_num_waiters(&journal->entry_waiters));
-	uds_log_info("	entries: started=%llu written=%llu committed=%llu",
+	vdo_log_info("	entries: started=%llu written=%llu committed=%llu",
 		     (unsigned long long) stats.entries.started,
 		     (unsigned long long) stats.entries.written,
 		     (unsigned long long) stats.entries.committed);
-	uds_log_info("	blocks: started=%llu written=%llu committed=%llu",
+	vdo_log_info("	blocks: started=%llu written=%llu committed=%llu",
 		     (unsigned long long) stats.blocks.started,
 		     (unsigned long long) stats.blocks.written,
 		     (unsigned long long) stats.blocks.committed);
 
-	uds_log_info("	active blocks:");
+	vdo_log_info("	active blocks:");
 	list_for_each_entry(block, &journal->active_tail_blocks, list_node)
 		dump_recovery_block(block);
 }
drivers/md/dm-vdo/repair.c +23 -23

31 lines not on this page · raw message

drivers/md/dm-vdo/slab-depot.c +27 -27

54 lines not on this page · raw message

drivers/md/dm-vdo/status-codes.c +3 -3
index 42e87b2344bc..918e46e7121f 100644

Lines of this file are not shown. View the raw message.

drivers/md/dm-vdo/thread-utils.c +1 -1
index c822df86f731..bd620be61c1d 100644

Lines of this file are not shown. View the raw message.

drivers/md/dm-vdo/vdo.c +7 -7
index 28e6352c758e..fff847767755 100644

Lines of this file are not shown. View the raw message.

drivers/md/dm-vdo/vio.c +5 -5
index b1e4e604c2c3..b291578f726f 100644

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

Signature · 1 line
2.42.0

Part of the diff is not shown here. View the raw message.

author maintainer
#3 lore raw

PATCH 3/3 dm vdo string-utils: change from uds_ to vdo_ namespace

In reply to Matthew Sakai

From: Mike Snitzer <[email protected]>

---
 drivers/md/dm-vdo/dm-vdo-target.c |  2 +-
 drivers/md/dm-vdo/errors.c        | 16 ++++++++--------
 drivers/md/dm-vdo/logical-zone.c  |  2 +-
 drivers/md/dm-vdo/slab-depot.c    |  6 +++---
 drivers/md/dm-vdo/string-utils.c  |  2 +-
 drivers/md/dm-vdo/string-utils.h  | 10 +++++-----
 6 files changed, 19 insertions(+), 19 deletions(-)
drivers/md/dm-vdo/dm-vdo-target.c +1 -1
index 4908996f5224..b7b3eec39522 100644
@@ -340,7 +340,7 @@ static int join_strings(char **substring_array, size_t array_length, char separa
 	current_position = &output[0];
 
 	for (i = 0; (i < array_length) && (substring_array[i] != NULL); i++) {
-		current_position = uds_append_to_buffer(current_position,
+		current_position = vdo_append_to_buffer(current_position,
 							output + string_length, "%s",
 							substring_array[i]);
 		*current_position = separator;
drivers/md/dm-vdo/errors.c +8 -8
index 8b2d22381274..6f89eb1c63a3 100644
@@ -154,19 +154,19 @@ const char *uds_string_error(int errnum, char *buf, size_t buflen)
 	block_name = get_error_info(errnum, &info);
 	if (block_name != NULL) {
 		if (info != NULL) {
-			buffer = uds_append_to_buffer(buffer, buf_end, "%s: %s",
+			buffer = vdo_append_to_buffer(buffer, buf_end, "%s: %s",
 						      block_name, info->message);
 		} else {
-			buffer = uds_append_to_buffer(buffer, buf_end, "Unknown %s %d",
+			buffer = vdo_append_to_buffer(buffer, buf_end, "Unknown %s %d",
 						      block_name, errnum);
 		}
 	} else if (info != NULL) {
-		buffer = uds_append_to_buffer(buffer, buf_end, "%s", info->message);
+		buffer = vdo_append_to_buffer(buffer, buf_end, "%s", info->message);
 	} else {
 		const char *tmp = system_string_error(errnum, buffer, buf_end - buffer);
 
 		if (tmp != buffer)
-			buffer = uds_append_to_buffer(buffer, buf_end, "%s", tmp);
+			buffer = vdo_append_to_buffer(buffer, buf_end, "%s", tmp);
 		else
 			buffer += strlen(tmp);
 	}
@@ -188,19 +188,19 @@ const char *uds_string_error_name(int errnum, char *buf, size_t buflen)
 	block_name = get_error_info(errnum, &info);
 	if (block_name != NULL) {
 		if (info != NULL) {
-			buffer = uds_append_to_buffer(buffer, buf_end, "%s", info->name);
+			buffer = vdo_append_to_buffer(buffer, buf_end, "%s", info->name);
 		} else {
-			buffer = uds_append_to_buffer(buffer, buf_end, "%s %d",
+			buffer = vdo_append_to_buffer(buffer, buf_end, "%s %d",
 						      block_name, errnum);
 		}
 	} else if (info != NULL) {
-		buffer = uds_append_to_buffer(buffer, buf_end, "%s", info->name);
+		buffer = vdo_append_to_buffer(buffer, buf_end, "%s", info->name);
 	} else {
 		const char *tmp;
 
 		tmp = system_string_error(errnum, buffer, buf_end - buffer);
 		if (tmp != buffer)
-			buffer = uds_append_to_buffer(buffer, buf_end, "%s", tmp);
+			buffer = vdo_append_to_buffer(buffer, buf_end, "%s", tmp);
 		else
 			buffer += strlen(tmp);
 	}
drivers/md/dm-vdo/logical-zone.c +1 -1
index 258bc55e419b..026f031ffc9e 100644
@@ -368,6 +368,6 @@ void vdo_dump_logical_zone(const struct logical_zone *zone)
 		     (unsigned long long) READ_ONCE(zone->flush_generation),
 		     (unsigned long long) READ_ONCE(zone->oldest_active_generation),
 		     (unsigned long long) READ_ONCE(zone->notification_generation),
-		     uds_bool_to_string(READ_ONCE(zone->notifying)),
+		     vdo_bool_to_string(READ_ONCE(zone->notifying)),
 		     (unsigned long long) READ_ONCE(zone->ios_in_flush_generation));
 }
drivers/md/dm-vdo/slab-depot.c +3 -3
index dc9f3d3c3995..46e4721e5b4f 100644
@@ -3597,8 +3597,8 @@ void vdo_dump_block_allocator(const struct block_allocator *allocator)
 
 		vdo_log_info("  slab journal: entry_waiters=%zu waiting_to_commit=%s updating_slab_summary=%s head=%llu unreapable=%llu tail=%llu next_commit=%llu summarized=%llu last_summarized=%llu recovery_lock=%llu dirty=%s",
 			     vdo_waitq_num_waiters(&journal->entry_waiters),
-			     uds_bool_to_string(journal->waiting_to_commit),
-			     uds_bool_to_string(journal->updating_slab_summary),
+			     vdo_bool_to_string(journal->waiting_to_commit),
+			     vdo_bool_to_string(journal->updating_slab_summary),
 			     (unsigned long long) journal->head,
 			     (unsigned long long) journal->unreapable,
 			     (unsigned long long) journal->tail,
@@ -3606,7 +3606,7 @@ void vdo_dump_block_allocator(const struct block_allocator *allocator)
 			     (unsigned long long) journal->summarized,
 			     (unsigned long long) journal->last_summarized,
 			     (unsigned long long) journal->recovery_lock,
-			     uds_bool_to_string(journal->recovery_lock != 0));
+			     vdo_bool_to_string(journal->recovery_lock != 0));
 		/*
 		 * Given the frequency with which the locks are just a tiny bit off, it might be
 		 * worth dumping all the locks, but that might be too much logging.
drivers/md/dm-vdo/string-utils.c +1 -1
index 6cdf018cdaf0..71e44b4683ea 100644
@@ -5,7 +5,7 @@
 
 #include "string-utils.h"
 
-char *uds_append_to_buffer(char *buffer, char *buf_end, const char *fmt, ...)
+char *vdo_append_to_buffer(char *buffer, char *buf_end, const char *fmt, ...)
 {
 	va_list args;
 	size_t n;
drivers/md/dm-vdo/string-utils.h +5 -5
index 8275af582cf7..96eecd38b1c2 100644
@@ -3,21 +3,21 @@
  * Copyright 2023 Red Hat
  */
 
-#ifndef UDS_STRING_UTILS_H
-#define UDS_STRING_UTILS_H
+#ifndef VDO_STRING_UTILS_H
+#define VDO_STRING_UTILS_H
 
 #include <linux/kernel.h>
 #include <linux/string.h>
 
 /* Utilities related to string manipulation */
 
-static inline const char *uds_bool_to_string(bool value)
+static inline const char *vdo_bool_to_string(bool value)
 {
 	return value ? "true" : "false";
 }
 
 /* Append a formatted string to the end of a buffer. */
-char *uds_append_to_buffer(char *buffer, char *buf_end, const char *fmt, ...)
+char *vdo_append_to_buffer(char *buffer, char *buf_end, const char *fmt, ...)
 	__printf(3, 4);
 
-#endif /* UDS_STRING_UTILS_H */
+#endif /* VDO_STRING_UTILS_H */
Signature · 1 line
2.42.0