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.
This commit is contained in:
Mateusz Guzik 2017-01-21 19:01:42 +00:00
parent abbc538d9a
commit 829857c893
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=312602

View File

@ -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;