netdev
[Top] [All Lists]

Re: [PATCH] Clean up fib_hash datastructures

To: Herbert Xu <herbert@xxxxxxxxxxxxxxxxxxx>
Subject: Re: [PATCH] Clean up fib_hash datastructures
From: "David S. Miller" <davem@xxxxxxxxxxxxx>
Date: Sun, 19 Sep 2004 20:17:35 -0700
Cc: hadi@xxxxxxxxxx, netdev@xxxxxxxxxxx
In-reply-to: <E1C9Edi-00033O-00@gondolin.me.apana.org.au>
References: <1095640781.1047.168.camel@jzny.localdomain> <E1C9Edi-00033O-00@gondolin.me.apana.org.au>
Sender: netdev-bounce@xxxxxxxxxxx
On Mon, 20 Sep 2004 13:14:54 +1000
Herbert Xu <herbert@xxxxxxxxxxxxxxxxxxx> wrote:

> jamal <hadi@xxxxxxxxxx> wrote:
> > 
> > --- a/net/ipv4/fib_hash.c       2004/09/20 00:35:16     1.1
> > +++ b/net/ipv4/fib_hash.c       2004/09/20 00:36:16
> > @@ -915,7 +915,7 @@
> >             iter->zone = iter->zone->fz_next) {
> >                int maxslot;
> > 
> > -               if (!iter->zone->fz_next)
> > +               if (!iter->zone->fz_nent)
> >                        continue;
> 
> Good catch.  There seems to be another problem with the seq_file
> conversion.  Why is this check only in fib_get_first(), but not
> in fib_get_next()?
> 
> Either it's needed in fib_get_next() as well, or it can be removed here.

It's an optimization, the hash list traversal will find no entries
even if we don't do this test.

It does belong in fib_get_next(), so I'll happily add it there.
Thanks.

<Prev in Thread] Current Thread [Next in Thread>