[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAMbhsRQXS_bcvOmN7Bnofr9Ana_6b23rakriQU51RjTcS3=63Q@mail.gmail.com>
Date: Thu, 22 Sep 2011 16:24:21 -0700
From: Colin Cross <ccross@...roid.com>
To: Alan Cox <alan@...rguk.ukuu.org.uk>
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, Sep 22, 2011 at 3:54 PM, Alan Cox <alan@...rguk.ukuu.org.uk> wrote:
> 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.
What would happen when seq_read overflowed the buffer? It wouldn't be
able to reallocate it.
--
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