Due to continuing issues with VOP_READ/VOP_WRITE ops being called without
authorMatthew Dillon <dillon@dragonflybsd.org>
Fri, 7 Apr 2006 06:38:33 +0000 (06:38 +0000)
committerMatthew Dillon <dillon@dragonflybsd.org>
Fri, 7 Apr 2006 06:38:33 +0000 (06:38 +0000)
commit1c843a13b38e87670f8169e750b2406c3eb6e68e
tree31abe16cc32491af22b45b51af1f707744ef8b91
parenta8851a0fb965e874e53e6455853ae0f725548030
Due to continuing issues with VOP_READ/VOP_WRITE ops being called without
a VOP_OPEN, particularly by NFS, redo the way VM objects are associated
with vnodes.

* The size of the object is now passed to vinitvmio().  vinitvmio() no
  longer calls VOP_GETATTR().

* Instead of trying to call vinitvmio() conditionally in various places,
  we now call it unconditionally when a vnode is instantiated if
  the filesystem at any time in the future intends to use the buffer
  cache to access that vnode's dataspace.

* Specfs 'disk' devices are an exception.  Since we cannot safely do I/O
  on such vnodes if they have not been VOP_OPEN()'ed anyhow, the VM objects
  for those vnodes are still only associated on open.

The performance impact is limited to the case where large numbers of vnodes
are being created and destroyed.  This case only occurs when a large
directory topology (number of files > kernel's vnode cache) is traversed
and all related inodes are cached by the system.  Being a pure-cpu case
the slight loss of performance due to the VM object allocations is
not really a big dael.
18 files changed:
sys/kern/vfs_subr.c
sys/sys/vnode.h
sys/vfs/gnu/ext2fs/ext2_inode.c
sys/vfs/gnu/ext2fs/ext2_vnops.c
sys/vfs/isofs/cd9660/cd9660_lookup.c
sys/vfs/isofs/cd9660/cd9660_vfsops.c
sys/vfs/isofs/cd9660/cd9660_vnops.c
sys/vfs/msdosfs/msdosfs_denode.c
sys/vfs/msdosfs/msdosfs_vnops.c
sys/vfs/nfs/nfs_serv.c
sys/vfs/nfs/nfs_subs.c
sys/vfs/nfs/nfs_vfsops.c
sys/vfs/nfs/nfs_vnops.c
sys/vfs/nfs/nfsmount.h
sys/vfs/ntfs/ntfs_vnops.c
sys/vfs/specfs/spec_vnops.c
sys/vfs/ufs/ffs_inode.c
sys/vfs/ufs/ufs_vnops.c