diff options
author | John Dyson <dyson@FreeBSD.org> | 1996-08-21 21:56:23 +0000 |
---|---|---|
committer | John Dyson <dyson@FreeBSD.org> | 1996-08-21 21:56:23 +0000 |
commit | 6476c0d204848007fc6da182e3935f01e267d77f (patch) | |
tree | 07a76a1b97882ad9c1e3805d05f820bc976c60bd /sys/ufs/ffs/ffs_vfsops.c | |
parent | fe6869c2d0e28a9e4e6af9bcaf8f65506ac68e86 (diff) | |
download | src-6476c0d204848007fc6da182e3935f01e267d77f.tar.gz src-6476c0d204848007fc6da182e3935f01e267d77f.zip |
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
Notes
Notes:
svn path=/head/; revision=17761
Diffstat (limited to 'sys/ufs/ffs/ffs_vfsops.c')
-rw-r--r-- | sys/ufs/ffs/ffs_vfsops.c | 20 |
1 files changed, 16 insertions, 4 deletions
diff --git a/sys/ufs/ffs/ffs_vfsops.c b/sys/ufs/ffs/ffs_vfsops.c index 200b0065d8f2..510d91903a1d 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 <vm/vm_prot.h> #include <vm/vm_page.h> #include <vm/vm_object.h> +#include <vm/vm_extern.h> 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); |