Page MenuHomeFreeBSD

D44217.id135397.diff
No OneTemporary

D44217.id135397.diff

diff --git a/sys/fs/nullfs/null_vfsops.c b/sys/fs/nullfs/null_vfsops.c
--- a/sys/fs/nullfs/null_vfsops.c
+++ b/sys/fs/nullfs/null_vfsops.c
@@ -48,6 +48,7 @@
#include <sys/proc.h>
#include <sys/vnode.h>
#include <sys/jail.h>
+#include <sys/sysctl.h>
#include <fs/nullfs/null.h>
@@ -63,6 +64,14 @@
static vfs_vget_t nullfs_vget;
static vfs_extattrctl_t nullfs_extattrctl;
+SYSCTL_DECL(_vfs);
+
+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_RW,
+ &null_cache_vnodes, 0, "cache free nullfs vnodes");
+
/*
* Mount null layer
*/
@@ -89,6 +98,9 @@
if (mp->mnt_flag & MNT_UPDATE) {
/*
* Only support update mounts for NFS export.
+ *
+ * XXX nocache should also be updated for the tuning of the nullfs
+ * vnode caching on the fly.
*/
if (vfs_flagopt(mp->mnt_optnew, "export", NULL, 0))
return (0);
@@ -198,7 +210,8 @@
}
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;

File Metadata

Mime Type
text/plain
Expires
Thu, Mar 12, 4:06 PM (6 h, 37 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
29588457
Default Alt Text
D44217.id135397.diff (1 KB)

Event Timeline