public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Arnaldo Carvalho de Melo <acme@conectiva.com.br>
To: "David S. Miller" <davem@redhat.com>,
	neilb@cse.unsw.edu.au, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] ipv4: make arp seq_file show method only produce one record per call
Date: Wed, 16 Oct 2002 23:23:21 -0300	[thread overview]
Message-ID: <20021017022321.GZ7541@conectiva.com.br> (raw)
In-Reply-To: <20021017021028.GW7541@conectiva.com.br>

Em Wed, Oct 16, 2002 at 11:10:28PM -0300, Arnaldo C. Melo escreveu:
> Em Wed, Oct 16, 2002 at 11:00:01PM -0300, Arnaldo C. Melo escreveu:
> > Em Wed, Oct 16, 2002 at 06:28:14PM -0700, David S. Miller escreveu:
> > >    From: Neil Brown <neilb@cse.unsw.edu.au>
> > >    Date: Thu, 17 Oct 2002 11:30:43 +1000
> > >    
> > >    I use seq->private for private state for /proc/fs/nfs/exports.
> > >    It works nicely.
> > >    You need to define an 'open' the sets it up, and a 'release' to
> > >    tear it down, rather than doing it in start/stop.
> > >    See fs/nfsd/fnsctl.c:exports_open
> > > 
> > > Hmmm, Arnaldo? :-)
> > 
> > 	I know that it works :-) I just refrained from using it because it is
> > not the designed purpose for this field, as per what the author stated to me,
> > so I didn't wanted to use in a way that could change under my feet in the
> > future when Al decided to do some change in seq_file.
> > 
> > 	But if Al changes his mind and state that this is valid use, great,
> > I'll happily use it.
> > 
> > 	See my other post with Al's comments.
> 
> Ok, /me knocks his head on the wall, rereading I think that it is OK, just the
> _pointer_ can't change, oh well, duh, back to work.

Oh, and now that I think about it there is a way to do it without even using
seq_file->private when you need state passed, just allocates a state structure
in seq_start and return it, keeping the pointer to the real object inside this
state structure, together with any other state you need, when the the list is
exhausted, just free the state structure and return NULL, or return NULL and
free the state struct in ->stop, like kernel/module.c:{s_start, s_stop} do, but
I think that what Neil do in NFS is OK, and better, so I'll use seq->private.

- Arnaldo

  reply	other threads:[~2002-10-17  2:17 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-10-17  1:01 [PATCH] ipv4: make arp seq_file show method only produce one record per call Arnaldo Carvalho de Melo
2002-10-17  0:58 ` David S. Miller
2002-10-17  1:11   ` Arnaldo Carvalho de Melo
2002-10-17  1:15     ` David S. Miller
2002-10-17  1:30       ` Neil Brown
2002-10-17  1:28         ` David S. Miller
2002-10-17  2:00           ` Arnaldo Carvalho de Melo
2002-10-17  2:10             ` Arnaldo Carvalho de Melo
2002-10-17  2:23               ` Arnaldo Carvalho de Melo [this message]
2002-10-17  1:35       ` Arnaldo Carvalho de Melo

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20021017022321.GZ7541@conectiva.com.br \
    --to=acme@conectiva.com.br \
    --cc=davem@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=neilb@cse.unsw.edu.au \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox