diff options
author | Pavel Emelianov <xemul@openvz.org> | 2007-05-03 18:13:45 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2007-05-03 18:13:45 -0400 |
commit | 7562f876cd93800f2f8c89445f2a563590b24e09 (patch) | |
tree | 78a34c011af275efa0d55ba59c3bd49b771dd533 /net/decnet/dn_route.c | |
parent | 03fba0479600114f32d29eee74ca3eaa364606bf (diff) |
[NET]: Rework dev_base via list_head (v3)
Cleanup of dev_base list use, with the aim to simplify making device
list per-namespace. In almost every occasion, use of dev_base variable
and dev->next pointer could be easily replaced by for_each_netdev
loop. A few most complicated places were converted to using
first_netdev()/next_netdev().
Signed-off-by: Pavel Emelianov <xemul@openvz.org>
Acked-by: Kirill Korotaev <dev@openvz.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/decnet/dn_route.c')
-rw-r--r-- | net/decnet/dn_route.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/net/decnet/dn_route.c b/net/decnet/dn_route.c index 5d7337bcf0fe..a8bf106b7a61 100644 --- a/net/decnet/dn_route.c +++ b/net/decnet/dn_route.c | |||
@@ -886,7 +886,7 @@ static int dn_route_output_slow(struct dst_entry **pprt, const struct flowi *old | |||
886 | .iif = loopback_dev.ifindex, | 886 | .iif = loopback_dev.ifindex, |
887 | .oif = oldflp->oif }; | 887 | .oif = oldflp->oif }; |
888 | struct dn_route *rt = NULL; | 888 | struct dn_route *rt = NULL; |
889 | struct net_device *dev_out = NULL; | 889 | struct net_device *dev_out = NULL, *dev; |
890 | struct neighbour *neigh = NULL; | 890 | struct neighbour *neigh = NULL; |
891 | unsigned hash; | 891 | unsigned hash; |
892 | unsigned flags = 0; | 892 | unsigned flags = 0; |
@@ -925,15 +925,17 @@ static int dn_route_output_slow(struct dst_entry **pprt, const struct flowi *old | |||
925 | goto out; | 925 | goto out; |
926 | } | 926 | } |
927 | read_lock(&dev_base_lock); | 927 | read_lock(&dev_base_lock); |
928 | for(dev_out = dev_base; dev_out; dev_out = dev_out->next) { | 928 | for_each_netdev(dev) { |
929 | if (!dev_out->dn_ptr) | 929 | if (!dev->dn_ptr) |
930 | continue; | 930 | continue; |
931 | if (!dn_dev_islocal(dev_out, oldflp->fld_src)) | 931 | if (!dn_dev_islocal(dev, oldflp->fld_src)) |
932 | continue; | 932 | continue; |
933 | if ((dev_out->flags & IFF_LOOPBACK) && | 933 | if ((dev->flags & IFF_LOOPBACK) && |
934 | oldflp->fld_dst && | 934 | oldflp->fld_dst && |
935 | !dn_dev_islocal(dev_out, oldflp->fld_dst)) | 935 | !dn_dev_islocal(dev, oldflp->fld_dst)) |
936 | continue; | 936 | continue; |
937 | |||
938 | dev_out = dev; | ||
937 | break; | 939 | break; |
938 | } | 940 | } |
939 | read_unlock(&dev_base_lock); | 941 | read_unlock(&dev_base_lock); |