From owner-svn-src-head@freebsd.org Sat Jan 21 19:01:44 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 1E55ACBB839; Sat, 21 Jan 2017 19:01:44 +0000 (UTC) (envelope-from mjg@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 E27CFCEB; Sat, 21 Jan 2017 19:01:43 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v0LJ1hgh081830; Sat, 21 Jan 2017 19:01:43 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0LJ1hft081829; Sat, 21 Jan 2017 19:01:43 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <201701211901.v0LJ1hft081829@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Sat, 21 Jan 2017 19:01:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r312602 - head/sys/kern X-SVN-Group: head 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: Sat, 21 Jan 2017 19:01:44 -0000 Author: mjg Date: Sat Jan 21 19:01:42 2017 New Revision: 312602 URL: https://svnweb.freebsd.org/changeset/base/312602 Log: vfs: __predict_false the need to handle F_HASLOCK Also reorder the check with DTYPE_VNODE. Passed files are vnodes vast majority of the time, so it is typically true. Modified: head/sys/kern/vfs_vnops.c Modified: head/sys/kern/vfs_vnops.c ============================================================================== --- head/sys/kern/vfs_vnops.c Sat Jan 21 18:56:58 2017 (r312601) +++ head/sys/kern/vfs_vnops.c Sat Jan 21 19:01:42 2017 (r312602) @@ -1575,12 +1575,12 @@ vn_closefile(fp, td) vp = fp->f_vnode; fp->f_ops = &badfileops; - if (fp->f_type == DTYPE_VNODE && fp->f_flag & FHASLOCK) - vref(vp); + if (__predict_false(fp->f_flag & FHASLOCK) && fp->f_type == DTYPE_VNODE) + vrefact(vp); error = vn_close(vp, fp->f_flag, fp->f_cred, td); - if (fp->f_type == DTYPE_VNODE && fp->f_flag & FHASLOCK) { + if (__predict_false(fp->f_flag & FHASLOCK) && fp->f_type == DTYPE_VNODE) { lf.l_whence = SEEK_SET; lf.l_start = 0; lf.l_len = 0;