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] [thread-next>] [day] [month] [year] [list]
Message-ID: <20110922235417.6cf88f7d@lxorguk.ukuu.org.uk>
Date:	Thu, 22 Sep 2011 23:54:17 +0100
From:	Alan Cox <alan@...rguk.ukuu.org.uk>
To:	Colin Cross <ccross@...roid.com>
Cc:	linux-kernel@...r.kernel.org, linux-fsdevel@...r.kernel.org,
	Alexander Viro <viro@...iv.linux.org.uk>,
	Ingo Molnar <mingo@...e.hu>,
	Peter Zijlstra <peterz@...radead.org>,
	Andrew Morton <akpm@...ux-foundation.org>,
	Alexey Dobriyan <adobriyan@...il.com>
Subject: Re: [PATCH 1/3] fs: seq_file: add seq_reserve

On Thu, 22 Sep 2011 13:57:07 -0700
Colin Cross <ccross@...roid.com> wrote:

> Adds a seq_reserve function to allow users of the seq_file interface to
> increase the initial size of the buffer.  Avoids repeated allocations and
> calls to the show function in cases where large buffers of known size are
> needed.

Would it not be better to have something akin to


	void seq_set_buffer(struct seq_file *m, void *ptr, size_t size)
	{
		m->buf = ptr;
		m->size = size;
		m->private = 1;
	}

and let the caller simply provide a buffer by any means it wishes (even
statically) and free it again itself. That keeps the caller fully in
control when it wishes to be.

Alan
--
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