[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20070815041845.GJ21089@ftp.linux.org.uk>
Date: Wed, 15 Aug 2007 05:18:45 +0100
From: Al Viro <viro@....linux.org.uk>
To: Mathieu Desnoyers <mathieu.desnoyers@...ymtl.ca>,
akpm@...ux-foundation.org, linux-kernel@...r.kernel.org,
Randy Dunlap <rddunlap@...l.org>,
Martin Bligh <mbligh@...gle.com>
Subject: Re: [patch 2/2] Sort module list by pointer address to get coherent sleepable seq_file iterators
On Wed, Aug 15, 2007 at 11:39:45AM +0800, Fengguang Wu wrote:
> On Sun, Aug 12, 2007 at 11:08:46AM -0400, Mathieu Desnoyers wrote:
> >
> > static void *m_next(struct seq_file *m, void *p, loff_t *pos)
> > {
> > - return seq_list_next(p, &modules, pos);
> > + return seq_sorted_list_next(p, &modules, &m->private);
> > }
>
> In theory it is not safe to use something other than the passed in
> *pos as an position indicator. Because seq_file do not always call
> ->next() to advance to the next item. Look at seq_file.c, it sometimes
> increase the pos/index directly! Which also prevents pos to skip
> forward, which is preferred in your case.
>
> The attached patch tries to fix it.
>
> The seq_file.c is so twisted!
>
> Fengguang
> ===
>
> seqfile: remove seq_file's assumption about iterators
>
> The seq_file implementation has some hardcoded index++/pos++ lines,
> which assumes iterators to be *continuous* integers.
What the fuck? It assumes no such thing and a lot of iterators are
nothing like integers. What are you talking about?
-
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