From owner-svn-src-stable-10@FreeBSD.ORG Fri Sep 5 13:22:29 2014 Return-Path: Delivered-To: svn-src-stable-10@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 4B05F90; Fri, 5 Sep 2014 13:22:29 +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 1C1CE13B9; Fri, 5 Sep 2014 13:22:29 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s85DMSpW011832; Fri, 5 Sep 2014 13:22:28 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s85DMSFD011829; Fri, 5 Sep 2014 13:22:28 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201409051322.s85DMSFD011829@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Fri, 5 Sep 2014 13:22:28 +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: r271161 - in stable/10/sys: kern sys X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Sep 2014 13:22:29 -0000 Author: kib Date: Fri Sep 5 13:22:28 2014 New Revision: 271161 URL: http://svnweb.freebsd.org/changeset/base/271161 Log: Add function and wrapper to switch lockmgr and vnode lock back to auto-promotion of shared to exclusive. Approved by: re (gjb) Modified: stable/10/sys/kern/kern_lock.c stable/10/sys/sys/lockmgr.h stable/10/sys/sys/vnode.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/kern/kern_lock.c ============================================================================== --- stable/10/sys/kern/kern_lock.c Fri Sep 5 11:48:32 2014 (r271160) +++ stable/10/sys/kern/kern_lock.c Fri Sep 5 13:22:28 2014 (r271161) @@ -419,6 +419,14 @@ lockallowshare(struct lock *lk) } void +lockdisableshare(struct lock *lk) +{ + + lockmgr_assert(lk, KA_XLOCKED); + lk->lock_object.lo_flags |= LK_NOSHARE; +} + +void lockallowrecurse(struct lock *lk) { Modified: stable/10/sys/sys/lockmgr.h ============================================================================== --- stable/10/sys/sys/lockmgr.h Fri Sep 5 11:48:32 2014 (r271160) +++ stable/10/sys/sys/lockmgr.h Fri Sep 5 13:22:28 2014 (r271161) @@ -77,6 +77,7 @@ void lockallowrecurse(struct lock *lk); void lockallowshare(struct lock *lk); void lockdestroy(struct lock *lk); void lockdisablerecurse(struct lock *lk); +void lockdisableshare(struct lock *lk); void lockinit(struct lock *lk, int prio, const char *wmesg, int timo, int flags); #ifdef DDB Modified: stable/10/sys/sys/vnode.h ============================================================================== --- stable/10/sys/sys/vnode.h Fri Sep 5 11:48:32 2014 (r271160) +++ stable/10/sys/sys/vnode.h Fri Sep 5 13:22:28 2014 (r271161) @@ -428,6 +428,7 @@ extern struct vattr va_null; /* predefi #define VN_LOCK_AREC(vp) lockallowrecurse((vp)->v_vnlock) #define VN_LOCK_ASHARE(vp) lockallowshare((vp)->v_vnlock) +#define VN_LOCK_DSHARE(vp) lockdisableshare((vp)->v_vnlock) #endif /* _KERNEL */