Skip to content

Commit 237a8e1

Browse files
author
Kent Overstreet
committed
bcachefs: CLASS(printbuf)
Add a DEFINE_CLASS() for printbufs. Signed-off-by: Kent Overstreet <[email protected]>
1 parent a0f7437 commit 237a8e1

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

fs/bcachefs/printbuf.h

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,14 @@ void bch2_prt_bitflags_vector(struct printbuf *, const char * const[],
140140
.size = _size, \
141141
})
142142

143+
static inline struct printbuf bch2_printbuf_init(void)
144+
{
145+
return PRINTBUF;
146+
}
147+
148+
DEFINE_CLASS(printbuf, struct printbuf,
149+
bch2_printbuf_exit(&_T), bch2_printbuf_init(), void)
150+
143151
/*
144152
* Returns size remaining of output buffer:
145153
*/

0 commit comments

Comments
 (0)