git: 5ff7fb76cbae - main - nfs: patch up MNT_LAZY on sync
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Sun, 26 Feb 2023 13:45:01 UTC
The branch main has been updated by mjg: URL: https://cgit.FreeBSD.org/src/commit/?id=5ff7fb76cbaea42348b63d23089e9e0549b19cbd commit 5ff7fb76cbaea42348b63d23089e9e0549b19cbd Author: Mateusz Guzik <mjg@FreeBSD.org> AuthorDate: 2023-02-24 19:18:11 +0000 Commit: Mateusz Guzik <mjg@FreeBSD.org> CommitDate: 2023-02-26 13:44:56 +0000 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 --- sys/fs/nfsclient/nfs_clvfsops.c | 6 ++++-- 1 file 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; }