Date: Mon, 12 Jan 2015 13:44:35 +0000 (UTC) From: Gleb Smirnoff <glebius@FreeBSD.org> To: src-committers@freebsd.org, svn-src-projects@freebsd.org Subject: svn commit: r277069 - in projects/ifnet/sys: net netinet6 Message-ID: <201501121344.t0CDiZ4p017568@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: glebius Date: Mon Jan 12 13:44:34 2015 New Revision: 277069 URL: https://svnweb.freebsd.org/changeset/base/277069 Log: Remove if_m?addr_r(un)?lock(). The drivers will use if_foreach_addr() and if_foreach_maddr(). The rest of the kernel can use macros. Modified: projects/ifnet/sys/net/if.c projects/ifnet/sys/net/if_var.h projects/ifnet/sys/netinet6/in6.c Modified: projects/ifnet/sys/net/if.c ============================================================================== --- projects/ifnet/sys/net/if.c Mon Jan 12 13:21:23 2015 (r277068) +++ projects/ifnet/sys/net/if.c Mon Jan 12 13:44:34 2015 (r277069) @@ -1739,40 +1739,6 @@ if_data_copy(struct ifnet *ifp, struct i } /* - * Wrapper functions for struct ifnet address list locking macros. These are - * used by kernel modules to avoid encoding programming interface or binary - * interface assumptions that may be violated when kernel-internal locking - * approaches change. - */ -void -if_addr_rlock(struct ifnet *ifp) -{ - - IF_ADDR_RLOCK(ifp); -} - -void -if_addr_runlock(struct ifnet *ifp) -{ - - IF_ADDR_RUNLOCK(ifp); -} - -void -if_maddr_rlock(if_t ifp) -{ - - IF_ADDR_RLOCK((struct ifnet *)ifp); -} - -void -if_maddr_runlock(if_t ifp) -{ - - IF_ADDR_RUNLOCK((struct ifnet *)ifp); -} - -/* * Initialization, destruction and refcounting functions for ifaddrs. */ struct ifaddr * Modified: projects/ifnet/sys/net/if_var.h ============================================================================== --- projects/ifnet/sys/net/if_var.h Mon Jan 12 13:21:23 2015 (r277068) +++ projects/ifnet/sys/net/if_var.h Mon Jan 12 13:44:34 2015 (r277069) @@ -182,16 +182,6 @@ struct ifnet { #define IF_ADDR_LOCK_ASSERT(if) rw_assert(&(if)->if_addr_lock, RA_LOCKED) #define IF_ADDR_WLOCK_ASSERT(if) rw_assert(&(if)->if_addr_lock, RA_WLOCKED) -/* - * Function variations on locking macros intended to be used by loadable - * kernel modules in order to divorce them from the internals of address list - * locking. - */ -void if_addr_rlock(struct ifnet *ifp); /* if_addrhead */ -void if_addr_runlock(struct ifnet *ifp); /* if_addrhead */ -void if_maddr_rlock(if_t ifp); /* if_multiaddrs */ -void if_maddr_runlock(if_t ifp); /* if_multiaddrs */ - #ifdef _KERNEL #ifdef _SYS_EVENTHANDLER_H_ /* interface link layer address change event */ Modified: projects/ifnet/sys/netinet6/in6.c ============================================================================== --- projects/ifnet/sys/netinet6/in6.c Mon Jan 12 13:21:23 2015 (r277068) +++ projects/ifnet/sys/netinet6/in6.c Mon Jan 12 13:44:34 2015 (r277069) @@ -1542,7 +1542,7 @@ in6ifa_llaonifp(struct ifnet *ifp) if (ND_IFINFO(ifp)->flags & ND6_IFF_IFDISABLED) return (NULL); - if_addr_rlock(ifp); + IF_ADDR_RLOCK(ifp); TAILQ_FOREACH(ifa, &ifp->if_addrhead, ifa_link) { if (ifa->ifa_addr->sa_family != AF_INET6) continue; @@ -1552,7 +1552,7 @@ in6ifa_llaonifp(struct ifnet *ifp) IN6_IS_ADDR_MC_NODELOCAL(&sin6->sin6_addr)) break; } - if_addr_runlock(ifp); + IF_ADDR_RUNLOCK(ifp); return ((struct in6_ifaddr *)ifa); }
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201501121344.t0CDiZ4p017568>