Date: Thu, 14 Mar 2024 00:47:36 GMT From: Konstantin Belousov <kib@FreeBSD.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org Subject: git: d119f5a194fe - stable/13 - nullfs: Add the vfs.nullfs.cache_nodes sysctl to control nocache default Message-ID: <202403140047.42E0laYm029255@gitrepo.freebsd.org>
next in thread | raw e-mail | index | archive | help
The branch stable/13 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=d119f5a194fe0dd81e43f8ab7470b1b0a51b932d commit d119f5a194fe0dd81e43f8ab7470b1b0a51b932d Author: Seigo Tanimura <seigo.tanimura@gmail.com> AuthorDate: 2024-03-04 13:50:25 +0000 Commit: Konstantin Belousov <kib@FreeBSD.org> CommitDate: 2024-03-13 00:31:20 +0000 nullfs: Add the vfs.nullfs.cache_nodes sysctl to control nocache default (cherry picked from commit c849eb8f1925f95ebfb8dbbe00672d902486a973) --- sys/fs/nullfs/null_vfsops.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/sys/fs/nullfs/null_vfsops.c b/sys/fs/nullfs/null_vfsops.c index 500352338f6d..0285a5e45e51 100644 --- a/sys/fs/nullfs/null_vfsops.c +++ b/sys/fs/nullfs/null_vfsops.c @@ -50,6 +50,7 @@ #include <sys/mount.h> #include <sys/namei.h> #include <sys/proc.h> +#include <sys/sysctl.h> #include <sys/vnode.h> #include <sys/jail.h> @@ -67,6 +68,13 @@ static vfs_unmount_t nullfs_unmount; static vfs_vget_t nullfs_vget; static vfs_extattrctl_t nullfs_extattrctl; +SYSCTL_NODE(_vfs, OID_AUTO, nullfs, CTLFLAG_RW, 0, "nullfs"); + +static bool null_cache_vnodes = true; +SYSCTL_BOOL(_vfs_nullfs, OID_AUTO, cache_vnodes, CTLFLAG_RWTUN, + &null_cache_vnodes, 0, + "cache free nullfs vnodes"); + /* * Mount null layer */ @@ -195,7 +203,8 @@ nullfs_mount(struct mount *mp) } xmp->nullm_flags |= NULLM_CACHE; - if (vfs_getopt(mp->mnt_optnew, "nocache", NULL, NULL) == 0 || + if (!null_cache_vnodes || + vfs_getopt(mp->mnt_optnew, "nocache", NULL, NULL) == 0 || (xmp->nullm_vfs->mnt_kern_flag & MNTK_NULL_NOCACHE) != 0) xmp->nullm_flags &= ~NULLM_CACHE;
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202403140047.42E0laYm029255>