login
Login
/
Register
Search
Forums
News
Blogs
Features
Site
Home
»
Mailing list archives
»
linux-kernel
»
2007
»
October
»
30
Re: [PATCH 1/4] stringbuf: A string buffer implementation
view
thread
!MAILaRCHIVE_VOTE_RePLACE
Previous message: [
thread
] [
date
] [
author
]
Next message: [
thread
] [
date
] [
author
]
[view in full thread]
From:
Denys Vlasenko <vda.linux@...>
To: Matthew Wilcox <matthew@...>
Cc: <torvalds@...>, <akpm@...>, <linux-kernel@...>, Matthew Wilcox <willy@...>
Subject:
Re: [PATCH 1/4] stringbuf: A string buffer implementation
Date: Tuesday, October 30, 2007 - 11:26 am
On Tuesday 23 October 2007 22:12, Matthew Wilcox wrote:
quoted text
> Consecutive calls to printk are non-atomic, which leads to various > implementations for accumulating strings which can be printed in one call. > This is a generic string buffer which can also be used for non-printk > purposes. There is no sb_scanf implementation yet as I haven't identified > a user for it. > > Signed-off-by: Matthew Wilcox <willy@linux.intel.com>
quoted text
> +static inline void sb_free(struct stringbuf *sb) > +{ > + if (sb->alloc > 0) > + kfree(sb->s); > + sb_init(sb); > +}
quoted text
> +static inline char *sb_to_string(struct stringbuf *sb) > +{ > + char *s = sb->s; > + if (sb_error(sb)) > + s = kstrdup(s, GFP_ATOMIC); > + sb_init(sb); > + return s; > +}
I am not sure inlining these functions is a win. -- vda -
unsubscribe notice
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to
majordomo@vger.kernel.org
More majordomo info at
http://vger.kernel.org/majordomo-info.html
Please read the FAQ at
http://www.tux.org/lkml/
Previous message: [
thread
] [
date
] [
author
]
Next message: [
thread
] [
date
] [
author
]
Messages in current thread:
[PATCH 1/4] stringbuf: A string buffer implementation
, Matthew Wilcox
, (Tue Oct 23, 5:12 pm)
Re: [PATCH 1/4] stringbuf: A string buffer implementation
, Denys Vlasenko
, (Tue Oct 30, 11:26 am)
Re: [PATCH 1/4] stringbuf: A string buffer implementation
, Pavel Machek
, (Sat Oct 27, 3:31 am)
Re: [PATCH 1/4] stringbuf: A string buffer implementation
, Pekka Enberg
, (Fri Oct 26, 8:05 am)
Re: [PATCH 1/4] stringbuf: A string buffer implementation
, Florian Weimer
, (Wed Oct 24, 9:21 am)
Re: [PATCH 1/4] stringbuf: A string buffer implementation
, Matthew Wilcox
, (Wed Oct 24, 10:02 am)
Re: [PATCH 1/4] stringbuf: A string buffer implementation
, Matthew Wilcox
, (Tue Oct 23, 10:35 pm)
Re: [PATCH 1/4] stringbuf: A string buffer implementation
, Eric St-Laurent
, (Tue Oct 23, 10:48 pm)
Re: [PATCH 1/4] stringbuf: A string buffer implementation
, Linus Torvalds
, (Tue Oct 23, 7:43 pm)
Re: [PATCH 1/4] stringbuf: A string buffer implementation
, Matthew Wilcox
, (Tue Oct 23, 10:30 pm)
Re: [PATCH 1/4] stringbuf: A string buffer implementation
, Andrew Morton
, (Tue Oct 23, 10:45 pm)
Re: [PATCH 1/4] stringbuf: A string buffer implementation
, Eric St-Laurent
, (Tue Oct 23, 10:19 pm)
Re: [PATCH 1/4] stringbuf: A string buffer implementation
, Matt Mackall
, (Tue Oct 23, 6:11 pm)
Re: [PATCH 1/4] stringbuf: A string buffer implementation
, Matthew Wilcox
, (Tue Oct 23, 9:49 pm)
Re: [PATCH 1/4] stringbuf: A string buffer implementation
, Matt Mackall
, (Wed Oct 24, 11:20 am)
Re: [PATCH 1/4] stringbuf: A string buffer implementation
, Matthew Wilcox
, (Wed Oct 24, 11:30 am)
[PATCH 2/4] isdn: Use stringbuf
, Matthew Wilcox
, (Tue Oct 23, 5:12 pm)
[PATCH 3/4] sound: Use stringbuf
, Matthew Wilcox
, (Tue Oct 23, 5:12 pm)
Re: [PATCH 3/4] sound: Use stringbuf
, Takashi Iwai
, (Wed Oct 24, 10:18 am)
Re: [PATCH 3/4] sound: Use stringbuf
, Matthew Wilcox
, (Wed Oct 24, 12:01 pm)
Re: [PATCH 3/4] sound: Use stringbuf
, Takashi Iwai
, (Wed Oct 24, 10:50 am)
[PATCH 4/4] partitions: Fix non-atomic printk
, Matthew Wilcox
, (Tue Oct 23, 5:12 pm)
Navigation
Create content
Mailing list archives
Recent posts
Popular discussions
linux-kernel
:
H. Peter Anvin
Re: [RFC 00/15] x86_64: Optimize percpu accesses
Linus Torvalds
Linux 2.6.27-rc5
Ingo Molnar
[announce] "kill the Big Kernel Lock (BKL)" tree
Greg KH
Re: Dual-Licensing Linux Kernel with GPL V2 and GPL V3
git
:
linux-netdev
:
Jarek Poplawski
[PATCH] pkt_sched: Destroy gen estimators under rtnl_lock().
Gerrit Renker
[PATCH 27/37] dccp: Integration of dynamic feature activation - part 2 (server side)
Ben Hutchings
Re: [GIT]: Networking
Jarek Poplawski
[PATCH iproute2] Re: HTB accuracy for high speed
openbsd-misc
:
Colocation donated by:
Who's online
There are currently
5 users
and
624 guests
online.
Online users
mrsleepyhead
registryfix
disenococinas
johnnysteele
kathrynecullina
Syndicate