From 966cbc5d29e66792108ec7d19f731b46d171245b Mon Sep 17 00:00:00 2001 From: dyson Date: Wed, 21 Aug 1996 21:56:23 +0000 Subject: Even though this looks like it, this is not a complex code change. The interface into the "VMIO" system has changed to be more consistant and robust. Essentially, it is now no longer necessary to call vn_open to get merged VM/Buffer cache operation, and exceptional conditions such as merged operation of VBLK devices is simpler and more correct. This code corrects a potentially large set of problems including the problems with ktrace output and loaded systems, file create/deletes, etc. Most of the changes to NFS are cosmetic and name changes, eliminating a layer of subroutine calls. The direct calls to vput/vrele have been re-instituted for better cross platform compatibility. Reviewed by: davidg --- sys/ufs/ffs/ffs_vfsops.c | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) (limited to 'sys/ufs') diff --git a/sys/ufs/ffs/ffs_vfsops.c b/sys/ufs/ffs/ffs_vfsops.c index 200b006..510d919 100644 --- a/sys/ufs/ffs/ffs_vfsops.c +++ b/sys/ufs/ffs/ffs_vfsops.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * @(#)ffs_vfsops.c 8.8 (Berkeley) 4/18/94 - * $Id: ffs_vfsops.c,v 1.38 1996/03/02 22:18:34 dyson Exp $ + * $Id: ffs_vfsops.c,v 1.39 1996/06/12 03:37:51 davidg Exp $ */ #include "opt_quota.h" @@ -67,6 +67,7 @@ #include #include #include +#include static int ffs_sbupdate __P((struct ufsmount *, int)); static int ffs_reload __P((struct mount *,struct ucred *,struct proc *)); @@ -468,6 +469,7 @@ ffs_mountfs(devvp, mp, p) int error, i, size; int ronly; u_int strsize; + int ncount; /* * Disallow multiple mounts of the same device. @@ -478,7 +480,10 @@ ffs_mountfs(devvp, mp, p) error = vfs_mountedon(devvp); if (error) return (error); - if (vcount(devvp) > 1 && devvp != rootvp) + ncount = vcount(devvp); + if (devvp->v_object) + ncount -= 1; + if (ncount > 1 && devvp != rootvp) return (EBUSY); error = vinvalbuf(devvp, V_SAVE, p->p_ucred, p, 0, 0); if (error) @@ -587,9 +592,11 @@ ffs_mountfs(devvp, mp, p) /* * Only VMIO the backing device if the backing device is a real * block device. This excludes the original MFS implementation. + * Note that it is optional that the backing device be VMIOed. This + * increases the opportunity for metadata caching. */ if ((devvp->v_type == VBLK) && (major(devvp->v_rdev) < nblkdev)) { - vn_vmio_open(devvp, p, p->p_ucred); + vfs_object_create(devvp, p, p->p_ucred, 0); } return (0); out: @@ -663,9 +670,14 @@ ffs_unmount(mp, mntflags, p) ffs_sbupdate(ump, MNT_WAIT); } ump->um_devvp->v_specflags &= ~SI_MOUNTEDON; + + vnode_pager_uncache(ump->um_devvp); + error = VOP_CLOSE(ump->um_devvp, ronly ? FREAD : FREAD|FWRITE, NOCRED, p); - vn_vmio_close(ump->um_devvp); + + vrele(ump->um_devvp); + free(fs->fs_csp[0], M_UFSMNT); free(fs, M_UFSMNT); free(ump, M_UFSMNT); -- cgit v1.1