Clean the VFS operations vector and related code:
authorHiten Pandya <hmp@dragonflybsd.org>
Tue, 26 Jul 2005 15:43:36 +0000 (15:43 +0000)
committerHiten Pandya <hmp@dragonflybsd.org>
Tue, 26 Jul 2005 15:43:36 +0000 (15:43 +0000)
commit43c45e8f849b4b1b18e5935b2b2e908fe8a11a8d
tree84c7aaa468dd04a0fdb1f2ec11fcee4e0db861bc
parent64fc74be583b648afd7eb5ac236b8669f9375264
Clean the VFS operations vector and related code:

* take advantage of C99 sparse structure initialisation, this allows
  us to initialise left out vfsops entries cleanly when vfs_register()
  is called; any vfsop entries that are not specified will be assigned
  vfs_std* functions.  the only exception to this rule is VFS_SYNC
  which is assigned vfs_stdnosync() since a file system may not have
  support for it.  file systems can simply assign vfs_stdsync if they
  do not have their own sync operation.

* add KKASSERTS to make sure that the VFS_ROOT, VFS_MOUNT and VFS_UNMOUNT
  vfs operations are provided by a file system being registered.  all of
  the above are necessary to ensure a minimally working file system.

* remove scattered no-op definitions of VFS_START() vfsop vector entry
  and take advantage of sparse vfsop initialisation.  VFS_START is only
  used by MFS to make ensure calling process is not swapped out when
  I/O is initialised.  The entry point is called from the mount path,
  before the file system is marked ready.

* remove scattered no-op definitions of VFS_QUOTACTL() vfsop vector entry
  and take advantage of sparse vfsop initialisation.

* give UFS a VFS_UNINIT vfsop entry and make use of it in ext2fs when
  ripping down the hash tables.

* many file systems in the kernel seem to not implement the complementing
  VFS_UNINIT() vfsop entry, this is not so much of a problem when the
  file system is compiled into the kernel, but it can leave leakage when
  compiled as KLD modules.  add uninitialisation code and entry points
  for ext2fs, ufs, fdescfs.  grab the ufs_ihash_token when free'ing the
  inode hash table at ripping time.

* add typedefs for all the vfsop entry points, make use of it in definition
  of struct vfsops; this results in clean and consolidate code.  use the
  typedefs for vfs_std* function prototypes.
28 files changed:
sys/kern/vfs_default.c
sys/kern/vfs_init.c
sys/sys/mount.h
sys/vfs/coda/coda_vfsops.c
sys/vfs/fdesc/fdesc.h
sys/vfs/fdesc/fdesc_vfsops.c
sys/vfs/fdesc/fdesc_vnops.c
sys/vfs/gnu/ext2fs/ext2_extern.h
sys/vfs/gnu/ext2fs/ext2_inode.c
sys/vfs/gnu/ext2fs/ext2_vfsops.c
sys/vfs/hpfs/hpfs_vfsops.c
sys/vfs/isofs/cd9660/cd9660_vfsops.c
sys/vfs/mfs/mfs_vfsops.c
sys/vfs/msdosfs/msdosfs_vfsops.c
sys/vfs/nfs/nfs_vfsops.c
sys/vfs/ntfs/ntfs_vfsops.c
sys/vfs/nullfs/null_vfsops.c
sys/vfs/nwfs/nwfs_vfsops.c
sys/vfs/portal/portal_vfsops.c
sys/vfs/procfs/procfs_vfsops.c
sys/vfs/smbfs/smbfs_vfsops.c
sys/vfs/udf/udf_vfsops.c
sys/vfs/ufs/ffs_vfsops.c
sys/vfs/ufs/ufs_extern.h
sys/vfs/ufs/ufs_ihash.c
sys/vfs/ufs/ufs_vfsops.c
sys/vfs/umapfs/umap_vfsops.c
sys/vfs/union/union_vfsops.c