Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 3 Jun 2014 19:06:48 +0000 (UTC)
From:      Cy Schubert <cy@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org
Subject:   svn commit: r267020 - stable/10/sys/contrib/ipfilter/netinet
Message-ID:  <201406031906.s53J6mxx028458@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: cy
Date: Tue Jun  3 19:06:47 2014
New Revision: 267020
URL: http://svnweb.freebsd.org/changeset/base/267020

Log:
  MFC r266605.
  
  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)

Modified:
  stable/10/sys/contrib/ipfilter/netinet/ip_log.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/sys/contrib/ipfilter/netinet/ip_log.c
==============================================================================
--- stable/10/sys/contrib/ipfilter/netinet/ip_log.c	Tue Jun  3 19:03:23 2014	(r267019)
+++ stable/10/sys/contrib/ipfilter/netinet/ip_log.c	Tue Jun  3 19:06:47 2014	(r267020)
@@ -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?201406031906.s53J6mxx028458>