Use the vnode v_opencount and v_writecount universally. They were previously
authorMatthew Dillon <dillon@dragonflybsd.org>
Sat, 1 Apr 2006 20:46:54 +0000 (20:46 +0000)
committerMatthew Dillon <dillon@dragonflybsd.org>
Sat, 1 Apr 2006 20:46:54 +0000 (20:46 +0000)
commit8ddc60049ae330a0af88b01d0b7e12d5001e6bb2
tree4979a4cd5a8395903d8d7332b7f9ff2c010b00d7
parentda1828e0ad20076ab66c6253e0d39013735fb514
Use the vnode v_opencount and v_writecount universally.  They were previously
only used by specfs.  Require that VOP_OPEN and VOP_CLOSE calls match.
Assert on boundary errors.

Clean up umount's FORCECLOSE mode.  Adjust deadfs to allow duplicate closes
(which can happen due to a forced unmount or revoke).

Add vop_stdopen() and vop_stdclose() and adjust the default vnode ops to
call them.  All VFSs except DEADFS which supply their own vop_open and
vop_close now call vop_stdopen() and vop_stdclose() to handle v_opencount
and v_writecount adjustments.

Change the VOP_OPEN/fp specs.  VOP_OPEN (aka vop_stdopen) is now responsible
for filling in the file pointer information, rather than the caller of
VOP_OPEN.  Additionally, when supplied a file pointer, VOP_OPEN is now
allowed to populate the file pointer with a different vnode then the one
passed to it, which will be used later on to allow filesystems which
synthesize different vnodes on open, for example so we can create a generic
tty/pty pairing devices rather than scanning for an unused pty, and so we
can create swap-backed generic anonymous file descriptors rather than having
to use /tmp.  And for other purposes as well.

Fix UFS's mount/remount/unmount code to make the proper VOP_OPEN and
VOP_CLOSE calls when a filesystem is remounted read-only or read-write.
29 files changed:
sys/emulation/linux/i386/linprocfs/linprocfs_vnops.c
sys/kern/kern_fp.c
sys/kern/kern_subr.c
sys/kern/vfs_default.c
sys/kern/vfs_lock.c
sys/kern/vfs_subr.c
sys/kern/vfs_syscalls.c
sys/kern/vfs_vnops.c
sys/sys/vnode.h
sys/vfs/coda/coda_vnops.c
sys/vfs/deadfs/dead_vnops.c
sys/vfs/fdesc/fdesc_vnops.c
sys/vfs/fifofs/fifo_vnops.c
sys/vfs/gnu/ext2fs/ext2_vfsops.c
sys/vfs/hpfs/hpfs_vnops.c
sys/vfs/isofs/cd9660/cd9660_vnops.c
sys/vfs/mfs/mfs_vfsops.c
sys/vfs/mfs/mfs_vnops.c
sys/vfs/msdosfs/msdosfs_vnops.c
sys/vfs/nfs/nfs_vnops.c
sys/vfs/ntfs/ntfs_vnops.c
sys/vfs/nwfs/nwfs_vnops.c
sys/vfs/portal/portal_vnops.c
sys/vfs/procfs/procfs_vnops.c
sys/vfs/smbfs/smbfs_vnops.c
sys/vfs/specfs/spec_vnops.c
sys/vfs/ufs/ffs_vfsops.c
sys/vfs/ufs/ufs_vnops.c
sys/vfs/union/union_subr.c