summaryrefslogtreecommitdiffstats
path: root/sys/nfsclient
diff options
context:
space:
mode:
authorhsu <hsu@FreeBSD.org>2002-12-22 05:35:03 +0000
committerhsu <hsu@FreeBSD.org>2002-12-22 05:35:03 +0000
commit82e1e3bab0d3abe1018a0b56559c154485f2f676 (patch)
treed0f9ee7e6f9d8014e6f8f94ab6965e85c268792e /sys/nfsclient
parent2afef11c570b7b725c3145fc710f8dcd8d7ed4e0 (diff)
downloadFreeBSD-src-82e1e3bab0d3abe1018a0b56559c154485f2f676.zip
FreeBSD-src-82e1e3bab0d3abe1018a0b56559c154485f2f676.tar.gz
SMP locking for ifnet list.
Diffstat (limited to 'sys/nfsclient')
-rw-r--r--sys/nfsclient/bootp_subr.c4
-rw-r--r--sys/nfsclient/nfs_diskless.c6
2 files changed, 9 insertions, 1 deletions
diff --git a/sys/nfsclient/bootp_subr.c b/sys/nfsclient/bootp_subr.c
index a9c504f..50f3b1f 100644
--- a/sys/nfsclient/bootp_subr.c
+++ b/sys/nfsclient/bootp_subr.c
@@ -401,6 +401,7 @@ bootpboot_p_iflist(void)
struct ifaddr *ifa;
printf("Interface list:\n");
+ IFNET_RLOCK(); /* could sleep, but okay for debugging XXX */
for (ifp = TAILQ_FIRST(&ifnet);
ifp != NULL;
ifp = TAILQ_NEXT(ifp, if_link)) {
@@ -410,6 +411,7 @@ bootpboot_p_iflist(void)
if (ifa->ifa_addr->sa_family == AF_INET)
bootpboot_p_if(ifp, ifa);
}
+ IFNET_RUNLOCK();
}
#endif /* defined(BOOTP_DEBUG) */
@@ -1689,6 +1691,7 @@ bootpc_init(void)
__XSTRING(BOOTP_WIRED_TO));
#endif
bzero(&ifctx->ireq, sizeof(ifctx->ireq));
+ IFNET_RLOCK();
for (ifp = TAILQ_FIRST(&ifnet);
ifp != NULL;
ifp = TAILQ_NEXT(ifp, if_link)) {
@@ -1712,6 +1715,7 @@ bootpc_init(void)
gctx->lastinterface = ifctx;
ifctx = allocifctx(gctx);
}
+ IFNET_RUNLOCK();
free(ifctx, M_TEMP);
if (gctx->interfaces == NULL) {
diff --git a/sys/nfsclient/nfs_diskless.c b/sys/nfsclient/nfs_diskless.c
index 791c61e..c5f167e 100644
--- a/sys/nfsclient/nfs_diskless.c
+++ b/sys/nfsclient/nfs_diskless.c
@@ -102,6 +102,7 @@ nfs_setup_diskless(void)
return;
}
ifa = NULL;
+ IFNET_RLOCK();
TAILQ_FOREACH(ifp, &ifnet, if_link) {
TAILQ_FOREACH(ifa, &ifp->if_addrhead, ifa_link) {
if ((ifa->ifa_addr->sa_family == AF_LINK) &&
@@ -110,11 +111,14 @@ nfs_setup_diskless(void)
(sdl->sdl_alen == ourdl.sdl_alen) &&
!bcmp(sdl->sdl_data + sdl->sdl_nlen,
ourdl.sdl_data + ourdl.sdl_nlen,
- sdl->sdl_alen))
+ sdl->sdl_alen)) {
+ IFNET_RUNLOCK();
goto match_done;
+ }
}
}
}
+ IFNET_RUNLOCK();
printf("nfs_diskless: no interface\n");
return; /* no matching interface */
match_done:
OpenPOWER on IntegriCloud