lkml.org 
[lkml]   [2003]   [Nov]   [15]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: 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]
\
 
 \ /
  Last update: 2005-03-22 13:58    [W:0.055 / U:0.024 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site