#include <linux/vmalloc.h>
#include <linux/workqueue.h>
-#define PAGE_SECTOR_SHIFT (PAGE_SHIFT - 9)
-#define PAGE_SECTORS (1UL << PAGE_SECTOR_SHIFT)
-
struct closure;
#ifdef CONFIG_BCACHEFS_DEBUG
struct printbuf {
char *pos;
char *end;
+ unsigned indent;
};
static inline size_t printbuf_remaining(struct printbuf *buf)
__VA_ARGS__); \
} while (0)
+static inline void printbuf_indent_push(struct printbuf *buf, unsigned spaces)
+{
+ buf->indent += spaces;
+ while (spaces--)
+ pr_buf(buf, " ");
+}
+
+static inline void printbuf_indent_pop(struct printbuf *buf, unsigned spaces)
+{
+ buf->indent -= spaces;
+}
+
+static inline void printbuf_newline(struct printbuf *buf)
+{
+ unsigned i;
+
+ pr_buf(buf, "\n");
+ for (i = 0; i < buf->indent; i++)
+ pr_buf(buf, " ");
+}
+
void bch_scnmemcpy(struct printbuf *, const char *, size_t);
int bch2_strtoint_h(const char *, int *);
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 */