diff options
author | rwatson <rwatson@FreeBSD.org> | 2009-06-21 19:30:33 +0000 |
---|---|---|
committer | rwatson <rwatson@FreeBSD.org> | 2009-06-21 19:30:33 +0000 |
commit | 1f7e54e8c51edb13935d195e0c1f2ec68c672794 (patch) | |
tree | 2cfffa4418c1fa90f1e9d094aa882742d0ababb9 /sys/netatalk | |
parent | 2fc79768f33d575d200ae1482dc23207f9d93703 (diff) | |
download | FreeBSD-src-1f7e54e8c51edb13935d195e0c1f2ec68c672794.zip FreeBSD-src-1f7e54e8c51edb13935d195e0c1f2ec68c672794.tar.gz |
Clean up common ifaddr management:
- Unify reference count and lock initialization in a single function,
ifa_init().
- Move tear-down from a macro (IFAFREE) to a function ifa_free().
- Move reference count bump from a macro (IFAREF) to a function ifa_ref().
- Instead of using a u_int protected by a mutex to refcount(9) for
reference count management.
The ifa_mtx is now used for exactly one ioctl, and possibly should be
removed.
MFC after: 3 weeks
Diffstat (limited to 'sys/netatalk')
-rw-r--r-- | sys/netatalk/at_control.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/sys/netatalk/at_control.c b/sys/netatalk/at_control.c index cfb1bd8..56b750f 100644 --- a/sys/netatalk/at_control.c +++ b/sys/netatalk/at_control.c @@ -189,8 +189,7 @@ at_control(struct socket *so, u_long cmd, caddr_t data, struct ifnet *ifp, * and link our new one on the end */ ifa = (struct ifaddr *)aa; - IFA_LOCK_INIT(ifa); - ifa->ifa_refcnt = 1; + ifa_init(ifa); /* * As the at_ifaddr contains the actual sockaddrs, @@ -325,7 +324,7 @@ at_control(struct socket *so, u_long cmd, caddr_t data, struct ifnet *ifp, /* * Now reclaim the reference. */ - IFAFREE(ifa0); + ifa_free(ifa0); break; default: |