lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:	Tue, 30 Oct 2007 15:26:31 +0000
From:	Denys Vlasenko <vda.linux@...glemail.com>
To:	Matthew Wilcox <matthew@....cx>
Cc:	torvalds@...ux-foundation.org, akpm@...ux-foundation.org,
	linux-kernel@...r.kernel.org,
	Matthew Wilcox <willy@...ux.intel.com>
Subject: Re: [PATCH 1/4] stringbuf: A string buffer implementation

On Tuesday 23 October 2007 22:12, Matthew Wilcox wrote:
> 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@...ux.intel.com>

> +static inline void sb_free(struct stringbuf *sb)
> +{
> +	if (sb->alloc > 0)
> +		kfree(sb->s);
> +	sb_init(sb);
> +}

> +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
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ