From owner-svn-src-stable@FreeBSD.ORG Tue Feb 7 19:55:59 2012 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3A8DC106568C; Tue, 7 Feb 2012 19:55:59 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0FEA28FC25; Tue, 7 Feb 2012 19:55:59 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q17JtwBh005100; Tue, 7 Feb 2012 19:55:58 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q17Jtwe5005098; Tue, 7 Feb 2012 19:55:58 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201202071955.q17Jtwe5005098@svn.freebsd.org> From: John Baldwin Date: Tue, 7 Feb 2012 19:55:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231157 - stable/9/sys/net X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Feb 2012 19:55:59 -0000 Author: jhb Date: Tue Feb 7 19:55:58 2012 New Revision: 231157 URL: http://svn.freebsd.org/changeset/base/231157 Log: MFC 229614: Add new variants of the IF_ADDR_*LOCK*() macros used for protecting interface address lists that distinguish read locks from write locks. To preserve the KPI, the previous operations are mapped to the write lock macros. The lock is still kept as a mutex for now. Modified: stable/9/sys/net/if_var.h Directory Properties: stable/9/sys/ (props changed) stable/9/sys/amd64/include/xen/ (props changed) stable/9/sys/boot/ (props changed) stable/9/sys/boot/i386/efi/ (props changed) stable/9/sys/boot/ia64/efi/ (props changed) stable/9/sys/boot/ia64/ski/ (props changed) stable/9/sys/boot/powerpc/boot1.chrp/ (props changed) stable/9/sys/boot/powerpc/ofw/ (props changed) stable/9/sys/cddl/contrib/opensolaris/ (props changed) stable/9/sys/conf/ (props changed) stable/9/sys/contrib/dev/acpica/ (props changed) stable/9/sys/contrib/octeon-sdk/ (props changed) stable/9/sys/contrib/pf/ (props changed) stable/9/sys/contrib/x86emu/ (props changed) Modified: stable/9/sys/net/if_var.h ============================================================================== --- stable/9/sys/net/if_var.h Tue Feb 7 19:53:02 2012 (r231156) +++ stable/9/sys/net/if_var.h Tue Feb 7 19:55:58 2012 (r231157) @@ -248,9 +248,15 @@ typedef void if_init_f_t(void *); #define IF_ADDR_LOCK_INIT(if) mtx_init(&(if)->if_addr_mtx, \ "if_addr_mtx", NULL, MTX_DEF) #define IF_ADDR_LOCK_DESTROY(if) mtx_destroy(&(if)->if_addr_mtx) -#define IF_ADDR_LOCK(if) mtx_lock(&(if)->if_addr_mtx) -#define IF_ADDR_UNLOCK(if) mtx_unlock(&(if)->if_addr_mtx) +#define IF_ADDR_WLOCK(if) mtx_lock(&(if)->if_addr_mtx) +#define IF_ADDR_WUNLOCK(if) mtx_unlock(&(if)->if_addr_mtx) +#define IF_ADDR_RLOCK(if) mtx_lock(&(if)->if_addr_mtx) +#define IF_ADDR_RUNLOCK(if) mtx_unlock(&(if)->if_addr_mtx) #define IF_ADDR_LOCK_ASSERT(if) mtx_assert(&(if)->if_addr_mtx, MA_OWNED) +#define IF_ADDR_WLOCK_ASSERT(if) mtx_assert(&(if)->if_addr_mtx, MA_OWNED) +/* XXX: Compat. */ +#define IF_ADDR_LOCK(if) IF_ADDR_WLOCK(if) +#define IF_ADDR_UNLOCK(if) IF_ADDR_WUNLOCK(if) /* * Function variations on locking macros intended to be used by loadable