mirror of
https://github.com/opnsense/src.git
synced 2026-06-04 14:26:03 -04:00
nullfs: Add the vfs.nullfs.cache_nodes sysctl to control nocache default
Differential revision: https://reviews.freebsd.org/D44217 MFC after: 1 week
This commit is contained in:
parent
4fefe1b763
commit
c849eb8f19
1 changed files with 10 additions and 1 deletions
|
|
@ -46,6 +46,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>
|
||||
|
||||
|
|
@ -63,6 +64,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
|
||||
*/
|
||||
|
|
@ -198,7 +206,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;
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue