summaryrefslogtreecommitdiff
path: root/include/linux/kernel.h
diff options
context:
space:
mode:
authorKent Overstreet <kent.overstreet@gmail.com>2022-06-09 01:13:46 -0400
committerKent Overstreet <kent.overstreet@gmail.com>2022-06-09 15:07:25 -0400
commit6ac37db8415c636607d878c16af8346df55668f4 (patch)
tree9c41e2d77899017d8deebc20d3d125541d476457 /include/linux/kernel.h
parentbec3a265658010a6cbf0cfac6dca461a7edf2c7d (diff)
Update bcachefs sources to 24f7e08cd8 bcachefs: shrinker.to_text() methods
Diffstat (limited to 'include/linux/kernel.h')
-rw-r--r--include/linux/kernel.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/include/linux/kernel.h b/include/linux/kernel.h
index 30451cb9..a0d3e467 100644
--- a/include/linux/kernel.h
+++ b/include/linux/kernel.h
@@ -228,6 +228,16 @@ static inline int __must_check kstrtos32(const char *s, unsigned int base, s32 *
return kstrtoint(s, base, res);
}
+struct printbuf;
+extern __printf(2, 3) void prt_printf(struct printbuf *out, const char *fmt, ...);
+
+static const char hex_asc[] = "0123456789abcdef";
+#define hex_asc_lo(x) hex_asc[((x) & 0x0f)]
+#define hex_asc_hi(x) hex_asc[((x) & 0xf0) >> 4]
+static const char hex_asc_upper[] = "0123456789ABCDEF";
+#define hex_asc_upper_lo(x) hex_asc_upper[((x) & 0x0f)]
+#define hex_asc_upper_hi(x) hex_asc_upper[((x) & 0xf0) >> 4]
+
/* The hash is always the low bits of hash_len */
#if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__
#define HASH_LEN_DECLARE u32 hash; u32 len