From owner-svn-src-all@FreeBSD.ORG Tue Jun 3 19:06:48 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 87A618EA; Tue, 3 Jun 2014 19:06:48 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 74B9A2BBA; Tue, 3 Jun 2014 19:06:48 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s53J6mm1028460; Tue, 3 Jun 2014 19:06:48 GMT (envelope-from cy@svn.freebsd.org) Received: (from cy@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s53J6mxx028458; Tue, 3 Jun 2014 19:06:48 GMT (envelope-from cy@svn.freebsd.org) Message-Id: <201406031906.s53J6mxx028458@svn.freebsd.org> From: Cy Schubert Date: Tue, 3 Jun 2014 19:06:48 +0000 (UTC) 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 X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 03 Jun 2014 19:06:48 -0000 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;