Re: seq_file and exporting dynamically allocated data

From: Harald Welte
Date: Sat Nov 15 2003 - 05:15:40 EST


On Fri, Nov 14, 2003 at 09:01:58PM +0000, Tigran Aivazian wrote:
> On Fri, 14 Nov 2003, Harald Welte wrote:
> > The problem is, that seq_file is already using the file.private_data
> > member...
>
> there is a seq_file->private pointer where you can store private (per file
> structure) data. That is what I do and it works very nice, BUT the problem
> is that the ->private pointer was only added to seq_file recently
> (2.4.20 if I remember correctly) although seq_file API was present since
> 2.4.15.

that doesn't help. As I am aware, the seq_file structure is only
allocated in the seq_open() call. How does seq_open() know which
private data (i.e. hash table) to associate with struct file?

The only moment I know which htable corresponds to a proc entry is at
the time where I call proc_net_create() [or a similar function]. So the
information would need to be associated with the dentry or whatever...
seq_file() is allocated way too late.

> Kind regards
> Tigran

--
- Harald Welte <laforge@xxxxxxxxxxxxx> http://www.netfilter.org/
============================================================================
"Fragmentation is like classful addressing -- an interesting early
architectural error that shows how much experimentation was going
on while IP was being designed." -- Paul Vixie

Attachment: pgp00001.pgp
Description: PGP signature