ipv4: make arp seq_file show method only produce one record per call

ipv4: make arp seq_file show method only produce one record per call

Post by David S. Mille » Fri, 18 Oct 2002 03:10:08




   Date: Wed, 16 Oct 2002 22:01:36 -0300

        Please pull from:

   master.kernel.org:/home/acme/BK/net-2.5

Pulled, thanks.

Now to help Al create a sane mechanism for carrying private state
around between start/stop :-)

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in

More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

 
 
 

ipv4: make arp seq_file show method only produce one record per call

Post by Arnaldo Carvalho de Mel » Fri, 18 Oct 2002 03:20:06


Em Wed, Oct 16, 2002 at 05:58:09PM -0700, David S. Miller escreveu:


>    Date: Wed, 16 Oct 2002 22:01:36 -0300

>            Please pull from:

>    master.kernel.org:/home/acme/BK/net-2.5

> Pulled, thanks.

> Now to help Al create a sane mechanism for carrying private state
> around between start/stop :-)

That would be nice, yes, bastardizing pos for this is, humm, ugly, and
it isn't accessible at show time (pun intended 8) ).

But now I have to chainsaw the /proc/net/route support into shape, and
this one will be fun, as I'll have to change the semantics of the
struct fib_table tb_seq_show so that I can grab the lock at fib_seq_start,
and at fib_seq_show pass just one entry, then drop the lock at fib_seq_stop.
So, probably we'll have fib_table::tb_seq_{start, next, show, start}, humm,
this gave another idea... :)

- Arnaldo
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in

More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

 
 
 

ipv4: make arp seq_file show method only produce one record per call

Post by David S. Mille » Fri, 18 Oct 2002 03:30:07



   Date: Wed, 16 Oct 2002 22:11:08 -0300

   That would be nice, yes, bastardizing pos for this is, humm, ugly, and
   it isn't accessible at show time (pun intended 8) ).

Can you remind me what the original objection was to
just using seq->private?  Is it used, or planned to
be used, by something else?
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in

More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

 
 
 

ipv4: make arp seq_file show method only produce one record per call

Post by Neil Brow » Fri, 18 Oct 2002 03:40:06




>    Date: Wed, 16 Oct 2002 22:11:08 -0300

>    That would be nice, yes, bastardizing pos for this is, humm, ugly, and
>    it isn't accessible at show time (pun intended 8) ).

> Can you remind me what the original objection was to
> just using seq->private?  Is it used, or planned to
> be used, by something else?

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

NeilBrown
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in

More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

 
 
 

ipv4: make arp seq_file show method only produce one record per call

Post by Arnaldo Carvalho de Mel » Fri, 18 Oct 2002 03:40:07


Em Wed, Oct 16, 2002 at 06:15:50PM -0700, David S. Miller escreveu:


>    Date: Wed, 16 Oct 2002 22:11:08 -0300

>    That would be nice, yes, bastardizing pos for this is, humm, ugly, and
>    it isn't accessible at show time (pun intended 8) ).

> Can you remind me what the original objection was to
> just using seq->private?  Is it used, or planned to
> be used, by something else?

lemme get my logs... here it is:

Quoting Al:

"You're free to use, but keep in mind that it's assumed to be constant over
->start/->stop/->next/->show more accurately, there's no sane way to use it as
part of iterator state it's for "which of iterators with similar code it is?"
e.g. /proc/<pid>/mounts uses the same iterator over different namespaces -
depending on pid.  take a look at the way /proc/ksyms is done"

- Arnaldo
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in

More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

 
 
 

ipv4: make arp seq_file show method only produce one record per call

Post by David S. Mille » Fri, 18 Oct 2002 03:40:07



   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? :-)
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in

More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

 
 
 

ipv4: make arp seq_file show method only produce one record per call

Post by Arnaldo Carvalho de Mel » Fri, 18 Oct 2002 04:10:06


Em Wed, Oct 16, 2002 at 06:28:14PM -0700, David S. Miller escreveu:


>    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.

- Arnaldo
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in

More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

 
 
 

ipv4: make arp seq_file show method only produce one record per call

Post by Arnaldo Carvalho de Mel » Fri, 18 Oct 2002 04:20:04


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:

> >    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.

- Arnaldo
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in

More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

 
 
 

ipv4: make arp seq_file show method only produce one record per call

Post by Arnaldo Carvalho de Mel » Fri, 18 Oct 2002 04:30:07


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:

> > >    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
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in

More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

 
 
 

1. ipv4: udp seq_file support: produce only one record per seq_show


   Date: Wed, 16 Oct 2002 03:24:49 -0300

   master.kernel.org:/home/acme/BK/net-2.5

Pulled.

Two notes:

1) ARP and FIB hacks need similar treatment
2) I don't think it's so nice to snprintf() onto the
   stack and then seq_printf() that in fib_node_seq_show.

   You should be able to keep the line within it's
   limit length just by specifying lengths to the integer
   formats.

Thanks.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in

More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

2. FAQ: Sun Computer Administration Frequently Asked Questions

3. ipv4: move /proc/net/arp seq_file support back to arp.c

4. US-IL, Unix Developers

5. ipv4: convert /proc/net/arp to seq_file

6. pdksh for Win98

7. arp -a shows only one address, what version of arp?

8. And the BAD news is....

9. Remove compile warnings from ipv4/raw.c and ipv4/arp.c

10. ipv4: convert /proc/net/udp to seq_file

11. ipv4: remove the hack, make udp seq_file functions use seq->private

12. ipv4: convert /proc/net/raw to seq_file

13. ipv4/route: convert /proc/net/rt_cache to seq_file