summaryrefslogtreecommitdiff
path: root/fs/bcachefs/util.h
diff options
context:
space:
mode:
authorKent Overstreet <kent.overstreet@gmail.com>2022-01-05 03:05:08 +0300
committerKent Overstreet <kent.overstreet@linux.dev>2023-10-23 00:09:21 +0300
commit03ea3962ab99adf0cf7de9949716e6baeda230f3 (patch)
tree1d1a8140f3b43772591ad33ffd49a0b76d7b8b55 /fs/bcachefs/util.h
parent57cfdd8b54b945fe80191767e36595b46893e5e0 (diff)
downloadlinux-03ea3962ab99adf0cf7de9949716e6baeda230f3.tar.xz
bcachefs: Log & error message improvements
- Add a shim uuid_unparse_lower() in the kernel, since %pU doesn't work in userspace - We don't need to print the bcachefs: or the filesystem name prefix in userspace - Improve a few error messages Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com>
Diffstat (limited to 'fs/bcachefs/util.h')
-rw-r--r--fs/bcachefs/util.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/fs/bcachefs/util.h b/fs/bcachefs/util.h
index 969139fef086..fbe5b710e9c5 100644
--- a/fs/bcachefs/util.h
+++ b/fs/bcachefs/util.h
@@ -764,4 +764,13 @@ static inline int u8_cmp(u8 l, u8 r)
return cmp_int(l, r);
}
+#ifdef __KERNEL__
+static inline void uuid_unparse_lower(u8 *uuid, char *out)
+{
+ sprintf(out, "%plU", uuid);
+}
+#else
+#include <uuid/uuid.h>
+#endif
+
#endif /* _BCACHEFS_UTIL_H */