diff options
author | kib <kib@FreeBSD.org> | 2013-01-03 19:17:57 +0000 |
---|---|---|
committer | kib <kib@FreeBSD.org> | 2013-01-03 19:17:57 +0000 |
commit | a7c71037dff32d49d32466102682ea2390f8d3a2 (patch) | |
tree | b40d81bb8b27a27e533ff513285113179bcc22d8 /sys/fs/nullfs/null_vnops.c | |
parent | 5a9188f8d3a59199c437c0e2eec747d7e9227d77 (diff) | |
download | FreeBSD-src-a7c71037dff32d49d32466102682ea2390f8d3a2.zip FreeBSD-src-a7c71037dff32d49d32466102682ea2390f8d3a2.tar.gz |
Add the "nocache" nullfs mount option, which disables the caching of
the free nullfs vnodes, switching nullfs behaviour to pre-r240285.
The option is mostly intended as the last-resort when higher pressure
on the vnode cache due to doubling of the vnode counts is not
desirable.
Note that disabling the cache costs more than 2x wall time in the
metadata-hungry scenarious. The default is "cache".
Tested and benchmarked by: pho (previous version)
MFC after: 2 weeks
Diffstat (limited to 'sys/fs/nullfs/null_vnops.c')
-rw-r--r-- | sys/fs/nullfs/null_vnops.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/sys/fs/nullfs/null_vnops.c b/sys/fs/nullfs/null_vnops.c index f530ed2..cc35d81 100644 --- a/sys/fs/nullfs/null_vnops.c +++ b/sys/fs/nullfs/null_vnops.c @@ -692,7 +692,22 @@ null_unlock(struct vop_unlock_args *ap) static int null_inactive(struct vop_inactive_args *ap __unused) { + struct vnode *vp; + struct mount *mp; + struct null_mount *xmp; + vp = ap->a_vp; + mp = vp->v_mount; + xmp = MOUNTTONULLMOUNT(mp); + if ((xmp->nullm_flags & NULLM_CACHE) == 0) { + /* + * If this is the last reference and caching of the + * nullfs vnodes is not enabled, then free up the + * vnode so as not to tie up the lower vnodes. + */ + vp->v_object = NULL; + vrecycle(vp); + } return (0); } |