From 43c45e8f849b4b1b18e5935b2b2e908fe8a11a8d Mon Sep 17 00:00:00 2001 From: Hiten Pandya Date: Tue, 26 Jul 2005 15:43:36 +0000 Subject: [PATCH] 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. --- sys/kern/vfs_default.c | 11 +++- sys/kern/vfs_init.c | 74 ++++++++++++++++++++++- sys/sys/mount.h | 87 +++++++++++++++------------- sys/vfs/coda/coda_vfsops.c | 21 ++----- sys/vfs/fdesc/fdesc.h | 3 +- sys/vfs/fdesc/fdesc_vfsops.c | 23 +++----- sys/vfs/fdesc/fdesc_vnops.c | 9 ++- sys/vfs/gnu/ext2fs/ext2_extern.h | 3 +- sys/vfs/gnu/ext2fs/ext2_inode.c | 8 +-- sys/vfs/gnu/ext2fs/ext2_vfsops.c | 28 +++++---- sys/vfs/hpfs/hpfs_vfsops.c | 27 ++++----- sys/vfs/isofs/cd9660/cd9660_vfsops.c | 27 ++++----- sys/vfs/mfs/mfs_vfsops.c | 28 +++++---- sys/vfs/msdosfs/msdosfs_vfsops.c | 26 ++++----- sys/vfs/nfs/nfs_vfsops.c | 23 +++----- sys/vfs/ntfs/ntfs_vfsops.c | 27 ++++----- sys/vfs/nullfs/null_vfsops.c | 52 +++++------------ sys/vfs/nwfs/nwfs_vfsops.c | 48 +++------------ sys/vfs/portal/portal_vfsops.c | 21 ++----- sys/vfs/procfs/procfs_vfsops.c | 21 ++----- sys/vfs/smbfs/smbfs_vfsops.c | 54 +++-------------- sys/vfs/udf/udf_vfsops.c | 24 +++----- sys/vfs/ufs/ffs_vfsops.c | 28 +++++---- sys/vfs/ufs/ufs_extern.h | 3 +- sys/vfs/ufs/ufs_ihash.c | 14 ++++- sys/vfs/ufs/ufs_vfsops.c | 13 +---- sys/vfs/umapfs/umap_vfsops.c | 52 +++++------------ sys/vfs/union/union_vfsops.c | 22 +++---- 28 files changed, 336 insertions(+), 441 deletions(-) diff --git a/sys/kern/vfs_default.c b/sys/kern/vfs_default.c index 71724e0c98..06041e1d41 100644 --- a/sys/kern/vfs_default.c +++ b/sys/kern/vfs_default.c @@ -37,7 +37,7 @@ * * * $FreeBSD: src/sys/kern/vfs_default.c,v 1.28.2.7 2003/01/10 18:23:26 bde Exp $ - * $DragonFly: src/sys/kern/vfs_default.c,v 1.25 2004/12/29 02:40:02 dillon Exp $ + * $DragonFly: src/sys/kern/vfs_default.c,v 1.26 2005/07/26 15:43:35 hmp Exp $ */ #include @@ -1413,8 +1413,7 @@ vop_stdgetvobject(ap) * used to fill the vfs fucntion table to get reasonable default return values. */ int -vfs_stdmount(struct mount *mp, char *path, caddr_t data, - struct nlookupdata *nd, struct thread *td) +vfs_stdmount(struct mount *mp, char *path, caddr_t data, struct thread *td) { return (0); } @@ -1462,6 +1461,12 @@ vfs_stdsync(struct mount *mp, int waitfor, struct thread *td) return (0); } +int +vfs_stdnosync(struct mount *mp, int waitfor, struct thread *td) +{ + return (EOPNOTSUPP); +} + int vfs_stdvget(struct mount *mp, ino_t ino, struct vnode **vpp) { diff --git a/sys/kern/vfs_init.c b/sys/kern/vfs_init.c index e307f9144e..cae297b887 100644 --- a/sys/kern/vfs_init.c +++ b/sys/kern/vfs_init.c @@ -70,7 +70,7 @@ * * @(#)vfs_init.c 8.3 (Berkeley) 1/4/94 * $FreeBSD: src/sys/kern/vfs_init.c,v 1.59 2002/04/30 18:44:32 dillon Exp $ - * $DragonFly: src/sys/kern/vfs_init.c,v 1.8 2004/12/17 00:18:07 dillon Exp $ + * $DragonFly: src/sys/kern/vfs_init.c,v 1.9 2005/07/26 15:43:35 hmp Exp $ */ /* * Manage vnode VOP operations vectors @@ -295,6 +295,7 @@ vfs_register(struct vfsconf *vfc) { struct sysctl_oid *oidp; struct vfsconf *vfsp; + struct vfsops *vfsops = NULL; vfsp = NULL; if (vfsconf) @@ -325,6 +326,77 @@ vfs_register(struct vfsconf *vfc) oidp->oid_number = vfc->vfc_typenum; sysctl_register_oid(oidp); } + + /* + * Initialise unused fields in the file system's vfsops vector. + * + * NOTE the file system should provide the mount and unmount ops + * at the least. In order for unmount to succeed, we also need + * the file system to provide us with vfsops->vfs_root otherwise + * the unmount(2) operation will not succeed. + */ + vfsops = vfc->vfc_vfsops; + KKASSERT(vfc->vfc_vfsops != NULL); + KKASSERT(vfsops->vfs_mount != NULL); + KKASSERT(vfsops->vfs_root != NULL); + KKASSERT(vfsops->vfs_unmount != NULL); + + if (vfsops->vfs_root == NULL) { + /* return file system's root vnode */ + vfsops->vfs_root = vfs_stdroot; + } + if (vfsops->vfs_start == NULL) { + /* + * Make file system operational before first use. This + * routine is called at mount-time for initialising MFS, + * not used by other file systems. + */ + vfsops->vfs_start = vfs_stdstart; + } + if (vfsops->vfs_quotactl == NULL) { + /* quota control */ + vfsops->vfs_quotactl = vfs_stdquotactl; + } + if (vfsops->vfs_statfs == NULL) { + /* return file system's status */ + vfsops->vfs_statfs = vfs_stdstatfs; + } + if (vfsops->vfs_sync == NULL) { + /* + * Flush dirty buffers. File systems can use vfs_stdsync() + * by explicitly setting it in the vfsops->vfs_sync vector + * entry. + */ + vfsops->vfs_sync = vfs_stdnosync; + } + if (vfsops->vfs_vget == NULL) { + /* convert an inode number to a vnode */ + vfsops->vfs_vget = vfs_stdvget; + } + if (vfsops->vfs_fhtovp == NULL) { + /* turn an NFS file handle into a vnode */ + vfsops->vfs_fhtovp = vfs_stdfhtovp; + } + if (vfsops->vfs_checkexp == NULL) { + /* check if file system is exported */ + vfsops->vfs_checkexp = vfs_stdcheckexp; + } + if (vfsops->vfs_vptofh == NULL) { + /* turn a vnode into an NFS file handle */ + vfsops->vfs_vptofh = vfs_stdvptofh; + } + if (vfsops->vfs_init == NULL) { + /* file system specific initialisation */ + vfsops->vfs_init = vfs_stdinit; + } + if (vfsops->vfs_uninit == NULL) { + /* file system specific uninitialisation */ + vfsops->vfs_uninit = vfs_stduninit; + } + if (vfsops->vfs_extattrctl == NULL) { + /* extended attribute control */ + vfsops->vfs_extattrctl = vfs_stdextattrctl; + } /* * Call init function for this VFS... diff --git a/sys/sys/mount.h b/sys/sys/mount.h index 92eb304e16..6018c89666 100644 --- a/sys/sys/mount.h +++ b/sys/sys/mount.h @@ -32,7 +32,7 @@ * * @(#)mount.h 8.21 (Berkeley) 5/20/95 * $FreeBSD: src/sys/sys/mount.h,v 1.89.2.7 2003/04/04 20:35:57 tegge Exp $ - * $DragonFly: src/sys/sys/mount.h,v 1.20 2005/04/20 17:01:51 dillon Exp $ + * $DragonFly: src/sys/sys/mount.h,v 1.21 2005/07/26 15:43:35 hmp Exp $ */ #ifndef _SYS_MOUNT_H_ @@ -373,32 +373,43 @@ struct nlookupdata; struct mbuf; #endif -struct vfsops { - int (*vfs_mount) (struct mount *mp, char *path, caddr_t data, - struct thread *td); - int (*vfs_start) (struct mount *mp, int flags, +typedef int vfs_mount_t(struct mount *mp, char *path, caddr_t data, struct thread *td); - int (*vfs_unmount) (struct mount *mp, int mntflags, +typedef int vfs_start_t(struct mount *mp, int flags, struct thread *td); +typedef int vfs_unmount_t(struct mount *mp, int mntflags, struct thread *td); - int (*vfs_root) (struct mount *mp, struct vnode **vpp); - int (*vfs_quotactl) (struct mount *mp, int cmds, uid_t uid, - caddr_t arg, struct thread *td); - int (*vfs_statfs) (struct mount *mp, struct statfs *sbp, +typedef int vfs_root_t(struct mount *mp, struct vnode **vpp); +typedef int vfs_quotactl_t(struct mount *mp, int cmds, uid_t uid, caddr_t arg, struct thread *td); - int (*vfs_sync) (struct mount *mp, int waitfor, +typedef int vfs_statfs_t(struct mount *mp, struct statfs *sbp, struct thread *td); - int (*vfs_vget) (struct mount *mp, ino_t ino, - struct vnode **vpp); - int (*vfs_fhtovp) (struct mount *mp, struct fid *fhp, +typedef int vfs_sync_t(struct mount *mp, int waitfor, struct thread *td); +typedef int vfs_vget_t(struct mount *mp, ino_t ino, struct vnode **vpp); +typedef int vfs_fhtovp_t(struct mount *mp, struct fid *fhp, struct vnode **vpp); - int (*vfs_checkexp) (struct mount *mp, struct sockaddr *nam, +typedef int vfs_checkexp_t(struct mount *mp, struct sockaddr *nam, int *extflagsp, struct ucred **credanonp); - int (*vfs_vptofh) (struct vnode *vp, struct fid *fhp); - int (*vfs_init) (struct vfsconf *); - int (*vfs_uninit) (struct vfsconf *); - int (*vfs_extattrctl) (struct mount *mp, int cmd, - const char *attrname, caddr_t arg, - struct thread *td); +typedef int vfs_vptofh_t(struct vnode *vp, struct fid *fhp); +typedef int vfs_init_t(struct vfsconf *); +typedef int vfs_uninit_t(struct vfsconf *); +typedef int vfs_extattrctl_t(struct mount *mp, int cmd,const char *attrname, + caddr_t arg, struct thread *td); + +struct vfsops { + vfs_mount_t *vfs_mount; + vfs_start_t *vfs_start; + vfs_unmount_t *vfs_unmount; + vfs_root_t *vfs_root; + vfs_quotactl_t *vfs_quotactl; + vfs_statfs_t *vfs_statfs; + vfs_sync_t *vfs_sync; + vfs_vget_t *vfs_vget; + vfs_fhtovp_t *vfs_fhtovp; + vfs_checkexp_t *vfs_checkexp; + vfs_vptofh_t *vfs_vptofh; + vfs_init_t *vfs_init; + vfs_uninit_t *vfs_uninit; + vfs_extattrctl_t *vfs_extattrctl; }; #define VFS_MOUNT(MP, PATH, DATA, P) \ @@ -504,24 +515,22 @@ extern struct nfs_public nfs_pub; * kern/vfs_default.c, they should be used instead of making "dummy" * functions or casting entries in the VFS op table to "enopnotsupp()". */ -int vfs_stdmount (struct mount *mp, char *path, caddr_t data, - struct nlookupdata *ndp, struct thread *p); -int vfs_stdstart (struct mount *mp, int flags, struct thread *p); -int vfs_stdunmount (struct mount *mp, int mntflags, struct thread *p); -int vfs_stdroot (struct mount *mp, struct vnode **vpp); -int vfs_stdquotactl (struct mount *mp, int cmds, uid_t uid, - caddr_t arg, struct thread *p); -int vfs_stdstatfs (struct mount *mp, struct statfs *sbp, struct thread *p); -int vfs_stdsync (struct mount *mp, int waitfor, struct thread *td); -int vfs_stdvget (struct mount *mp, ino_t ino, struct vnode **vpp); -int vfs_stdfhtovp (struct mount *mp, struct fid *fhp, struct vnode **vpp); -int vfs_stdcheckexp (struct mount *mp, struct sockaddr *nam, - int *extflagsp, struct ucred **credanonp); -int vfs_stdvptofh (struct vnode *vp, struct fid *fhp); -int vfs_stdinit (struct vfsconf *); -int vfs_stduninit (struct vfsconf *); -int vfs_stdextattrctl (struct mount *mp, int cmd, const char *attrname, - caddr_t arg, struct thread *p); +vfs_start_t vfs_stdstart; +vfs_mount_t vfs_stdmount; +vfs_unmount_t vfs_stdunmount; +vfs_root_t vfs_stdroot; +vfs_quotactl_t vfs_stdquotactl; +vfs_statfs_t vfs_stdstatfs; +vfs_sync_t vfs_stdsync; +vfs_sync_t vfs_stdnosync; +vfs_vget_t vfs_stdvget; +vfs_fhtovp_t vfs_stdfhtovp; +vfs_checkexp_t vfs_stdcheckexp; +vfs_vptofh_t vfs_stdvptofh; +vfs_init_t vfs_stdinit; +vfs_uninit_t vfs_stduninit; +vfs_extattrctl_t vfs_stdextattrctl; + int journal_mountctl(struct vop_mountctl_args *ap); void journal_remove_all_journals(struct mount *mp, int flags); diff --git a/sys/vfs/coda/coda_vfsops.c b/sys/vfs/coda/coda_vfsops.c index eee0ab5256..9658fd5804 100644 --- a/sys/vfs/coda/coda_vfsops.c +++ b/sys/vfs/coda/coda_vfsops.c @@ -28,7 +28,7 @@ * * @(#) src/sys/cfs/coda_vfsops.c,v 1.1.1.1 1998/08/29 21:14:52 rvb Exp $ * $FreeBSD: src/sys/coda/coda_vfsops.c,v 1.24.2.1 2001/07/26 20:36:45 iedowse Exp $ - * $DragonFly: src/sys/vfs/coda/Attic/coda_vfsops.c,v 1.21 2005/04/19 17:54:44 dillon Exp $ + * $DragonFly: src/sys/vfs/coda/Attic/coda_vfsops.c,v 1.22 2005/07/26 15:43:35 hmp Exp $ * */ @@ -520,20 +520,11 @@ devtomp_callback(struct mount *mp, void *data) } struct vfsops coda_vfsops = { - coda_mount, - vfs_stdstart, - coda_unmount, - coda_root, - vfs_stdquotactl, - coda_nb_statfs, - coda_sync, - vfs_stdvget, - vfs_stdfhtovp, - vfs_stdcheckexp, - vfs_stdvptofh, - vfs_stdinit, - vfs_stduninit, - vfs_stdextattrctl, + .vfs_mount = coda_mount, + .vfs_unmount = coda_unmount, + .vfs_root = coda_root, + .vfs_statfs = coda_nb_statfs, + .vfs_sync = coda_sync }; VFS_SET(coda_vfsops, coda, VFCF_NETWORK); diff --git a/sys/vfs/fdesc/fdesc.h b/sys/vfs/fdesc/fdesc.h index c0221c0772..93d8606e9e 100644 --- a/sys/vfs/fdesc/fdesc.h +++ b/sys/vfs/fdesc/fdesc.h @@ -36,7 +36,7 @@ * @(#)fdesc.h 8.5 (Berkeley) 1/21/94 * * $FreeBSD: src/sys/miscfs/fdesc/fdesc.h,v 1.8.2.1 2001/10/22 22:49:26 chris Exp $ - * $DragonFly: src/sys/vfs/fdesc/fdesc.h,v 1.4 2003/08/20 09:56:31 rob Exp $ + * $DragonFly: src/sys/vfs/fdesc/fdesc.h,v 1.5 2005/07/26 15:43:35 hmp Exp $ */ #ifdef _KERNEL @@ -64,6 +64,7 @@ struct fdescnode { #define VTOFDESC(vp) ((struct fdescnode *)(vp)->v_data) extern int fdesc_init (struct vfsconf *); +extern int fdesc_uninit (struct vfsconf *); extern int fdesc_root (struct mount *, struct vnode **); extern int fdesc_allocvp (fdntype, int, struct mount *, struct vnode **, struct thread *); diff --git a/sys/vfs/fdesc/fdesc_vfsops.c b/sys/vfs/fdesc/fdesc_vfsops.c index 468647546a..2fd562f35e 100644 --- a/sys/vfs/fdesc/fdesc_vfsops.c +++ b/sys/vfs/fdesc/fdesc_vfsops.c @@ -36,7 +36,7 @@ * @(#)fdesc_vfsops.c 8.4 (Berkeley) 1/21/94 * * $FreeBSD: src/sys/miscfs/fdesc/fdesc_vfsops.c,v 1.22.2.3 2002/08/23 17:42:39 njl Exp $ - * $DragonFly: src/sys/vfs/fdesc/fdesc_vfsops.c,v 1.14 2005/06/22 01:33:32 dillon Exp $ + * $DragonFly: src/sys/vfs/fdesc/fdesc_vfsops.c,v 1.15 2005/07/26 15:43:35 hmp Exp $ */ /* @@ -204,20 +204,13 @@ fdesc_statfs(struct mount *mp, struct statfs *sbp, struct thread *td) } static struct vfsops fdesc_vfsops = { - fdesc_mount, - vfs_stdstart, - fdesc_unmount, - fdesc_root, - vfs_stdquotactl, - fdesc_statfs, - vfs_stdsync, - vfs_stdvget, - vfs_stdfhtovp, - vfs_stdcheckexp, - vfs_stdvptofh, - fdesc_init, - vfs_stduninit, - vfs_stdextattrctl, + .vfs_mount = fdesc_mount, + .vfs_unmount = fdesc_unmount, + .vfs_root = fdesc_root, + .vfs_statfs = fdesc_statfs, + .vfs_sync = vfs_stdsync, + .vfs_init = fdesc_init, + .vfs_uninit = fdesc_uninit }; VFS_SET(fdesc_vfsops, fdesc, VFCF_SYNTHETIC); diff --git a/sys/vfs/fdesc/fdesc_vnops.c b/sys/vfs/fdesc/fdesc_vnops.c index 72c750060f..0f5d8e2451 100644 --- a/sys/vfs/fdesc/fdesc_vnops.c +++ b/sys/vfs/fdesc/fdesc_vnops.c @@ -36,7 +36,7 @@ * @(#)fdesc_vnops.c 8.9 (Berkeley) 1/21/94 * * $FreeBSD: src/sys/miscfs/fdesc/fdesc_vnops.c,v 1.47.2.1 2001/10/22 22:49:26 chris Exp $ - * $DragonFly: src/sys/vfs/fdesc/fdesc_vnops.c,v 1.18 2005/06/22 01:33:32 dillon Exp $ + * $DragonFly: src/sys/vfs/fdesc/fdesc_vnops.c,v 1.19 2005/07/26 15:43:35 hmp Exp $ */ /* @@ -93,6 +93,13 @@ fdesc_init(struct vfsconf *vfsp) return (0); } +int +fdesc_uninit(struct vfsconf *vfsp) +{ + if (fdhashtbl) + free(fdhashtbl, M_CACHE); + return (0); +} int fdesc_allocvp(fdntype ftype, int ix, struct mount *mp, struct vnode **vpp, struct thread *td) diff --git a/sys/vfs/gnu/ext2fs/ext2_extern.h b/sys/vfs/gnu/ext2fs/ext2_extern.h index be60465a9c..af5fa3c798 100644 --- a/sys/vfs/gnu/ext2fs/ext2_extern.h +++ b/sys/vfs/gnu/ext2fs/ext2_extern.h @@ -38,7 +38,7 @@ * * @(#)ffs_extern.h 8.3 (Berkeley) 4/16/94 * $FreeBSD: src/sys/gnu/ext2fs/ext2_extern.h,v 1.22.6.1 2000/11/05 19:17:40 bde Exp $ - * $DragonFly: src/sys/vfs/gnu/ext2fs/ext2_extern.h,v 1.7 2004/11/12 00:09:30 dillon Exp $ + * $DragonFly: src/sys/vfs/gnu/ext2fs/ext2_extern.h,v 1.8 2005/07/26 15:43:35 hmp Exp $ */ #ifndef _SYS_GNU_EXT2FS_EXT2_EXTERN_H_ @@ -59,7 +59,6 @@ int ext2_blkatoff (struct vnode *, off_t, char **, struct buf **); void ext2_blkfree (struct inode *, daddr_t, long); daddr_t ext2_blkpref (struct inode *, daddr_t, int, daddr_t *, daddr_t); int ext2_bmap (struct vop_bmap_args *); -int ext2_init (struct vfsconf *); int ext2_reallocblks (struct vop_reallocblks_args *); int ext2_reclaim (struct vop_reclaim_args *); void ext2_setblock (struct ext2_sb_info *, u_char *, daddr_t); diff --git a/sys/vfs/gnu/ext2fs/ext2_inode.c b/sys/vfs/gnu/ext2fs/ext2_inode.c index e2bb22970f..8af6102a85 100644 --- a/sys/vfs/gnu/ext2fs/ext2_inode.c +++ b/sys/vfs/gnu/ext2fs/ext2_inode.c @@ -38,7 +38,7 @@ * * @(#)ext2_inode.c 8.5 (Berkeley) 12/30/93 * $FreeBSD: src/sys/gnu/ext2fs/ext2_inode.c,v 1.24.2.1 2000/08/03 00:52:57 peter Exp $ - * $DragonFly: src/sys/vfs/gnu/ext2fs/ext2_inode.c,v 1.8 2005/04/15 19:08:16 dillon Exp $ + * $DragonFly: src/sys/vfs/gnu/ext2fs/ext2_inode.c,v 1.9 2005/07/26 15:43:35 hmp Exp $ */ #include "opt_quota.h" @@ -66,12 +66,6 @@ static int ext2_indirtrunc (struct inode *, daddr_t, daddr_t, daddr_t, int, long *); -int -ext2_init(struct vfsconf *vfsp) -{ - return (ufs_init(vfsp)); -} - /* * Update the access, modified, and inode change times as specified by the * IN_ACCESS, IN_UPDATE, and IN_CHANGE flags respectively. Write the inode diff --git a/sys/vfs/gnu/ext2fs/ext2_vfsops.c b/sys/vfs/gnu/ext2fs/ext2_vfsops.c index 613e17e9d4..32c1d10998 100644 --- a/sys/vfs/gnu/ext2fs/ext2_vfsops.c +++ b/sys/vfs/gnu/ext2fs/ext2_vfsops.c @@ -38,7 +38,7 @@ * * @(#)ffs_vfsops.c 8.8 (Berkeley) 4/18/94 * $FreeBSD: src/sys/gnu/ext2fs/ext2_vfsops.c,v 1.63.2.7 2002/07/01 00:18:51 iedowse Exp $ - * $DragonFly: src/sys/vfs/gnu/ext2fs/ext2_vfsops.c,v 1.29 2005/06/06 15:35:06 dillon Exp $ + * $DragonFly: src/sys/vfs/gnu/ext2fs/ext2_vfsops.c,v 1.30 2005/07/26 15:43:35 hmp Exp $ */ #include "opt_quota.h" @@ -91,20 +91,18 @@ static int ext2_vptofh (struct vnode *, struct fid *); static MALLOC_DEFINE(M_EXT2NODE, "EXT2 node", "EXT2 vnode private part"); static struct vfsops ext2fs_vfsops = { - ext2_mount, - ufs_start, /* empty function */ - ext2_unmount, - ufs_root, /* root inode via vget */ - ufs_quotactl, /* does operations associated with quotas */ - ext2_statfs, - ext2_sync, - ext2_vget, - ext2_fhtovp, - ufs_check_export, - ext2_vptofh, - ext2_init, - vfs_stduninit, - vfs_stdextattrctl, + .vfs_mount = ext2_mount, + .vfs_unmount = ext2_unmount, + .vfs_root = ufs_root, /* root inode via vget */ + .vfs_quotactl = ufs_quotactl, /* quota operations */ + .vfs_statfs = ext2_statfs, + .vfs_sync = ext2_sync, + .vfs_vget = ext2_vget, + .vfs_fhtovp = ext2_fhtovp, + .vfs_checkexp = ufs_check_export, + .vfs_vptofh = ext2_vptofh, + .vfs_init = ufs_init, + .vfs_uninit = ufs_uninit }; VFS_SET(ext2fs_vfsops, ext2fs, 0); diff --git a/sys/vfs/hpfs/hpfs_vfsops.c b/sys/vfs/hpfs/hpfs_vfsops.c index b54d3479f4..80b777c6cf 100644 --- a/sys/vfs/hpfs/hpfs_vfsops.c +++ b/sys/vfs/hpfs/hpfs_vfsops.c @@ -24,7 +24,7 @@ * SUCH DAMAGE. * * $FreeBSD: src/sys/fs/hpfs/hpfs_vfsops.c,v 1.3.2.2 2001/12/25 01:44:45 dillon Exp $ - * $DragonFly: src/sys/vfs/hpfs/hpfs_vfsops.c,v 1.27 2005/07/25 17:25:51 hmp Exp $ + * $DragonFly: src/sys/vfs/hpfs/hpfs_vfsops.c,v 1.28 2005/07/26 15:43:35 hmp Exp $ */ @@ -553,20 +553,17 @@ hpfs_vget(struct mount *mp, ino_t ino, struct vnode **vpp) } static struct vfsops hpfs_vfsops = { - hpfs_mount, - vfs_stdstart, - hpfs_unmount, - hpfs_root, - vfs_stdquotactl, - hpfs_statfs, - vfs_stdsync, - hpfs_vget, - hpfs_fhtovp, - hpfs_checkexp, - hpfs_vptofh, - hpfs_init, - hpfs_hphash_uninit, - vfs_stdextattrctl, + .vfs_mount = hpfs_mount, + .vfs_unmount = hpfs_unmount, + .vfs_root = hpfs_root, + .vfs_statfs = hpfs_statfs, + .vfs_sync = vfs_stdsync, + .vfs_vget = hpfs_vget, + .vfs_fhtovp = hpfs_fhtovp, + .vfs_checkexp = hpfs_checkexp, + .vfs_vptofh = hpfs_vptofh, + .vfs_init = hpfs_init, + .vfs_uninit = hpfs_hphash_uninit }; VFS_SET(hpfs_vfsops, hpfs, 0); diff --git a/sys/vfs/isofs/cd9660/cd9660_vfsops.c b/sys/vfs/isofs/cd9660/cd9660_vfsops.c index a3c068d4e3..7ef1487aa3 100644 --- a/sys/vfs/isofs/cd9660/cd9660_vfsops.c +++ b/sys/vfs/isofs/cd9660/cd9660_vfsops.c @@ -37,7 +37,7 @@ * * @(#)cd9660_vfsops.c 8.18 (Berkeley) 5/22/95 * $FreeBSD: src/sys/isofs/cd9660/cd9660_vfsops.c,v 1.74.2.7 2002/04/08 09:39:29 bde Exp $ - * $DragonFly: src/sys/vfs/isofs/cd9660/cd9660_vfsops.c,v 1.26 2005/04/08 03:16:18 dillon Exp $ + * $DragonFly: src/sys/vfs/isofs/cd9660/cd9660_vfsops.c,v 1.27 2005/07/26 15:43:35 hmp Exp $ */ #include @@ -80,20 +80,17 @@ static int cd9660_checkexp (struct mount *, struct sockaddr *, static int cd9660_vptofh (struct vnode *, struct fid *); static struct vfsops cd9660_vfsops = { - cd9660_mount, - vfs_stdstart, - cd9660_unmount, - cd9660_root, - vfs_stdquotactl, - cd9660_statfs, - vfs_stdsync, - cd9660_vget, - cd9660_fhtovp, - cd9660_checkexp, - cd9660_vptofh, - cd9660_init, - cd9660_uninit, - vfs_stdextattrctl, + .vfs_mount = cd9660_mount, + .vfs_unmount = cd9660_unmount, + .vfs_root = cd9660_root, + .vfs_statfs = cd9660_statfs, + .vfs_sync = vfs_stdsync, + .vfs_vget = cd9660_vget, + .vfs_fhtovp = cd9660_fhtovp, + .vfs_checkexp = cd9660_checkexp, + .vfs_vptofh = cd9660_vptofh, + .vfs_init = cd9660_init, + .vfs_uninit = cd9660_uninit, }; VFS_SET(cd9660_vfsops, cd9660, VFCF_READONLY); MODULE_VERSION(cd9660, 1); diff --git a/sys/vfs/mfs/mfs_vfsops.c b/sys/vfs/mfs/mfs_vfsops.c index f17222d796..2645393c17 100644 --- a/sys/vfs/mfs/mfs_vfsops.c +++ b/sys/vfs/mfs/mfs_vfsops.c @@ -32,7 +32,7 @@ * * @(#)mfs_vfsops.c 8.11 (Berkeley) 6/19/95 * $FreeBSD: src/sys/ufs/mfs/mfs_vfsops.c,v 1.81.2.3 2001/07/04 17:35:21 tegge Exp $ - * $DragonFly: src/sys/vfs/mfs/mfs_vfsops.c,v 1.22 2005/06/06 15:09:38 drhodus Exp $ + * $DragonFly: src/sys/vfs/mfs/mfs_vfsops.c,v 1.23 2005/07/26 15:43:35 hmp Exp $ */ @@ -106,20 +106,18 @@ static struct cdevsw mfs_cdevsw = { * mfs vfs operations. */ static struct vfsops mfs_vfsops = { - mfs_mount, - mfs_start, - ffs_unmount, - ufs_root, - ufs_quotactl, - mfs_statfs, - ffs_sync, - ffs_vget, - ffs_fhtovp, - ufs_check_export, - ffs_vptofh, - mfs_init, - vfs_stduninit, - vfs_stdextattrctl, + .vfs_mount = mfs_mount, + .vfs_start = mfs_start, + .vfs_unmount = ffs_unmount, + .vfs_root = ufs_root, + .vfs_quotactl = ufs_quotactl, + .vfs_statfs = mfs_statfs, + .vfs_sync = ffs_sync, + .vfs_vget = ffs_vget, + .vfs_fhtovp = ffs_fhtovp, + .vfs_checkexp = ufs_check_export, + .vfs_vptofh = ffs_vptofh, + .vfs_init = mfs_init }; VFS_SET(mfs_vfsops, mfs, 0); diff --git a/sys/vfs/msdosfs/msdosfs_vfsops.c b/sys/vfs/msdosfs/msdosfs_vfsops.c index bf26464fbb..e285359aeb 100644 --- a/sys/vfs/msdosfs/msdosfs_vfsops.c +++ b/sys/vfs/msdosfs/msdosfs_vfsops.c @@ -1,5 +1,5 @@ /* $FreeBSD: /usr/local/www/cvsroot/FreeBSD/src/sys/msdosfs/Attic/msdosfs_vfsops.c,v 1.60.2.8 2004/03/02 09:43:04 tjr Exp $ */ -/* $DragonFly: src/sys/vfs/msdosfs/msdosfs_vfsops.c,v 1.25 2005/04/15 19:08:19 dillon Exp $ */ +/* $DragonFly: src/sys/vfs/msdosfs/msdosfs_vfsops.c,v 1.26 2005/07/26 15:43:35 hmp Exp $ */ /* $NetBSD: msdosfs_vfsops.c,v 1.51 1997/11/17 15:36:58 ws Exp $ */ /*- @@ -888,20 +888,16 @@ msdosfs_vptofh(struct vnode *vp, struct fid *fhp) } static struct vfsops msdosfs_vfsops = { - msdosfs_mount, - vfs_stdstart, - msdosfs_unmount, - msdosfs_root, - vfs_stdquotactl, - msdosfs_statfs, - msdosfs_sync, - vfs_stdvget, - msdosfs_fhtovp, - msdosfs_checkexp, - msdosfs_vptofh, - msdosfs_init, - msdosfs_uninit, - vfs_stdextattrctl, + .vfs_mount = msdosfs_mount, + .vfs_unmount = msdosfs_unmount, + .vfs_root = msdosfs_root, + .vfs_statfs = msdosfs_statfs, + .vfs_sync = msdosfs_sync, + .vfs_fhtovp = msdosfs_fhtovp, + .vfs_checkexp = msdosfs_checkexp, + .vfs_vptofh = msdosfs_vptofh, + .vfs_init = msdosfs_init, + .vfs_uninit = msdosfs_uninit }; VFS_SET(msdosfs_vfsops, msdos, 0); diff --git a/sys/vfs/nfs/nfs_vfsops.c b/sys/vfs/nfs/nfs_vfsops.c index 66b38f9330..d0da38c78a 100644 --- a/sys/vfs/nfs/nfs_vfsops.c +++ b/sys/vfs/nfs/nfs_vfsops.c @@ -35,7 +35,7 @@ * * @(#)nfs_vfsops.c 8.12 (Berkeley) 5/20/95 * $FreeBSD: src/sys/nfs/nfs_vfsops.c,v 1.91.2.7 2003/01/27 20:04:08 dillon Exp $ - * $DragonFly: src/sys/vfs/nfs/nfs_vfsops.c,v 1.27 2005/06/06 15:09:38 drhodus Exp $ + * $DragonFly: src/sys/vfs/nfs/nfs_vfsops.c,v 1.28 2005/07/26 15:43:35 hmp Exp $ */ #include "opt_bootp.h" @@ -130,20 +130,13 @@ static int nfs_sync ( struct mount *mp, int waitfor, * nfs vfs operations. */ static struct vfsops nfs_vfsops = { - nfs_mount, - vfs_stdstart, - nfs_unmount, - nfs_root, - vfs_stdquotactl, - nfs_statfs, - nfs_sync, - vfs_stdvget, - vfs_stdfhtovp, /* shouldn't happen */ - vfs_stdcheckexp, - vfs_stdvptofh, /* shouldn't happen */ - nfs_init, - nfs_uninit, - vfs_stdextattrctl, + .vfs_mount = nfs_mount, + .vfs_unmount = nfs_unmount, + .vfs_root = nfs_root, + .vfs_statfs = nfs_statfs, + .vfs_sync = nfs_sync, + .vfs_init = nfs_init, + .vfs_uninit = nfs_uninit }; VFS_SET(nfs_vfsops, nfs, VFCF_NETWORK); diff --git a/sys/vfs/ntfs/ntfs_vfsops.c b/sys/vfs/ntfs/ntfs_vfsops.c index c187e28949..df59a020d5 100644 --- a/sys/vfs/ntfs/ntfs_vfsops.c +++ b/sys/vfs/ntfs/ntfs_vfsops.c @@ -26,7 +26,7 @@ * SUCH DAMAGE. * * $FreeBSD: src/sys/ntfs/ntfs_vfsops.c,v 1.20.2.5 2001/12/25 01:44:45 dillon Exp $ - * $DragonFly: src/sys/vfs/ntfs/ntfs_vfsops.c,v 1.27 2005/04/19 17:54:49 dillon Exp $ + * $DragonFly: src/sys/vfs/ntfs/ntfs_vfsops.c,v 1.28 2005/07/26 15:43:36 hmp Exp $ */ @@ -937,20 +937,17 @@ ntfs_vget(struct mount *mp, ino_t ino, struct vnode **vpp) #if defined(__DragonFly__) static struct vfsops ntfs_vfsops = { - ntfs_mount, - vfs_stdstart, - ntfs_unmount, - ntfs_root, - vfs_stdquotactl, - ntfs_statfs, - vfs_stdsync, - ntfs_vget, - ntfs_fhtovp, - ntfs_checkexp, - ntfs_vptofh, - ntfs_init, - ntfs_nthash_uninit, /* see ntfs_ihash.c */ - vfs_stdextattrctl, + .vfs_mount = ntfs_mount, + .vfs_unmount = ntfs_unmount, + .vfs_root = ntfs_root, + .vfs_statfs = ntfs_statfs, + .vfs_sync = vfs_stdsync, + .vfs_vget = ntfs_vget, + .vfs_fhtovp = ntfs_fhtovp, + .vfs_checkexp = ntfs_checkexp, + .vfs_vptofh = ntfs_vptofh, + .vfs_init = ntfs_init, + .vfs_uninit = ntfs_nthash_uninit /* see ntfs_ihash.c */ }; VFS_SET(ntfs_vfsops, ntfs, 0); #elif defined(__NetBSD__) diff --git a/sys/vfs/nullfs/null_vfsops.c b/sys/vfs/nullfs/null_vfsops.c index aaf5de5428..b53e62d8c6 100644 --- a/sys/vfs/nullfs/null_vfsops.c +++ b/sys/vfs/nullfs/null_vfsops.c @@ -37,7 +37,7 @@ * * @(#)lofs_vfsops.c 1.2 (Berkeley) 6/18/92 * $FreeBSD: src/sys/miscfs/nullfs/null_vfsops.c,v 1.35.2.3 2001/07/26 20:37:11 iedowse Exp $ - * $DragonFly: src/sys/vfs/nullfs/null_vfsops.c,v 1.16 2005/02/02 21:34:18 joerg Exp $ + * $DragonFly: src/sys/vfs/nullfs/null_vfsops.c,v 1.17 2005/07/26 15:43:36 hmp Exp $ */ /* @@ -68,10 +68,8 @@ static int nullfs_mount(struct mount *mp, char *path, caddr_t data, static int nullfs_quotactl(struct mount *mp, int cmd, uid_t uid, caddr_t arg, struct thread *td); static int nullfs_root(struct mount *mp, struct vnode **vpp); -static int nullfs_start(struct mount *mp, int flags, struct thread *td); static int nullfs_statfs(struct mount *mp, struct statfs *sbp, struct thread *td); -static int nullfs_sync(struct mount *mp, int waitfor, struct thread *td); static int nullfs_unmount(struct mount *mp, int mntflags, struct thread *td); static int nullfs_vget(struct mount *mp, ino_t ino, struct vnode **vpp); static int nullfs_vptofh(struct vnode *vp, struct fid *fhp); @@ -199,18 +197,6 @@ nullfs_mount(struct mount *mp, char *path, caddr_t data, struct thread *td) return (0); } -/* - * VFS start. Nothing needed here - the start routine - * on the underlying filesystem will have been called - * when that filesystem was mounted. - */ -static int -nullfs_start(struct mount *mp, int flags, struct thread *td) -{ - return (0); - /* return VFS_START(MOUNTTONULLMOUNT(mp)->nullm_vfs, flags, td); */ -} - /* * Free reference to null layer */ @@ -308,15 +294,6 @@ nullfs_statfs(struct mount *mp, struct statfs *sbp, struct thread *td) return (0); } -static int -nullfs_sync(struct mount *mp, int waitfor, struct thread *td) -{ - /* - * XXX - Assumes no data cached at null layer. - */ - return (0); -} - static int nullfs_vget(struct mount *mp, ino_t ino, struct vnode **vpp) { @@ -356,20 +333,19 @@ nullfs_extattrctl(struct mount *mp, int cmd, const char *attrname, caddr_t arg, static struct vfsops null_vfsops = { - nullfs_mount, - nullfs_start, - nullfs_unmount, - nullfs_root, - nullfs_quotactl, - nullfs_statfs, - nullfs_sync, - nullfs_vget, - nullfs_fhtovp, - nullfs_checkexp, - nullfs_vptofh, - nullfs_init, - nullfs_uninit, - nullfs_extattrctl, + .vfs_mount = nullfs_mount, + .vfs_unmount = nullfs_unmount, + .vfs_root = nullfs_root, + .vfs_quotactl = nullfs_quotactl, + .vfs_statfs = nullfs_statfs, + .vfs_sync = vfs_stdsync, + .vfs_vget = nullfs_vget, + .vfs_fhtovp = nullfs_fhtovp, + .vfs_checkexp = nullfs_checkexp, + .vfs_vptofh = nullfs_vptofh, + .vfs_init = nullfs_init, + .vfs_uninit = nullfs_uninit, + .vfs_extattrctl = nullfs_extattrctl }; VFS_SET(null_vfsops, null, VFCF_LOOPBACK); diff --git a/sys/vfs/nwfs/nwfs_vfsops.c b/sys/vfs/nwfs/nwfs_vfsops.c index c5c9dc94b3..684f23e17f 100644 --- a/sys/vfs/nwfs/nwfs_vfsops.c +++ b/sys/vfs/nwfs/nwfs_vfsops.c @@ -30,7 +30,7 @@ * SUCH DAMAGE. * * $FreeBSD: src/sys/nwfs/nwfs_vfsops.c,v 1.6.2.6 2001/10/25 19:18:54 dillon Exp $ - * $DragonFly: src/sys/vfs/nwfs/nwfs_vfsops.c,v 1.18 2005/04/20 17:01:55 dillon Exp $ + * $DragonFly: src/sys/vfs/nwfs/nwfs_vfsops.c,v 1.19 2005/07/26 15:43:36 hmp Exp $ */ #include "opt_ncp.h" #ifndef NCP @@ -70,9 +70,7 @@ SYSCTL_INT(_vfs_nwfs, OID_AUTO, version, CTLFLAG_RD, &nwfs_version, 0, ""); SYSCTL_INT(_vfs_nwfs, OID_AUTO, debuglevel, CTLFLAG_RW, &nwfs_debuglevel, 0, ""); static int nwfs_mount(struct mount *, char *, caddr_t, struct thread *); -static int nwfs_quotactl(struct mount *, int, uid_t, caddr_t, struct thread *); static int nwfs_root(struct mount *, struct vnode **); -static int nwfs_start(struct mount *, int, struct thread *); static int nwfs_statfs(struct mount *, struct statfs *, struct thread *); static int nwfs_sync(struct mount *, int, struct thread *); static int nwfs_unmount(struct mount *, int, struct thread *); @@ -80,20 +78,13 @@ static int nwfs_init(struct vfsconf *vfsp); static int nwfs_uninit(struct vfsconf *vfsp); static struct vfsops nwfs_vfsops = { - nwfs_mount, - nwfs_start, - nwfs_unmount, - nwfs_root, - nwfs_quotactl, - nwfs_statfs, - nwfs_sync, - vfs_stdvget, - vfs_stdfhtovp, /* shouldn't happen */ - vfs_stdcheckexp, - vfs_stdvptofh, /* shouldn't happen */ - nwfs_init, - nwfs_uninit, - vfs_stdextattrctl, + .vfs_mount = nwfs_mount, + .vfs_unmount = nwfs_unmount, + .vfs_root = nwfs_root, + .vfs_statfs = nwfs_statfs, + .vfs_sync = nwfs_sync, + .vfs_init = nwfs_init, + .vfs_uninit = nwfs_uninit }; @@ -368,29 +359,6 @@ nwfs_root(struct mount *mp, struct vnode **vpp) return (0); } -/* - * Vfs start routine, a no-op. - */ -/* ARGSUSED */ -static int -nwfs_start(struct mount *mp, int flags, struct thread *td) -{ - NCPVODEBUG("flags=%04x\n",flags); - return (0); -} - -/* - * Do operations associated with quotas, not supported - */ -/* ARGSUSED */ -static int -nwfs_quotactl(struct mount *mp, int cmd, uid_t uid, caddr_t arg, - struct thread *td) -{ - NCPVODEBUG("return EOPNOTSUPP\n"); - return (EOPNOTSUPP); -} - /*ARGSUSED*/ int nwfs_init(struct vfsconf *vfsp) diff --git a/sys/vfs/portal/portal_vfsops.c b/sys/vfs/portal/portal_vfsops.c index dc97443449..b96ef0fbd7 100644 --- a/sys/vfs/portal/portal_vfsops.c +++ b/sys/vfs/portal/portal_vfsops.c @@ -36,7 +36,7 @@ * @(#)portal_vfsops.c 8.11 (Berkeley) 5/14/95 * * $FreeBSD: src/sys/miscfs/portal/portal_vfsops.c,v 1.26.2.2 2001/07/26 20:37:16 iedowse Exp $ - * $DragonFly: src/sys/vfs/portal/portal_vfsops.c,v 1.15 2005/02/02 21:34:18 joerg Exp $ + * $DragonFly: src/sys/vfs/portal/portal_vfsops.c,v 1.16 2005/07/26 15:43:36 hmp Exp $ */ /* @@ -230,20 +230,11 @@ portal_statfs(struct mount *mp, struct statfs *sbp, struct thread *td) } static struct vfsops portal_vfsops = { - portal_mount, - vfs_stdstart, - portal_unmount, - portal_root, - vfs_stdquotactl, - portal_statfs, - vfs_stdsync, - vfs_stdvget, - vfs_stdfhtovp, - vfs_stdcheckexp, - vfs_stdvptofh, - vfs_stdinit, - vfs_stduninit, - vfs_stdextattrctl, + .vfs_mount = portal_mount, + .vfs_unmount = portal_unmount, + .vfs_root = portal_root, + .vfs_statfs = portal_statfs, + .vfs_sync = vfs_stdsync }; VFS_SET(portal_vfsops, portal, VFCF_SYNTHETIC); diff --git a/sys/vfs/procfs/procfs_vfsops.c b/sys/vfs/procfs/procfs_vfsops.c index 502ab58087..8e07358a06 100644 --- a/sys/vfs/procfs/procfs_vfsops.c +++ b/sys/vfs/procfs/procfs_vfsops.c @@ -37,7 +37,7 @@ * @(#)procfs_vfsops.c 8.7 (Berkeley) 5/10/95 * * $FreeBSD: src/sys/miscfs/procfs/procfs_vfsops.c,v 1.32.2.1 2001/10/15 20:42:01 des Exp $ - * $DragonFly: src/sys/vfs/procfs/procfs_vfsops.c,v 1.11 2005/02/02 21:34:18 joerg Exp $ + * $DragonFly: src/sys/vfs/procfs/procfs_vfsops.c,v 1.12 2005/07/26 15:43:36 hmp Exp $ */ /* @@ -149,20 +149,11 @@ procfs_statfs(struct mount *mp, struct statfs *sbp, struct thread *td) } static struct vfsops procfs_vfsops = { - procfs_mount, - vfs_stdstart, - procfs_unmount, - procfs_root, - vfs_stdquotactl, - procfs_statfs, - vfs_stdsync, - vfs_stdvget, - vfs_stdfhtovp, - vfs_stdcheckexp, - vfs_stdvptofh, - vfs_stdinit, - vfs_stduninit, - vfs_stdextattrctl, + .vfs_mount = procfs_mount, + .vfs_unmount = procfs_unmount, + .vfs_root = procfs_root, + .vfs_statfs = procfs_statfs, + .vfs_sync = vfs_stdsync }; VFS_SET(procfs_vfsops, procfs, VFCF_SYNTHETIC); diff --git a/sys/vfs/smbfs/smbfs_vfsops.c b/sys/vfs/smbfs/smbfs_vfsops.c index 8f4f11ef23..26446398dd 100644 --- a/sys/vfs/smbfs/smbfs_vfsops.c +++ b/sys/vfs/smbfs/smbfs_vfsops.c @@ -30,7 +30,7 @@ * SUCH DAMAGE. * * $FreeBSD: src/sys/fs/smbfs/smbfs_vfsops.c,v 1.2.2.5 2003/01/17 08:20:26 tjr Exp $ - * $DragonFly: src/sys/vfs/smbfs/smbfs_vfsops.c,v 1.21 2005/06/06 15:35:09 dillon Exp $ + * $DragonFly: src/sys/vfs/smbfs/smbfs_vfsops.c,v 1.22 2005/07/26 15:43:36 hmp Exp $ */ #include "opt_netsmb.h" #ifndef NETSMB @@ -82,9 +82,7 @@ static MALLOC_DEFINE(M_SMBFSHASH, "SMBFS hash", "SMBFS hash table"); static int smbfs_mount(struct mount *, char *, caddr_t, struct thread *); -static int smbfs_quotactl(struct mount *, int, uid_t, caddr_t, struct thread *); static int smbfs_root(struct mount *, struct vnode **); -static int smbfs_start(struct mount *, int, struct thread *); static int smbfs_statfs(struct mount *, struct statfs *, struct thread *); static int smbfs_sync(struct mount *, int, struct thread *); static int smbfs_unmount(struct mount *, int, struct thread *); @@ -100,26 +98,13 @@ static int smbfs_vptofh(struct vnode *, struct fid *); #endif static struct vfsops smbfs_vfsops = { - smbfs_mount, - smbfs_start, - smbfs_unmount, - smbfs_root, - smbfs_quotactl, - smbfs_statfs, - smbfs_sync, -#if defined(__DragonFly__) || __FreeBSD_version > 400008 - vfs_stdvget, - vfs_stdfhtovp, /* shouldn't happen */ - vfs_stdcheckexp, - vfs_stdvptofh, /* shouldn't happen */ -#else - smbfs_vget, - smbfs_fhtovp, - smbfs_vptofh, -#endif - smbfs_init, - smbfs_uninit, - vfs_stdextattrctl + .vfs_mount = smbfs_mount, + .vfs_unmount = smbfs_unmount, + .vfs_root = smbfs_root, + .vfs_statfs = smbfs_statfs, + .vfs_sync = smbfs_sync, + .vfs_init = smbfs_init, + .vfs_uninit = smbfs_uninit }; @@ -338,29 +323,6 @@ smbfs_root(struct mount *mp, struct vnode **vpp) return 0; } -/* - * Vfs start routine, a no-op. - */ -/* ARGSUSED */ -static int -smbfs_start(struct mount *mp, int flags, struct thread *td) -{ - SMBVDEBUG("flags=%04x\n", flags); - return 0; -} - -/* - * Do operations associated with quotas, not supported - */ -/* ARGSUSED */ -static int -smbfs_quotactl(struct mount *mp, int cmd, uid_t uid, caddr_t arg, - struct thread *td) -{ - SMBVDEBUG("return EOPNOTSUPP\n"); - return EOPNOTSUPP; -} - /*ARGSUSED*/ int smbfs_init(struct vfsconf *vfsp) diff --git a/sys/vfs/udf/udf_vfsops.c b/sys/vfs/udf/udf_vfsops.c index a9b41b3605..298de8431a 100644 --- a/sys/vfs/udf/udf_vfsops.c +++ b/sys/vfs/udf/udf_vfsops.c @@ -24,7 +24,7 @@ * SUCH DAMAGE. * * $FreeBSD: src/sys/fs/udf/udf_vfsops.c,v 1.16 2003/11/05 06:56:08 scottl Exp $ - * $DragonFly: src/sys/vfs/udf/udf_vfsops.c,v 1.12 2005/02/02 21:34:18 joerg Exp $ + * $DragonFly: src/sys/vfs/udf/udf_vfsops.c,v 1.13 2005/07/26 15:43:36 hmp Exp $ */ /* udf_vfsops.c */ @@ -110,20 +110,14 @@ static int udf_vptofh(struct vnode *, struct fid *); static int udf_find_partmaps(struct udf_mnt *, struct logvol_desc *); static struct vfsops udf_vfsops = { - udf_mount, - vfs_stdstart, - udf_unmount, - udf_root, - vfs_stdquotactl, - udf_statfs, - vfs_stdsync, - udf_vget, - udf_fhtovp, - vfs_stdcheckexp, - udf_vptofh, - vfs_stdinit, - vfs_stduninit, - vfs_stdextattrctl, + .vfs_mount = udf_mount, + .vfs_unmount = udf_unmount, + .vfs_root = udf_root, + .vfs_statfs = udf_statfs, + .vfs_sync = vfs_stdsync, + .vfs_vget = udf_vget, + .vfs_fhtovp = udf_fhtovp, + .vfs_vptofh = udf_vptofh }; VFS_SET(udf_vfsops, udf, VFCF_READONLY); diff --git a/sys/vfs/ufs/ffs_vfsops.c b/sys/vfs/ufs/ffs_vfsops.c index 3eb048c409..b273bbf286 100644 --- a/sys/vfs/ufs/ffs_vfsops.c +++ b/sys/vfs/ufs/ffs_vfsops.c @@ -32,7 +32,7 @@ * * @(#)ffs_vfsops.c 8.31 (Berkeley) 5/20/95 * $FreeBSD: src/sys/ufs/ffs/ffs_vfsops.c,v 1.117.2.10 2002/06/23 22:34:52 iedowse Exp $ - * $DragonFly: src/sys/vfs/ufs/ffs_vfsops.c,v 1.32 2005/04/15 19:08:32 dillon Exp $ + * $DragonFly: src/sys/vfs/ufs/ffs_vfsops.c,v 1.33 2005/07/26 15:43:36 hmp Exp $ */ #include "opt_quota.h" @@ -71,20 +71,18 @@ static int ffs_mount (struct mount *, char *, caddr_t, struct thread *); static int ffs_init (struct vfsconf *); static struct vfsops ufs_vfsops = { - ffs_mount, - ufs_start, - ffs_unmount, - ufs_root, - ufs_quotactl, - ffs_statfs, - ffs_sync, - ffs_vget, - ffs_fhtovp, - ufs_check_export, - ffs_vptofh, - ffs_init, - vfs_stduninit, - vfs_stdextattrctl, + .vfs_mount = ffs_mount, + .vfs_unmount = ffs_unmount, + .vfs_root = ufs_root, + .vfs_quotactl = ufs_quotactl, + .vfs_statfs = ffs_statfs, + .vfs_sync = ffs_sync, + .vfs_vget = ffs_vget, + .vfs_fhtovp = ffs_fhtovp, + .vfs_checkexp = ufs_check_export, + .vfs_vptofh = ffs_vptofh, + .vfs_init = ffs_init, + .vfs_uninit = ufs_uninit }; VFS_SET(ufs_vfsops, ufs, 0); diff --git a/sys/vfs/ufs/ufs_extern.h b/sys/vfs/ufs/ufs_extern.h index 86b974b920..205b768069 100644 --- a/sys/vfs/ufs/ufs_extern.h +++ b/sys/vfs/ufs/ufs_extern.h @@ -32,7 +32,7 @@ * * @(#)ufs_extern.h 8.10 (Berkeley) 5/14/95 * $FreeBSD: src/sys/ufs/ufs/ufs_extern.h,v 1.27.2.1 2000/12/28 11:01:46 ps Exp $ - * $DragonFly: src/sys/vfs/ufs/ufs_extern.h,v 1.11 2005/01/20 18:08:54 dillon Exp $ + * $DragonFly: src/sys/vfs/ufs/ufs_extern.h,v 1.12 2005/07/26 15:43:36 hmp Exp $ */ #ifndef _UFS_UFS_EXTERN_H_ @@ -86,6 +86,7 @@ struct vnode * void ufs_ihashrem(struct inode *); int ufs_inactive(struct vop_inactive_args *); int ufs_init(struct vfsconf *); +int ufs_uninit(struct vfsconf *); void ufs_itimes(struct vnode *vp); int ufs_lookup(struct vop_lookup_args *); int ufs_reclaim(struct vop_reclaim_args *); diff --git a/sys/vfs/ufs/ufs_ihash.c b/sys/vfs/ufs/ufs_ihash.c index 792a1bf27b..3d6d528851 100644 --- a/sys/vfs/ufs/ufs_ihash.c +++ b/sys/vfs/ufs/ufs_ihash.c @@ -32,7 +32,7 @@ * * @(#)ufs_ihash.c 8.7 (Berkeley) 5/17/95 * $FreeBSD: src/sys/ufs/ufs/ufs_ihash.c,v 1.20 1999/08/28 00:52:29 peter Exp $ - * $DragonFly: src/sys/vfs/ufs/ufs_ihash.c,v 1.15 2005/01/20 18:08:54 dillon Exp $ + * $DragonFly: src/sys/vfs/ufs/ufs_ihash.c,v 1.16 2005/07/26 15:43:36 hmp Exp $ */ #include @@ -71,6 +71,18 @@ ufs_ihashinit(void) lwkt_token_init(&ufs_ihash_token); } +int +ufs_uninit(struct vfsconf *vfc) +{ + lwkt_tokref ilock; + + lwkt_gettoken(&ilock, &ufs_ihash_token); + if (ihashtbl) + free(ihashtbl, M_UFSIHASH); + lwkt_reltoken(&ilock); + + return (0); +} /* * Use the device/inum pair to find the incore inode, and return a pointer * to it. If it is in core, return it, even if it is locked. diff --git a/sys/vfs/ufs/ufs_vfsops.c b/sys/vfs/ufs/ufs_vfsops.c index 0874a0a242..ce3593cf0c 100644 --- a/sys/vfs/ufs/ufs_vfsops.c +++ b/sys/vfs/ufs/ufs_vfsops.c @@ -37,7 +37,7 @@ * * @(#)ufs_vfsops.c 8.8 (Berkeley) 5/20/95 * $FreeBSD: src/sys/ufs/ufs/ufs_vfsops.c,v 1.17.2.3 2001/10/14 19:08:16 iedowse Exp $ - * $DragonFly: src/sys/vfs/ufs/ufs_vfsops.c,v 1.10 2005/04/19 17:54:50 dillon Exp $ + * $DragonFly: src/sys/vfs/ufs/ufs_vfsops.c,v 1.11 2005/07/26 15:43:36 hmp Exp $ */ #include "opt_quota.h" @@ -55,17 +55,6 @@ #include "ufs_extern.h" MALLOC_DEFINE(M_UFSMNT, "UFS mount", "UFS mount structure"); -/* - * Make a filesystem operational. - * Nothing to do at the moment. - */ -/* ARGSUSED */ -int -ufs_start(struct mount *mp, int flags, struct thread *td) -{ - return (0); -} - /* * Return the root of a filesystem. */ diff --git a/sys/vfs/umapfs/umap_vfsops.c b/sys/vfs/umapfs/umap_vfsops.c index 680ebfe5eb..f10e6621bf 100644 --- a/sys/vfs/umapfs/umap_vfsops.c +++ b/sys/vfs/umapfs/umap_vfsops.c @@ -36,7 +36,7 @@ * @(#)umap_vfsops.c 8.8 (Berkeley) 5/14/95 * * $FreeBSD: src/sys/miscfs/umapfs/umap_vfsops.c,v 1.31.2.2 2001/09/11 09:49:53 kris Exp $ - * $DragonFly: src/sys/vfs/umapfs/Attic/umap_vfsops.c,v 1.16 2005/02/02 21:34:19 joerg Exp $ + * $DragonFly: src/sys/vfs/umapfs/Attic/umap_vfsops.c,v 1.17 2005/07/26 15:43:36 hmp Exp $ */ /* @@ -68,11 +68,8 @@ static int umapfs_mount (struct mount *mp, char *path, caddr_t data, static int umapfs_quotactl (struct mount *mp, int cmd, uid_t uid, caddr_t arg, struct thread *td); static int umapfs_root (struct mount *mp, struct vnode **vpp); -static int umapfs_start (struct mount *mp, int flags, struct thread *td); static int umapfs_statfs (struct mount *mp, struct statfs *sbp, struct thread *td); -static int umapfs_sync (struct mount *mp, int waitfor, - struct thread *td); static int umapfs_unmount (struct mount *mp, int mntflags, struct thread *td); static int umapfs_vget (struct mount *mp, ino_t ino, @@ -236,18 +233,6 @@ umapfs_mount(struct mount *mp, char *path, caddr_t data, struct thread *td) return (0); } -/* - * VFS start. Nothing needed here - the start routine - * on the underlying filesystem will have been called - * when that filesystem was mounted. - */ -static int -umapfs_start(struct mount *mp, int flags, struct thread *td) -{ - return (0); - /* return (VFS_START(MOUNTTOUMAPMOUNT(mp)->umapm_vfs, flags, p)); */ -} - /* * Free reference to umap layer */ @@ -351,15 +336,6 @@ umapfs_statfs(struct mount *mp, struct statfs *sbp, struct thread *td) return (0); } -static int -umapfs_sync(struct mount *mp, int waitfor, struct thread *td) -{ - /* - * XXX - Assumes no data cached at umap layer. - */ - return (0); -} - static int umapfs_vget(struct mount *mp, ino_t ino, struct vnode **vpp) { @@ -399,20 +375,18 @@ umapfs_extattrctl(struct mount *mp, int cmd, const char *attrname, static struct vfsops umap_vfsops = { - umapfs_mount, - umapfs_start, - umapfs_unmount, - umapfs_root, - umapfs_quotactl, - umapfs_statfs, - umapfs_sync, - umapfs_vget, - umapfs_fhtovp, - umapfs_checkexp, - umapfs_vptofh, - umapfs_init, - vfs_stduninit, - umapfs_extattrctl, + .vfs_mount = umapfs_mount, + .vfs_unmount = umapfs_unmount, + .vfs_root = umapfs_root, + .vfs_quotactl = umapfs_quotactl, + .vfs_statfs = umapfs_statfs, + .vfs_sync = vfs_stdsync, + .vfs_vget = umapfs_vget, + .vfs_fhtovp = umapfs_fhtovp, + .vfs_checkexp = umapfs_checkexp, + .vfs_vptofh = umapfs_vptofh, + .vfs_init = umapfs_init, + .vfs_extattrctl = umapfs_extattrctl }; VFS_SET(umap_vfsops, umap, VFCF_LOOPBACK); diff --git a/sys/vfs/union/union_vfsops.c b/sys/vfs/union/union_vfsops.c index cfd50c70aa..76ff818c71 100644 --- a/sys/vfs/union/union_vfsops.c +++ b/sys/vfs/union/union_vfsops.c @@ -36,7 +36,7 @@ * * @(#)union_vfsops.c 8.20 (Berkeley) 5/20/95 * $FreeBSD: src/sys/miscfs/union/union_vfsops.c,v 1.39.2.2 2001/10/25 19:18:53 dillon Exp $ - * $DragonFly: src/sys/vfs/union/union_vfsops.c,v 1.19 2005/02/02 21:34:19 joerg Exp $ + * $DragonFly: src/sys/vfs/union/union_vfsops.c,v 1.20 2005/07/26 15:43:36 hmp Exp $ */ /* @@ -447,20 +447,12 @@ union_statfs(struct mount *mp, struct statfs *sbp, struct thread *td) } static struct vfsops union_vfsops = { - union_mount, - vfs_stdstart, /* underlying start already done */ - union_unmount, - union_root, - vfs_stdquotactl, - union_statfs, - vfs_stdsync, /* XXX assumes no cached data on union level */ - vfs_stdvget, - vfs_stdfhtovp, - vfs_stdcheckexp, - vfs_stdvptofh, - union_init, - vfs_stduninit, - vfs_stdextattrctl, + .vfs_mount = union_mount, + .vfs_unmount = union_unmount, + .vfs_root = union_root, + .vfs_statfs = union_statfs, + .vfs_sync = vfs_stdsync, + .vfs_init = union_init }; VFS_SET(union_vfsops, union, VFCF_LOOPBACK); -- 2.41.0