Messages in this thread | | | Date | Sat, 15 Nov 2003 18:33:10 +0100 | From | Harald Welte <> | Subject | Re: seq_file and exporting dynamically allocated data |
| |
On Sat, Nov 15, 2003 at 05:18:44PM +0000, viro@parcelfarce.linux.theplanet.co.uk wrote: > On Sat, Nov 15, 2003 at 10:38:33AM +0100, Harald Welte wrote: > > 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? > > Why should seq_open() know that? Its caller does and it can set the damn > thing to whatever it wants.
So who is the caller? it's the ->open() member of struct file_operations. and struct file_operations doesn't have some private member where I could hide my pointer before saving it to seq_file.private in seq_open().
> Wrong.
Hm, maybe somebody could enlighten me then. Maybe this is a stupid qestion, but I wasn't able to figure that out after reading all the structures, etc.
-- - Harald Welte <laforge@netfilter.org> 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 [unhandled content-type:application/pgp-signature] | |