aboutsummaryrefslogtreecommitdiff
path: root/sys/kern/kern_poll.c
diff options
context:
space:
mode:
authorRobert Watson <rwatson@FreeBSD.org>2007-08-06 14:26:03 +0000
committerRobert Watson <rwatson@FreeBSD.org>2007-08-06 14:26:03 +0000
commit0bf686c1257e2e7944a4cee9d9d628280facaa3d (patch)
tree63e9e0c42ec5669b83e25b5f9cbdcbee7e1be6dc /sys/kern/kern_poll.c
parentec2af96ad1603562dcbcad9de48a2d0692367e14 (diff)
downloadsrc-0bf686c1257e2e7944a4cee9d9d628280facaa3d.tar.gz
src-0bf686c1257e2e7944a4cee9d9d628280facaa3d.zip
Remove the now-unused NET_{LOCK,UNLOCK,ASSERT}_GIANT() macros, which
previously conditionally acquired Giant based on debug.mpsafenet. As that has now been removed, they are no longer required. Removing them significantly simplifies error-handling in the socket layer, eliminated quite a bit of unwinding of locking in error cases. While here clean up the now unneeded opt_net.h, which previously was used for the NET_WITH_GIANT kernel option. Clean up some related gotos for consistency. Reviewed by: bz, csjp Tested by: kris Approved by: re (kensmith)
Notes
Notes: svn path=/head/; revision=171744
Diffstat (limited to 'sys/kern/kern_poll.c')
-rw-r--r--sys/kern/kern_poll.c11
1 files changed, 0 insertions, 11 deletions
diff --git a/sys/kern/kern_poll.c b/sys/kern/kern_poll.c
index fa5d58a3134b..a908f0095591 100644
--- a/sys/kern/kern_poll.c
+++ b/sys/kern/kern_poll.c
@@ -329,7 +329,6 @@ ether_poll(int count)
{
int i;
- NET_LOCK_GIANT();
mtx_lock(&poll_mtx);
if (count > poll_each_burst)
@@ -339,7 +338,6 @@ ether_poll(int count)
pr[i].handler(pr[i].ifp, POLL_ONLY, count);
mtx_unlock(&poll_mtx);
- NET_UNLOCK_GIANT();
}
/*
@@ -366,8 +364,6 @@ netisr_pollmore()
struct timeval t;
int kern_load;
- NET_ASSERT_GIANT();
-
mtx_lock(&poll_mtx);
phase = 5;
if (residual_burst > 0) {
@@ -417,8 +413,6 @@ netisr_poll(void)
int i, cycles;
enum poll_cmd arg = POLL_ONLY;
- NET_ASSERT_GIANT();
-
mtx_lock(&poll_mtx);
phase = 3;
if (residual_burst == 0) { /* first call in this tick */
@@ -456,8 +450,6 @@ ether_poll_register(poll_handler_t *h, struct ifnet *ifp)
KASSERT(h != NULL, ("%s: handler is NULL", __func__));
KASSERT(ifp != NULL, ("%s: ifp is NULL", __func__));
- NET_ASSERT_GIANT();
-
mtx_lock(&poll_mtx);
if (poll_handlers >= POLL_LIST_LEN) {
/*
@@ -504,7 +496,6 @@ ether_poll_deregister(struct ifnet *ifp)
KASSERT(ifp != NULL, ("%s: ifp is NULL", __func__));
- NET_ASSERT_GIANT();
mtx_lock(&poll_mtx);
for (i = 0 ; i < poll_handlers ; i++)
@@ -547,7 +538,6 @@ poll_switch(SYSCTL_HANDLER_ARGS)
polling = val;
- NET_LOCK_GIANT();
IFNET_RLOCK();
TAILQ_FOREACH(ifp, &ifnet, if_link) {
if (ifp->if_capabilities & IFCAP_POLLING) {
@@ -565,7 +555,6 @@ poll_switch(SYSCTL_HANDLER_ARGS)
}
}
IFNET_RUNLOCK();
- NET_UNLOCK_GIANT();
log(LOG_ERR, "kern.polling.enable is deprecated. Use ifconfig(8)");