vfs: in vop_stdadd_writecount only vlazy vnodes on mounts using msync

The only reason to vlazy there is to (overzealously) ensure all vnodes
which need to be visited by msync scan can be found there.

In particluar this is of no use zfs and tmpfs.

While here depessimize the check.
This commit is contained in:
Mateusz Guzik 2020-01-15 01:34:05 +00:00
parent 2a829749d3
commit cda3176851
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=356745

View File

@ -1220,6 +1220,7 @@ static int
vop_stdadd_writecount(struct vop_add_writecount_args *ap)
{
struct vnode *vp;
struct mount *mp;
int error;
vp = ap->a_vp;
@ -1229,9 +1230,12 @@ vop_stdadd_writecount(struct vop_add_writecount_args *ap)
} else {
VNASSERT(vp->v_writecount + ap->a_inc >= 0, vp,
("neg writecount increment %d", ap->a_inc));
if (vp->v_writecount == 0) {
mp = vp->v_mount;
if (mp != NULL && (mp->mnt_kern_flag & MNTK_NOMSYNC) == 0)
vlazy(vp);
}
vp->v_writecount += ap->a_inc;
if (vp->v_writecount > 0 && vp->v_mount != NULL)
vlazy(vp);
error = 0;
}
VI_UNLOCK(vp);