Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=4f494554f9b95d0de57c14c460d525e3715e3f6f
Commit:     4f494554f9b95d0de57c14c460d525e3715e3f6f
Parent:     1e6e9342d41ff80ced0ad5dfcf084926700cdfc5
Author:     Thomas Graf <[EMAIL PROTECTED]>
AuthorDate: Wed Aug 8 23:12:36 2007 -0700
Committer:  David S. Miller <[EMAIL PROTECTED]>
CommitDate: Wed Oct 10 16:47:48 2007 -0700

    [NEIGH]: Combine neighbour cleanup and release
    
    Introduces neigh_cleanup_and_release() to be used after a
    neighbour has been removed from its neighbour table. Serves
    as preparation to add event notifications.
    
    Signed-off-by: Thomas Graf <[EMAIL PROTECTED]>
    Signed-off-by: David S. Miller <[EMAIL PROTECTED]>
---
 net/core/neighbour.c |   27 +++++++++++++--------------
 1 files changed, 13 insertions(+), 14 deletions(-)

diff --git a/net/core/neighbour.c b/net/core/neighbour.c
index f7de8f2..4b815db 100644
--- a/net/core/neighbour.c
+++ b/net/core/neighbour.c
@@ -105,6 +105,14 @@ static int neigh_blackhole(struct sk_buff *skb)
        return -ENETDOWN;
 }
 
+static void neigh_cleanup_and_release(struct neighbour *neigh)
+{
+       if (neigh->parms->neigh_cleanup)
+               neigh->parms->neigh_cleanup(neigh);
+
+       neigh_release(neigh);
+}
+
 /*
  * It is random distribution in the interval (1/2)*base...(3/2)*base.
  * It corresponds to default IPv6 settings and is not overridable,
@@ -141,9 +149,7 @@ static int neigh_forced_gc(struct neigh_table *tbl)
                                n->dead = 1;
                                shrunk  = 1;
                                write_unlock(&n->lock);
-                               if (n->parms->neigh_cleanup)
-                                       n->parms->neigh_cleanup(n);
-                               neigh_release(n);
+                               neigh_cleanup_and_release(n);
                                continue;
                        }
                        write_unlock(&n->lock);
@@ -214,9 +220,7 @@ static void neigh_flush_dev(struct neigh_table *tbl, struct 
net_device *dev)
                                NEIGH_PRINTK2("neigh %p is stray.\n", n);
                        }
                        write_unlock(&n->lock);
-                       if (n->parms->neigh_cleanup)
-                               n->parms->neigh_cleanup(n);
-                       neigh_release(n);
+                       neigh_cleanup_and_release(n);
                }
        }
 }
@@ -677,9 +681,7 @@ static void neigh_periodic_timer(unsigned long arg)
                        *np = n->next;
                        n->dead = 1;
                        write_unlock(&n->lock);
-                       if (n->parms->neigh_cleanup)
-                               n->parms->neigh_cleanup(n);
-                       neigh_release(n);
+                       neigh_cleanup_and_release(n);
                        continue;
                }
                write_unlock(&n->lock);
@@ -2095,11 +2097,8 @@ void __neigh_for_each_release(struct neigh_table *tbl,
                        } else
                                np = &n->next;
                        write_unlock(&n->lock);
-                       if (release) {
-                               if (n->parms->neigh_cleanup)
-                                       n->parms->neigh_cleanup(n);
-                               neigh_release(n);
-                       }
+                       if (release)
+                               neigh_cleanup_and_release(n);
                }
        }
 }
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to