Re: Stringbuf, v2

Joe Perches
2007-10-24T20:52:08Z

On Wed, 2007-10-24 at 13:58 -0600, Matthew Wilcox wrote:
> - Pass a gfp_t to sb_printk

sb_printf

As it doesn't actually output anything but extends
a buffer pointer in a struct, perhaps it's better to
rename sb_printf to sb_sprintf.

I believe the common use will be GFP_ATOMIC.
Perhaps a default wrapper define and a renamed function?

void sb_sprintf_gfp(struct stringbuf *sb, gfp_t gfp, const char *fmt, ...)

#define sb_sprintf(sb, fmt, arg...) \
sb_sprintf_gfp(sb, GFP_ATOMIC, fmt, ##arg)