From: Kent Overstreet Date: Sun, 25 May 2025 06:59:35 +0000 (-0400) Subject: bcachefs: CLASS(printbuf) X-Git-Tag: v6.16-rc1~48^2~25 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=237a8e16bd71cce84e0e3404e1ed8df2b5d63c7c;p=thirdparty%2Flinux.git bcachefs: CLASS(printbuf) Add a DEFINE_CLASS() for printbufs. Signed-off-by: Kent Overstreet --- diff --git a/fs/bcachefs/printbuf.h b/fs/bcachefs/printbuf.h index 1ca476adbf6f1..8f4e28d440ac3 100644 --- a/fs/bcachefs/printbuf.h +++ b/fs/bcachefs/printbuf.h @@ -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: */