summaryrefslogtreecommitdiffstats
path: root/sys/fs/nullfs/null_vnops.c
diff options
context:
space:
mode:
Diffstat (limited to 'sys/fs/nullfs/null_vnops.c')
-rw-r--r--sys/fs/nullfs/null_vnops.c15
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);
}
OpenPOWER on IntegriCloud