Re: [PATCH 1/4] stringbuf: A string buffer implementation

!MAILaRCHIVE_VOTE_RePLACE
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: Pekka Enberg <penberg@...>
Cc: Rusty Russell <rusty@...>, Linus Torvalds <torvalds@...>, Andrew Morton <akpm@...>, <linux-kernel@...>, Matthew Wilcox <willy@...>
Date: Saturday, October 27, 2007 - 12:48 pm

On Sat, Oct 27, 2007 at 07:34:47PM +0300, Pekka Enberg wrote:

That was why I had an sb_error() as part of the API so a caller who
cared could check, and a caller who didn't care would never know --
they'd just print the out-of-memory string and continue happily.

It's not hard to add an sb_error to Rusty's rewrite.  It looks something
like:

static inline int sb_error(struct stringbuf *sb)
{
	if (sb == sb_enomem_string)
		return -ENOMEM;
	return 0;
}

-- 
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."
-
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
Stringbuf, v2, Matthew Wilcox, (Wed Oct 24, 3:58 pm)
Re: Stringbuf, v2, Joe Perches, (Wed Oct 24, 4:51 pm)
Re: Stringbuf, v2, Matthew Wilcox, (Wed Oct 24, 4:57 pm)
Re: Stringbuf, v2, Joe Perches, (Wed Oct 24, 5:06 pm)
Re: Stringbuf, v2, Matthew Wilcox, (Wed Oct 24, 5:34 pm)
[PATCH 1/4] stringbuf: A string buffer implementation, Matthew Wilcox, (Wed Oct 24, 3:59 pm)
Re: [PATCH 1/4] stringbuf: A string buffer implementation, Rusty Russell, (Thu Oct 25, 10:11 pm)
Re: [PATCH 1/4] stringbuf: A string buffer implementation, Rusty Russell, (Sat Oct 27, 8:50 am)
Re: [PATCH 1/4] stringbuf: A string buffer implementation, Pekka Enberg, (Sat Oct 27, 12:34 pm)
Re: [PATCH 1/4] stringbuf: A string buffer implementation, Matthew Wilcox, (Sat Oct 27, 12:48 pm)
Re: [PATCH 1/4] stringbuf: A string buffer implementation, Matthew Wilcox, (Fri Oct 26, 7:57 am)
Re: [PATCH 1/4] stringbuf: A string buffer implementation, Rusty Russell, (Sat Oct 27, 6:09 am)
Re: [PATCH 1/4] stringbuf: A string buffer implementation, Matt Mackall, (Sun Oct 28, 11:03 pm)
Re: [PATCH 1/4] stringbuf: A string buffer implementation, Rusty Russell, (Mon Oct 29, 1:38 am)
Re: [PATCH 1/4] stringbuf: A string buffer implementation, Matthew Wilcox, (Wed Oct 24, 5:21 pm)
Re: [PATCH 1/4] stringbuf: A string buffer implementation, Matthew Wilcox, (Wed Oct 24, 11:23 pm)
[PATCH 2/4] isdn: Use stringbuf, Matthew Wilcox, (Wed Oct 24, 3:59 pm)
[PATCH 3/4] sound: Use stringbuf, Matthew Wilcox, (Wed Oct 24, 3:59 pm)
[PATCH 4/4] partitions: Fix non-atomic printk, Matthew Wilcox, (Wed Oct 24, 3:59 pm)