Re: [PATCH v2 01/28] lib/printbuf: New data structure for printing strings

From: Matthew Wilcox
Date: Thu May 19 2022 - 14:21:22 EST


On Thu, May 19, 2022 at 01:23:54PM -0400, Kent Overstreet wrote:
> This adds printbufs: a printbuf points to a char * buffer and knows the
> size of the output buffer as well as the current output position.
>
> Future patches will be adding more features to printbuf, but initially
> printbufs are targeted at refactoring and improving our existing code in
> lib/vsprintf.c - so this initial printbuf patch has the features
> required for that.
>
> Signed-off-by: Kent Overstreet <kent.overstreet@xxxxxxxxx>

Reviewed-by: Matthew Wilcox (Oracle) <willy@xxxxxxxxxxxxx>

My only complaint ...

> +#define PRINTBUF ((struct printbuf) { .si_units = PRINTBUF_UNITS_10 })

si_units doesn't exist yet :-)