Thread (28 messages) 28 messages, 5 authors, 2004-09-23

Re: [PATCH] Clean up fib_hash datastructures

From: jamal <hidden>
Date: 2004-09-20 13:33:17

On Sun, 2004-09-19 at 23:17, David S. Miller wrote:
On Mon, 20 Sep 2004 13:14:54 +1000
Herbert Xu [off-list ref] wrote:
quoted
jamal [off-list ref] wrote:
quoted
--- 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.
Seems like get_first just populates the fib_iter_state with the first
valid entry and fib_get_next gets the next valid one - Sorry never paid
attention when patches for these were going in. 
In which case the check for zero entries is missing from fib_get_next
making it ineeficient (but not buggy).
A more complete patch (untested, uncompiled) attached.

cheers,
jamal

Attachments

Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help