netdev
[Top] [All Lists]

Re: [BK PATCH] [IPV6] Multiple locking fixes/improvements

To: Brian.Haley@xxxxxx
Subject: Re: [BK PATCH] [IPV6] Multiple locking fixes/improvements
From: YOSHIFUJI Hideaki / 吉藤英明 <yoshfuji@xxxxxxxxxxxxxx>
Date: Tue, 23 Nov 2004 13:37:44 -0500 (EST)
Cc: davem@xxxxxxxxxxxxx, netdev@xxxxxxxxxxx
In-reply-to: <41A37CD4.3030503@xxxxxx>
Organization: USAGI Project
References: <20041122.223205.14979415.yoshfuji@xxxxxxxxxxxxxx> <41A37CD4.3030503@xxxxxx>
Sender: netdev-bounce@xxxxxxxxxxx
In article <41A37CD4.3030503@xxxxxx> (at Tue, 23 Nov 2004 13:09:24 -0500), 
Brian Haley <Brian.Haley@xxxxxx> says:

> Not to nitpick, but this is just easier to read:
> 
> +static void ipv6_ifa_notify(int event, struct inet6_ifaddr *ifp)
> +{
> +     read_lock_bh(&addrconf_lock);
> +     if (!ifp->idev->dead)
> +             __ipv6_ifa_notify(event, ifp);
> +     read_unlock_bh(&addrconf_lock);
>   }

agreed and added one changeset.

# This is a BitKeeper generated diff -Nru style patch.
#
# ChangeSet
#   2004/11/24 03:34:53+09:00 Brian.Haley@xxxxxx 
#   [IPV6] improve ipv6_ifa_notify() readability.
# 
# net/ipv6/addrconf.c
#   2004/11/24 03:34:41+09:00 Brian.Haley@xxxxxx +2 -4
#   [IPV6] improve ipv6_ifa_notify() readability.
# 
diff -Nru a/net/ipv6/addrconf.c b/net/ipv6/addrconf.c
--- a/net/ipv6/addrconf.c       2004-11-24 03:35:33 +09:00
+++ b/net/ipv6/addrconf.c       2004-11-24 03:35:33 +09:00
@@ -3017,10 +3017,8 @@
 static void ipv6_ifa_notify(int event, struct inet6_ifaddr *ifp)
 {
        read_lock_bh(&addrconf_lock);
-       if (ifp->idev->dead)
-               goto out;
-       __ipv6_ifa_notify(event, ifp);
-out:
+       if (likely(ifp->idev->dead == 0))
+               __ipv6_ifa_notify(event, ifp);
        read_unlock_bh(&addrconf_lock);
 }
 


-- 
Hideaki YOSHIFUJI @ USAGI Project <yoshfuji@xxxxxxxxxxxxxx>
GPG FP: 9022 65EB 1ECF 3AD1 0BDF  80D8 4807 F894 E062 0EEA

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