bcachefs: CLASS(printbuf)
authorKent Overstreet <kent.overstreet@linux.dev>
Sun, 25 May 2025 06:59:35 +0000 (02:59 -0400)
committerKent Overstreet <kent.overstreet@linux.dev>
Sun, 1 Jun 2025 02:03:17 +0000 (22:03 -0400)
Add a DEFINE_CLASS() for printbufs.

Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
fs/bcachefs/printbuf.h

index 1ca476adbf6f170fe8cec9d83dcbacd5faf15301..8f4e28d440ac3fbdd116483a9ac02839f392f966 100644 (file)
@@ -140,6 +140,14 @@ void bch2_prt_bitflags_vector(struct printbuf *, const char * const[],
        .size   = _size,                                \
 })
 
+static inline struct printbuf bch2_printbuf_init(void)
+{
+       return PRINTBUF;
+}
+
+DEFINE_CLASS(printbuf, struct printbuf,
+            bch2_printbuf_exit(&_T), bch2_printbuf_init(), void)
+
 /*
  * Returns size remaining of output buffer:
  */