From owner-svn-src-all@FreeBSD.ORG Sat May 24 06:05:22 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 5C196119; Sat, 24 May 2014 06:05:22 +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 49AA32D81; Sat, 24 May 2014 06:05:22 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4O65MiA098052; Sat, 24 May 2014 06:05:22 GMT (envelope-from cy@svn.freebsd.org) Received: (from cy@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4O65MXd098051; Sat, 24 May 2014 06:05:22 GMT (envelope-from cy@svn.freebsd.org) Message-Id: <201405240605.s4O65MXd098051@svn.freebsd.org> From: Cy Schubert Date: Sat, 24 May 2014 06:05:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r266605 - head/sys/contrib/ipfilter/netinet X-SVN-Group: head 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: Sat, 24 May 2014 06:05:22 -0000 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;