svn commit: r356745 - head/sys/kern
Mateusz Guzik
mjg at FreeBSD.org
Wed Jan 15 01:34:05 UTC 2020
Author: mjg
Date: Wed Jan 15 01:34:05 2020
New Revision: 356745
URL: https://svnweb.freebsd.org/changeset/base/356745
Log:
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.
Modified:
head/sys/kern/vfs_default.c
Modified: head/sys/kern/vfs_default.c
==============================================================================
--- head/sys/kern/vfs_default.c Wed Jan 15 01:32:11 2020 (r356744)
+++ head/sys/kern/vfs_default.c Wed Jan 15 01:34:05 2020 (r356745)
@@ -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 *
} 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);
More information about the svn-src-all
mailing list