dm vdo string-utils: change from uds_ to vdo_ namespace
authorMike Snitzer <snitzer@kernel.org>
Wed, 14 Feb 2024 15:34:46 +0000 (09:34 -0600)
committerMike Snitzer <snitzer@kernel.org>
Mon, 4 Mar 2024 20:07:57 +0000 (15:07 -0500)
Signed-off-by: Mike Snitzer <snitzer@kernel.org>
Signed-off-by: Chung Chung <cchung@redhat.com>
Signed-off-by: Matthew Sakai <msakai@redhat.com>
drivers/md/dm-vdo/dm-vdo-target.c
drivers/md/dm-vdo/errors.c
drivers/md/dm-vdo/logical-zone.c
drivers/md/dm-vdo/slab-depot.c
drivers/md/dm-vdo/string-utils.c
drivers/md/dm-vdo/string-utils.h

index 4908996f52248860508ee8774c2c98ef522b9db9..b7b3eec39522e6d44ee4fe86c6e607e329d05123 100644 (file)
@@ -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;
index 8b2d2238127451fd2231cf453b3f1409887bfb3e..6f89eb1c63a3fbec5f6c8a2b446376505e68c736 100644 (file)
@@ -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);
        }
index 258bc55e419bdd01b7f30c7f69cc3f7297b0532d..026f031ffc9e76dd3677f5288044450bd86d83ba 100644 (file)
@@ -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));
 }
index dc9f3d3c3995bdfe5db43a6feebad31e1e20e8e9..46e4721e5b4f14ae45e8ca913e5eb13bfe75dda2 100644 (file)
@@ -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.
index 6cdf018cdaf094b450186456c4253d821e8e19fa..71e44b4683eafabe7b41d7fcfd8fc34cd94bee56 100644 (file)
@@ -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;
index 8275af582cf7a25ac9e344ebbc60cb7953cc2300..96eecd38b1c222f2bd1ba1d7a7d64b1669d44ed1 100644 (file)
@@ -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 */