Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 4 Oct 2012 16:21:59 -0700
From:      Vijay Singh <vijju.singh@gmail.com>
To:        net@freebsd.org
Subject:   A small cleanup patch
Message-ID:  <CALCNsJTWhVaV-2U1J5EtN2-6iyi_CGgCCrBVZ3VO1H0JLUKfvQ@mail.gmail.com>

next in thread | raw e-mail | index | archive | help
Folks, I came up with this while going through the lltable code.

kong@[/u/vijay/bsd/CODE/cur/sys]# svn diff net/if.c
Index: net/if.c
===================================================================
--- net/if.c	(revision 241169)
+++ net/if.c	(working copy)
@@ -691,12 +691,9 @@
 if_attachdomain(void *dummy)
 {
 	struct ifnet *ifp;
-	int s;

-	s = splnet();
 	TAILQ_FOREACH(ifp, &V_ifnet, if_link)
 		if_attachdomain1(ifp);
-	splx(s);
 }
 SYSINIT(domainifattach, SI_SUB_PROTO_IFATTACHDOMAIN, SI_ORDER_SECOND,
     if_attachdomain, NULL);
@@ -705,22 +702,17 @@
 if_attachdomain1(struct ifnet *ifp)
 {
 	struct domain *dp;
-	int s;

-	s = splnet();
-
 	/*
 	 * Since dp->dom_ifattach calls malloc() with M_WAITOK, we
 	 * cannot lock ifp->if_afdata initialization, entirely.
 	 */
 	if (IF_AFDATA_TRYLOCK(ifp) == 0) {
-		splx(s);
 		return;
 	}
 	if (ifp->if_afdata_initialized >= domain_init_status) {
 		IF_AFDATA_UNLOCK(ifp);
-		splx(s);
-		printf("if_attachdomain called more than once on %s\n",
+		log(LOG_WARNING, "if_attachdomain called more than once on %s\n",
 		    ifp->if_xname);
 		return;
 	}
@@ -734,8 +726,6 @@
 			ifp->if_afdata[dp->dom_family] =
 			    (*dp->dom_ifattach)(ifp);
 	}
-
-	splx(s);
 }

 /*



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CALCNsJTWhVaV-2U1J5EtN2-6iyi_CGgCCrBVZ3VO1H0JLUKfvQ>