From: Matthew Wilcox <matthew@wil.cx>
To: Joe Perches <joe@perches.com>
Cc: Linus Torvalds <torvalds@osdl.org>, Andrew Morton <akpm@osdl.org>,
linux-kernel@vger.kernel.org
Subject: Re: Stringbuf, v2
Date: Wed, 24 Oct 2007 14:57:01 -0600 [thread overview]
Message-ID: <20071024205701.GF27248@parisc-linux.org> (raw)
In-Reply-To: <1193259097.19617.18.camel@localhost>
On Wed, Oct 24, 2007 at 01:51:37PM -0700, Joe Perches wrote:
> On Wed, 2007-10-24 at 13:58 -0600, Matthew Wilcox wrote:
> > - Pass a gfp_t to sb_printk
>
> sb_printf
indeed.
> 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.
printf prints to stdout. fprintf prints to a file. sprintf prints to
a string. sb_printf prints to an sb.
> I believe the common use will be GFP_ATOMIC.
An interesting belief. Of the three users I've converted, one uses
GFP_ATOMIC and two use GFP_KERNEL.
> 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)
If you look at the patches, you'll see that they basically all have a
wrapper around sb_printf that I was able to insert the GFP argument
into, so I don't see this as a win. I hadn't bothered with one for
ISDN, and that one involved much more editing.
--
Intel are signing my paycheques ... these opinions are still mine
"Bill, look, we understand that you're interested in selling us this
operating system, but compare it to ours. We can't possibly take such
a retrograde step."
next prev parent reply other threads:[~2007-10-24 20:57 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-10-24 19:58 Stringbuf, v2 Matthew Wilcox
2007-10-24 19:59 ` [PATCH 1/4] stringbuf: A string buffer implementation Matthew Wilcox
2007-10-24 19:59 ` [PATCH 2/4] isdn: Use stringbuf Matthew Wilcox
2007-10-24 19:59 ` [PATCH 3/4] sound: " Matthew Wilcox
2007-10-24 19:59 ` [PATCH 4/4] partitions: Fix non-atomic printk Matthew Wilcox
2007-10-24 20:59 ` [PATCH 1/4] stringbuf: A string buffer implementation Kyle Moffett
2007-10-24 21:21 ` Matthew Wilcox
2007-10-25 0:07 ` Kyle Moffett
2007-10-25 3:23 ` Matthew Wilcox
2007-10-26 2:11 ` Rusty Russell
2007-10-26 3:41 ` Joe Perches
2007-10-26 5:05 ` Joe Perches
2007-10-26 11:57 ` Matthew Wilcox
2007-10-26 20:57 ` Matt Mackall
2007-10-27 10:09 ` Rusty Russell
2007-10-29 3:03 ` Matt Mackall
2007-10-29 5:38 ` Rusty Russell
2007-10-27 11:47 ` Pekka Enberg
2007-10-27 12:50 ` Rusty Russell
2007-10-27 16:34 ` Pekka Enberg
2007-10-27 16:48 ` Matthew Wilcox
2007-10-24 20:51 ` Stringbuf, v2 Joe Perches
2007-10-24 20:57 ` Matthew Wilcox [this message]
2007-10-24 21:06 ` Joe Perches
2007-10-24 21:34 ` Matthew Wilcox
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20071024205701.GF27248@parisc-linux.org \
--to=matthew@wil.cx \
--cc=akpm@osdl.org \
--cc=joe@perches.com \
--cc=linux-kernel@vger.kernel.org \
--cc=torvalds@osdl.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox