diff options
author | Mateusz Guzik <mjg@FreeBSD.org> | 2023-02-24 19:18:11 +0000 |
---|---|---|
committer | Mateusz Guzik <mjg@FreeBSD.org> | 2023-02-26 13:44:56 +0000 |
commit | 5ff7fb76cbaea42348b63d23089e9e0549b19cbd (patch) | |
tree | 952084c963396a034a40f49eaf65e1e7dfe4bc65 | |
parent | a55b5a9aed3981fcec205e246436991d138c78a2 (diff) | |
download | src-5ff7fb76cbaea42348b63d23089e9e0549b19cbd.tar.gz src-5ff7fb76cbaea42348b63d23089e9e0549b19cbd.zip |
nfs: patch up MNT_LAZY on sync
It is a de facto noop, just make it less costly.
Reviewed by: rmacklem
Differential Revision: https://reviews.freebsd.org/D38763
-rw-r--r-- | sys/fs/nfsclient/nfs_clvfsops.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/sys/fs/nfsclient/nfs_clvfsops.c b/sys/fs/nfsclient/nfs_clvfsops.c index 7635835ef0e0..efc92f6e7e19 100644 --- a/sys/fs/nfsclient/nfs_clvfsops.c +++ b/sys/fs/nfsclient/nfs_clvfsops.c @@ -1918,14 +1918,16 @@ nfs_sync(struct mount *mp, int waitfor) } MNT_IUNLOCK(mp); + if (waitfor == MNT_LAZY) + return (0); + /* * Force stale buffer cache information to be flushed. */ loop: MNT_VNODE_FOREACH_ALL(vp, mp, mvp) { /* XXX Racy bv_cnt check. */ - if (NFSVOPISLOCKED(vp) || vp->v_bufobj.bo_dirty.bv_cnt == 0 || - waitfor == MNT_LAZY) { + if (NFSVOPISLOCKED(vp) || vp->v_bufobj.bo_dirty.bv_cnt == 0) { VI_UNLOCK(vp); continue; } |