Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 24 May 2014 06:05:22 +0000 (UTC)
From:      Cy Schubert <cy@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r266605 - head/sys/contrib/ipfilter/netinet
Message-ID:  <201405240605.s4O65MXd098051@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: cy
Date: Sat May 24 06:05:21 2014
New Revision: 266605
URL: http://svnweb.freebsd.org/changeset/base/266605

Log:
  Move mutex creation from ipf_log_soft_init() to ipf_log_soft_create()
  to be consistent with mutex destruction in ipf_log_soft_destroy(). As a
  result mutex destruction in ipf_log_soft_fini() is redundant.
  
  Approved by:	glebius (mentor)
  Obtained from:	darrenr (author)

Modified:
  head/sys/contrib/ipfilter/netinet/ip_log.c

Modified: head/sys/contrib/ipfilter/netinet/ip_log.c
==============================================================================
--- head/sys/contrib/ipfilter/netinet/ip_log.c	Sat May 24 03:09:27 2014	(r266604)
+++ head/sys/contrib/ipfilter/netinet/ip_log.c	Sat May 24 06:05:21 2014	(r266605)
@@ -214,6 +214,7 @@ ipf_log_soft_create(softc)
 	ipf_main_softc_t *softc;
 {
 	ipf_log_softc_t *softl;
+	int i;
 
 	KMALLOC(softl, ipf_log_softc_t *);
 	if (softl == NULL)
@@ -234,6 +235,10 @@ ipf_log_soft_create(softc)
 		return NULL;
 	}
 
+	for (i = IPL_LOGMAX; i >= 0; i--) {
+		MUTEX_INIT(&softl->ipl_mutex[i], "ipf log mutex");
+	}
+
 	softl->ipl_suppress = 1;
 	softl->ipl_logall = 0;
 	softl->ipl_log_init = 0;
@@ -267,13 +272,6 @@ ipf_log_soft_init(softc, arg)
 		softl->iplog_ss[i].read_waiter = 0;
 		softl->iplog_ss[i].state = 0;
 # endif
-# if defined(linux) && defined(_KERNEL)
-		init_waitqueue_head(softl->iplh_linux + i);
-# endif
-# if SOLARIS && defined(_KERNEL)
-		cv_init(&softl->ipl_wait[i], NULL, CV_DRIVER, NULL);
-# endif
-		MUTEX_INIT(&softl->ipl_mutex[i], "ipf log mutex");
 	}
 
 
@@ -324,7 +322,7 @@ ipf_log_soft_fini(softc, arg)
 # endif
 			MUTEX_ENTER(&softl->ipl_mutex[i]);
 		}
-		MUTEX_DESTROY(&softl->ipl_mutex[i]);
+		MUTEX_EXIT(&softl->ipl_mutex[i]);
 	}
 
 	return 0;



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201405240605.s4O65MXd098051>