From owner-svn-src-head@freebsd.org Mon Oct 9 07:44:11 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2AE50E284F1; Mon, 9 Oct 2017 07:44:11 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::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 76AFB72E67; Mon, 9 Oct 2017 07:44:10 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v997i9B7045361; Mon, 9 Oct 2017 07:44:09 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v997i977045360; Mon, 9 Oct 2017 07:44:09 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201710090744.v997i977045360@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Mon, 9 Oct 2017 07:44:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324425 - head/sys/cddl/compat/opensolaris/sys X-SVN-Group: head X-SVN-Commit-Author: avg X-SVN-Commit-Paths: head/sys/cddl/compat/opensolaris/sys X-SVN-Commit-Revision: 324425 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Oct 2017 07:44:11 -0000 Author: avg Date: Mon Oct 9 07:44:09 2017 New Revision: 324425 URL: https://svnweb.freebsd.org/changeset/base/324425 Log: illumos mutex_init: use SX_NEW instead of bzero There should be no functional change, but SX_NEW seems to be more idiomatic to the use-case. MFC after: 2 weeks X-MFC note: stable/11 only Modified: head/sys/cddl/compat/opensolaris/sys/mutex.h Modified: head/sys/cddl/compat/opensolaris/sys/mutex.h ============================================================================== --- head/sys/cddl/compat/opensolaris/sys/mutex.h Mon Oct 9 05:16:34 2017 (r324424) +++ head/sys/cddl/compat/opensolaris/sys/mutex.h Mon Oct 9 07:44:09 2017 (r324425) @@ -47,9 +47,9 @@ typedef enum { typedef struct sx kmutex_t; #ifndef OPENSOLARIS_WITNESS -#define MUTEX_FLAGS (SX_DUPOK | SX_NOWITNESS) +#define MUTEX_FLAGS (SX_DUPOK | SX_NEW | SX_NOWITNESS) #else -#define MUTEX_FLAGS (SX_DUPOK) +#define MUTEX_FLAGS (SX_DUPOK | SX_NEW) #endif #define mutex_init(lock, desc, type, arg) do { \ @@ -57,7 +57,6 @@ typedef struct sx kmutex_t; ASSERT((type) == 0 || (type) == MUTEX_DEFAULT); \ KASSERT(((lock)->lock_object.lo_flags & LO_ALLMASK) != \ LO_EXPECTED, ("lock %s already initialized", #lock)); \ - bzero((lock), sizeof(struct sx)); \ for (_name = #lock; *_name != '\0'; _name++) { \ if (*_name >= 'a' && *_name <= 'z') \ break; \