Add various support utilities for the vdo target and deduplication index, including logging utilities, string and time management, and index-specific error codes. Co-developed-by: J. corwin Coburn <corwin@hurlbutnet.net> Signed-off-by: J. corwin Coburn <corwin@hurlbutnet.net> Co-developed-by: Michael Sclafani <dm-devel@lists.linux.dev> Signed-off-by: Michael Sclafani <dm-devel@lists.linux.dev> Co-developed-by: Thomas Jaskiewicz <tom@jaskiewicz.us> Signed-off-by: Thomas Jaskiewicz <tom@jaskiewicz.us> Co-developed-by: Ken Raeburn <raeburn@redhat.com> Signed-off-by: Ken Raeburn <raeburn@redhat.com> Signed-off-by: Matthew Sakai <msakai@redhat.com> Signed-off-by: Mike Snitzer <snitzer@kernel.org>
24 lines
514 B
C
24 lines
514 B
C
/* SPDX-License-Identifier: GPL-2.0-only */
|
|
/*
|
|
* Copyright 2023 Red Hat
|
|
*/
|
|
|
|
#ifndef UDS_STRING_UTILS_H
|
|
#define UDS_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)
|
|
{
|
|
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, ...)
|
|
__printf(3, 4);
|
|
|
|
#endif /* UDS_STRING_UTILS_H */
|