login
Login
/
Register
Search
Search this site:
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
Previous message: [
thread
] [
date
] [
author
]
Next message: [thread] [
date
] [
author
]
[view in full thread]
From: Denys Vlasenko
Subject:
Re: [PATCH 1/4] stringbuf: A string buffer implementation
Date: Tuesday, October 30, 2007 - 8: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, 2:12 pm)
[PATCH 2/4] isdn: Use stringbuf
, Matthew Wilcox
, (Tue Oct 23, 2:12 pm)
[PATCH 3/4] sound: Use stringbuf
, Matthew Wilcox
, (Tue Oct 23, 2:12 pm)
[PATCH 4/4] partitions: Fix non-atomic printk
, Matthew Wilcox
, (Tue Oct 23, 2:12 pm)
Re: [PATCH 1/4] stringbuf: A string buffer implementation
, Matt Mackall
, (Tue Oct 23, 3:11 pm)
Re: [PATCH 1/4] stringbuf: A string buffer implementation
, Linus Torvalds
, (Tue Oct 23, 4:43 pm)
Re: [PATCH 1/4] stringbuf: A string buffer implementation
, Matthew Wilcox
, (Tue Oct 23, 6:49 pm)
Re: [PATCH 1/4] stringbuf: A string buffer implementation
, Eric St-Laurent
, (Tue Oct 23, 7:19 pm)
Re: [PATCH 1/4] stringbuf: A string buffer implementation
, Matthew Wilcox
, (Tue Oct 23, 7:30 pm)
Re: [PATCH 1/4] stringbuf: A string buffer implementation
, Matthew Wilcox
, (Tue Oct 23, 7:35 pm)
Re: [PATCH 1/4] stringbuf: A string buffer implementation
, Andrew Morton
, (Tue Oct 23, 7:45 pm)
Re: [PATCH 1/4] stringbuf: A string buffer implementation
, Eric St-Laurent
, (Tue Oct 23, 7:48 pm)
Re: [PATCH 1/4] stringbuf: A string buffer implementation
, Florian Weimer
, (Wed Oct 24, 6:21 am)
Re: [PATCH 1/4] stringbuf: A string buffer implementation
, Matthew Wilcox
, (Wed Oct 24, 7:02 am)
Re: [PATCH 3/4] sound: Use stringbuf
, Takashi Iwai
, (Wed Oct 24, 7:18 am)
Re: [PATCH 3/4] sound: Use stringbuf
, Takashi Iwai
, (Wed Oct 24, 7:50 am)
Re: [PATCH 1/4] stringbuf: A string buffer implementation
, Matt Mackall
, (Wed Oct 24, 8:20 am)
Re: [PATCH 1/4] stringbuf: A string buffer implementation
, Matthew Wilcox
, (Wed Oct 24, 8:30 am)
Re: [PATCH 3/4] sound: Use stringbuf
, Matthew Wilcox
, (Wed Oct 24, 9:01 am)
Re: [PATCH 1/4] stringbuf: A string buffer implementation
, Pekka Enberg
, (Fri Oct 26, 5:05 am)
Re: [PATCH 1/4] stringbuf: A string buffer implementation
, Pavel Machek
, (Sat Oct 27, 12:31 am)
Re: [PATCH 1/4] stringbuf: A string buffer implementation
, Denys Vlasenko
, (Tue Oct 30, 8:26 am)
Navigation
Mailing list archives
Recent posts
Popular discussions
linux-kernel
:
Fortier,Vincent [Montreal]
2.6.21.5 june 30th to july 1st date hang?
Jeff Dike
[ PATCH 2/6 ] UML - Formatting fixes around os_{read_write}_file callers
Liam Girdwood
[PATCH 07/13] regulator: regulator test harness
Oleg Nesterov
Re: Getting the new RxRPC patches upstream
Stefan Seyfried
Re: 2.6.19-rc5: grub is much slower resuming from suspend-to-disk than in 2.6.18
linux-netdev
:
Arnaud Ebalard
Re: [REGRESSION,BISECTED] MIPv6 support broken by f4f914b58019f0
Jan Engelhardt
Re: [PATCH iptables] extension: add xt_cpu match
Jarek Poplawski
Re: [PATCH] pkt_sched: Destroy gen estimators under rtnl_lock().
Sebastian Andrzej Siewior
[PATCH 8/8] net/emergency: remove locking from reycling pool if emergncy pools are...
David Miller
Re: [PATCH] qlcnic: dont assume NET_IP_ALIGN is 2
git
:
Jakub Narebski
Re: git on MacOSX and files with decomposed utf-8 file names
Brandon Casey
Re: Thunderbird and patches (was Re: [PATCH v2] Enable setting attach as the def...
Christian Couder
[PATCH 1/3] rev-parse: add test script for "--verify"
Ramkumar Ramachandra
Re: [GSoC update] git-remote-svn: The final one
Junio C Hamano
Re: git-rm isn't the inverse action of git-add
openbsd-misc
:
Joachim Schipper
Re: UVC Webcams
Florin Andrei
SOLVED [was: firewall is very slow, something's wrong]
Todd Alan Smith
Re: Microsoft gets the Most Secure Operating Systems award
Neal Hogan
Re: Need Advice: Thinkpad T60 or T61?
Sam Fourman Jr.
Re: Real men don't attack straw men
git-commits-head
:
Linux Kernel Mailing List
ACPI: Disable ARB_DISABLE on platforms where it is not needed
Linux Kernel Mailing List
m68knommu: add read_barrier_depends() and irqs_disabled_flags()
Linux Kernel Mailing List
[MTD] Add mtd panic_write function pointer
Linux Kernel Mailing List
[ARM] pxa: remove duplicate select statements from Kconfig
Linux Kernel Mailing List
mlx4_core: Don't read reserved fields in mlx4_QUERY_ADAPTER()
Colocation donated by:
Syndicate