Date: Sat, 21 Jan 2017 19:01:43 +0000 (UTC) From: Mateusz Guzik <mjg@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r312602 - head/sys/kern Message-ID: <201701211901.v0LJ1hft081829@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
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;
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201701211901.v0LJ1hft081829>