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 /drivers/block | |
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 'drivers/block')
-rw-r--r-- | drivers/block/aoe/aoecmd.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/drivers/block/aoe/aoecmd.c b/drivers/block/aoe/aoecmd.c index 1a6aeac5a1c3..01fbdd38e3be 100644 --- a/drivers/block/aoe/aoecmd.c +++ b/drivers/block/aoe/aoecmd.c | |||
@@ -194,15 +194,15 @@ aoecmd_cfg_pkts(ushort aoemajor, unsigned char aoeminor, struct sk_buff **tail) | |||
194 | sl = sl_tail = NULL; | 194 | sl = sl_tail = NULL; |
195 | 195 | ||
196 | read_lock(&dev_base_lock); | 196 | read_lock(&dev_base_lock); |
197 | for (ifp = dev_base; ifp; dev_put(ifp), ifp = ifp->next) { | 197 | for_each_netdev(ifp) { |
198 | dev_hold(ifp); | 198 | dev_hold(ifp); |
199 | if (!is_aoe_netif(ifp)) | 199 | if (!is_aoe_netif(ifp)) |
200 | continue; | 200 | goto cont; |
201 | 201 | ||
202 | skb = new_skb(sizeof *h + sizeof *ch); | 202 | skb = new_skb(sizeof *h + sizeof *ch); |
203 | if (skb == NULL) { | 203 | if (skb == NULL) { |
204 | printk(KERN_INFO "aoe: skb alloc failure\n"); | 204 | printk(KERN_INFO "aoe: skb alloc failure\n"); |
205 | continue; | 205 | goto cont; |
206 | } | 206 | } |
207 | skb_put(skb, sizeof *h + sizeof *ch); | 207 | skb_put(skb, sizeof *h + sizeof *ch); |
208 | skb->dev = ifp; | 208 | skb->dev = ifp; |
@@ -221,6 +221,8 @@ aoecmd_cfg_pkts(ushort aoemajor, unsigned char aoeminor, struct sk_buff **tail) | |||
221 | 221 | ||
222 | skb->next = sl; | 222 | skb->next = sl; |
223 | sl = skb; | 223 | sl = skb; |
224 | cont: | ||
225 | dev_put(ifp); | ||
224 | } | 226 | } |
225 | read_unlock(&dev_base_lock); | 227 | read_unlock(&dev_base_lock); |
226 | 228 | ||