Remove several layers in the vnode operations vector init code. Declare
authorMatthew Dillon <dillon@dragonflybsd.org>
Tue, 18 Jul 2006 22:22:16 +0000 (22:22 +0000)
committerMatthew Dillon <dillon@dragonflybsd.org>
Tue, 18 Jul 2006 22:22:16 +0000 (22:22 +0000)
the operations vector directly instead of via a descriptor array.  Remove
most of the recalculation code, it stopped being needed over a year ago.

This work is similar to what FreeBSD now does, but was developed along a
different line.  Ultimately our vop_ops will become SYSLINK ops for userland
VFS and clustering support.

52 files changed:
sys/emulation/linux/i386/linprocfs/linprocfs_vfsops.c
sys/emulation/linux/i386/linprocfs/linprocfs_vnops.c
sys/kern/vfs_default.c
sys/kern/vfs_init.c
sys/kern/vfs_jops.c
sys/kern/vfs_mount.c
sys/kern/vfs_subr.c
sys/kern/vfs_sync.c
sys/kern/vfs_syscalls.c
sys/kern/vfs_vopops.c
sys/sys/mount.h
sys/sys/vfsops.h
sys/sys/vnode.h
sys/vfs/coda/coda_vnops.c
sys/vfs/deadfs/dead_vnops.c
sys/vfs/fdesc/fdesc_vfsops.c
sys/vfs/fdesc/fdesc_vnops.c
sys/vfs/fifofs/fifo.h
sys/vfs/fifofs/fifo_vnops.c
sys/vfs/gnu/ext2fs/ext2_vfsops.c
sys/vfs/gnu/ext2fs/ext2_vnops.c
sys/vfs/hpfs/hpfs_vfsops.c
sys/vfs/hpfs/hpfs_vnops.c
sys/vfs/isofs/cd9660/cd9660_vfsops.c
sys/vfs/isofs/cd9660/cd9660_vnops.c
sys/vfs/mfs/mfs_vfsops.c
sys/vfs/mfs/mfs_vnops.c
sys/vfs/msdosfs/msdosfs_vfsops.c
sys/vfs/msdosfs/msdosfs_vnops.c
sys/vfs/nfs/nfs_vfsops.c
sys/vfs/nfs/nfs_vnops.c
sys/vfs/ntfs/ntfs_vfsops.c
sys/vfs/ntfs/ntfs_vnops.c
sys/vfs/nullfs/null_vfsops.c
sys/vfs/nullfs/null_vnops.c
sys/vfs/nwfs/nwfs_vfsops.c
sys/vfs/nwfs/nwfs_vnops.c
sys/vfs/portal/portal_vfsops.c
sys/vfs/portal/portal_vnops.c
sys/vfs/procfs/procfs_vfsops.c
sys/vfs/procfs/procfs_vnops.c
sys/vfs/smbfs/smbfs_vfsops.c
sys/vfs/smbfs/smbfs_vnops.c
sys/vfs/specfs/spec_vnops.c
sys/vfs/udf/udf_vfsops.c
sys/vfs/udf/udf_vnops.c
sys/vfs/ufs/ffs_vfsops.c
sys/vfs/ufs/ffs_vnops.c
sys/vfs/ufs/ufs_vnops.c
sys/vfs/union/union_vfsops.c
sys/vfs/union/union_vnops.c
sys/vm/vm_swap.c

index 8d7f2db..450bdbf 100644 (file)
@@ -39,7 +39,7 @@
  *     @(#)procfs_vfsops.c     8.7 (Berkeley) 5/10/95
  *
  * $FreeBSD: src/sys/i386/linux/linprocfs/linprocfs_vfsops.c,v 1.2.2.3 2001/10/15 20:42:01 des Exp $
- * $DragonFly: src/sys/emulation/linux/i386/linprocfs/linprocfs_vfsops.c,v 1.12 2006/05/06 18:48:51 dillon Exp $
+ * $DragonFly: src/sys/emulation/linux/i386/linprocfs/linprocfs_vfsops.c,v 1.13 2006/07/18 22:22:11 dillon Exp $
  */
 
 /*
@@ -55,7 +55,7 @@
 #include <sys/vnode.h>
 #include "linprocfs.h"
 
-extern struct vnodeopv_entry_desc linprocfs_vnodeop_entries[];
+extern struct vop_ops linprocfs_vnode_vops;
 
 static int     linprocfs_mount (struct mount *mp, char *path, caddr_t data,
                                  struct ucred *cred);
@@ -87,8 +87,7 @@ linprocfs_mount(struct mount *mp, char *path, caddr_t data, struct ucred *cred)
        mp->mnt_data = 0;
        vfs_getnewfsid(mp);
 
-       vfs_add_vnodeops(mp, &mp->mnt_vn_norm_ops, 
-                        linprocfs_vnodeop_entries, 0);
+       vfs_add_vnodeops(mp, &linprocfs_vnode_vops, &mp->mnt_vn_norm_ops);
 
        size = sizeof("linprocfs") - 1;
        bcopy("linprocfs", mp->mnt_stat.f_mntfromname, size);
index a0caef0..40f5235 100644 (file)
@@ -39,7 +39,7 @@
  *     @(#)procfs_vnops.c      8.18 (Berkeley) 5/21/95
  *
  * $FreeBSD: src/sys/i386/linux/linprocfs/linprocfs_vnops.c,v 1.3.2.5 2001/08/12 14:29:19 rwatson Exp $
- * $DragonFly: src/sys/emulation/linux/i386/linprocfs/linprocfs_vnops.c,v 1.31 2006/05/24 17:44:01 dillon Exp $
+ * $DragonFly: src/sys/emulation/linux/i386/linprocfs/linprocfs_vnops.c,v 1.32 2006/07/18 22:22:11 dillon Exp $
  */
 
 /*
@@ -69,7 +69,7 @@
 extern struct vnode *procfs_findtextvp (struct proc *);
 
 static int     linprocfs_access (struct vop_access_args *);
-static int     linprocfs_badop (void);
+static int     linprocfs_badop (struct vop_generic_args *);
 static int     linprocfs_bmap (struct vop_bmap_args *);
 static int     linprocfs_close (struct vop_close_args *);
 static int     linprocfs_getattr (struct vop_getattr_args *);
@@ -86,6 +86,38 @@ static int   linprocfs_setattr (struct vop_setattr_args *);
 static int     linprocfs_readdir_proc(struct vop_readdir_args *);
 static int     linprocfs_readdir_root(struct vop_readdir_args *);
 
+/*
+ * procfs vnode operations.
+ */
+struct vop_ops linprocfs_vnode_vops = {
+       .vop_default =          vop_defaultop,
+       .vop_access =           linprocfs_access,
+       .vop_advlock =          (void *)linprocfs_badop,
+       .vop_bmap =             linprocfs_bmap,
+       .vop_close =            linprocfs_close,
+       .vop_old_create =       (void *)linprocfs_badop,
+       .vop_getattr =          linprocfs_getattr,
+       .vop_inactive =         linprocfs_inactive,
+       .vop_old_link =         (void *)linprocfs_badop,
+       .vop_old_lookup =       linprocfs_lookup,
+       .vop_old_mkdir =        (void *)linprocfs_badop,
+       .vop_old_mknod =        (void *)linprocfs_badop,
+       .vop_open =             linprocfs_open,
+       .vop_pathconf =         vop_stdpathconf,
+       .vop_print =            linprocfs_print,
+       .vop_read =             (void *)linprocfs_rw,
+       .vop_readdir =          linprocfs_readdir,
+       .vop_readlink =         linprocfs_readlink,
+       .vop_reclaim =          linprocfs_reclaim,
+       .vop_old_remove =       (void *)linprocfs_badop,
+       .vop_old_rename =       (void *)linprocfs_badop,
+       .vop_old_rmdir =        (void *)linprocfs_badop,
+       .vop_setattr =          linprocfs_setattr,
+       .vop_old_symlink =      (void *)linprocfs_badop,
+       .vop_write =            (void *)linprocfs_rw,
+       .vop_ioctl =            linprocfs_ioctl
+};
+
 /*
  * This is a list of the valid names in the
  * process-specific sub-directories.  It is
@@ -353,7 +385,7 @@ linprocfs_print(struct vop_print_args *ap)
  * generic entry point for unsupported operations
  */
 static int
-linprocfs_badop(void)
+linprocfs_badop(struct vop_generic_args *ap __unused)
 {
 
        return (EIO);
@@ -1048,35 +1080,3 @@ atopid(const char *b, u_int len)
        return (p);
 }
 
-/*
- * procfs vnode operations.
- */
-struct vnodeopv_entry_desc linprocfs_vnodeop_entries[] = {
-       { &vop_default_desc,            (vnodeopv_entry_t)vop_defaultop },
-       { &vop_access_desc,             (vnodeopv_entry_t)linprocfs_access },
-       { &vop_advlock_desc,            (vnodeopv_entry_t)linprocfs_badop },
-       { &vop_bmap_desc,               (vnodeopv_entry_t)linprocfs_bmap },
-       { &vop_close_desc,              (vnodeopv_entry_t)linprocfs_close },
-       { &vop_old_create_desc,         (vnodeopv_entry_t)linprocfs_badop },
-       { &vop_getattr_desc,            (vnodeopv_entry_t)linprocfs_getattr },
-       { &vop_inactive_desc,           (vnodeopv_entry_t)linprocfs_inactive },
-       { &vop_old_link_desc,           (vnodeopv_entry_t)linprocfs_badop },
-       { &vop_old_lookup_desc,         (vnodeopv_entry_t)linprocfs_lookup },
-       { &vop_old_mkdir_desc,          (vnodeopv_entry_t)linprocfs_badop },
-       { &vop_old_mknod_desc,          (vnodeopv_entry_t)linprocfs_badop },
-       { &vop_open_desc,               (vnodeopv_entry_t)linprocfs_open },
-       { &vop_pathconf_desc,           (vnodeopv_entry_t)vop_stdpathconf },
-       { &vop_print_desc,              (vnodeopv_entry_t)linprocfs_print },
-       { &vop_read_desc,               (vnodeopv_entry_t)linprocfs_rw },
-       { &vop_readdir_desc,            (vnodeopv_entry_t)linprocfs_readdir },
-       { &vop_readlink_desc,           (vnodeopv_entry_t)linprocfs_readlink },
-       { &vop_reclaim_desc,            (vnodeopv_entry_t)linprocfs_reclaim },
-       { &vop_old_remove_desc,         (vnodeopv_entry_t)linprocfs_badop },
-       { &vop_old_rename_desc,         (vnodeopv_entry_t)linprocfs_badop },
-       { &vop_old_rmdir_desc,          (vnodeopv_entry_t)linprocfs_badop },
-       { &vop_setattr_desc,            (vnodeopv_entry_t)linprocfs_setattr },
-       { &vop_old_symlink_desc,        (vnodeopv_entry_t)linprocfs_badop },
-       { &vop_write_desc,              (vnodeopv_entry_t)linprocfs_rw },
-       { &vop_ioctl_desc,              (vnodeopv_entry_t)linprocfs_ioctl },
-       { NULL, NULL }
-};
index 7fd3419..c776c2a 100644 (file)
@@ -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.40 2006/05/06 18:48:52 dillon Exp $
+ * $DragonFly: src/sys/kern/vfs_default.c,v 1.41 2006/07/18 22:22:12 dillon Exp $
  */
 
 #include <sys/param.h>
@@ -74,49 +74,44 @@ static int  vop_nostrategy (struct vop_strategy_args *);
  *
  * If there is no specific entry here, we will return EOPNOTSUPP.
  */
-struct vop_ops *default_vnode_vops;
-static struct vnodeopv_entry_desc default_vnodeop_entries[] = {
-       { &vop_default_desc,            vop_eopnotsupp },
-       { &vop_advlock_desc,            vop_einval },
-       { &vop_fsync_desc,              vop_null },
-       { &vop_ioctl_desc,              vop_enotty },
-       { &vop_islocked_desc,           (void *) vop_stdislocked },
-       { &vop_lock_desc,               (void *) vop_stdlock },
-       { &vop_mmap_desc,               vop_einval },
-       { &vop_old_lookup_desc,         (void *) vop_nolookup },
-       { &vop_open_desc,               (void *) vop_stdopen },
-       { &vop_close_desc,              (void *) vop_stdclose },
-       { &vop_pathconf_desc,           vop_einval },
-       { &vop_poll_desc,               (void *) vop_nopoll },
-       { &vop_readlink_desc,           vop_einval },
-       { &vop_reallocblks_desc,        vop_eopnotsupp },
-       { &vop_revoke_desc,             (void *) vop_stdrevoke },
-       { &vop_strategy_desc,           (void *) vop_nostrategy },
-       { &vop_unlock_desc,             (void *) vop_stdunlock },
-       { &vop_getacl_desc,             vop_eopnotsupp },
-       { &vop_setacl_desc,             vop_eopnotsupp },
-       { &vop_aclcheck_desc,           vop_eopnotsupp },
-       { &vop_getextattr_desc,         vop_eopnotsupp },
-       { &vop_setextattr_desc,         vop_eopnotsupp },
-       { &vop_nresolve_desc,           (void *) vop_compat_nresolve },
-       { &vop_nlookupdotdot_desc,      (void *) vop_compat_nlookupdotdot },
-       { &vop_ncreate_desc,            (void *) vop_compat_ncreate },
-       { &vop_nmkdir_desc,             (void *) vop_compat_nmkdir },
-       { &vop_nmknod_desc,             (void *) vop_compat_nmknod },
-       { &vop_nlink_desc,              (void *) vop_compat_nlink },
-       { &vop_nsymlink_desc,           (void *) vop_compat_nsymlink },
-       { &vop_nwhiteout_desc,          (void *) vop_compat_nwhiteout },
-       { &vop_nremove_desc,            (void *) vop_compat_nremove },
-       { &vop_nrmdir_desc,             (void *) vop_compat_nrmdir },
-       { &vop_nrename_desc,            (void *) vop_compat_nrename },
-       { &vop_mountctl_desc,           (void *) journal_mountctl },
-       { NULL, NULL }
+struct vop_ops default_vnode_vops = {
+       .vop_default            = vop_eopnotsupp,
+       .vop_advlock            = (void *)vop_einval,
+       .vop_fsync              = (void *)vop_null,
+       .vop_ioctl              = (void *)vop_enotty,
+       .vop_islocked           = vop_stdislocked,
+       .vop_lock               = vop_stdlock,
+       .vop_mmap               = (void *)vop_einval,
+       .vop_old_lookup         = vop_nolookup,
+       .vop_open               = vop_stdopen,
+       .vop_close              = vop_stdclose,
+       .vop_pathconf           = (void *)vop_einval,
+       .vop_poll               = vop_nopoll,
+       .vop_readlink           = (void *)vop_einval,
+       .vop_reallocblks        = (void *)vop_eopnotsupp,
+       .vop_revoke             = vop_stdrevoke,
+       .vop_strategy           = vop_nostrategy,
+       .vop_unlock             = vop_stdunlock,
+       .vop_getacl             = (void *)vop_eopnotsupp,
+       .vop_setacl             = (void *)vop_eopnotsupp,
+       .vop_aclcheck           = (void *)vop_eopnotsupp,
+       .vop_getextattr         = (void *)vop_eopnotsupp,
+       .vop_setextattr         = (void *)vop_eopnotsupp,
+       .vop_nresolve           = vop_compat_nresolve,
+       .vop_nlookupdotdot      = vop_compat_nlookupdotdot,
+       .vop_ncreate            = vop_compat_ncreate,
+       .vop_nmkdir             = vop_compat_nmkdir,
+       .vop_nmknod             = vop_compat_nmknod,
+       .vop_nlink              = vop_compat_nlink,
+       .vop_nsymlink           = vop_compat_nsymlink,
+       .vop_nwhiteout          = vop_compat_nwhiteout,
+       .vop_nremove            = vop_compat_nremove,
+       .vop_nrmdir             = vop_compat_nrmdir,
+       .vop_nrename            = vop_compat_nrename,
+       .vop_mountctl           = journal_mountctl
 };
 
-static struct vnodeopv_desc default_vnodeop_opv_desc =
-        { &default_vnode_vops, default_vnodeop_entries, 0 };
-
-VNODEOP_SET(default_vnodeop_opv_desc);
+VNODEOP_SET(default_vnode_vops);
 
 int
 vop_eopnotsupp(struct vop_generic_args *ap)
@@ -151,7 +146,7 @@ vop_null(struct vop_generic_args *ap)
 int
 vop_defaultop(struct vop_generic_args *ap)
 {
-       return (VOCALL(default_vnode_vops, ap));
+       return (VOCALL(&default_vnode_vops, ap));
 }
 
 int
index 1d5f301..abac355 100644 (file)
@@ -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.12 2006/06/01 06:10:50 dillon Exp $
+ * $DragonFly: src/sys/kern/vfs_init.c,v 1.13 2006/07/18 22:22:12 dillon Exp $
  */
 /*
  * Manage vnode VOP operations vectors
@@ -100,62 +100,47 @@ int maxvfsconf;
 struct vfsconf *vfsconf;
 
 static TAILQ_HEAD(, vnodeopv_node) vnodeopv_list;
-static void vfs_recalc_vnodeops(void);
+static void vfs_calc_vnodeops(struct vop_ops *ops);
 
 /*
  * Add a vnode operations (vnops) vector to the global list.
  */
 void
-vfs_add_vnodeops_sysinit(const void *data)
+vfs_nadd_vnodeops_sysinit(void *data)
 {
-       const struct vnodeopv_desc *vdesc = data;
+       struct vop_ops *ops = data;
 
-       vfs_add_vnodeops(NULL, vdesc->opv_desc_vector, 
-                        vdesc->opv_desc_ops, vdesc->opv_flags);
+       vfs_add_vnodeops(NULL, ops, NULL);      /* mount, template, newcopy */
 }
 
 /*
  * Unlink previously added vnode operations vector.
  */
 void
-vfs_rm_vnodeops_sysinit(const void *data)
+vfs_nrm_vnodeops_sysinit(void *data)
 {
-       const struct vnodeopv_desc *vdesc = data;
+       struct vop_ops *ops = data;
 
-       vfs_rm_vnodeops(vdesc->opv_desc_vector);
+       vfs_rm_vnodeops(NULL, ops, NULL);
 }
 
 void
-vfs_add_vnodeops(struct mount *mp, struct vop_ops **vops_pp,
-               struct vnodeopv_entry_desc *descs, int flags)
+vfs_add_vnodeops(struct mount *mp, struct vop_ops *template,
+                struct vop_ops **ops_pp)
 {
-       struct vnodeopv_node *node;
        struct vop_ops *ops;
 
-       node = malloc(sizeof(*node), M_VNODEOP, M_ZERO|M_WAITOK);
-       KKASSERT(*vops_pp == NULL);
-       if ((ops = *vops_pp) == NULL) {
-               ops = malloc(sizeof(struct vop_ops),
-                               M_VNODEOP, M_ZERO|M_WAITOK);
-               *vops_pp = ops;
+       if (ops_pp) {
+               KKASSERT(*ops_pp == NULL);
+               *ops_pp = malloc(sizeof(*ops), M_VNODEOP, M_WAITOK);
+               ops = *ops_pp;
+               bcopy(template, ops, sizeof(*ops));
+       } else {
+               ops = template;
        }
-       node->ops = ops;
-       node->descs = descs;
-       ops->vv_mount = mp;
-       ops->vv_flags |= flags;
 
-       /*
-        * Journal and coherency ops inherit normal ops flags
-        */
-       if (vops_pp == &mp->mnt_vn_coherency_ops && mp->mnt_vn_norm_ops)
-           ops->vv_flags |= mp->mnt_vn_norm_ops->vv_flags;
-       if (vops_pp == &mp->mnt_vn_journal_ops && mp->mnt_vn_norm_ops)
-           ops->vv_flags |= mp->mnt_vn_norm_ops->vv_flags;
-
-       ++ops->vv_refs;
-       TAILQ_INSERT_TAIL(&vnodeopv_list, node, entry);
-
-       vfs_recalc_vnodeops();
+       vfs_calc_vnodeops(ops);
+       ops->head.vv_mount = mp;
 
        if (mp) {
                if (mp->mnt_vn_coherency_ops)
@@ -167,99 +152,53 @@ vfs_add_vnodeops(struct mount *mp, struct vop_ops **vops_pp,
        }
 }
 
+/*
+ * Remove a previously installed operations vector.
+ *
+ * NOTE: Either template or ops_pp may be NULL, but not both.
+ */
 void
-vfs_rm_vnodeops(struct vop_ops **vops_pp)
+vfs_rm_vnodeops(struct mount *mp, struct vop_ops *template,
+               struct vop_ops **ops_pp)
 {
-       struct vop_ops *ops = *vops_pp;
-       struct vnodeopv_node *node;
-       struct mount *mp;
-
-       if (ops == NULL)
-               return;
+       struct vop_ops *ops;
 
-       TAILQ_FOREACH(node, &vnodeopv_list, entry) {
-               if (node->ops == ops)
-                       break;
+       if (ops_pp) {
+               ops = *ops_pp;
+               *ops_pp = NULL;
+       } else {
+               ops = template;
        }
-       if (node == NULL) {
-               printf("vfs_rm_vnodeops: unable to find ops: %p\n", ops);
+       if (ops == NULL)
                return;
+       KKASSERT(mp == ops->head.vv_mount);
+       if (mp) {
+               if (mp->mnt_vn_coherency_ops)
+                       mp->mnt_vn_use_ops = mp->mnt_vn_coherency_ops;
+               else if (mp->mnt_vn_journal_ops)
+                       mp->mnt_vn_use_ops = mp->mnt_vn_journal_ops;
+               else
+                       mp->mnt_vn_use_ops = mp->mnt_vn_norm_ops;
        }
-       TAILQ_REMOVE(&vnodeopv_list, node, entry);
-       free(node, M_VNODEOP);
-       KKASSERT(ops != NULL && ops->vv_refs > 0);
-       if (--ops->vv_refs == 0) {
-               *vops_pp = NULL;
-               if ((mp = ops->vv_mount) != NULL) {
-                       if (mp->mnt_vn_coherency_ops)
-                               mp->mnt_vn_use_ops = mp->mnt_vn_coherency_ops;
-                       else if (mp->mnt_vn_journal_ops)
-                               mp->mnt_vn_use_ops = mp->mnt_vn_journal_ops;
-                       else
-                               mp->mnt_vn_use_ops = mp->mnt_vn_norm_ops;
-               }
+       if (ops_pp)
                free(ops, M_VNODEOP);
-       }
-       vfs_recalc_vnodeops();
 }
 
 /*
- * Recalculate VFS operations vectors
+ * Calculate the VFS operations vector array.  This function basically
+ * replaces any NULL entry with the default entry.
  */
 static void
-vfs_recalc_vnodeops(void)
+vfs_calc_vnodeops(struct vop_ops *ops)
 {
-       struct vnodeopv_node *node;
-       struct vnodeopv_entry_desc *desc;
-       struct vop_ops *ops;
-       struct vop_ops *vnew;
        int off;
 
-       /*
-        * Because vop_ops may be active we can't just blow them away, we
-        * have to generate new vop_ops and then copy them into the running
-        * vop_ops.  Any missing entries will be assigned to the default
-        * entry.  If the default entry itself is missing it will be assigned
-        * to vop_eopnotsupp.
-        */
-       TAILQ_FOREACH(node, &vnodeopv_list, entry) {
-               ops = node->ops;
-               if ((vnew = ops->vv_new) == NULL) {
-                       vnew = malloc(sizeof(struct vop_ops),
-                                       M_VNODEOP, M_ZERO|M_WAITOK);
-                       ops->vv_new = vnew;
-                       vnew->vop_default = vop_eopnotsupp;
-               }
-               for (desc = node->descs; desc->opve_op; ++desc) {
-                       off = desc->opve_op->vdesc_offset;
-                       *(void **)((char *)vnew + off) = desc->opve_func;
-               }
-               for (off = __offsetof(struct vop_ops, vop_ops_first_field);
-                    off <= __offsetof(struct vop_ops, vop_ops_last_field);
-                    off += sizeof(void **)
-               ) {
-                       if (*(void **)((char *)vnew + off) == NULL)
-                           *(void **)((char *)vnew + off) = vnew->vop_default;
-               }
-       }
-
-       /*
-        * Copy the temporary ops into the running configuration and then
-        * delete them.
-        */
-       TAILQ_FOREACH(node, &vnodeopv_list, entry) {
-               ops = node->ops;
-               if ((vnew = ops->vv_new) == NULL)
-                       continue;
-               for (off = __offsetof(struct vop_ops, vop_ops_first_field);
-                    off <= __offsetof(struct vop_ops, vop_ops_last_field);
-                    off += sizeof(void **)
-               ) {
-                       *(void **)((char *)ops + off) = 
-                               *(void **)((char *)vnew + off);
-               }
-               ops->vv_new = NULL;
-               free(vnew, M_VNODEOP);
+       for (off = __offsetof(struct vop_ops, vop_ops_first_field);
+            off <= __offsetof(struct vop_ops, vop_ops_last_field);
+            off += sizeof(void *)
+       ) {
+               if (*(void **)((char *)ops + off) == NULL)
+                   *(void **)((char *)ops + off) = ops->vop_default;
        }
 }
 
index 51e234f..f64da95 100644 (file)
@@ -31,7 +31,7 @@
  * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  *
- * $DragonFly: src/sys/kern/vfs_jops.c,v 1.27 2006/05/08 18:45:51 dillon Exp $
+ * $DragonFly: src/sys/kern/vfs_jops.c,v 1.28 2006/07/18 22:22:12 dillon Exp $
  */
 /*
  * Each mount point may have zero or more independantly configured journals
@@ -134,25 +134,24 @@ static int journal_nrename(struct vop_nrename_args *ap);
                         JRUNDO_NLINK)
 #define JRUNDO_ALL     (JRUNDO_VATTR|JRUNDO_FILEDATA)
 
-static struct vnodeopv_entry_desc journal_vnodeop_entries[] = {
-    { &vop_default_desc,               vop_journal_operate_ap },
-    { &vop_mountctl_desc,              (void *)journal_mountctl },
-    { &vop_setattr_desc,               (void *)journal_setattr },
-    { &vop_write_desc,                 (void *)journal_write },
-    { &vop_fsync_desc,                 (void *)journal_fsync },
-    { &vop_putpages_desc,              (void *)journal_putpages },
-    { &vop_setacl_desc,                        (void *)journal_setacl },
-    { &vop_setextattr_desc,            (void *)journal_setextattr },
-    { &vop_ncreate_desc,               (void *)journal_ncreate },
-    { &vop_nmknod_desc,                        (void *)journal_nmknod },
-    { &vop_nlink_desc,                 (void *)journal_nlink },
-    { &vop_nsymlink_desc,              (void *)journal_nsymlink },
-    { &vop_nwhiteout_desc,             (void *)journal_nwhiteout },
-    { &vop_nremove_desc,               (void *)journal_nremove },
-    { &vop_nmkdir_desc,                        (void *)journal_nmkdir },
-    { &vop_nrmdir_desc,                        (void *)journal_nrmdir },
-    { &vop_nrename_desc,               (void *)journal_nrename },
-    { NULL, NULL }
+static struct vop_ops journal_vnode_vops = {
+    .vop_default =     vop_journal_operate_ap,
+    .vop_mountctl =    journal_mountctl,
+    .vop_setattr =     journal_setattr,
+    .vop_write =       journal_write,
+    .vop_fsync =       journal_fsync,
+    .vop_putpages =    journal_putpages,
+    .vop_setacl =      journal_setacl,
+    .vop_setextattr =  journal_setextattr,
+    .vop_ncreate =     journal_ncreate,
+    .vop_nmknod =      journal_nmknod,
+    .vop_nlink =       journal_nlink,
+    .vop_nsymlink =    journal_nsymlink,
+    .vop_nwhiteout =   journal_nwhiteout,
+    .vop_nremove =     journal_nremove,
+    .vop_nmkdir =      journal_nmkdir,
+    .vop_nrmdir =      journal_nrmdir,
+    .vop_nrename =     journal_nrename
 };
 
 static MALLOC_DEFINE(M_JOURNAL, "journal", "Journaling structures");
@@ -164,7 +163,7 @@ journal_mountctl(struct vop_mountctl_args *ap)
     struct mount *mp;
     int error = 0;
 
-    mp = ap->a_head.a_ops->vv_mount;
+    mp = ap->a_head.a_ops->head.vv_mount;
     KKASSERT(mp);
 
     if (mp->mnt_vn_journal_ops == NULL) {
@@ -244,8 +243,7 @@ static int
 journal_attach(struct mount *mp)
 {
     KKASSERT(mp->mnt_jbitmap == NULL);
-    vfs_add_vnodeops(mp, &mp->mnt_vn_journal_ops, 
-                    journal_vnodeop_entries, 0);
+    vfs_add_vnodeops(mp, &journal_vnode_vops, &mp->mnt_vn_journal_ops);
     mp->mnt_jbitmap = malloc(JREC_STREAMID_JMAX/8, M_JOURNAL, M_WAITOK|M_ZERO);
     mp->mnt_streamid = JREC_STREAMID_JMIN;
     return(0);
@@ -256,7 +254,7 @@ journal_detach(struct mount *mp)
 {
     KKASSERT(mp->mnt_jbitmap != NULL);
     if (mp->mnt_vn_journal_ops)
-       vfs_rm_vnodeops(&mp->mnt_vn_journal_ops);
+       vfs_rm_vnodeops(mp, &journal_vnode_vops, &mp->mnt_vn_journal_ops);
     free(mp->mnt_jbitmap, M_JOURNAL);
     mp->mnt_jbitmap = NULL;
 }
@@ -808,7 +806,7 @@ journal_setattr(struct vop_setattr_args *ap)
     void *save;
     int error;
 
-    mp = ap->a_head.a_ops->vv_mount;
+    mp = ap->a_head.a_ops->head.vv_mount;
     if (jreclist_init(mp, &jreclist, &jreccache, JTYPE_SETATTR)) {
        jreclist_undo_file(&jreclist, ap->a_vp, JRUNDO_VATTR, 0, 0);
     }
@@ -868,7 +866,7 @@ journal_write(struct vop_write_args *ap)
      * IO_APPEND is set, but fortunately we have no undo file data to
      * write out in that case.
      */
-    mp = ap->a_head.a_ops->vv_mount;
+    mp = ap->a_head.a_ops->head.vv_mount;
     if (jreclist_init(mp, &jreclist, &jreccache, JTYPE_WRITE)) {
        if (ap->a_ioflag & IO_APPEND) {
            jreclist_undo_file(&jreclist, ap->a_vp, JRUNDO_SIZE|JRUNDO_MTIME, 0, 0);
@@ -921,7 +919,7 @@ journal_fsync(struct vop_fsync_args *ap)
 
     error = vop_journal_operate_ap(&ap->a_head);
 #if 0
-    mp = ap->a_head.a_ops->vv_mount;
+    mp = ap->a_head.a_ops->head.vv_mount;
     if (error == 0) {
        TAILQ_FOREACH(jo, &mp->mnt_jlist, jentry) {
            /* XXX synchronize pending journal records */
@@ -947,7 +945,7 @@ journal_putpages(struct vop_putpages_args *ap)
     void *save;
     int error;
 
-    mp = ap->a_head.a_ops->vv_mount;
+    mp = ap->a_head.a_ops->head.vv_mount;
     if (jreclist_init(mp, &jreclist, &jreccache, JTYPE_PUTPAGES) && 
        ap->a_count > 0
     ) {
@@ -982,7 +980,7 @@ journal_setacl(struct vop_setacl_args *ap)
     struct mount *mp;
     int error;
 
-    mp = ap->a_head.a_ops->vv_mount;
+    mp = ap->a_head.a_ops->head.vv_mount;
     jreclist_init(mp, &jreclist, &jreccache, JTYPE_SETACL);
     error = vop_journal_operate_ap(&ap->a_head);
     if (error == 0) {
@@ -1018,7 +1016,7 @@ journal_setextattr(struct vop_setextattr_args *ap)
     void *save;
     int error;
 
-    mp = ap->a_head.a_ops->vv_mount;
+    mp = ap->a_head.a_ops->head.vv_mount;
     jreclist_init(mp, &jreclist, &jreccache, JTYPE_SETEXTATTR);
     error = vop_journal_operate_ap(&ap->a_head);
     if (error == 0) {
@@ -1053,7 +1051,7 @@ journal_ncreate(struct vop_ncreate_args *ap)
     void *save;
     int error;
 
-    mp = ap->a_head.a_ops->vv_mount;
+    mp = ap->a_head.a_ops->head.vv_mount;
     jreclist_init(mp, &jreclist, &jreccache, JTYPE_CREATE);
     error = vop_journal_operate_ap(&ap->a_head);
     if (error == 0) {
@@ -1085,7 +1083,7 @@ journal_nmknod(struct vop_nmknod_args *ap)
     void *save;
     int error;
 
-    mp = ap->a_head.a_ops->vv_mount;
+    mp = ap->a_head.a_ops->head.vv_mount;
     jreclist_init(mp, &jreclist, &jreccache, JTYPE_MKNOD);
     error = vop_journal_operate_ap(&ap->a_head);
     if (error == 0) {
@@ -1117,7 +1115,7 @@ journal_nlink(struct vop_nlink_args *ap)
     void *save;
     int error;
 
-    mp = ap->a_head.a_ops->vv_mount;
+    mp = ap->a_head.a_ops->head.vv_mount;
     jreclist_init(mp, &jreclist, &jreccache, JTYPE_LINK);
     error = vop_journal_operate_ap(&ap->a_head);
     if (error == 0) {
@@ -1150,7 +1148,7 @@ journal_nsymlink(struct vop_nsymlink_args *ap)
     void *save;
     int error;
 
-    mp = ap->a_head.a_ops->vv_mount;
+    mp = ap->a_head.a_ops->head.vv_mount;
     jreclist_init(mp, &jreclist, &jreccache, JTYPE_SYMLINK);
     error = vop_journal_operate_ap(&ap->a_head);
     if (error == 0) {
@@ -1182,7 +1180,7 @@ journal_nwhiteout(struct vop_nwhiteout_args *ap)
     struct mount *mp;
     int error;
 
-    mp = ap->a_head.a_ops->vv_mount;
+    mp = ap->a_head.a_ops->head.vv_mount;
     jreclist_init(mp, &jreclist, &jreccache, JTYPE_WHITEOUT);
     error = vop_journal_operate_ap(&ap->a_head);
     if (error == 0) {
@@ -1208,7 +1206,7 @@ journal_nremove(struct vop_nremove_args *ap)
     struct mount *mp;
     int error;
 
-    mp = ap->a_head.a_ops->vv_mount;
+    mp = ap->a_head.a_ops->head.vv_mount;
     if (jreclist_init(mp, &jreclist, &jreccache, JTYPE_REMOVE) &&
        ap->a_ncp->nc_vp
     ) {
@@ -1239,7 +1237,7 @@ journal_nmkdir(struct vop_nmkdir_args *ap)
     struct mount *mp;
     int error;
 
-    mp = ap->a_head.a_ops->vv_mount;
+    mp = ap->a_head.a_ops->head.vv_mount;
     jreclist_init(mp, &jreclist, &jreccache, JTYPE_MKDIR);
     error = vop_journal_operate_ap(&ap->a_head);
     if (error == 0) {
@@ -1274,7 +1272,7 @@ journal_nrmdir(struct vop_nrmdir_args *ap)
     struct mount *mp;
     int error;
 
-    mp = ap->a_head.a_ops->vv_mount;
+    mp = ap->a_head.a_ops->head.vv_mount;
     if (jreclist_init(mp, &jreclist, &jreccache, JTYPE_RMDIR)) {
        jreclist_undo_file(&jreclist, ap->a_ncp->nc_vp,
                           JRUNDO_VATTR|JRUNDO_GETVP, 0, 0);
@@ -1303,7 +1301,7 @@ journal_nrename(struct vop_nrename_args *ap)
     struct mount *mp;
     int error;
 
-    mp = ap->a_head.a_ops->vv_mount;
+    mp = ap->a_head.a_ops->head.vv_mount;
     if (jreclist_init(mp, &jreclist, &jreccache, JTYPE_RENAME) &&
        ap->a_tncp->nc_vp
     ) {
index be70fcc..a952c1e 100644 (file)
@@ -67,7 +67,7 @@
  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  *
- * $DragonFly: src/sys/kern/vfs_mount.c,v 1.17 2006/05/06 02:43:12 dillon Exp $
+ * $DragonFly: src/sys/kern/vfs_mount.c,v 1.18 2006/07/18 22:22:12 dillon Exp $
  */
 
 /*
@@ -208,7 +208,7 @@ getnewvnode(enum vtagtype tag, struct mount *mp,
  */
 int
 getspecialvnode(enum vtagtype tag, struct mount *mp,
-               struct vop_ops **ops_pp,
+               struct vop_ops **ops,
                struct vnode **vpp, int lktimeout, int lkflags)
 {
        struct vnode *vp;
@@ -216,7 +216,7 @@ getspecialvnode(enum vtagtype tag, struct mount *mp,
        vp = allocvnode(lktimeout, lkflags);
        vp->v_tag = tag;
        vp->v_data = NULL;
-       vp->v_ops = ops_pp;
+       vp->v_ops = ops;
 
        /*
         * Placing the vnode on the mount point's queue makes it visible.
@@ -1097,7 +1097,7 @@ vflush_scan(struct mount *mp, struct vnode *vp, void *data)
                        vgone(vp);
                } else {
                        vclean(vp, 0);
-                       vp->v_ops = &spec_vnode_vops;
+                       vp->v_ops = &spec_vnode_vops_p;
                        insmntque(vp, NULL);
                }
                return(0);
index 1367a3d..2d425ee 100644 (file)
@@ -37,7 +37,7 @@
  *
  *     @(#)vfs_subr.c  8.31 (Berkeley) 5/26/95
  * $FreeBSD: src/sys/kern/vfs_subr.c,v 1.249.2.30 2003/04/04 20:35:57 tegge Exp $
- * $DragonFly: src/sys/kern/vfs_subr.c,v 1.90 2006/07/10 04:42:56 dillon Exp $
+ * $DragonFly: src/sys/kern/vfs_subr.c,v 1.91 2006/07/18 22:22:12 dillon Exp $
  */
 
 /*
@@ -130,7 +130,6 @@ static int  vfs_hang_addrlist (struct mount *mp, struct netexport *nep,
                                       struct export_args *argp);
 
 extern int dev_ref_debug;
-extern struct vnodeopv_entry_desc spec_vnodeop_entries[];
 
 /*
  * Red black tree functions
@@ -981,7 +980,7 @@ bdevvp(dev_t dev, struct vnode **vpp)
                *vpp = NULLVP;
                return (ENXIO);
        }
-       error = getspecialvnode(VT_NON, NULL, &spec_vnode_vops, &nvp, 0, 0);
+       error = getspecialvnode(VT_NON, NULL, &spec_vnode_vops_p, &nvp, 0, 0);
        if (error) {
                *vpp = NULLVP;
                return (error);
@@ -1145,7 +1144,7 @@ vclean(struct vnode *vp, int flags)
        /*
         * Done with purge, notify sleepers of the grim news.
         */
-       vp->v_ops = &dead_vnode_vops;
+       vp->v_ops = &dead_vnode_vops_p;
        vn_pollgone(vp);
        vp->v_tag = VT_NON;
 }
index c931e67..65db8f7 100644 (file)
@@ -37,7 +37,7 @@
  *
  *     @(#)vfs_subr.c  8.31 (Berkeley) 5/26/95
  * $FreeBSD: src/sys/kern/vfs_subr.c,v 1.249.2.30 2003/04/04 20:35:57 tegge Exp $
- * $DragonFly: src/sys/kern/vfs_sync.c,v 1.10 2006/05/06 02:43:12 dillon Exp $
+ * $DragonFly: src/sys/kern/vfs_sync.c,v 1.11 2006/07/18 22:22:12 dillon Exp $
  */
 
 /*
@@ -305,24 +305,21 @@ static int        sync_reclaim  (struct  vop_reclaim_args *);
 static int     sync_print (struct vop_print_args *);
 #define sync_islocked ((int(*) (struct vop_islocked_args *))vop_stdislocked)
 
-static struct vop_ops *sync_vnode_vops;
-static struct vnodeopv_entry_desc sync_vnodeop_entries[] = {
-       { &vop_default_desc,    vop_eopnotsupp },
-       { &vop_close_desc,      (void *) sync_close },          /* close */
-       { &vop_fsync_desc,      (void *) sync_fsync },          /* fsync */
-       { &vop_inactive_desc,   (void *) sync_inactive },       /* inactive */
-       { &vop_reclaim_desc,    (void *) sync_reclaim },        /* reclaim */
-       { &vop_lock_desc,       (void *) sync_lock },           /* lock */
-       { &vop_unlock_desc,     (void *) sync_unlock },         /* unlock */
-       { &vop_print_desc,      (void *) sync_print },          /* print */
-       { &vop_islocked_desc,   (void *) sync_islocked },       /* islocked */
-       { NULL, NULL }
+static struct vop_ops sync_vnode_vops = {
+       .vop_default =  vop_eopnotsupp,
+       .vop_close =    sync_close,
+       .vop_fsync =    sync_fsync,
+       .vop_inactive = sync_inactive,
+       .vop_reclaim =  sync_reclaim,
+       .vop_lock =     sync_lock,
+       .vop_unlock =   sync_unlock,
+       .vop_print =    sync_print,
+       .vop_islocked = sync_islocked
 };
 
-static struct vnodeopv_desc sync_vnodeop_opv_desc =
-       { &sync_vnode_vops, sync_vnodeop_entries, 0 };
+static struct vop_ops *sync_vnode_vops_p = &sync_vnode_vops;
 
-VNODEOP_SET(sync_vnodeop_opv_desc);
+VNODEOP_SET(sync_vnode_vops);
 
 /*
  * Create a new filesystem syncer vnode for the specified mount point.
@@ -340,7 +337,7 @@ vfs_allocate_syncvnode(struct mount *mp)
        int error;
 
        /* Allocate a new vnode */
-       error = getspecialvnode(VT_VFS, mp, &sync_vnode_vops, &vp, 0, 0);
+       error = getspecialvnode(VT_VFS, mp, &sync_vnode_vops_p, &vp, 0, 0);
        if (error) {
                mp->mnt_syncer = NULL;
                return (error);
index e4f6c3f..1824833 100644 (file)
@@ -37,7 +37,7 @@
  *
  *     @(#)vfs_syscalls.c      8.13 (Berkeley) 4/15/94
  * $FreeBSD: src/sys/kern/vfs_syscalls.c,v 1.151.2.18 2003/04/04 20:35:58 tegge Exp $
- * $DragonFly: src/sys/kern/vfs_syscalls.c,v 1.96 2006/06/05 07:26:10 dillon Exp $
+ * $DragonFly: src/sys/kern/vfs_syscalls.c,v 1.97 2006/07/18 22:22:12 dillon Exp $
  */
 
 #include <sys/param.h>
@@ -376,11 +376,11 @@ update:
                if ((error = VFS_START(mp, 0)) != 0)
                        vrele(vp);
        } else {
-               vfs_rm_vnodeops(&mp->mnt_vn_coherency_ops);
-               vfs_rm_vnodeops(&mp->mnt_vn_journal_ops);
-               vfs_rm_vnodeops(&mp->mnt_vn_norm_ops);
-               vfs_rm_vnodeops(&mp->mnt_vn_spec_ops);
-               vfs_rm_vnodeops(&mp->mnt_vn_fifo_ops);
+               vfs_rm_vnodeops(mp, NULL, &mp->mnt_vn_coherency_ops);
+               vfs_rm_vnodeops(mp, NULL, &mp->mnt_vn_journal_ops);
+               vfs_rm_vnodeops(mp, NULL, &mp->mnt_vn_norm_ops);
+               vfs_rm_vnodeops(mp, NULL, &mp->mnt_vn_spec_ops);
+               vfs_rm_vnodeops(mp, NULL, &mp->mnt_vn_fifo_ops);
                vp->v_flag &= ~VMOUNT;
                mp->mnt_vfc->vfc_refcount--;
                vfs_unbusy(mp);
@@ -629,11 +629,11 @@ dounmount(struct mount *mp, int flags)
         * Remove any installed vnode ops here so the individual VFSs don't
         * have to.
         */
-       vfs_rm_vnodeops(&mp->mnt_vn_coherency_ops);
-       vfs_rm_vnodeops(&mp->mnt_vn_journal_ops);
-       vfs_rm_vnodeops(&mp->mnt_vn_norm_ops);
-       vfs_rm_vnodeops(&mp->mnt_vn_spec_ops);
-       vfs_rm_vnodeops(&mp->mnt_vn_fifo_ops);
+       vfs_rm_vnodeops(mp, NULL, &mp->mnt_vn_coherency_ops);
+       vfs_rm_vnodeops(mp, NULL, &mp->mnt_vn_journal_ops);
+       vfs_rm_vnodeops(mp, NULL, &mp->mnt_vn_norm_ops);
+       vfs_rm_vnodeops(mp, NULL, &mp->mnt_vn_spec_ops);
+       vfs_rm_vnodeops(mp, NULL, &mp->mnt_vn_fifo_ops);
 
        if ((coveredvp = mp->mnt_vnodecovered) != NULLVP) {
                coveredvp->v_mountedhere = NULL;
index cba8718..e7419cd 100644 (file)
@@ -32,7 +32,7 @@
  * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  * 
- * $DragonFly: src/sys/kern/vfs_vopops.c,v 1.27 2006/06/04 17:33:35 dillon Exp $
+ * $DragonFly: src/sys/kern/vfs_vopops.c,v 1.28 2006/07/18 22:22:12 dillon Exp $
  */
 
 #include <sys/param.h>
@@ -308,7 +308,7 @@ vop_getattr(struct vop_ops *ops, struct vnode *vp, struct vattr *vap)
        ap.a_vap = vap;
 
        DO_OPS(ops, error, &ap, vop_getattr);
-       if ((ops->vv_flags & VVF_SUPPORTS_FSMID) == 0)
+       if ((ops->head.vv_mount->mnt_kern_flag & MNTK_FSMID) == 0)
                vap->va_fsmid = cache_sync_fsmid_vp(vp);
        return(error);
 }
@@ -1294,10 +1294,10 @@ vop_cache_operate_ap(struct vop_generic_args *ap)
        int error;
 
        ops = ap->a_ops;
-       if (ops->vv_mount->mnt_vn_journal_ops)
-               error = VOCALL(ops->vv_mount->mnt_vn_journal_ops, ap);
+       if (ops->head.vv_mount->mnt_vn_journal_ops)
+               error = VOCALL(ops->head.vv_mount->mnt_vn_journal_ops, ap);
        else
-               error = VOCALL(ops->vv_mount->mnt_vn_norm_ops, ap);
+               error = VOCALL(ops->head.vv_mount->mnt_vn_norm_ops, ap);
        return (error);
 }
 
@@ -1313,7 +1313,7 @@ vop_journal_operate_ap(struct vop_generic_args *ap)
        int error;
 
        ops = ap->a_ops;
-       error = VOCALL(ops->vv_mount->mnt_vn_norm_ops, ap);
+       error = VOCALL(ops->head.vv_mount->mnt_vn_norm_ops, ap);
 
        return (error);
 }
index 8ee1de3..1fac2be 100644 (file)
@@ -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.26 2006/05/21 03:43:47 dillon Exp $
+ * $DragonFly: src/sys/sys/mount.h,v 1.27 2006/07/18 22:22:15 dillon Exp $
  */
 
 #ifndef _SYS_MOUNT_H_
@@ -119,13 +119,6 @@ struct statfs {
  * list.  Filesystem kld's syncing code should remain compatible since
  * they only need to scan the dirty vnode list (nvnodelist -> dirtyvnodelist).
  *
- * NOTE: mnt_fsmanage structures.  These structures are required by the new
- * vnode operations vector abstraction.  Each one contains its own operations
- * vector which is registered just like VNODEOP_SET/vnodeopv_desc except it
- * is done in the mount code rather then on vfs initialization.  This
- * structure is responsible for per-mount management, including vfs threading,
- * journaling, and so forth.
- *
  * NOTE: All VFSs must at least populate mnt_vn_ops or those VOP ops that
  * only take namecache pointers will not be able to find their operations
  * vector via namecache->nc_mount.
@@ -250,6 +243,7 @@ struct mount {
 #define MNTK_UNMOUNT   0x01000000      /* unmount in progress */
 #define        MNTK_MWAIT      0x02000000      /* waiting for unmount to finish */
 #define MNTK_WANTRDWR  0x04000000      /* upgrade to read/write requested */
+#define MNTK_FSMID     0x08000000      /* getattr supports FSMIDs */
 
 /*
  * mountlist_*() defines
index 0af566d..b8a9dd8 100644 (file)
  * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  *
- * $DragonFly: src/sys/sys/vfsops.h,v 1.22 2006/05/06 02:43:13 dillon Exp $
+ * $DragonFly: src/sys/sys/vfsops.h,v 1.23 2006/07/18 22:22:15 dillon Exp $
  */
 
 /*
  * The vop_ops structure vectors all access to a filesystem.  It contains a
- * fixed set of vectors which are 'compiled' by the vnodeopv_entry_desc
- * array that is typically declared in "vfs/blah/blah_vnops.c".
+ * fixed set of vectors.
  *
  * In DragonFly the ultimate goal is to thread the VFS, which means that
  * the dispatch functions will eventually be called from the context of 
@@ -525,15 +524,9 @@ struct vop_nrename_args {
  * calls used for chaining vop_ops structures from a VFS context.
  */
 struct vop_ops {
-       struct vop_ops  *vv_new;        /* vfs_recalc_vnodeops() only */
-       struct mount    *vv_mount;
-       int             vv_refs;
-       int             vv_flags;       /* see VVF_* flags below */
-
-       void            *vv_unused1;
-       void            *vv_unused2;
-
-       int             vv_reserved[62]; /* (temporary) reduce recompile pain */
+       struct {
+               struct mount    *vv_mount;
+       } head;
 
 #define vop_ops_first_field    vop_default
        int     (*vop_default)(struct vop_generic_args *);
@@ -604,15 +597,6 @@ struct vop_ops {
 #define vop_ops_last_field     vop_nrename
 };
 
-#define VVF_JOURNAL_LAYER      0x0001
-#define VVF_COHERENCY_LAYER    0x0002
-#define VVF_SUPPORTS_FSMID     0x0004
-#define VVF_UNUSED_08          0x0008
-#define VVF_NOATIME            0x0010          /* FUTURE */
-#define VVF_RDONLY             0x0020          /* FUTURE */
-#define VVF_NOCLUSTER          0x0040          /* FUTURE */
-#define VVF_SUIDDIR            0x0080          /* FUTURE */
-
 /*
  * vop_mountctl() operations
  */
index 52cebce..638276d 100644 (file)
@@ -32,7 +32,7 @@
  *
  *     @(#)vnode.h     8.7 (Berkeley) 2/4/94
  * $FreeBSD: src/sys/sys/vnode.h,v 1.111.2.19 2002/12/29 18:19:53 dillon Exp $
- * $DragonFly: src/sys/sys/vnode.h,v 1.60 2006/06/10 20:00:17 dillon Exp $
+ * $DragonFly: src/sys/sys/vnode.h,v 1.61 2006/07/18 22:22:15 dillon Exp $
  */
 
 #ifndef _SYS_VNODE_H_
@@ -188,8 +188,8 @@ struct vnode {
        int     v_opencount;                    /* number of explicit opens */
        struct bio_track v_track_read;          /* track I/O's in progress */
        struct bio_track v_track_write;         /* track I/O's in progress */
-       struct  mount *v_mount;                 /* ptr to vfs we are in */
-       struct  vop_ops **v_ops;                /* vnode operations vector */
+       struct mount *v_mount;                  /* ptr to vfs we are in */
+       struct vop_ops **v_ops;                 /* vnode operations vector */
        TAILQ_ENTRY(vnode) v_freelist;          /* vnode freelist */
        TAILQ_ENTRY(vnode) v_nmntvnodes;        /* vnodes for mount point */
        struct buf_rb_tree v_rbclean_tree;      /* RB tree of clean bufs */
@@ -359,8 +359,8 @@ extern      int             vttoif_tab[];
 #define        NULLVP  ((struct vnode *)NULL)
 
 #define        VNODEOP_SET(f) \
-       C_SYSINIT(f##init, SI_SUB_VFS, SI_ORDER_SECOND, vfs_add_vnodeops_sysinit, &f); \
-       C_SYSUNINIT(f##uninit, SI_SUB_VFS, SI_ORDER_SECOND,vfs_rm_vnodeops_sysinit, &f);
+       SYSINIT(f##init, SI_SUB_VFS, SI_ORDER_SECOND, vfs_nadd_vnodeops_sysinit, &f); \
+       SYSUNINIT(f##uninit, SI_SUB_VFS, SI_ORDER_SECOND,vfs_nrm_vnodeops_sysinit, &f);
 
 /*
  * Global vnode data.
@@ -459,28 +459,6 @@ extern struct lwkt_token mntvnode_token;
 
 typedef int (*vnodeopv_entry_t)(struct vop_generic_args *);
 
-/*
- * This structure is used to configure the new vnodeops vector.  The entry
- * descriptor describes a patricular VOP function while the operations
- * vector descriptor recursively describes arrays of entry descriptors.
- */
-struct vnodeopv_entry_desc {
-       struct vnodeop_desc *opve_op;
-       vnodeopv_entry_t opve_func;
-};
-
-struct vnodeopv_desc {
-       struct vop_ops **opv_desc_vector;           /* vect to allocate/fill*/
-       struct vnodeopv_entry_desc *opv_desc_ops;   /* null terminated list */
-       int opv_flags;
-};
-
-struct vnodeopv_node {
-       TAILQ_ENTRY(vnodeopv_node)      entry;
-       struct vop_ops                  *ops;       /* allocated vector */
-       struct vnodeopv_entry_desc      *descs;     /* null terminated list */
-};
-
 #ifdef DEBUG_VFS_LOCKS
 /*
  * Macros to aid in tracing VFS locking problems.  Not totally
@@ -553,11 +531,10 @@ int       speedup_syncer (void);
 void   vattr_null (struct vattr *vap);
 int    vcount (struct vnode *vp);
 int    vfinddev (dev_t dev, enum vtype type, struct vnode **vpp);
-void   vfs_add_vnodeops_sysinit (const void *);
-void   vfs_rm_vnodeops_sysinit (const void *);
-void   vfs_add_vnodeops(struct mount *, struct vop_ops **,
-                       struct vnodeopv_entry_desc *, int);
-void   vfs_rm_vnodeops(struct vop_ops **);
+void   vfs_nadd_vnodeops_sysinit (void *);
+void   vfs_nrm_vnodeops_sysinit (void *);
+void   vfs_add_vnodeops(struct mount *, struct vop_ops *, struct vop_ops **);
+void   vfs_rm_vnodeops(struct mount *, struct vop_ops *, struct vop_ops **);
 int    vflush (struct mount *mp, int rootrefs, int flags);
 int    vmntvnodescan(struct mount *mp, int flags,
            int (*fastfunc)(struct mount *mp, struct vnode *vp, void *data),
@@ -657,9 +634,13 @@ void       vfs_sync_init(void);
 void   vn_syncer_add_to_worklist(struct vnode *, int);
 void   vnlru_proc_wait(void);
 
-extern struct vop_ops *default_vnode_vops;
-extern struct vop_ops *spec_vnode_vops;
-extern struct vop_ops *dead_vnode_vops;
+extern struct vop_ops default_vnode_vops;
+extern struct vop_ops spec_vnode_vops;
+extern struct vop_ops dead_vnode_vops;
+
+extern struct vop_ops *default_vnode_vops_p;
+extern struct vop_ops *spec_vnode_vops_p;
+extern struct vop_ops *dead_vnode_vops_p;
 
 #endif /* _KERNEL */
 
index 6680032..9fa37f7 100644 (file)
@@ -28,7 +28,7 @@
  * 
  *     @(#) src/sys/coda/coda_vnops.c,v 1.1.1.1 1998/08/29 21:14:52 rvb Exp $
  * $FreeBSD: src/sys/coda/coda_vnops.c,v 1.22.2.1 2001/06/29 16:26:22 shafeeq Exp $
- * $DragonFly: src/sys/vfs/coda/Attic/coda_vnops.c,v 1.38 2006/05/06 02:43:13 dillon Exp $
+ * $DragonFly: src/sys/vfs/coda/Attic/coda_vnops.c,v 1.39 2006/07/18 22:22:15 dillon Exp $
  * 
  */
 
@@ -110,58 +110,42 @@ static int coda_lockdebug = 0;
 
 /* Definition of the vnode operation vector */
 
-struct vnodeopv_entry_desc coda_vnodeop_entries[] = {
-    { &vop_default_desc, (vnodeopv_entry_t)coda_vop_error },
-    { &vop_old_lookup_desc, (vnodeopv_entry_t)coda_lookup },   /* lookup */
-    { &vop_old_create_desc, (vnodeopv_entry_t)coda_create },   /* create */
-    { &vop_old_mknod_desc, (vnodeopv_entry_t)coda_vop_error }, /* mknod */
-    { &vop_open_desc, (vnodeopv_entry_t)coda_open },           /* open */
-    { &vop_close_desc, (vnodeopv_entry_t)coda_close },         /* close */
-    { &vop_access_desc, (vnodeopv_entry_t)coda_access },       /* access */
-    { &vop_getattr_desc, (vnodeopv_entry_t)coda_getattr },     /* getattr */
-    { &vop_setattr_desc, (vnodeopv_entry_t)coda_setattr },     /* setattr */
-    { &vop_read_desc, (vnodeopv_entry_t)coda_read },           /* read */
-    { &vop_write_desc, (vnodeopv_entry_t)coda_write },         /* write */
-    { &vop_ioctl_desc, (vnodeopv_entry_t)coda_ioctl },         /* ioctl */
-    { &vop_mmap_desc, (vnodeopv_entry_t)coda_vop_error },      /* mmap */
-    { &vop_fsync_desc, (vnodeopv_entry_t)coda_fsync },         /* fsync */
-    { &vop_old_remove_desc, (vnodeopv_entry_t)coda_remove },   /* remove */
-    { &vop_old_link_desc, (vnodeopv_entry_t)coda_link },       /* link */
-    { &vop_old_rename_desc, (vnodeopv_entry_t)coda_rename },   /* rename */
-    { &vop_old_mkdir_desc, (vnodeopv_entry_t)coda_mkdir },     /* mkdir */
-    { &vop_old_rmdir_desc, (vnodeopv_entry_t)coda_rmdir },     /* rmdir */
-    { &vop_old_symlink_desc, (vnodeopv_entry_t)coda_symlink }, /* symlink */
-    { &vop_readdir_desc, (vnodeopv_entry_t)coda_readdir },     /* readdir */
-    { &vop_readlink_desc, (vnodeopv_entry_t)coda_readlink },   /* readlink */
-    { &vop_inactive_desc, (vnodeopv_entry_t)coda_inactive },   /* inactive */
-    { &vop_reclaim_desc, (vnodeopv_entry_t)coda_reclaim },     /* reclaim */
-    { &vop_lock_desc, (vnodeopv_entry_t)coda_lock },           /* lock */
-    { &vop_unlock_desc, (vnodeopv_entry_t)coda_unlock },       /* unlock */
-    { &vop_bmap_desc, (vnodeopv_entry_t)coda_bmap },           /* bmap */
-    { &vop_strategy_desc, (vnodeopv_entry_t)coda_strategy },   /* strategy */
-    { &vop_print_desc, (vnodeopv_entry_t)coda_vop_error },     /* print */
-    { &vop_islocked_desc, (vnodeopv_entry_t)coda_islocked },   /* islocked */
-    { &vop_pathconf_desc, (vnodeopv_entry_t)coda_vop_error },  /* pathconf */
-    { &vop_advlock_desc, (vnodeopv_entry_t)coda_vop_nop },     /* advlock */
-    { &vop_poll_desc, (vnodeopv_entry_t)vop_stdpoll },         /* poll */
-    { &vop_getpages_desc, (vnodeopv_entry_t)coda_fbsd_getpages }, /* pager intf.*/
-    { &vop_putpages_desc, (vnodeopv_entry_t)coda_fbsd_putpages }, /* pager intf.*/
-
-#if    0
-
-    we need to define these someday
-#define UFS_BLKATOFF(aa, bb, cc, dd) VFSTOUFS((aa)->v_mount)->um_blkatoff(aa, bb, cc, dd)
-#define UFS_VALLOC(aa, bb, cc, dd) VFSTOUFS((aa)->v_mount)->um_valloc(aa, bb, cc, dd)
-#define UFS_VFREE(aa, bb, cc) VFSTOUFS((aa)->v_mount)->um_vfree(aa, bb, cc)
-#define UFS_TRUNCATE(aa, bb, cc, dd) VFSTOUFS((aa)->v_mount)->um_truncate(aa, bb, cc, dd)
-#define UFS_UPDATE(aa, bb) VFSTOUFS((aa)->v_mount)->um_update(aa, bb)
-
-    missing
-    { &vop_reallocblks_desc,   (vnodeopv_entry_t) ufs_missingop },
-    { &vop_old_lookup_desc,    (vnodeopv_entry_t) ufs_lookup },
-    { &vop_old_whiteout_desc,  (vnodeopv_entry_t) ufs_whiteout },
-#endif
-    { NULL, NULL }
+struct vop_ops coda_vnode_ops = {
+    .vop_default =     (void *)coda_vop_error,
+    .vop_old_lookup =  (void *)coda_lookup,
+    .vop_old_create =  (void *)coda_create,
+    .vop_old_mknod =   (void *)coda_vop_error,
+    .vop_open =                (void *)coda_open,
+    .vop_close =       (void *)coda_close,
+    .vop_access =      (void *)coda_access,
+    .vop_getattr =     (void *)coda_getattr,
+    .vop_setattr =     (void *)coda_setattr,
+    .vop_read =                (void *)coda_read,
+    .vop_write =       (void *)coda_write,
+    .vop_ioctl =       (void *)coda_ioctl,
+    .vop_mmap =                (void *)coda_vop_error,
+    .vop_fsync =       (void *)coda_fsync,
+    .vop_old_remove =  (void *)coda_remove,
+    .vop_old_link =    (void *)coda_link,
+    .vop_old_rename =  (void *)coda_rename,
+    .vop_old_mkdir =   (void *)coda_mkdir,
+    .vop_old_rmdir =   (void *)coda_rmdir,
+    .vop_old_symlink = (void *)coda_symlink,
+    .vop_readdir =     (void *)coda_readdir,
+    .vop_readlink =    (void *)coda_readlink,
+    .vop_inactive =    (void *)coda_inactive,
+    .vop_reclaim =     (void *)coda_reclaim,
+    .vop_lock =                (void *)coda_lock,
+    .vop_unlock =      (void *)coda_unlock,
+    .vop_bmap =                (void *)coda_bmap,
+    .vop_strategy =    (void *)coda_strategy,
+    .vop_print =       (void *)coda_vop_error,
+    .vop_islocked =    (void *)coda_islocked,
+    .vop_pathconf =    (void *)coda_vop_error,
+    .vop_advlock =     (void *)coda_vop_nop,
+    .vop_poll =                vop_stdpoll,
+    .vop_getpages =    (void *)coda_fbsd_getpages,
+    .vop_putpages =    (void *)coda_fbsd_putpages
 };
 
 /* A generic panic: we were called with something we didn't define yet */
index 6a45983..949274c 100644 (file)
@@ -32,7 +32,7 @@
  *
  *     @(#)dead_vnops.c        8.1 (Berkeley) 6/10/93
  * $FreeBSD: src/sys/miscfs/deadfs/dead_vnops.c,v 1.26 1999/08/28 00:46:42 peter Exp $
- * $DragonFly: src/sys/vfs/deadfs/dead_vnops.c,v 1.17 2006/05/25 01:20:07 dillon Exp $
+ * $DragonFly: src/sys/vfs/deadfs/dead_vnops.c,v 1.18 2006/07/18 22:22:15 dillon Exp $
  */
 
 #include <sys/param.h>
@@ -58,42 +58,40 @@ static int  dead_print (struct vop_print_args *);
 static int     dead_read (struct vop_read_args *);
 static int     dead_write (struct vop_write_args *);
 
-struct vop_ops *dead_vnode_vops;
-static struct vnodeopv_entry_desc dead_vnodeop_entries[] = {
-       { &vop_default_desc,            vop_defaultop },
-       { &vop_access_desc,             vop_ebadf },
-       { &vop_advlock_desc,            vop_ebadf },
-       { &vop_bmap_desc,               (vnodeopv_entry_t) dead_bmap },
-       { &vop_old_create_desc,         (vnodeopv_entry_t) dead_badop },
-       { &vop_getattr_desc,            vop_ebadf },
-       { &vop_inactive_desc,           vop_null },
-       { &vop_ioctl_desc,              (vnodeopv_entry_t) dead_ioctl },
-       { &vop_old_link_desc,           (vnodeopv_entry_t) dead_badop },
-       { &vop_old_lookup_desc,         (vnodeopv_entry_t) dead_lookup },
-       { &vop_old_mkdir_desc,          (vnodeopv_entry_t) dead_badop },
-       { &vop_old_mknod_desc,          (vnodeopv_entry_t) dead_badop },
-       { &vop_mmap_desc,               (vnodeopv_entry_t) dead_badop },
-       { &vop_open_desc,               (vnodeopv_entry_t) dead_open },
-       { &vop_close_desc,              (vnodeopv_entry_t) dead_close },
-       { &vop_pathconf_desc,           vop_ebadf },    /* per pathconf(2) */
-       { &vop_poll_desc,               (vnodeopv_entry_t) dead_poll },
-       { &vop_print_desc,              (vnodeopv_entry_t) dead_print },
-       { &vop_read_desc,               (vnodeopv_entry_t) dead_read },
-       { &vop_readdir_desc,            vop_ebadf },
-       { &vop_readlink_desc,           vop_ebadf },
-       { &vop_reclaim_desc,            vop_null },
-       { &vop_old_remove_desc,         (vnodeopv_entry_t) dead_badop },
-       { &vop_old_rename_desc,         (vnodeopv_entry_t) dead_badop },
-       { &vop_old_rmdir_desc,          (vnodeopv_entry_t) dead_badop },
-       { &vop_setattr_desc,            vop_ebadf },
-       { &vop_old_symlink_desc,        (vnodeopv_entry_t) dead_badop },
-       { &vop_write_desc,              (vnodeopv_entry_t) dead_write },
-       { NULL, NULL }
+struct vop_ops dead_vnode_vops = {
+       .vop_default =          vop_defaultop,
+       .vop_access =           (void *)vop_ebadf,
+       .vop_advlock =          (void *)vop_ebadf,
+       .vop_bmap =             dead_bmap,
+       .vop_old_create =       (void *)dead_badop,
+       .vop_getattr =          (void *)vop_ebadf,
+       .vop_inactive =         (void *)vop_null,
+       .vop_ioctl =            dead_ioctl,
+       .vop_old_link =         (void *)dead_badop,
+       .vop_old_lookup =       dead_lookup,
+       .vop_old_mkdir =        (void *)dead_badop,
+       .vop_old_mknod =        (void *)dead_badop,
+       .vop_mmap =             (void *)dead_badop,
+       .vop_open =             dead_open,
+       .vop_close =            dead_close,
+       .vop_pathconf =         (void *)vop_ebadf,      /* per pathconf(2) */
+       .vop_poll =             dead_poll,
+       .vop_print =            dead_print,
+       .vop_read =             dead_read,
+       .vop_readdir =          (void *)vop_ebadf,
+       .vop_readlink =         (void *)vop_ebadf,
+       .vop_reclaim =          (void *)vop_null,
+       .vop_old_remove =       (void *)dead_badop,
+       .vop_old_rename =       (void *)dead_badop,
+       .vop_old_rmdir =        (void *)dead_badop,
+       .vop_setattr =          (void *)vop_ebadf,
+       .vop_old_symlink =      (void *)dead_badop,
+       .vop_write =            dead_write
 };
-static struct vnodeopv_desc dead_vnodeop_opv_desc =
-       { &dead_vnode_vops, dead_vnodeop_entries, 0 };
 
-VNODEOP_SET(dead_vnodeop_opv_desc);
+struct vop_ops *dead_vnode_vops_p = &dead_vnode_vops;
+
+VNODEOP_SET(dead_vnode_vops);
 
 /*
  * Trivial lookup routine that always fails.
index 47d9b74..a5d5cc1 100644 (file)
@@ -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.19 2006/05/06 18:48:52 dillon Exp $
+ * $DragonFly: src/sys/vfs/fdesc/fdesc_vfsops.c,v 1.20 2006/07/18 22:22:15 dillon Exp $
  */
 
 /*
@@ -57,7 +57,7 @@
 
 #include "fdesc.h"
 
-extern struct vnodeopv_entry_desc fdesc_vnodeop_entries[];
+extern struct vop_ops fdesc_vnode_vops;
 
 static MALLOC_DEFINE(M_FDESCMNT, "FDESC mount", "FDESC mount structure");
 
@@ -86,8 +86,7 @@ fdesc_mount(struct mount *mp, char *path, caddr_t data, struct ucred *cred)
        if (mp->mnt_flag & MNT_UPDATE)
                return (EOPNOTSUPP);
 
-       vfs_add_vnodeops(mp, &mp->mnt_vn_norm_ops, 
-                        fdesc_vnodeop_entries, 0);
+       vfs_add_vnodeops(mp, &fdesc_vnode_vops, &mp->mnt_vn_norm_ops);
 
        error = fdesc_allocvp(Froot, FD_ROOT, mp, &rvp);
        if (error)
index 475372e..4eda09e 100644 (file)
@@ -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.30 2006/05/24 03:23:35 dillon Exp $
+ * $DragonFly: src/sys/vfs/fdesc/fdesc_vnops.c,v 1.31 2006/07/18 22:22:15 dillon Exp $
  */
 
 /*
@@ -537,19 +537,18 @@ fdesc_print(struct vop_print_args *ap)
        return (0);
 }
 
-struct vnodeopv_entry_desc fdesc_vnodeop_entries[] = {
-       { &vop_default_desc,            vop_defaultop },
-       { &vop_access_desc,             vop_null },
-       { &vop_getattr_desc,            (vnodeopv_entry_t) fdesc_getattr },
-       { &vop_inactive_desc,           (vnodeopv_entry_t) fdesc_inactive },
-       { &vop_old_lookup_desc,         (vnodeopv_entry_t) fdesc_lookup },
-       { &vop_open_desc,               (vnodeopv_entry_t) fdesc_open },
-       { &vop_pathconf_desc,           (vnodeopv_entry_t) vop_stdpathconf },
-       { &vop_poll_desc,               (vnodeopv_entry_t) fdesc_poll },
-       { &vop_print_desc,              (vnodeopv_entry_t) fdesc_print },
-       { &vop_readdir_desc,            (vnodeopv_entry_t) fdesc_readdir },
-       { &vop_reclaim_desc,            (vnodeopv_entry_t) fdesc_reclaim },
-       { &vop_setattr_desc,            (vnodeopv_entry_t) fdesc_setattr },
-       { NULL, NULL }
+struct vop_ops fdesc_vnode_vops = {
+       .vop_default =          vop_defaultop,
+       .vop_access =           (void *)vop_null,
+       .vop_getattr =          fdesc_getattr,
+       .vop_inactive =         fdesc_inactive,
+       .vop_old_lookup =       fdesc_lookup,
+       .vop_open =             fdesc_open,
+       .vop_pathconf =         vop_stdpathconf,
+       .vop_poll =             fdesc_poll,
+       .vop_print =            fdesc_print,
+       .vop_readdir =          fdesc_readdir,
+       .vop_reclaim =          fdesc_reclaim,
+       .vop_setattr =          fdesc_setattr
 };
 
index 1eb0bf4..ee868e1 100644 (file)
  *
  *     @(#)fifo.h      8.6 (Berkeley) 5/21/95
  * $FreeBSD: src/sys/miscfs/fifofs/fifo.h,v 1.16 1999/08/28 00:46:46 peter Exp $
- * $DragonFly: src/sys/vfs/fifofs/fifo.h,v 1.4 2004/08/13 17:51:10 dillon Exp $
+ * $DragonFly: src/sys/vfs/fifofs/fifo.h,v 1.5 2006/07/18 22:22:15 dillon Exp $
  */
 
-extern struct vop_ops *fifo_vnode_vops;
+extern struct vop_ops fifo_vnode_vops;
 
 /*
  * Prototypes for fifo operations on vnodes.
index 3940c66..ffae404 100644 (file)
@@ -32,7 +32,7 @@
  *
  *     @(#)fifo_vnops.c        8.10 (Berkeley) 5/27/95
  * $FreeBSD: src/sys/miscfs/fifofs/fifo_vnops.c,v 1.45.2.4 2003/04/22 10:11:24 bde Exp $
- * $DragonFly: src/sys/vfs/fifofs/fifo_vnops.c,v 1.30 2006/06/13 08:12:04 dillon Exp $
+ * $DragonFly: src/sys/vfs/fifofs/fifo_vnops.c,v 1.31 2006/07/18 22:22:15 dillon Exp $
  */
 
 #include <sys/param.h>
@@ -92,43 +92,39 @@ static struct filterops fiforead_filtops =
 static struct filterops fifowrite_filtops =
        { 1, NULL, filt_fifowdetach, filt_fifowrite };
   
-struct vop_ops *fifo_vnode_vops;
-static struct vnodeopv_entry_desc fifo_vnodeop_entries[] = {
-       { &vop_default_desc,            (vnodeopv_entry_t) vop_defaultop },
-       { &vop_access_desc,             (vnodeopv_entry_t) vop_ebadf },
-       { &vop_advlock_desc,            (vnodeopv_entry_t) fifo_advlock },
-       { &vop_bmap_desc,               (vnodeopv_entry_t) fifo_bmap },
-       { &vop_close_desc,              (vnodeopv_entry_t) fifo_close },
-       { &vop_old_create_desc,         (vnodeopv_entry_t) fifo_badop },
-       { &vop_getattr_desc,            (vnodeopv_entry_t) vop_ebadf },
-       { &vop_inactive_desc,           (vnodeopv_entry_t) fifo_inactive },
-       { &vop_ioctl_desc,              (vnodeopv_entry_t) fifo_ioctl },
-       { &vop_kqfilter_desc,           (vnodeopv_entry_t) fifo_kqfilter },
-       { &vop_old_link_desc,           (vnodeopv_entry_t) fifo_badop },
-       { &vop_old_lookup_desc,         (vnodeopv_entry_t) fifo_lookup },
-       { &vop_old_mkdir_desc,          (vnodeopv_entry_t) fifo_badop },
-       { &vop_old_mknod_desc,          (vnodeopv_entry_t) fifo_badop },
-       { &vop_open_desc,               (vnodeopv_entry_t) fifo_open },
-       { &vop_pathconf_desc,           (vnodeopv_entry_t) fifo_pathconf },
-       { &vop_poll_desc,               (vnodeopv_entry_t) fifo_poll },
-       { &vop_print_desc,              (vnodeopv_entry_t) fifo_print },
-       { &vop_read_desc,               (vnodeopv_entry_t) fifo_read },
-       { &vop_readdir_desc,            (vnodeopv_entry_t) fifo_badop },
-       { &vop_readlink_desc,           (vnodeopv_entry_t) fifo_badop },
-       { &vop_reallocblks_desc,        (vnodeopv_entry_t) fifo_badop },
-       { &vop_reclaim_desc,            (vnodeopv_entry_t) vop_null },
-       { &vop_old_remove_desc,         (vnodeopv_entry_t) fifo_badop },
-       { &vop_old_rename_desc,         (vnodeopv_entry_t) fifo_badop },
-       { &vop_old_rmdir_desc,          (vnodeopv_entry_t) fifo_badop },
-       { &vop_setattr_desc,            (vnodeopv_entry_t) vop_ebadf },
-       { &vop_old_symlink_desc,        (vnodeopv_entry_t) fifo_badop },
-       { &vop_write_desc,              (vnodeopv_entry_t) fifo_write },
-       { NULL, NULL }
+struct vop_ops fifo_vnode_vops = {
+       .vop_default =          vop_defaultop,
+       .vop_access =           (void *)vop_ebadf,
+       .vop_advlock =          fifo_advlock,
+       .vop_bmap =             fifo_bmap,
+       .vop_close =            fifo_close,
+       .vop_old_create =       (void *)fifo_badop,
+       .vop_getattr =          (void *)vop_ebadf,
+       .vop_inactive =         fifo_inactive,
+       .vop_ioctl =            fifo_ioctl,
+       .vop_kqfilter =         fifo_kqfilter,
+       .vop_old_link =         (void *)fifo_badop,
+       .vop_old_lookup =       fifo_lookup,
+       .vop_old_mkdir =        (void *)fifo_badop,
+       .vop_old_mknod =        (void *)fifo_badop,
+       .vop_open =             fifo_open,
+       .vop_pathconf =         fifo_pathconf,
+       .vop_poll =             fifo_poll,
+       .vop_print =            fifo_print,
+       .vop_read =             fifo_read,
+       .vop_readdir =          (void *)fifo_badop,
+       .vop_readlink =         (void *)fifo_badop,
+       .vop_reallocblks =      (void *)fifo_badop,
+       .vop_reclaim =          (void *)vop_null,
+       .vop_old_remove =       (void *)fifo_badop,
+       .vop_old_rename =       (void *)fifo_badop,
+       .vop_old_rmdir =        (void *)fifo_badop,
+       .vop_setattr =          (void *)vop_ebadf,
+       .vop_old_symlink =      (void *)fifo_badop,
+       .vop_write =            fifo_write
 };
-static struct vnodeopv_desc fifo_vnodeop_opv_desc =
-       { &fifo_vnode_vops, fifo_vnodeop_entries, 0 };
 
-VNODEOP_SET(fifo_vnodeop_opv_desc);
+VNODEOP_SET(fifo_vnode_vops);
 
 static MALLOC_DEFINE(M_FIFOINFO, "Fifo info", "Fifo info entries");
 
@@ -138,7 +134,7 @@ static MALLOC_DEFINE(M_FIFOINFO, "Fifo info", "Fifo info entries");
 int
 fifo_vnoperate(struct vop_generic_args *ap)
 {
-       return (VOCALL(fifo_vnode_vops, ap));
+       return (VOCALL(&fifo_vnode_vops, ap));
 }
 
 /*
index 09e297e..8de4e1c 100644 (file)
@@ -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.43 2006/05/06 18:48:52 dillon Exp $
+ *     $DragonFly: src/sys/vfs/gnu/ext2fs/ext2_vfsops.c,v 1.44 2006/07/18 22:22:15 dillon Exp $
  */
 
 #include "opt_quota.h"
@@ -71,9 +71,9 @@
 #include "ext2_fs.h"
 #include "ext2_fs_sb.h"
 
-extern struct vnodeopv_entry_desc ext2_vnodeop_entries[];
-extern struct vnodeopv_entry_desc ext2_specop_entries[];
-extern struct vnodeopv_entry_desc ext2_fifoop_entries[];
+extern struct vop_ops ext2_vnode_vops;
+extern struct vop_ops ext2_spec_vops;
+extern struct vop_ops ext2_fifo_vops;
 
 static int ext2_fhtovp (struct mount *, struct fid *, struct vnode **);
 static int ext2_flushfiles (struct mount *mp, int flags);
@@ -812,12 +812,9 @@ ext2_mountfs(struct vnode *devvp, struct mount *mp)
                ump->um_quotas[i] = NULLVP; 
        dev->si_mountpoint = mp;
 
-       vfs_add_vnodeops(mp, &mp->mnt_vn_norm_ops, 
-                        ext2_vnodeop_entries, 0);
-       vfs_add_vnodeops(mp, &mp->mnt_vn_spec_ops,
-                        ext2_specop_entries, 0);
-       vfs_add_vnodeops(mp, &mp->mnt_vn_fifo_ops,
-                        ext2_fifoop_entries, 0);
+       vfs_add_vnodeops(mp, &ext2_vnode_vops, &mp->mnt_vn_norm_ops);
+       vfs_add_vnodeops(mp, &ext2_spec_vops, &mp->mnt_vn_spec_ops);
+       vfs_add_vnodeops(mp, &ext2_fifo_vops, &mp->mnt_vn_fifo_ops);
 
        if (ronly == 0) 
                ext2_sbupdate(ump, MNT_WAIT);
index 5a0dad7..0eb8b95 100644 (file)
@@ -44,7 +44,7 @@
  *     @(#)ufs_vnops.c 8.27 (Berkeley) 5/27/95
  *     @(#)ext2_vnops.c        8.7 (Berkeley) 2/3/94
  * $FreeBSD: src/sys/gnu/ext2fs/ext2_vnops.c,v 1.51.2.2 2003/01/02 17:26:18 bde Exp $
- * $DragonFly: src/sys/vfs/gnu/ext2fs/ext2_vnops.c,v 1.33 2006/05/06 02:43:13 dillon Exp $
+ * $DragonFly: src/sys/vfs/gnu/ext2fs/ext2_vnops.c,v 1.34 2006/07/18 22:22:15 dillon Exp $
  */
 
 #include "opt_quota.h"
@@ -1839,7 +1839,7 @@ ext2spec_read(struct vop_read_args *ap)
 
        uio = ap->a_uio;
        resid = uio->uio_resid;
-       error = VOCALL(spec_vnode_vops, &ap->a_head);
+       error = VOCALL(&spec_vnode_vops, &ap->a_head);
        /*
         * The inode may have been revoked during the call, so it must not
         * be accessed blindly here or in the other wrapper functions.
@@ -1866,7 +1866,7 @@ ext2spec_write(struct vop_write_args *ap)
 
        uio = ap->a_uio;
        resid = uio->uio_resid;
-       error = VOCALL(spec_vnode_vops, &ap->a_head);
+       error = VOCALL(&spec_vnode_vops, &ap->a_head);
        ip = VTOI(ap->a_vp);
        if (ip != NULL && (uio->uio_resid != resid || (error == 0 && resid != 0)))
                VTOI(ap->a_vp)->i_flag |= IN_CHANGE | IN_UPDATE;
@@ -1888,7 +1888,7 @@ ext2spec_close(struct vop_close_args *ap)
 
        if (vp->v_usecount > 1)
                ext2_itimes(vp);
-       return (VOCALL(spec_vnode_vops, &ap->a_head));
+       return (VOCALL(&spec_vnode_vops, &ap->a_head));
 }
 
 /*
@@ -1907,7 +1907,7 @@ ext2fifo_read(struct vop_read_args *ap)
 
        uio = ap->a_uio;
        resid = uio->uio_resid;
-       error = VOCALL(fifo_vnode_vops, &ap->a_head);
+       error = VOCALL(&fifo_vnode_vops, &ap->a_head);
        ip = VTOI(ap->a_vp);
        if ((ap->a_vp->v_mount->mnt_flag & MNT_NOATIME) == 0 && ip != NULL &&
            (uio->uio_resid != resid || (error == 0 && resid != 0)))
@@ -1931,7 +1931,7 @@ ext2fifo_write(struct vop_write_args *ap)
 
        uio = ap->a_uio;
        resid = uio->uio_resid;
-       error = VOCALL(fifo_vnode_vops, &ap->a_head);
+       error = VOCALL(&fifo_vnode_vops, &ap->a_head);
        ip = VTOI(ap->a_vp);
        if (ip != NULL && (uio->uio_resid != resid || (error == 0 && resid != 0)))
                VTOI(ap->a_vp)->i_flag |= IN_CHANGE | IN_UPDATE;
@@ -1953,7 +1953,7 @@ ext2fifo_close(struct vop_close_args *ap)
 
        if (vp->v_usecount > 1)
                ext2_itimes(vp);
-       return (VOCALL(fifo_vnode_vops, &ap->a_head));
+       return (VOCALL(&fifo_vnode_vops, &ap->a_head));
 }
 
 /*
@@ -1967,7 +1967,7 @@ ext2fifo_kqfilter(struct vop_kqfilter_args *ap)
 {
        int error;
 
-       error = VOCALL(fifo_vnode_vops, &ap->a_head);
+       error = VOCALL(&fifo_vnode_vops, &ap->a_head);
        if (error)
                error = ext2_kqfilter(ap);
        return (error);
@@ -2172,97 +2172,84 @@ filt_ext2vnode(struct knote *kn, long hint)
        return (kn->kn_fflags != 0);
 }
 
-static struct vop_ops *ext2_vnode_vops;
-/* Global vfs data structures for ext2. */
-struct vnodeopv_entry_desc ext2_vnodeop_entries[] = {
-       { &vop_default_desc,            vop_defaultop },
-       { &vop_fsync_desc,              (vnodeopv_entry_t) ext2_fsync },
-       { &vop_read_desc,               (vnodeopv_entry_t) ext2_read },
-       { &vop_reallocblks_desc,        (vnodeopv_entry_t) ext2_reallocblks },
-       { &vop_write_desc,              (vnodeopv_entry_t) ext2_write },
-       { &vop_access_desc,             (vnodeopv_entry_t) ext2_access },
-       { &vop_advlock_desc,            (vnodeopv_entry_t) ext2_advlock },
-       { &vop_bmap_desc,               (vnodeopv_entry_t) ext2_bmap },
-       { &vop_old_lookup_desc,         (vnodeopv_entry_t) ext2_lookup },
-       { &vop_close_desc,              (vnodeopv_entry_t) ext2_close },
-       { &vop_old_create_desc,         (vnodeopv_entry_t) ext2_create },
-       { &vop_getattr_desc,            (vnodeopv_entry_t) ext2_getattr },
-       { &vop_inactive_desc,           (vnodeopv_entry_t) ext2_inactive },
-       { &vop_islocked_desc,           (vnodeopv_entry_t) vop_stdislocked },
-       { &vop_old_link_desc,           (vnodeopv_entry_t) ext2_link },
-       { &vop_lock_desc,               (vnodeopv_entry_t) vop_stdlock },
-       { &vop_old_mkdir_desc,          (vnodeopv_entry_t) ext2_mkdir },
-       { &vop_old_mknod_desc,          (vnodeopv_entry_t) ext2_mknod },
-       { &vop_mmap_desc,               (vnodeopv_entry_t) ext2_mmap },
-       { &vop_open_desc,               (vnodeopv_entry_t) ext2_open },
-       { &vop_pathconf_desc,           (vnodeopv_entry_t) ext2_pathconf },
-       { &vop_poll_desc,               (vnodeopv_entry_t) vop_stdpoll },
-       { &vop_kqfilter_desc,           (vnodeopv_entry_t) ext2_kqfilter },
-       { &vop_print_desc,              (vnodeopv_entry_t) ext2_print },
-       { &vop_readdir_desc,            (vnodeopv_entry_t) ext2_readdir },
-       { &vop_readlink_desc,           (vnodeopv_entry_t) ext2_readlink },
-       { &vop_reclaim_desc,            (vnodeopv_entry_t) ext2_reclaim },
-       { &vop_old_remove_desc,         (vnodeopv_entry_t) ext2_remove },
-       { &vop_old_rename_desc,         (vnodeopv_entry_t) ext2_rename },
-       { &vop_old_rmdir_desc,          (vnodeopv_entry_t) ext2_rmdir },
-       { &vop_setattr_desc,            (vnodeopv_entry_t) ext2_setattr },
-       { &vop_strategy_desc,           (vnodeopv_entry_t) ext2_strategy },
-       { &vop_old_symlink_desc,        (vnodeopv_entry_t) ext2_symlink },
-       { &vop_unlock_desc,             (vnodeopv_entry_t) vop_stdunlock },
-       { &vop_old_whiteout_desc,       (vnodeopv_entry_t) ext2_whiteout },
-       { &vop_getpages_desc,           (vnodeopv_entry_t) ext2_getpages },
-       { &vop_putpages_desc,           (vnodeopv_entry_t) ext2_putpages },
-       { NULL, NULL }
+struct vop_ops ext2_vnode_vops = {
+       .vop_default =          vop_defaultop,
+       .vop_fsync =            ext2_fsync,
+       .vop_read =             ext2_read,
+       .vop_reallocblks =      ext2_reallocblks,
+       .vop_write =            ext2_write,
+       .vop_access =           ext2_access,
+       .vop_advlock =          ext2_advlock,
+       .vop_bmap =             ext2_bmap,
+       .vop_old_lookup =       ext2_lookup,
+       .vop_close =            ext2_close,
+       .vop_old_create =       ext2_create,
+       .vop_getattr =          ext2_getattr,
+       .vop_inactive =         ext2_inactive,
+       .vop_islocked =         vop_stdislocked,
+       .vop_old_link =         ext2_link,
+       .vop_lock =             vop_stdlock,
+       .vop_old_mkdir =        ext2_mkdir,
+       .vop_old_mknod =        ext2_mknod,
+       .vop_mmap =             ext2_mmap,
+       .vop_open =             ext2_open,
+       .vop_pathconf =         ext2_pathconf,
+       .vop_poll =             vop_stdpoll,
+       .vop_kqfilter =         ext2_kqfilter,
+       .vop_print =            ext2_print,
+       .vop_readdir =          ext2_readdir,
+       .vop_readlink =         ext2_readlink,
+       .vop_reclaim =          ext2_reclaim,
+       .vop_old_remove =       ext2_remove,
+       .vop_old_rename =       ext2_rename,
+       .vop_old_rmdir =        ext2_rmdir,
+       .vop_setattr =          ext2_setattr,
+       .vop_strategy =         ext2_strategy,
+       .vop_old_symlink =      ext2_symlink,
+       .vop_unlock =           vop_stdunlock,
+       .vop_old_whiteout =     ext2_whiteout,
+       .vop_getpages =         ext2_getpages,
+       .vop_putpages =         ext2_putpages
 };
-static struct vnodeopv_desc ext2_vnodeop_opv_desc =
-       { &ext2_vnode_vops, ext2_vnodeop_entries, 0 };
-
-static struct vop_ops *ext2_spec_vops;
-struct vnodeopv_entry_desc ext2_specop_entries[] = {
-       { &vop_default_desc,            (vnodeopv_entry_t) ext2_vnoperatespec },
-       { &vop_fsync_desc,              (vnodeopv_entry_t) ext2_fsync },
-       { &vop_access_desc,             (vnodeopv_entry_t) ext2_access },
-       { &vop_close_desc,              (vnodeopv_entry_t) ext2spec_close },
-       { &vop_getattr_desc,            (vnodeopv_entry_t) ext2_getattr },
-       { &vop_inactive_desc,           (vnodeopv_entry_t) ext2_inactive },
-       { &vop_islocked_desc,           (vnodeopv_entry_t) vop_stdislocked },
-       { &vop_lock_desc,               (vnodeopv_entry_t) vop_stdlock },
-       { &vop_print_desc,              (vnodeopv_entry_t) ext2_print },
-       { &vop_read_desc,               (vnodeopv_entry_t) ext2spec_read },
-       { &vop_reclaim_desc,            (vnodeopv_entry_t) ext2_reclaim },
-       { &vop_setattr_desc,            (vnodeopv_entry_t) ext2_setattr },
-       { &vop_unlock_desc,             (vnodeopv_entry_t) vop_stdunlock },
-       { &vop_write_desc,              (vnodeopv_entry_t) ext2spec_write },
-       { NULL, NULL }
+
+struct vop_ops ext2_spec_vops = {
+       .vop_default =          ext2_vnoperatespec,
+       .vop_fsync =            ext2_fsync,
+       .vop_access =           ext2_access,
+       .vop_close =            ext2spec_close,
+       .vop_getattr =          ext2_getattr,
+       .vop_inactive =         ext2_inactive,
+       .vop_islocked =         vop_stdislocked,
+       .vop_lock =             vop_stdlock,
+       .vop_print =            ext2_print,
+       .vop_read =             ext2spec_read,
+       .vop_reclaim =          ext2_reclaim,
+       .vop_setattr =          ext2_setattr,
+       .vop_unlock =           vop_stdunlock,
+       .vop_write =            ext2spec_write
 };
-static struct vnodeopv_desc ext2_specop_opv_desc =
-       { &ext2_spec_vops, ext2_specop_entries, 0 };
-
-static struct vop_ops *ext2_fifo_vops;
-struct vnodeopv_entry_desc ext2_fifoop_entries[] = {
-       { &vop_default_desc,            (vnodeopv_entry_t) ext2_vnoperatefifo },
-       { &vop_fsync_desc,              (vnodeopv_entry_t) ext2_fsync },
-       { &vop_access_desc,             (vnodeopv_entry_t) ext2_access },
-       { &vop_close_desc,              (vnodeopv_entry_t) ext2fifo_close },
-       { &vop_getattr_desc,            (vnodeopv_entry_t) ext2_getattr },
-       { &vop_inactive_desc,           (vnodeopv_entry_t) ext2_inactive },
-       { &vop_islocked_desc,           (vnodeopv_entry_t) vop_stdislocked },
-       { &vop_kqfilter_desc,           (vnodeopv_entry_t) ext2fifo_kqfilter },
-       { &vop_lock_desc,               (vnodeopv_entry_t) vop_stdlock },
-       { &vop_print_desc,              (vnodeopv_entry_t) ext2_print },
-       { &vop_read_desc,               (vnodeopv_entry_t) ext2fifo_read },
-       { &vop_reclaim_desc,            (vnodeopv_entry_t) ext2_reclaim },
-       { &vop_setattr_desc,            (vnodeopv_entry_t) ext2_setattr },
-       { &vop_unlock_desc,             (vnodeopv_entry_t) vop_stdunlock },
-       { &vop_write_desc,              (vnodeopv_entry_t) ext2fifo_write },
-       { NULL, NULL }
+
+struct vop_ops ext2_fifo_vops = {
+       .vop_default =          ext2_vnoperatefifo,
+       .vop_fsync =            ext2_fsync,
+       .vop_access =           ext2_access,
+       .vop_close =            ext2fifo_close,
+       .vop_getattr =          ext2_getattr,
+       .vop_inactive =         ext2_inactive,
+       .vop_islocked =         vop_stdislocked,
+       .vop_kqfilter =         ext2fifo_kqfilter,
+       .vop_lock =             vop_stdlock,
+       .vop_print =            ext2_print,
+       .vop_read =             ext2fifo_read,
+       .vop_reclaim =          ext2_reclaim,
+       .vop_setattr =          ext2_setattr,
+       .vop_unlock =           vop_stdunlock,
+       .vop_write =            ext2fifo_write
 };
-static struct vnodeopv_desc ext2_fifoop_opv_desc =
-       { &ext2_fifo_vops, ext2_fifoop_entries, 0 };
 
-VNODEOP_SET(ext2_vnodeop_opv_desc);
-VNODEOP_SET(ext2_specop_opv_desc);
-VNODEOP_SET(ext2_fifoop_opv_desc);
+VNODEOP_SET(ext2_vnode_vops);
+VNODEOP_SET(ext2_spec_vops);
+VNODEOP_SET(ext2_fifo_vops);
 
 /*
  * ext2_vnoperate(struct vnodeop_desc *a_desc)
@@ -2270,7 +2257,7 @@ VNODEOP_SET(ext2_fifoop_opv_desc);
 int
 ext2_vnoperate(struct vop_generic_args *ap)
 {
-       return (VOCALL(ext2_vnode_vops, ap));
+       return (VOCALL(&ext2_vnode_vops, ap));
 }
 
 /*
@@ -2279,7 +2266,7 @@ ext2_vnoperate(struct vop_generic_args *ap)
 int
 ext2_vnoperatefifo(struct vop_generic_args *ap)
 {
-       return (VOCALL(ext2_fifo_vops, ap));
+       return (VOCALL(&ext2_fifo_vops, ap));
 }
 
 /*
@@ -2288,6 +2275,6 @@ ext2_vnoperatefifo(struct vop_generic_args *ap)
 int
 ext2_vnoperatespec(struct vop_generic_args *ap)
 {
-       return (VOCALL(ext2_spec_vops, ap));
+       return (VOCALL(&ext2_spec_vops, ap));
 }
 
index 0df337d..593366f 100644 (file)
@@ -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.35 2006/05/06 18:48:53 dillon Exp $
+ * $DragonFly: src/sys/vfs/hpfs/hpfs_vfsops.c,v 1.36 2006/07/18 22:22:15 dillon Exp $
  */
 
 
@@ -60,7 +60,7 @@
 #include "hpfsmount.h"
 #include "hpfs_subr.h"
 
-extern struct vnodeopv_entry_desc hpfs_vnodeop_entries[];
+extern struct vop_ops hpfs_vnode_vops;
 
 MALLOC_DEFINE(M_HPFSMNT, "HPFS mount", "HPFS mount structure");
 MALLOC_DEFINE(M_HPFSNO, "HPFS node", "HPFS node structure");
@@ -310,8 +310,7 @@ hpfs_mountfs(struct vnode *devvp, struct mount *mp, struct hpfs_args *argsp)
                hpfs_bmdeinit(hpmp);
                goto failed;
        }
-       vfs_add_vnodeops(mp, &mp->mnt_vn_norm_ops, 
-                        hpfs_vnodeop_entries, 0);
+       vfs_add_vnodeops(mp, &hpfs_vnode_vops, &mp->mnt_vn_norm_ops);
 
        error = hpfs_root(mp, &vp);
        if (error) {
index 399233f..839cc71 100644 (file)
@@ -24,7 +24,7 @@
  * SUCH DAMAGE.
  *
  * $FreeBSD: src/sys/fs/hpfs/hpfs_vnops.c,v 1.2.2.2 2002/01/15 18:35:09 semenu Exp $
- * $DragonFly: src/sys/vfs/hpfs/hpfs_vnops.c,v 1.35 2006/05/06 18:48:53 dillon Exp $
+ * $DragonFly: src/sys/vfs/hpfs/hpfs_vnops.c,v 1.36 2006/07/18 22:22:15 dillon Exp $
  */
 
 #include <sys/param.h>
@@ -1218,32 +1218,30 @@ hpfs_pathconf(struct vop_pathconf_args *ap)
  * Global vfs data structures
  */
 #if defined(__DragonFly__)
-struct vnodeopv_entry_desc hpfs_vnodeop_entries[] = {
-       { &vop_default_desc, (vnodeopv_entry_t)vop_defaultop },
-
-       { &vop_getattr_desc, (vnodeopv_entry_t)hpfs_getattr },
-       { &vop_setattr_desc, (vnodeopv_entry_t)hpfs_setattr },
-       { &vop_inactive_desc, (vnodeopv_entry_t)hpfs_inactive },
-       { &vop_reclaim_desc, (vnodeopv_entry_t)hpfs_reclaim },
-       { &vop_print_desc, (vnodeopv_entry_t)hpfs_print },
-       { &vop_old_create_desc, (vnodeopv_entry_t)hpfs_create },
-       { &vop_old_remove_desc, (vnodeopv_entry_t)hpfs_remove },
-       { &vop_islocked_desc, (vnodeopv_entry_t)vop_stdislocked },
-       { &vop_unlock_desc, (vnodeopv_entry_t)vop_stdunlock },
-       { &vop_lock_desc, (vnodeopv_entry_t)vop_stdlock },
-       { &vop_old_lookup_desc, (vnodeopv_entry_t)hpfs_lookup },
-       { &vop_access_desc, (vnodeopv_entry_t)hpfs_access },
-       { &vop_readdir_desc, (vnodeopv_entry_t)hpfs_readdir },
-       { &vop_fsync_desc, (vnodeopv_entry_t)hpfs_fsync },
-       { &vop_bmap_desc, (vnodeopv_entry_t)hpfs_bmap },
-       { &vop_getpages_desc, (vnodeopv_entry_t) hpfs_getpages },
-       { &vop_putpages_desc, (vnodeopv_entry_t) hpfs_putpages },
-       { &vop_strategy_desc, (vnodeopv_entry_t)hpfs_strategy },
-       { &vop_read_desc, (vnodeopv_entry_t)hpfs_read },
-       { &vop_write_desc, (vnodeopv_entry_t)hpfs_write },
-       { &vop_ioctl_desc, (vnodeopv_entry_t)hpfs_ioctl },
-       { &vop_pathconf_desc, (vnodeopv_entry_t)hpfs_pathconf },
-       { NULL, NULL }
+struct vop_ops hpfs_vnode_vops = {
+       .vop_default =          vop_defaultop,
+       .vop_getattr =          hpfs_getattr,
+       .vop_setattr =          hpfs_setattr,
+       .vop_inactive =         hpfs_inactive,
+       .vop_reclaim =          hpfs_reclaim,
+       .vop_print =            hpfs_print,
+       .vop_old_create =       hpfs_create,
+       .vop_old_remove =       hpfs_remove,
+       .vop_islocked =         vop_stdislocked,
+       .vop_unlock =           vop_stdunlock,
+       .vop_lock =             vop_stdlock,
+       .vop_old_lookup =       hpfs_lookup,
+       .vop_access =           hpfs_access,
+       .vop_readdir =          hpfs_readdir,
+       .vop_fsync =            hpfs_fsync,
+       .vop_bmap =             hpfs_bmap,
+       .vop_getpages =         hpfs_getpages,
+       .vop_putpages =         hpfs_putpages,
+       .vop_strategy =         hpfs_strategy,
+       .vop_read =             hpfs_read,
+       .vop_write =            hpfs_write,
+       .vop_ioctl =            hpfs_ioctl,
+       .vop_pathconf =         hpfs_pathconf
 };
 
 #else /* defined(__NetBSD__) */
index 0829561..f094d37 100644 (file)
@@ -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.36 2006/05/06 18:48:53 dillon Exp $
+ * $DragonFly: src/sys/vfs/isofs/cd9660/cd9660_vfsops.c,v 1.37 2006/07/18 22:22:15 dillon Exp $
  */
 
 #include <sys/param.h>
@@ -62,9 +62,9 @@
 #include "cd9660_node.h"
 #include "cd9660_mount.h"
 
-extern struct vnodeopv_entry_desc cd9660_vnodeop_entries[];
-extern struct vnodeopv_entry_desc cd9660_specop_entries[];
-extern struct vnodeopv_entry_desc cd9660_fifoop_entries[];
+extern struct vop_ops cd9660_vnode_vops;
+extern struct vop_ops cd9660_spec_vops;
+extern struct vop_ops cd9660_fifo_vops;
 
 MALLOC_DEFINE(M_ISOFSMNT, "ISOFS mount", "ISOFS mount structure");
 MALLOC_DEFINE(M_ISOFSNODE, "ISOFS node", "ISOFS vnode private part");
@@ -503,12 +503,9 @@ iso_mountfs(struct vnode *devvp, struct mount *mp, struct iso_args *argp)
                supbp = NULL;
        }
 
-       vfs_add_vnodeops(mp, &mp->mnt_vn_norm_ops, 
-                        cd9660_vnodeop_entries, 0);
-       vfs_add_vnodeops(mp, &mp->mnt_vn_spec_ops, 
-                        cd9660_specop_entries, 0);
-       vfs_add_vnodeops(mp, &mp->mnt_vn_fifo_ops,
-                        cd9660_fifoop_entries, 0);
+       vfs_add_vnodeops(mp, &cd9660_vnode_vops, &mp->mnt_vn_norm_ops);
+       vfs_add_vnodeops(mp, &cd9660_spec_vops, &mp->mnt_vn_spec_ops);
+       vfs_add_vnodeops(mp, &cd9660_fifo_vops, &mp->mnt_vn_fifo_ops);
 
        return 0;
 out:
index dc723d8..d4b0a85 100644 (file)
@@ -37,7 +37,7 @@
  *
  *     @(#)cd9660_vnops.c      8.19 (Berkeley) 5/27/95
  * $FreeBSD: src/sys/isofs/cd9660/cd9660_vnops.c,v 1.62 1999/12/15 23:01:51 eivind Exp $
- * $DragonFly: src/sys/vfs/isofs/cd9660/cd9660_vnops.c,v 1.27 2006/06/01 06:10:56 dillon Exp $
+ * $DragonFly: src/sys/vfs/isofs/cd9660/cd9660_vnops.c,v 1.28 2006/07/18 22:22:15 dillon Exp $
  */
 
 #include <sys/param.h>
@@ -867,60 +867,57 @@ cd9660_advlock(struct vop_advlock_args *ap)
 /*
  * Global vfs data structures for cd9660
  */
-struct vnodeopv_entry_desc cd9660_vnodeop_entries[] = {
-       { &vop_default_desc,            (vnodeopv_entry_t) vop_defaultop },
-       { &vop_open_desc,               (vnodeopv_entry_t) cd9660_open},
-       { &vop_access_desc,             (vnodeopv_entry_t) cd9660_access },
-       { &vop_advlock_desc,            (vnodeopv_entry_t) cd9660_advlock },
-       { &vop_bmap_desc,               (vnodeopv_entry_t) cd9660_bmap },
-       { &vop_old_lookup_desc,         (vnodeopv_entry_t) cd9660_lookup },
-       { &vop_getattr_desc,            (vnodeopv_entry_t) cd9660_getattr },
-       { &vop_inactive_desc,           (vnodeopv_entry_t) cd9660_inactive },
-       { &vop_ioctl_desc,              (vnodeopv_entry_t) cd9660_ioctl },
-       { &vop_islocked_desc,           (vnodeopv_entry_t) vop_stdislocked },
-       { &vop_lock_desc,               (vnodeopv_entry_t) vop_stdlock },
-       { &vop_pathconf_desc,           (vnodeopv_entry_t) cd9660_pathconf },
-       { &vop_print_desc,              (vnodeopv_entry_t) cd9660_print },
-       { &vop_read_desc,               (vnodeopv_entry_t) cd9660_read },
-       { &vop_readdir_desc,            (vnodeopv_entry_t) cd9660_readdir },
-       { &vop_readlink_desc,           (vnodeopv_entry_t) cd9660_readlink },
-       { &vop_reclaim_desc,            (vnodeopv_entry_t) cd9660_reclaim },
-       { &vop_setattr_desc,            (vnodeopv_entry_t) cd9660_setattr },
-       { &vop_strategy_desc,           (vnodeopv_entry_t) cd9660_strategy },
-       { &vop_unlock_desc,             (vnodeopv_entry_t) vop_stdunlock },
-       { &vop_getpages_desc,           (vnodeopv_entry_t) cd9660_getpages },
-       { &vop_putpages_desc,           (vnodeopv_entry_t) cd9660_putpages },
-       { NULL, NULL }
+struct vop_ops cd9660_vnode_vops = {
+       .vop_default =          vop_defaultop,
+       .vop_open =             cd9660_open,
+       .vop_access =           cd9660_access,
+       .vop_advlock =          cd9660_advlock,
+       .vop_bmap =             cd9660_bmap,
+       .vop_old_lookup =       cd9660_lookup,
+       .vop_getattr =          cd9660_getattr,
+       .vop_inactive =         cd9660_inactive,
+       .vop_ioctl =            cd9660_ioctl,
+       .vop_islocked =         vop_stdislocked,
+       .vop_lock =             vop_stdlock,
+       .vop_pathconf =         cd9660_pathconf,
+       .vop_print =            cd9660_print,
+       .vop_read =             cd9660_read,
+       .vop_readdir =          cd9660_readdir,
+       .vop_readlink =         cd9660_readlink,
+       .vop_reclaim =          cd9660_reclaim,
+       .vop_setattr =          cd9660_setattr,
+       .vop_strategy =         cd9660_strategy,
+       .vop_unlock =           vop_stdunlock,
+       .vop_getpages =         cd9660_getpages,
+       .vop_putpages =         cd9660_putpages
 };
 
 /*
  * Special device vnode ops
  */
-struct vnodeopv_entry_desc cd9660_specop_entries[] = {
-       { &vop_default_desc,            (vnodeopv_entry_t) spec_vnoperate },
-       { &vop_access_desc,             (vnodeopv_entry_t) cd9660_access },
-       { &vop_getattr_desc,            (vnodeopv_entry_t) cd9660_getattr },
-       { &vop_inactive_desc,           (vnodeopv_entry_t) cd9660_inactive },
-       { &vop_islocked_desc,           (vnodeopv_entry_t) vop_stdislocked },
-       { &vop_lock_desc,               (vnodeopv_entry_t) vop_stdlock },
-       { &vop_print_desc,              (vnodeopv_entry_t) cd9660_print },
-       { &vop_reclaim_desc,            (vnodeopv_entry_t) cd9660_reclaim },
-       { &vop_setattr_desc,            (vnodeopv_entry_t) cd9660_setattr },
-       { &vop_unlock_desc,             (vnodeopv_entry_t) vop_stdunlock },
-       { NULL, NULL }
+struct vop_ops cd9660_spec_vops = {
+       .vop_default =          spec_vnoperate,
+       .vop_access =           cd9660_access,
+       .vop_getattr =          cd9660_getattr,
+       .vop_inactive =         cd9660_inactive,
+       .vop_islocked =         vop_stdislocked,
+       .vop_lock =             vop_stdlock,
+       .vop_print =            cd9660_print,
+       .vop_reclaim =          cd9660_reclaim,
+       .vop_setattr =          cd9660_setattr,
+       .vop_unlock =           vop_stdunlock
 };
 
-struct vnodeopv_entry_desc cd9660_fifoop_entries[] = {
-       { &vop_default_desc,            (vnodeopv_entry_t) fifo_vnoperate },
-       { &vop_access_desc,             (vnodeopv_entry_t) cd9660_access },
-       { &vop_getattr_desc,            (vnodeopv_entry_t) cd9660_getattr },
-       { &vop_inactive_desc,           (vnodeopv_entry_t) cd9660_inactive },
-       { &vop_islocked_desc,           (vnodeopv_entry_t) vop_stdislocked },
-       { &vop_lock_desc,               (vnodeopv_entry_t) vop_stdlock },
-       { &vop_print_desc,              (vnodeopv_entry_t) cd9660_print },
-       { &vop_reclaim_desc,            (vnodeopv_entry_t) cd9660_reclaim },
-       { &vop_setattr_desc,            (vnodeopv_entry_t) cd9660_setattr },
-       { &vop_unlock_desc,             (vnodeopv_entry_t) vop_stdunlock },
-       { NULL, NULL }
+struct vop_ops cd9660_fifo_vops = {
+       .vop_default =          fifo_vnoperate,
+       .vop_access =           cd9660_access,
+       .vop_getattr =          cd9660_getattr,
+       .vop_inactive =         cd9660_inactive,
+       .vop_islocked =         vop_stdislocked,
+       .vop_lock =             vop_stdlock,
+       .vop_print =            cd9660_print,
+       .vop_reclaim =          cd9660_reclaim,
+       .vop_setattr =          cd9660_setattr,
+       .vop_unlock =           vop_stdunlock
 };
 
index a4d17f0..439cf59 100644 (file)
@@ -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.32 2006/05/11 08:23:20 swildner Exp $
+ * $DragonFly: src/sys/vfs/mfs/mfs_vfsops.c,v 1.33 2006/07/18 22:22:15 dillon Exp $
  */
 
 
@@ -70,8 +70,7 @@
 
 MALLOC_DEFINE(M_MFSNODE, "MFS node", "MFS vnode private part");
 
-
-extern struct vop_ops *mfs_vnode_vops;
+extern struct vop_ops *mfs_vnode_vops_p;
 
 static int     mfs_mount (struct mount *mp,
                        char *path, caddr_t data, struct ucred *td);
@@ -311,7 +310,7 @@ mfs_mount(struct mount *mp, char *path, caddr_t data, struct ucred *cred)
         */
        MALLOC(mfsp, struct mfsnode *, sizeof *mfsp, M_MFSNODE, M_WAITOK);
 
-       err = getspecialvnode(VT_MFS, NULL, &mfs_vnode_vops, &devvp, 0, 0);
+       err = getspecialvnode(VT_MFS, NULL, &mfs_vnode_vops_p, &devvp, 0, 0);
        if (err) {
                FREE(mfsp, M_MFSNODE);
                goto error_1;
index 3f3558d..94b41ac 100644 (file)
@@ -32,7 +32,7 @@
  *
  *     @(#)mfs_vnops.c 8.11 (Berkeley) 5/22/95
  * $FreeBSD: src/sys/ufs/mfs/mfs_vnops.c,v 1.47.2.1 2001/05/22 02:06:43 bp Exp $
- * $DragonFly: src/sys/vfs/mfs/mfs_vnops.c,v 1.28 2006/06/05 07:26:11 dillon Exp $
+ * $DragonFly: src/sys/vfs/mfs/mfs_vnops.c,v 1.29 2006/07/18 22:22:15 dillon Exp $
  */
 
 #include <sys/param.h>
@@ -73,29 +73,27 @@ static int  mfs_getpages (struct vop_getpages_args *); /* XXX */
  * mfs vnode operations.  Note: the vops here are used for the MFS block
  * device, not for operations on files (MFS calls the ffs mount code for that)
  */
-struct vop_ops *mfs_vnode_vops;
-static struct vnodeopv_entry_desc mfs_vnodeop_entries[] = {
-       { &vop_default_desc,            (vnodeopv_entry_t) mfs_badop },
-       { &vop_bmap_desc,               (vnodeopv_entry_t) mfs_bmap },
-       { &vop_close_desc,              (vnodeopv_entry_t) mfs_close },
-       { &vop_freeblks_desc,           (vnodeopv_entry_t) mfs_freeblks },
-       { &vop_fsync_desc,              (vnodeopv_entry_t) mfs_fsync },
-       { &vop_getpages_desc,           (vnodeopv_entry_t) mfs_getpages },
-       { &vop_inactive_desc,           (vnodeopv_entry_t) mfs_inactive },
-       { &vop_ioctl_desc,              vop_enotty },
-       { &vop_islocked_desc,           vop_defaultop },
-       { &vop_lock_desc,               vop_defaultop },
-       { &vop_open_desc,               (vnodeopv_entry_t) mfs_open },
-       { &vop_print_desc,              (vnodeopv_entry_t) mfs_print },
-       { &vop_reclaim_desc,            (vnodeopv_entry_t) mfs_reclaim },
-       { &vop_strategy_desc,           (vnodeopv_entry_t) mfs_strategy },
-       { &vop_unlock_desc,             vop_defaultop },
-       { NULL, NULL }
+static struct vop_ops mfs_vnode_vops = {
+       .vop_default =          mfs_badop,
+       .vop_bmap =             mfs_bmap,
+       .vop_close =            mfs_close,
+       .vop_freeblks =         mfs_freeblks,
+       .vop_fsync =            mfs_fsync,
+       .vop_getpages =         mfs_getpages,
+       .vop_inactive =         mfs_inactive,
+       .vop_ioctl =            (void *)vop_enotty,
+       .vop_islocked =         (void *)vop_defaultop,
+       .vop_lock =             (void *)vop_defaultop,
+       .vop_open =             mfs_open,
+       .vop_print =            mfs_print,
+       .vop_reclaim =          mfs_reclaim,
+       .vop_strategy =         mfs_strategy,
+       .vop_unlock =           (void *)vop_defaultop
 };
-static struct vnodeopv_desc mfs_vnodeop_opv_desc =
-       { &mfs_vnode_vops, mfs_vnodeop_entries, 0 };
 
-VNODEOP_SET(mfs_vnodeop_opv_desc);
+struct vop_ops *mfs_vnode_vops_p = &mfs_vnode_vops;
+
+VNODEOP_SET(mfs_vnode_vops);
 
 /*
  * Vnode Operations.
@@ -126,7 +124,7 @@ mfs_open(struct vop_open_args *ap)
 static int
 mfs_fsync(struct vop_fsync_args *ap)
 {
-       return (VOCALL(spec_vnode_vops, &ap->a_head));
+       return (VOCALL(&spec_vnode_vops, &ap->a_head));
 }
 
 /*
@@ -446,5 +444,5 @@ mfs_badop(struct vop_generic_args *ap)
 static int
 mfs_getpages(struct vop_getpages_args *ap)
 {
-       return (VOCALL(spec_vnode_vops, &ap->a_head));
+       return (VOCALL(&spec_vnode_vops, &ap->a_head));
 }
index 8c9f44c..d03ca95 100644 (file)
@@ -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.35 2006/06/02 04:59:54 dillon Exp $ */
+/* $DragonFly: src/sys/vfs/msdosfs/msdosfs_vfsops.c,v 1.36 2006/07/18 22:22:15 dillon Exp $ */
 /*     $NetBSD: msdosfs_vfsops.c,v 1.51 1997/11/17 15:36:58 ws Exp $   */
 
 /*-
@@ -70,7 +70,7 @@
 #include "msdosfsmount.h"
 #include "fat.h"
 
-extern struct vnodeopv_entry_desc msdosfs_vnodeop_entries[];
+extern struct vop_ops msdosfs_vnode_vops;
 
 #define MSDOSFS_DFLTBSIZE       4096
 
@@ -655,8 +655,7 @@ mountmsdosfs(struct vnode *devvp, struct mount *mp, struct msdosfs_args *argp)
        mp->mnt_stat.f_fsid.val[0] = dev2udev(dev);
        mp->mnt_stat.f_fsid.val[1] = mp->mnt_vfc->vfc_typenum;
        mp->mnt_flag |= MNT_LOCAL;
-       vfs_add_vnodeops(mp, &mp->mnt_vn_norm_ops, 
-                        msdosfs_vnodeop_entries, 0);
+       vfs_add_vnodeops(mp, &msdosfs_vnode_vops, &mp->mnt_vn_norm_ops);
        dev->si_mountpoint = mp;
 
        return 0;
index 215fa75..50ba9c6 100644 (file)
@@ -1,5 +1,5 @@
 /* $FreeBSD: src/sys/msdosfs/msdosfs_vnops.c,v 1.95.2.4 2003/06/13 15:05:47 trhodes Exp $ */
-/* $DragonFly: src/sys/vfs/msdosfs/msdosfs_vnops.c,v 1.38 2006/05/26 16:56:22 dillon Exp $ */
+/* $DragonFly: src/sys/vfs/msdosfs/msdosfs_vnops.c,v 1.39 2006/07/18 22:22:15 dillon Exp $ */
 /*     $NetBSD: msdosfs_vnops.c,v 1.68 1998/02/10 14:10:04 mrg Exp $   */
 
 /*-
@@ -1970,36 +1970,35 @@ msdosfs_putpages(struct vop_putpages_args *ap)
 }
 
 /* Global vfs data structures for msdosfs */
-struct vnodeopv_entry_desc msdosfs_vnodeop_entries[] = {
-       { &vop_default_desc,            vop_defaultop },
-       { &vop_access_desc,             (vnodeopv_entry_t) msdosfs_access },
-       { &vop_bmap_desc,               (vnodeopv_entry_t) msdosfs_bmap },
-       { &vop_old_lookup_desc,         (vnodeopv_entry_t) msdosfs_lookup },
-       { &vop_open_desc,               (vnodeopv_entry_t) msdosfs_open },
-       { &vop_close_desc,              (vnodeopv_entry_t) msdosfs_close },
-       { &vop_old_create_desc,         (vnodeopv_entry_t) msdosfs_create },
-       { &vop_fsync_desc,              (vnodeopv_entry_t) msdosfs_fsync },
-       { &vop_getattr_desc,            (vnodeopv_entry_t) msdosfs_getattr },
-       { &vop_inactive_desc,           (vnodeopv_entry_t) msdosfs_inactive },
-       { &vop_islocked_desc,           (vnodeopv_entry_t) vop_stdislocked },
-       { &vop_old_link_desc,           (vnodeopv_entry_t) msdosfs_link },
-       { &vop_lock_desc,               (vnodeopv_entry_t) vop_stdlock },
-       { &vop_old_mkdir_desc,          (vnodeopv_entry_t) msdosfs_mkdir },
-       { &vop_old_mknod_desc,          (vnodeopv_entry_t) msdosfs_mknod },
-       { &vop_pathconf_desc,           (vnodeopv_entry_t) msdosfs_pathconf },
-       { &vop_print_desc,              (vnodeopv_entry_t) msdosfs_print },
-       { &vop_read_desc,               (vnodeopv_entry_t) msdosfs_read },
-       { &vop_readdir_desc,            (vnodeopv_entry_t) msdosfs_readdir },
-       { &vop_reclaim_desc,            (vnodeopv_entry_t) msdosfs_reclaim },
-       { &vop_old_remove_desc,         (vnodeopv_entry_t) msdosfs_remove },
-       { &vop_old_rename_desc,         (vnodeopv_entry_t) msdosfs_rename },
-       { &vop_old_rmdir_desc,          (vnodeopv_entry_t) msdosfs_rmdir },
-       { &vop_setattr_desc,            (vnodeopv_entry_t) msdosfs_setattr },
-       { &vop_strategy_desc,           (vnodeopv_entry_t) msdosfs_strategy },
-       { &vop_old_symlink_desc,        (vnodeopv_entry_t) msdosfs_symlink },
-       { &vop_unlock_desc,             (vnodeopv_entry_t) vop_stdunlock },
-       { &vop_write_desc,              (vnodeopv_entry_t) msdosfs_write },
-       { &vop_getpages_desc,           (vnodeopv_entry_t) msdosfs_getpages },
-       { &vop_putpages_desc,           (vnodeopv_entry_t) msdosfs_putpages },
-       { NULL, NULL }
+struct vop_ops msdosfs_vnode_vops = {
+       .vop_default =          vop_defaultop,
+       .vop_access =           msdosfs_access,
+       .vop_bmap =             msdosfs_bmap,
+       .vop_old_lookup =       msdosfs_lookup,
+       .vop_open =             msdosfs_open,
+       .vop_close =            msdosfs_close,
+       .vop_old_create =       msdosfs_create,
+       .vop_fsync =            msdosfs_fsync,
+       .vop_getattr =          msdosfs_getattr,
+       .vop_inactive =         msdosfs_inactive,
+       .vop_islocked =         vop_stdislocked,
+       .vop_old_link =         msdosfs_link,
+       .vop_lock =             vop_stdlock,
+       .vop_old_mkdir =        msdosfs_mkdir,
+       .vop_old_mknod =        msdosfs_mknod,
+       .vop_pathconf =         msdosfs_pathconf,
+       .vop_print =            msdosfs_print,
+       .vop_read =             msdosfs_read,
+       .vop_readdir =          msdosfs_readdir,
+       .vop_reclaim =          msdosfs_reclaim,
+       .vop_old_remove =       msdosfs_remove,
+       .vop_old_rename =       msdosfs_rename,
+       .vop_old_rmdir =        msdosfs_rmdir,
+       .vop_setattr =          msdosfs_setattr,
+       .vop_strategy =         msdosfs_strategy,
+       .vop_old_symlink =      msdosfs_symlink,
+       .vop_unlock =           vop_stdunlock,
+       .vop_write =            msdosfs_write,
+       .vop_getpages =         msdosfs_getpages,
+       .vop_putpages =         msdosfs_putpages
 };
index 545629e..27eae2e 100644 (file)
@@ -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.43 2006/06/13 08:12:04 dillon Exp $
+ * $DragonFly: src/sys/vfs/nfs/nfs_vfsops.c,v 1.44 2006/07/18 22:22:15 dillon Exp $
  */
 
 #include "opt_bootp.h"
@@ -79,9 +79,9 @@ extern int    nfs_mountroot(struct mount *mp);
 extern void    bootpc_init(void);
 
 extern int     nfs_ticks;
-extern struct vnodeopv_entry_desc nfsv2_vnodeop_entries[];
-extern struct vnodeopv_entry_desc nfsv2_fifoop_entries[];
-extern struct vnodeopv_entry_desc nfsv2_specop_entries[];
+extern struct vop_ops nfsv2_vnode_vops;
+extern struct vop_ops nfsv2_fifo_vops;
+extern struct vop_ops nfsv2_spec_vops;
 
 MALLOC_DEFINE(M_NFSREQ, "NFS req", "NFS request header");
 MALLOC_DEFINE(M_NFSBIGFH, "NFSV3 bigfh", "NFS version 3 file handle");
@@ -961,12 +961,9 @@ mountnfs(struct nfs_args *argp, struct mount *mp, struct sockaddr *nam,
        /*
         * Install vop_ops for our vnops
         */
-       vfs_add_vnodeops(mp, &mp->mnt_vn_norm_ops, 
-                        nfsv2_vnodeop_entries, 0);
-       vfs_add_vnodeops(mp, &mp->mnt_vn_spec_ops,
-                        nfsv2_specop_entries, 0);
-       vfs_add_vnodeops(mp, &mp->mnt_vn_fifo_ops, 
-                        nfsv2_fifoop_entries, 0);
+       vfs_add_vnodeops(mp, &nfsv2_vnode_vops, &mp->mnt_vn_norm_ops);
+       vfs_add_vnodeops(mp, &nfsv2_spec_vops, &mp->mnt_vn_spec_ops);
+       vfs_add_vnodeops(mp, &nfsv2_fifo_vops, &mp->mnt_vn_fifo_ops);
 
        /*
         * A reference count is needed on the nfsnode representing the
index 71903c4..1369505 100644 (file)
@@ -35,7 +35,7 @@
  *
  *     @(#)nfs_vnops.c 8.16 (Berkeley) 5/27/95
  * $FreeBSD: src/sys/nfs/nfs_vnops.c,v 1.150.2.5 2001/12/20 19:56:28 dillon Exp $
- * $DragonFly: src/sys/vfs/nfs/nfs_vnops.c,v 1.61 2006/05/06 02:43:14 dillon Exp $
+ * $DragonFly: src/sys/vfs/nfs/nfs_vnops.c,v 1.62 2006/07/18 22:22:15 dillon Exp $
  */
 
 
@@ -134,82 +134,78 @@ static    int     nfs_nresolve (struct vop_nresolve_args *);
 /*
  * Global vfs data structures for nfs
  */
-struct vnodeopv_entry_desc nfsv2_vnodeop_entries[] = {
-       { &vop_default_desc,            vop_defaultop },
-       { &vop_access_desc,             (vnodeopv_entry_t) nfs_access },
-       { &vop_advlock_desc,            (vnodeopv_entry_t) nfs_advlock },
-       { &vop_bmap_desc,               (vnodeopv_entry_t) nfs_bmap },
-       { &vop_close_desc,              (vnodeopv_entry_t) nfs_close },
-       { &vop_old_create_desc,         (vnodeopv_entry_t) nfs_create },
-       { &vop_fsync_desc,              (vnodeopv_entry_t) nfs_fsync },
-       { &vop_getattr_desc,            (vnodeopv_entry_t) nfs_getattr },
-       { &vop_getpages_desc,           (vnodeopv_entry_t) nfs_getpages },
-       { &vop_putpages_desc,           (vnodeopv_entry_t) nfs_putpages },
-       { &vop_inactive_desc,           (vnodeopv_entry_t) nfs_inactive },
-       { &vop_islocked_desc,           (vnodeopv_entry_t) vop_stdislocked },
-       { &vop_old_link_desc,           (vnodeopv_entry_t) nfs_link },
-       { &vop_lock_desc,               (vnodeopv_entry_t) vop_stdlock },
-       { &vop_old_lookup_desc,         (vnodeopv_entry_t) nfs_lookup },
-       { &vop_old_mkdir_desc,          (vnodeopv_entry_t) nfs_mkdir },
-       { &vop_old_mknod_desc,          (vnodeopv_entry_t) nfs_mknod },
-       { &vop_mmap_desc,               (vnodeopv_entry_t) nfs_mmap },
-       { &vop_open_desc,               (vnodeopv_entry_t) nfs_open },
-       { &vop_poll_desc,               (vnodeopv_entry_t) nfs_poll },
-       { &vop_print_desc,              (vnodeopv_entry_t) nfs_print },
-       { &vop_read_desc,               (vnodeopv_entry_t) nfs_read },
-       { &vop_readdir_desc,            (vnodeopv_entry_t) nfs_readdir },
-       { &vop_readlink_desc,           (vnodeopv_entry_t) nfs_readlink },
-       { &vop_reclaim_desc,            (vnodeopv_entry_t) nfs_reclaim },
-       { &vop_old_remove_desc,         (vnodeopv_entry_t) nfs_remove },
-       { &vop_old_rename_desc,         (vnodeopv_entry_t) nfs_rename },
-       { &vop_old_rmdir_desc,          (vnodeopv_entry_t) nfs_rmdir },
-       { &vop_setattr_desc,            (vnodeopv_entry_t) nfs_setattr },
-       { &vop_strategy_desc,           (vnodeopv_entry_t) nfs_strategy },
-       { &vop_old_symlink_desc,        (vnodeopv_entry_t) nfs_symlink },
-       { &vop_unlock_desc,             (vnodeopv_entry_t) vop_stdunlock },
-       { &vop_write_desc,              (vnodeopv_entry_t) nfs_write },
-
-       { &vop_nresolve_desc,           (vnodeopv_entry_t) nfs_nresolve },
-       { NULL, NULL }
+struct vop_ops nfsv2_vnode_vops = {
+       .vop_default =          vop_defaultop,
+       .vop_access =           nfs_access,
+       .vop_advlock =          nfs_advlock,
+       .vop_bmap =             nfs_bmap,
+       .vop_close =            nfs_close,
+       .vop_old_create =       nfs_create,
+       .vop_fsync =            nfs_fsync,
+       .vop_getattr =          nfs_getattr,
+       .vop_getpages =         nfs_getpages,
+       .vop_putpages =         nfs_putpages,
+       .vop_inactive =         nfs_inactive,
+       .vop_islocked =         vop_stdislocked,
+       .vop_old_link =         nfs_link,
+       .vop_lock =             vop_stdlock,
+       .vop_old_lookup =       nfs_lookup,
+       .vop_old_mkdir =        nfs_mkdir,
+       .vop_old_mknod =        nfs_mknod,
+       .vop_mmap =             nfs_mmap,
+       .vop_open =             nfs_open,
+       .vop_poll =             nfs_poll,
+       .vop_print =            nfs_print,
+       .vop_read =             nfs_read,
+       .vop_readdir =          nfs_readdir,
+       .vop_readlink =         nfs_readlink,
+       .vop_reclaim =          nfs_reclaim,
+       .vop_old_remove =       nfs_remove,
+       .vop_old_rename =       nfs_rename,
+       .vop_old_rmdir =        nfs_rmdir,
+       .vop_setattr =          nfs_setattr,
+       .vop_strategy =         nfs_strategy,
+       .vop_old_symlink =      nfs_symlink,
+       .vop_unlock =           vop_stdunlock,
+       .vop_write =            nfs_write,
+       .vop_nresolve =         nfs_nresolve
 };
 
 /*
  * Special device vnode ops
  */
-struct vnodeopv_entry_desc nfsv2_specop_entries[] = {
-       { &vop_default_desc,            (vnodeopv_entry_t) spec_vnoperate },
-       { &vop_access_desc,             (vnodeopv_entry_t) nfsspec_access },
-       { &vop_close_desc,              (vnodeopv_entry_t) nfsspec_close },
-       { &vop_fsync_desc,              (vnodeopv_entry_t) nfs_fsync },
-       { &vop_getattr_desc,            (vnodeopv_entry_t) nfs_getattr },
-       { &vop_inactive_desc,           (vnodeopv_entry_t) nfs_inactive },
-       { &vop_islocked_desc,           (vnodeopv_entry_t) vop_stdislocked },
-       { &vop_lock_desc,               (vnodeopv_entry_t) vop_stdlock },
-       { &vop_print_desc,              (vnodeopv_entry_t) nfs_print },
-       { &vop_read_desc,               (vnodeopv_entry_t) nfsspec_read },
-       { &vop_reclaim_desc,            (vnodeopv_entry_t) nfs_reclaim },
-       { &vop_setattr_desc,            (vnodeopv_entry_t) nfs_setattr },
-       { &vop_unlock_desc,             (vnodeopv_entry_t) vop_stdunlock },
-       { &vop_write_desc,              (vnodeopv_entry_t) nfsspec_write },
-       { NULL, NULL }
+struct vop_ops nfsv2_spec_vops = {
+       .vop_default =          spec_vnoperate,
+       .vop_access =           nfsspec_access,
+       .vop_close =            nfsspec_close,
+       .vop_fsync =            nfs_fsync,
+       .vop_getattr =          nfs_getattr,
+       .vop_inactive =         nfs_inactive,
+       .vop_islocked =         vop_stdislocked,
+       .vop_lock =             vop_stdlock,
+       .vop_print =            nfs_print,
+       .vop_read =             nfsspec_read,
+       .vop_reclaim =          nfs_reclaim,
+       .vop_setattr =          nfs_setattr,
+       .vop_unlock =           vop_stdunlock,
+       .vop_write =            nfsspec_write
 };
 
-struct vnodeopv_entry_desc nfsv2_fifoop_entries[] = {
-       { &vop_default_desc,            (vnodeopv_entry_t) fifo_vnoperate },
-       { &vop_access_desc,             (vnodeopv_entry_t) nfsspec_access },
-       { &vop_close_desc,              (vnodeopv_entry_t) nfsfifo_close },
-       { &vop_fsync_desc,              (vnodeopv_entry_t) nfs_fsync },
-       { &vop_getattr_desc,            (vnodeopv_entry_t) nfs_getattr },
-       { &vop_inactive_desc,           (vnodeopv_entry_t) nfs_inactive },
-       { &vop_islocked_desc,           (vnodeopv_entry_t) vop_stdislocked },
-       { &vop_lock_desc,               (vnodeopv_entry_t) vop_stdlock },
-       { &vop_print_desc,              (vnodeopv_entry_t) nfs_print },
-       { &vop_read_desc,               (vnodeopv_entry_t) nfsfifo_read },
-       { &vop_reclaim_desc,            (vnodeopv_entry_t) nfs_reclaim },
-       { &vop_setattr_desc,            (vnodeopv_entry_t) nfs_setattr },
-       { &vop_unlock_desc,             (vnodeopv_entry_t) vop_stdunlock },
-       { &vop_write_desc,              (vnodeopv_entry_t) nfsfifo_write },
-       { NULL, NULL }
+struct vop_ops nfsv2_fifo_vops = {
+       .vop_default =          fifo_vnoperate,
+       .vop_access =           nfsspec_access,
+       .vop_close =            nfsfifo_close,
+       .vop_fsync =            nfs_fsync,
+       .vop_getattr =          nfs_getattr,
+       .vop_inactive =         nfs_inactive,
+       .vop_islocked =         vop_stdislocked,
+       .vop_lock =             vop_stdlock,
+       .vop_print =            nfs_print,
+       .vop_read =             nfsfifo_read,
+       .vop_reclaim =          nfs_reclaim,
+       .vop_setattr =          nfs_setattr,
+       .vop_unlock =           vop_stdunlock,
+       .vop_write =            nfsfifo_write
 };
 
 static int     nfs_mknodrpc (struct vnode *dvp, struct vnode **vpp,
@@ -3306,7 +3302,7 @@ nfsspec_read(struct vop_read_args *ap)
         */
        np->n_flag |= NACC;
        getnanotime(&np->n_atim);
-       return (VOCALL(spec_vnode_vops, &ap->a_head));
+       return (VOCALL(&spec_vnode_vops, &ap->a_head));
 }
 
 /*
@@ -3325,7 +3321,7 @@ nfsspec_write(struct vop_write_args *ap)
         */
        np->n_flag |= NUPD;
        getnanotime(&np->n_mtim);
-       return (VOCALL(spec_vnode_vops, &ap->a_head));
+       return (VOCALL(&spec_vnode_vops, &ap->a_head));
 }
 
 /*
@@ -3355,7 +3351,7 @@ nfsspec_close(struct vop_close_args *ap)
                        (void)VOP_SETATTR(vp, &vattr, nfs_vpcred(vp, ND_WRITE));
                }
        }
-       return (VOCALL(spec_vnode_vops, &ap->a_head));
+       return (VOCALL(&spec_vnode_vops, &ap->a_head));
 }
 
 /*
@@ -3374,7 +3370,7 @@ nfsfifo_read(struct vop_read_args *ap)
         */
        np->n_flag |= NACC;
        getnanotime(&np->n_atim);
-       return (VOCALL(fifo_vnode_vops, &ap->a_head));
+       return (VOCALL(&fifo_vnode_vops, &ap->a_head));
 }
 
 /*
@@ -3393,7 +3389,7 @@ nfsfifo_write(struct vop_write_args *ap)
         */
        np->n_flag |= NUPD;
        getnanotime(&np->n_mtim);
-       return (VOCALL(fifo_vnode_vops, &ap->a_head));
+       return (VOCALL(&fifo_vnode_vops, &ap->a_head));
 }
 
 /*
@@ -3428,6 +3424,6 @@ nfsfifo_close(struct vop_close_args *ap)
                        (void)VOP_SETATTR(vp, &vattr, nfs_vpcred(vp, ND_WRITE));
                }
        }
-       return (VOCALL(fifo_vnode_vops, &ap->a_head));
+       return (VOCALL(&fifo_vnode_vops, &ap->a_head));
 }
 
index 22186c3..c79faf0 100644 (file)
@@ -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.37 2006/05/06 18:48:53 dillon Exp $
+ * $DragonFly: src/sys/vfs/ntfs/ntfs_vfsops.c,v 1.38 2006/07/18 22:22:15 dillon Exp $
  */
 
 
@@ -70,7 +70,7 @@
 #include "ntfs_ihash.h"
 #include "ntfsmount.h"
 
-extern struct vnodeopv_entry_desc ntfs_vnodeop_entries[];
+extern struct vop_ops ntfs_vnode_vops;
 
 #if defined(__DragonFly__)
 MALLOC_DEFINE(M_NTFSMNT, "NTFS mount", "NTFS mount structure");
@@ -486,8 +486,7 @@ ntfs_mountfs(struct vnode *devvp, struct mount *mp, struct ntfs_args *argsp,
                (ntmp->ntm_flag & NTFS_MFLAG_ALLNAMES)?" allnames,":"",
                ntmp->ntm_uid, ntmp->ntm_gid, ntmp->ntm_mode));
 
-       vfs_add_vnodeops(mp, &mp->mnt_vn_norm_ops, 
-                        ntfs_vnodeop_entries, 0);
+       vfs_add_vnodeops(mp, &ntfs_vnode_vops, &mp->mnt_vn_norm_ops);
 
        /*
         * We read in some system nodes to do not allow 
index 68fc8a2..ab81cb1 100644 (file)
@@ -36,7 +36,7 @@
  * SUCH DAMAGE.
  *
  * $FreeBSD: src/sys/ntfs/ntfs_vnops.c,v 1.9.2.4 2002/08/06 19:35:18 semenu Exp $
- * $DragonFly: src/sys/vfs/ntfs/ntfs_vnops.c,v 1.33 2006/05/06 18:48:53 dillon Exp $
+ * $DragonFly: src/sys/vfs/ntfs/ntfs_vnops.c,v 1.34 2006/07/18 22:22:15 dillon Exp $
  *
  */
 
@@ -101,7 +101,7 @@ static int  ntfs_fsync (struct vop_fsync_args *ap);
 #else
 static int     ntfs_bypass (struct vop_generic_args *);
 #endif
-static int     ntfs_pathconf (void *);
+static int     ntfs_pathconf (struct vop_pathconf_args *);
 
 int    ntfs_prtactive = 1;     /* 1 => print out reclaim of active vnodes */
 
@@ -797,14 +797,8 @@ ntfs_fsync(struct vop_fsync_args *ap)
  * Return POSIX pathconf information applicable to NTFS filesystem
  */
 int
-ntfs_pathconf(void *v)
+ntfs_pathconf(struct vop_pathconf_args *ap)
 {
-       struct vop_pathconf_args /* {
-               struct vnode *a_vp;
-               int a_name;
-               register_t *a_retval;
-       } */ *ap = v;
-
        switch (ap->a_name) {
        case _PC_LINK_MAX:
                *ap->a_retval = 1;
@@ -838,33 +832,27 @@ ntfs_pathconf(void *v)
 /*
  * Global vfs data structures
  */
-struct vnodeopv_entry_desc ntfs_vnodeop_entries[] = {
-       { &vop_default_desc,    vop_defaultop },
-
-       { &vop_getattr_desc,    (vnodeopv_entry_t)ntfs_getattr },
-       { &vop_inactive_desc,   (vnodeopv_entry_t)ntfs_inactive },
-       { &vop_reclaim_desc,    (vnodeopv_entry_t)ntfs_reclaim },
-       { &vop_print_desc,      (vnodeopv_entry_t)ntfs_print },
-       { &vop_pathconf_desc,   (vnodeopv_entry_t)ntfs_pathconf },
-
-       { &vop_islocked_desc,   (vnodeopv_entry_t)vop_stdislocked },
-       { &vop_unlock_desc,     (vnodeopv_entry_t)vop_stdunlock },
-       { &vop_lock_desc,       (vnodeopv_entry_t)vop_stdlock },
-       { &vop_old_lookup_desc, (vnodeopv_entry_t)ntfs_lookup },
-
-       { &vop_access_desc,     (vnodeopv_entry_t)ntfs_access },
-       { &vop_close_desc,      (vnodeopv_entry_t)ntfs_close },
-       { &vop_open_desc,       (vnodeopv_entry_t)ntfs_open },
-       { &vop_readdir_desc,    (vnodeopv_entry_t)ntfs_readdir },
-       { &vop_fsync_desc,      (vnodeopv_entry_t)ntfs_fsync },
-
-       { &vop_bmap_desc,       (vnodeopv_entry_t)ntfs_bmap },
-       { &vop_getpages_desc,   (vnodeopv_entry_t)ntfs_getpages },
-       { &vop_putpages_desc,   (vnodeopv_entry_t)ntfs_putpages },
-       { &vop_strategy_desc,   (vnodeopv_entry_t)ntfs_strategy },
-       { &vop_read_desc,       (vnodeopv_entry_t)ntfs_read },
-       { &vop_write_desc,      (vnodeopv_entry_t)ntfs_write },
-
-       { NULL, NULL }
+struct vop_ops ntfs_vnode_vops = {
+       .vop_default =          vop_defaultop,
+       .vop_getattr =          ntfs_getattr,
+       .vop_inactive =         ntfs_inactive,
+       .vop_reclaim =          ntfs_reclaim,
+       .vop_print =            ntfs_print,
+       .vop_pathconf =         ntfs_pathconf,
+       .vop_islocked =         vop_stdislocked,
+       .vop_unlock =           vop_stdunlock,
+       .vop_lock =             vop_stdlock,
+       .vop_old_lookup =       ntfs_lookup,
+       .vop_access =           ntfs_access,
+       .vop_close =            ntfs_close,
+       .vop_open =             ntfs_open,
+       .vop_readdir =          ntfs_readdir,
+       .vop_fsync =            ntfs_fsync,
+       .vop_bmap =             ntfs_bmap,
+       .vop_getpages =         ntfs_getpages,
+       .vop_putpages =         ntfs_putpages,
+       .vop_strategy =         ntfs_strategy,
+       .vop_read =             ntfs_read,
+       .vop_write =            ntfs_write
 };
 
index 1a7eb2e..6ced01a 100644 (file)
@@ -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.21 2006/05/06 18:48:53 dillon Exp $
+ * $DragonFly: src/sys/vfs/nullfs/null_vfsops.c,v 1.22 2006/07/18 22:22:15 dillon Exp $
  */
 
 /*
@@ -55,7 +55,7 @@
 #include <sys/nlookup.h>
 #include "null.h"
 
-extern struct vnodeopv_entry_desc null_vnodeop_entries[];
+extern struct vop_ops null_vnode_vops;
 
 static MALLOC_DEFINE(M_NULLFSMNT, "NULLFS mount", "NULLFS mount structure");
 
@@ -117,8 +117,7 @@ nullfs_mount(struct mount *mp, char *path, caddr_t data, struct ucred *cred)
        xmp->nullm_vfs = nd.nl_ncp->nc_mount;
        nlookup_done(&nd);
 
-       vfs_add_vnodeops(mp, &mp->mnt_vn_norm_ops, 
-                        null_vnodeop_entries, 0);
+       vfs_add_vnodeops(mp, &null_vnode_vops, &mp->mnt_vn_norm_ops);
 
        VOP_UNLOCK(rootvp, 0);
 
index 968ac17..020b84d 100644 (file)
@@ -38,7 +38,7 @@
  * Ancestors:
  *     @(#)lofs_vnops.c        1.2 (Berkeley) 6/18/92
  * $FreeBSD: src/sys/miscfs/nullfs/null_vnops.c,v 1.38.2.6 2002/07/31 00:32:28 semenu Exp $
- * $DragonFly: src/sys/vfs/nullfs/null_vnops.c,v 1.26 2006/05/14 18:07:29 swildner Exp $
+ * $DragonFly: src/sys/vfs/nullfs/null_vnops.c,v 1.27 2006/07/18 22:22:15 dillon Exp $
  *     ...and...
  *     @(#)null_vnodeops.c 1.20 92/07/07 UCLA Ficus project
  *
@@ -211,17 +211,16 @@ null_nrename(struct vop_nrename_args *ap)
 /*
  * Global vfs data structures
  */
-struct vnodeopv_entry_desc null_vnodeop_entries[] = {
-       { &vop_nresolve_desc,           (vnodeopv_entry_t) null_nresolve },
-       { &vop_ncreate_desc,            (vnodeopv_entry_t) null_ncreate },
-       { &vop_nmkdir_desc,             (vnodeopv_entry_t) null_nmkdir },
-       { &vop_nmknod_desc,             (vnodeopv_entry_t) null_nmknod },
-       { &vop_nlink_desc,              (vnodeopv_entry_t) null_nlink },
-       { &vop_nsymlink_desc,           (vnodeopv_entry_t) null_nsymlink },
-       { &vop_nwhiteout_desc,          (vnodeopv_entry_t) null_nwhiteout },
-       { &vop_nremove_desc,            (vnodeopv_entry_t) null_nremove },
-       { &vop_nrmdir_desc,             (vnodeopv_entry_t) null_nrmdir },
-       { &vop_nrename_desc,            (vnodeopv_entry_t) null_nrename },
-       { NULL, NULL }
+struct vop_ops null_vnode_vops = {
+       .vop_nresolve =         null_nresolve,
+       .vop_ncreate =          null_ncreate,
+       .vop_nmkdir =           null_nmkdir,
+       .vop_nmknod =           null_nmknod,
+       .vop_nlink =            null_nlink,
+       .vop_nsymlink =         null_nsymlink,
+       .vop_nwhiteout =        null_nwhiteout,
+       .vop_nremove =          null_nremove,
+       .vop_nrmdir =           null_nrmdir,
+       .vop_nrename =          null_nrename
 };
 
index 0976b1c..0d02b71 100644 (file)
@@ -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.23 2006/05/06 18:48:53 dillon Exp $
+ * $DragonFly: src/sys/vfs/nwfs/nwfs_vfsops.c,v 1.24 2006/07/18 22:22:16 dillon Exp $
  */
 #include "opt_ncp.h"
 #ifndef NCP
@@ -58,7 +58,7 @@
 #include "nwfs_node.h"
 #include "nwfs_subr.h"
 
-extern struct vnodeopv_entry_desc nwfs_vnodeop_entries[];
+extern struct vop_ops nwfs_vnode_vops;
 
 int nwfs_debuglevel = 0;
 
@@ -203,8 +203,7 @@ nwfs_mount(struct mount *mp, char *path, caddr_t data, struct ucred *cred)
        /* protect against invalid mount points */
        nmp->m.mount_point[sizeof(nmp->m.mount_point)-1] = '\0';
 
-       vfs_add_vnodeops(mp, &mp->mnt_vn_norm_ops, 
-                        nwfs_vnodeop_entries, 0);
+       vfs_add_vnodeops(mp, &nwfs_vnode_vops, &mp->mnt_vn_norm_ops);
 
        vfs_getnewfsid(mp);
        error = nwfs_root(mp, &vp);
index 96d7aeb..df738f3 100644 (file)
@@ -30,7 +30,7 @@
  * SUCH DAMAGE.
  *
  * $FreeBSD: src/sys/nwfs/nwfs_vnops.c,v 1.6.2.3 2001/03/14 11:26:59 bp Exp $
- * $DragonFly: src/sys/vfs/nwfs/nwfs_vnops.c,v 1.29 2006/05/06 02:43:14 dillon Exp $
+ * $DragonFly: src/sys/vfs/nwfs/nwfs_vnops.c,v 1.30 2006/07/18 22:22:16 dillon Exp $
  */
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -84,39 +84,38 @@ static int nwfs_print(struct vop_print_args *);
 static int nwfs_pathconf(struct vop_pathconf_args *ap);
 
 /* Global vfs data structures for nwfs */
-struct vnodeopv_entry_desc nwfs_vnodeop_entries[] = {
-       { &vop_default_desc,            vop_defaultop },
-       { &vop_access_desc,             (vnodeopv_entry_t) nwfs_access },
-       { &vop_bmap_desc,               (vnodeopv_entry_t) nwfs_bmap },
-       { &vop_open_desc,               (vnodeopv_entry_t) nwfs_open },
-       { &vop_close_desc,              (vnodeopv_entry_t) nwfs_close },
-       { &vop_old_create_desc,         (vnodeopv_entry_t) nwfs_create },
-       { &vop_fsync_desc,              (vnodeopv_entry_t) nwfs_fsync },
-       { &vop_getattr_desc,            (vnodeopv_entry_t) nwfs_getattr },
-       { &vop_getpages_desc,           (vnodeopv_entry_t) nwfs_getpages },
-       { &vop_putpages_desc,           (vnodeopv_entry_t) nwfs_putpages },
-       { &vop_ioctl_desc,              (vnodeopv_entry_t) nwfs_ioctl },
-       { &vop_inactive_desc,           (vnodeopv_entry_t) nwfs_inactive },
-       { &vop_islocked_desc,           (vnodeopv_entry_t) vop_stdislocked },
-       { &vop_old_link_desc,           (vnodeopv_entry_t) nwfs_link },
-       { &vop_lock_desc,               (vnodeopv_entry_t) vop_stdlock },
-       { &vop_old_lookup_desc,         (vnodeopv_entry_t) nwfs_lookup },
-       { &vop_old_mkdir_desc,          (vnodeopv_entry_t) nwfs_mkdir },
-       { &vop_old_mknod_desc,          (vnodeopv_entry_t) nwfs_mknod },
-       { &vop_pathconf_desc,           (vnodeopv_entry_t) nwfs_pathconf },
-       { &vop_print_desc,              (vnodeopv_entry_t) nwfs_print },
-       { &vop_read_desc,               (vnodeopv_entry_t) nwfs_read },
-       { &vop_readdir_desc,            (vnodeopv_entry_t) nwfs_readdir },
-       { &vop_reclaim_desc,            (vnodeopv_entry_t) nwfs_reclaim },
-       { &vop_old_remove_desc,         (vnodeopv_entry_t) nwfs_remove },
-       { &vop_old_rename_desc,         (vnodeopv_entry_t) nwfs_rename },
-       { &vop_old_rmdir_desc,          (vnodeopv_entry_t) nwfs_rmdir },
-       { &vop_setattr_desc,            (vnodeopv_entry_t) nwfs_setattr },
-       { &vop_strategy_desc,           (vnodeopv_entry_t) nwfs_strategy },
-       { &vop_old_symlink_desc,        (vnodeopv_entry_t) nwfs_symlink },
-       { &vop_unlock_desc,             (vnodeopv_entry_t) vop_stdunlock },
-       { &vop_write_desc,              (vnodeopv_entry_t) nwfs_write },
-       { NULL, NULL }
+struct vop_ops nwfs_vnode_vops = {
+       .vop_default =          vop_defaultop,
+       .vop_access =           nwfs_access,
+       .vop_bmap =             nwfs_bmap,
+       .vop_open =             nwfs_open,
+       .vop_close =            nwfs_close,
+       .vop_old_create =       nwfs_create,
+       .vop_fsync =            nwfs_fsync,
+       .vop_getattr =          nwfs_getattr,
+       .vop_getpages =         nwfs_getpages,
+       .vop_putpages =         nwfs_putpages,
+       .vop_ioctl =            nwfs_ioctl,
+       .vop_inactive =         nwfs_inactive,
+       .vop_islocked =         vop_stdislocked,
+       .vop_old_link =         nwfs_link,
+       .vop_lock =             vop_stdlock,
+       .vop_old_lookup =       nwfs_lookup,
+       .vop_old_mkdir =        nwfs_mkdir,
+       .vop_old_mknod =        nwfs_mknod,
+       .vop_pathconf =         nwfs_pathconf,
+       .vop_print =            nwfs_print,
+       .vop_read =             nwfs_read,
+       .vop_readdir =          nwfs_readdir,
+       .vop_reclaim =          nwfs_reclaim,
+       .vop_old_remove =       nwfs_remove,
+       .vop_old_rename =       nwfs_rename,
+       .vop_old_rmdir =        nwfs_rmdir,
+       .vop_setattr =          nwfs_setattr,
+       .vop_strategy =         nwfs_strategy,
+       .vop_old_symlink =      nwfs_symlink,
+       .vop_unlock =           vop_stdunlock,
+       .vop_write =            nwfs_write
 };
 
 /*
index 4756d8a..dd98c28 100644 (file)
@@ -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.20 2006/05/06 18:48:53 dillon Exp $
+ * $DragonFly: src/sys/vfs/portal/portal_vfsops.c,v 1.21 2006/07/18 22:22:16 dillon Exp $
  */
 
 /*
@@ -58,7 +58,7 @@
 #include <sys/domain.h>
 #include "portal.h"
 
-extern struct vnodeopv_entry_desc portal_vnodeop_entries[];
+extern struct vop_ops portal_vnode_vops;
 
 static MALLOC_DEFINE(M_PORTALFSMNT, "PORTAL mount", "PORTAL mount structure");
 
@@ -111,8 +111,7 @@ portal_mount(struct mount *mp, char *path, caddr_t data, struct ucred *cred)
                M_PORTALFSMNT, M_WAITOK);       /* XXX */
 
         
-       vfs_add_vnodeops(mp, &mp->mnt_vn_norm_ops,
-                        portal_vnodeop_entries, 0);
+       vfs_add_vnodeops(mp, &portal_vnode_vops, &mp->mnt_vn_norm_ops);
 
        error = getnewvnode(VT_PORTAL, mp, &rvp, 0, 0);
        if (error) {
index e4d03ee..7576a4a 100644 (file)
@@ -36,7 +36,7 @@
  *     @(#)portal_vnops.c      8.14 (Berkeley) 5/21/95
  *
  * $FreeBSD: src/sys/miscfs/portal/portal_vnops.c,v 1.38 1999/12/21 06:29:00 chris Exp $
- * $DragonFly: src/sys/vfs/portal/portal_vnops.c,v 1.29 2006/06/13 08:12:04 dillon Exp $
+ * $DragonFly: src/sys/vfs/portal/portal_vnops.c,v 1.30 2006/07/18 22:22:16 dillon Exp $
  */
 
 /*
@@ -569,19 +569,18 @@ portal_badop(void)
        /* NOTREACHED */
 }
 
-struct vnodeopv_entry_desc portal_vnodeop_entries[] = {
-       { &vop_default_desc,            vop_defaultop },
-       { &vop_access_desc,             vop_null },
-       { &vop_bmap_desc,               (vnodeopv_entry_t) portal_badop },
-       { &vop_getattr_desc,            (vnodeopv_entry_t) portal_getattr },
-       { &vop_inactive_desc,           (vnodeopv_entry_t) portal_inactive },
-       { &vop_old_lookup_desc,         (vnodeopv_entry_t) portal_lookup },
-       { &vop_open_desc,               (vnodeopv_entry_t) portal_open },
-       { &vop_pathconf_desc,           (vnodeopv_entry_t) vop_stdpathconf },
-       { &vop_print_desc,              (vnodeopv_entry_t) portal_print },
-       { &vop_readdir_desc,            (vnodeopv_entry_t) portal_readdir },
-       { &vop_reclaim_desc,            (vnodeopv_entry_t) portal_reclaim },
-       { &vop_setattr_desc,            (vnodeopv_entry_t) portal_setattr },
-       { NULL, NULL }
+struct vop_ops portal_vnode_vops = {
+       .vop_default =          vop_defaultop,
+       .vop_access =           (void *)vop_null,
+       .vop_bmap =             (void *)portal_badop,
+       .vop_getattr =          portal_getattr,
+       .vop_inactive =         portal_inactive,
+       .vop_old_lookup =       portal_lookup,
+       .vop_open =             portal_open,
+       .vop_pathconf =         vop_stdpathconf,
+       .vop_print =            portal_print,
+       .vop_readdir =          portal_readdir,
+       .vop_reclaim =          portal_reclaim,
+       .vop_setattr =          portal_setattr
 };
 
index 739e187..bd148e6 100644 (file)
@@ -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.14 2006/05/06 18:48:53 dillon Exp $
+ * $DragonFly: src/sys/vfs/procfs/procfs_vfsops.c,v 1.15 2006/07/18 22:22:16 dillon Exp $
  */
 
 /*
@@ -52,7 +52,7 @@
 #include <sys/vnode.h>
 #include <vfs/procfs/procfs.h>
 
-extern struct vnodeopv_entry_desc procfs_vnodeop_entries[];
+extern struct vop_ops procfs_vnode_vops;
 
 static int     procfs_mount (struct mount *mp, char *path, caddr_t data,
                                  struct ucred *cred);
@@ -88,8 +88,7 @@ procfs_mount(struct mount *mp, char *path, caddr_t data, struct ucred *cred)
        bcopy("procfs", mp->mnt_stat.f_mntfromname, size);
        bzero(mp->mnt_stat.f_mntfromname + size, MNAMELEN - size);
        procfs_statfs(mp, &mp->mnt_stat, cred);
-       vfs_add_vnodeops(mp, &mp->mnt_vn_norm_ops,
-                        procfs_vnodeop_entries, 0);
+       vfs_add_vnodeops(mp, &procfs_vnode_vops, &mp->mnt_vn_norm_ops);
 
        return (0);
 }
index 310112f..f30c059 100644 (file)
@@ -37,7 +37,7 @@
  *     @(#)procfs_vnops.c      8.18 (Berkeley) 5/21/95
  *
  * $FreeBSD: src/sys/miscfs/procfs/procfs_vnops.c,v 1.76.2.7 2002/01/22 17:22:59 nectar Exp $
- * $DragonFly: src/sys/vfs/procfs/procfs_vnops.c,v 1.33 2006/05/26 16:56:31 dillon Exp $
+ * $DragonFly: src/sys/vfs/procfs/procfs_vnops.c,v 1.34 2006/07/18 22:22:16 dillon Exp $
  */
 
 /*
@@ -66,7 +66,7 @@
 #include <machine/limits.h>
 
 static int     procfs_access (struct vop_access_args *);
-static int     procfs_badop (void);
+static int     procfs_badop (struct vop_generic_args *);
 static int     procfs_bmap (struct vop_bmap_args *);
 static int     procfs_close (struct vop_close_args *);
 static int     procfs_getattr (struct vop_getattr_args *);
@@ -83,6 +83,39 @@ static int   procfs_setattr (struct vop_setattr_args *);
 static int     procfs_readdir_proc(struct vop_readdir_args *);
 static int     procfs_readdir_root(struct vop_readdir_args *);
 
+/*
+ * procfs vnode operations.
+ */
+struct vop_ops procfs_vnode_vops = {
+       .vop_default =          vop_defaultop,
+       .vop_access =           procfs_access,
+       .vop_advlock =          (void *)procfs_badop,
+       .vop_bmap =             procfs_bmap,
+       .vop_close =            procfs_close,
+       .vop_old_create =       (void *)procfs_badop,
+       .vop_getattr =          procfs_getattr,
+       .vop_inactive =         procfs_inactive,
+       .vop_old_link =         (void *)procfs_badop,
+       .vop_old_lookup =       procfs_lookup,
+       .vop_old_mkdir =        (void *)procfs_badop,
+       .vop_old_mknod =        (void *)procfs_badop,
+       .vop_open =             procfs_open,
+       .vop_pathconf =         vop_stdpathconf,
+       .vop_print =            procfs_print,
+       .vop_read =             procfs_rw,
+       .vop_readdir =          procfs_readdir,
+       .vop_readlink =         procfs_readlink,
+       .vop_reclaim =          procfs_reclaim,
+       .vop_old_remove =       (void *)procfs_badop,
+       .vop_old_rename =       (void *)procfs_badop,
+       .vop_old_rmdir =        (void *)procfs_badop,
+       .vop_setattr =          procfs_setattr,
+       .vop_old_symlink =      (void *)procfs_badop,
+       .vop_write =            (void *)procfs_rw,
+       .vop_ioctl =            procfs_ioctl
+};
+
+
 /*
  * This is a list of the valid names in the
  * process-specific sub-directories.  It is
@@ -393,7 +426,7 @@ procfs_print(struct vop_print_args *ap)
  * generic entry point for unsupported operations
  */
 static int
-procfs_badop(void)
+procfs_badop(struct vop_generic_args *ap)
 {
        return (EIO);
 }
@@ -1052,36 +1085,3 @@ atopid(const char *b, u_int len)
        return (p);
 }
 
-/*
- * procfs vnode operations.
- */
-struct vnodeopv_entry_desc procfs_vnodeop_entries[] = {
-       { &vop_default_desc,            vop_defaultop },
-       { &vop_access_desc,             (vnodeopv_entry_t) procfs_access },
-       { &vop_advlock_desc,            (vnodeopv_entry_t) procfs_badop },
-       { &vop_bmap_desc,               (vnodeopv_entry_t) procfs_bmap },
-       { &vop_close_desc,              (vnodeopv_entry_t) procfs_close },
-       { &vop_old_create_desc,         (vnodeopv_entry_t) procfs_badop },
-       { &vop_getattr_desc,            (vnodeopv_entry_t) procfs_getattr },
-       { &vop_inactive_desc,           (vnodeopv_entry_t) procfs_inactive },
-       { &vop_old_link_desc,           (vnodeopv_entry_t) procfs_badop },
-       { &vop_old_lookup_desc,         (vnodeopv_entry_t) procfs_lookup },
-       { &vop_old_mkdir_desc,          (vnodeopv_entry_t) procfs_badop },
-       { &vop_old_mknod_desc,          (vnodeopv_entry_t) procfs_badop },
-       { &vop_open_desc,               (vnodeopv_entry_t) procfs_open },
-       { &vop_pathconf_desc,           (vnodeopv_entry_t) vop_stdpathconf },
-       { &vop_print_desc,              (vnodeopv_entry_t) procfs_print },
-       { &vop_read_desc,               (vnodeopv_entry_t) procfs_rw },
-       { &vop_readdir_desc,            (vnodeopv_entry_t) procfs_readdir },
-       { &vop_readlink_desc,           (vnodeopv_entry_t) procfs_readlink },
-       { &vop_reclaim_desc,            (vnodeopv_entry_t) procfs_reclaim },
-       { &vop_old_remove_desc,         (vnodeopv_entry_t) procfs_badop },
-       { &vop_old_rename_desc,         (vnodeopv_entry_t) procfs_badop },
-       { &vop_old_rmdir_desc,          (vnodeopv_entry_t) procfs_badop },
-       { &vop_setattr_desc,            (vnodeopv_entry_t) procfs_setattr },
-       { &vop_old_symlink_desc,        (vnodeopv_entry_t) procfs_badop },
-       { &vop_write_desc,              (vnodeopv_entry_t) procfs_rw },
-       { &vop_ioctl_desc,              (vnodeopv_entry_t) procfs_ioctl },
-       { NULL, NULL }
-};
-
index e68a125..9099d3b 100644 (file)
@@ -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.27 2006/05/06 18:48:53 dillon Exp $
+ * $DragonFly: src/sys/vfs/smbfs/smbfs_vfsops.c,v 1.28 2006/07/18 22:22:16 dillon Exp $
  */
 #include "opt_netsmb.h"
 #ifndef NETSMB
@@ -60,7 +60,7 @@
 
 #include <sys/buf.h>
 
-extern struct vnodeopv_entry_desc smbfs_vnodeop_entries[];
+extern struct vop_ops smbfs_vnode_vops;
 
 int smbfs_debuglevel = 0;
 
@@ -199,8 +199,7 @@ smbfs_mount(struct mount *mp, char *path, caddr_t data, struct ucred *cred)
        smp->sm_args.mount_point[sizeof(smp->sm_args.mount_point) - 1] = '\0';
        vfs_getnewfsid(mp);
 
-       vfs_add_vnodeops(mp, &mp->mnt_vn_norm_ops, 
-                        smbfs_vnodeop_entries, 0);
+       vfs_add_vnodeops(mp, &smbfs_vnode_vops, &mp->mnt_vn_norm_ops);
 
        error = smbfs_root(mp, &vp);
        if (error)
index cdde82e..9dd56e7 100644 (file)
@@ -30,7 +30,7 @@
  * SUCH DAMAGE.
  *
  * $FreeBSD: src/sys/fs/smbfs/smbfs_vnops.c,v 1.2.2.8 2003/04/04 08:57:23 tjr Exp $
- * $DragonFly: src/sys/vfs/smbfs/smbfs_vnops.c,v 1.31 2006/06/13 12:31:57 corecode Exp $
+ * $DragonFly: src/sys/vfs/smbfs/smbfs_vnops.c,v 1.32 2006/07/18 22:22:16 dillon Exp $
  */
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -86,42 +86,41 @@ static int smbfs_pathconf(struct vop_pathconf_args *ap);
 static int smbfs_advlock(struct vop_advlock_args *);
 static int smbfs_getextattr(struct vop_getextattr_args *ap);
 
-struct vnodeopv_entry_desc smbfs_vnodeop_entries[] = {
-       { &vop_default_desc,            vop_defaultop },
-       { &vop_access_desc,             (vnodeopv_entry_t) smbfs_access },
-       { &vop_advlock_desc,            (vnodeopv_entry_t) smbfs_advlock },
-       { &vop_bmap_desc,               (vnodeopv_entry_t) smbfs_bmap },
-       { &vop_close_desc,              (vnodeopv_entry_t) smbfs_closel },
-       { &vop_old_create_desc,         (vnodeopv_entry_t) smbfs_create },
-       { &vop_fsync_desc,              (vnodeopv_entry_t) smbfs_fsync },
-       { &vop_getattr_desc,            (vnodeopv_entry_t) smbfs_getattr },
-       { &vop_getpages_desc,           (vnodeopv_entry_t) smbfs_getpages },
-       { &vop_inactive_desc,           (vnodeopv_entry_t) smbfs_inactive },
-       { &vop_ioctl_desc,              (vnodeopv_entry_t) smbfs_ioctl },
-       { &vop_islocked_desc,           (vnodeopv_entry_t) vop_stdislocked },
-       { &vop_old_link_desc,           (vnodeopv_entry_t) smbfs_link },
-       { &vop_lock_desc,               (vnodeopv_entry_t) vop_stdlock },
-       { &vop_old_lookup_desc,         (vnodeopv_entry_t) smbfs_lookup },
-       { &vop_old_mkdir_desc,          (vnodeopv_entry_t) smbfs_mkdir },
-       { &vop_old_mknod_desc,          (vnodeopv_entry_t) smbfs_mknod },
-       { &vop_open_desc,               (vnodeopv_entry_t) smbfs_open },
-       { &vop_pathconf_desc,           (vnodeopv_entry_t) smbfs_pathconf },
-       { &vop_print_desc,              (vnodeopv_entry_t) smbfs_print },
-       { &vop_putpages_desc,           (vnodeopv_entry_t) smbfs_putpages },
-       { &vop_read_desc,               (vnodeopv_entry_t) smbfs_read },
-       { &vop_readdir_desc,            (vnodeopv_entry_t) smbfs_readdir },
-       { &vop_reclaim_desc,            (vnodeopv_entry_t) smbfs_reclaim },
-       { &vop_old_remove_desc,         (vnodeopv_entry_t) smbfs_remove },
-       { &vop_old_rename_desc,         (vnodeopv_entry_t) smbfs_rename },
-       { &vop_old_rmdir_desc,          (vnodeopv_entry_t) smbfs_rmdir },
-       { &vop_setattr_desc,            (vnodeopv_entry_t) smbfs_setattr },
-       { &vop_strategy_desc,           (vnodeopv_entry_t) smbfs_strategy },
-       { &vop_old_symlink_desc,        (vnodeopv_entry_t) smbfs_symlink },
-       { &vop_unlock_desc,             (vnodeopv_entry_t) vop_stdunlock },
-       { &vop_write_desc,              (vnodeopv_entry_t) smbfs_write },
-       { &vop_getextattr_desc,         (vnodeopv_entry_t) smbfs_getextattr },
-/*     { &vop_setextattr_desc,         (vnodeopv_entry_t) smbfs_setextattr },*/
-       { NULL, NULL }
+struct vop_ops smbfs_vnode_vops = {
+       .vop_default =          vop_defaultop,
+       .vop_access =           smbfs_access,
+       .vop_advlock =          smbfs_advlock,
+       .vop_bmap =             smbfs_bmap,
+       .vop_close =            smbfs_closel,
+       .vop_old_create =       smbfs_create,
+       .vop_fsync =            smbfs_fsync,
+       .vop_getattr =          smbfs_getattr,
+       .vop_getpages =         smbfs_getpages,
+       .vop_inactive =         smbfs_inactive,
+       .vop_ioctl =            smbfs_ioctl,
+       .vop_islocked =         vop_stdislocked,
+       .vop_old_link =         smbfs_link,
+       .vop_lock =             vop_stdlock,
+       .vop_old_lookup =       smbfs_lookup,
+       .vop_old_mkdir =        smbfs_mkdir,
+       .vop_old_mknod =        smbfs_mknod,
+       .vop_open =             smbfs_open,
+       .vop_pathconf =         smbfs_pathconf,
+       .vop_print =            smbfs_print,
+       .vop_putpages =         smbfs_putpages,
+       .vop_read =             smbfs_read,
+       .vop_readdir =          smbfs_readdir,
+       .vop_reclaim =          smbfs_reclaim,
+       .vop_old_remove =       smbfs_remove,
+       .vop_old_rename =       smbfs_rename,
+       .vop_old_rmdir =        smbfs_rmdir,
+       .vop_setattr =          smbfs_setattr,
+       .vop_strategy =         smbfs_strategy,
+       .vop_old_symlink =      smbfs_symlink,
+       .vop_unlock =           vop_stdunlock,
+       .vop_write =            smbfs_write,
+       .vop_getextattr =       smbfs_getextattr
+/*     .vop_setextattr =       smbfs_setextattr */
 };
 
 /*
index 2fb7f41..97c8496 100644 (file)
@@ -32,7 +32,7 @@
  *
  *     @(#)spec_vnops.c        8.14 (Berkeley) 5/21/95
  * $FreeBSD: src/sys/miscfs/specfs/spec_vnops.c,v 1.131.2.4 2001/02/26 04:23:20 jlemon Exp $
- * $DragonFly: src/sys/vfs/specfs/spec_vnops.c,v 1.44 2006/05/07 19:17:18 dillon Exp $
+ * $DragonFly: src/sys/vfs/specfs/spec_vnops.c,v 1.45 2006/07/18 22:22:16 dillon Exp $
  */
 
 #include <sys/param.h>
@@ -76,44 +76,43 @@ static int  spec_read (struct vop_read_args *);
 static int     spec_strategy (struct vop_strategy_args *);
 static int     spec_write (struct vop_write_args *);
 
-struct vop_ops *spec_vnode_vops;
-struct vnodeopv_entry_desc spec_vnodeop_entries[] = {
-       { &vop_default_desc,            vop_defaultop },
-       { &vop_access_desc,             vop_ebadf },
-       { &vop_advlock_desc,            (vnodeopv_entry_t) spec_advlock },
-       { &vop_bmap_desc,               (vnodeopv_entry_t) spec_bmap },
-       { &vop_close_desc,              (vnodeopv_entry_t) spec_close },
-       { &vop_old_create_desc,         vop_panic },
-       { &vop_freeblks_desc,           (vnodeopv_entry_t) spec_freeblks },
-       { &vop_fsync_desc,              (vnodeopv_entry_t) spec_fsync },
-       { &vop_getpages_desc,           (vnodeopv_entry_t) spec_getpages },
-       { &vop_inactive_desc,           (vnodeopv_entry_t) spec_inactive },
-       { &vop_ioctl_desc,              (vnodeopv_entry_t) spec_ioctl },
-       { &vop_old_link_desc,           vop_panic },
-       { &vop_old_mkdir_desc,          vop_panic },
-       { &vop_old_mknod_desc,          vop_panic },
-       { &vop_open_desc,               (vnodeopv_entry_t) spec_open },
-       { &vop_pathconf_desc,           (vnodeopv_entry_t) vop_stdpathconf },
-       { &vop_poll_desc,               (vnodeopv_entry_t) spec_poll },
-       { &vop_kqfilter_desc,           (vnodeopv_entry_t) spec_kqfilter },
-       { &vop_print_desc,              (vnodeopv_entry_t) spec_print },
-       { &vop_read_desc,               (vnodeopv_entry_t) spec_read },
-       { &vop_readdir_desc,            vop_panic },
-       { &vop_readlink_desc,           vop_panic },
-       { &vop_reallocblks_desc,        vop_panic },
-       { &vop_reclaim_desc,            vop_null },
-       { &vop_old_remove_desc,         vop_panic },
-       { &vop_old_rename_desc,         vop_panic },
-       { &vop_old_rmdir_desc,          vop_panic },
-       { &vop_setattr_desc,            vop_ebadf },
-       { &vop_strategy_desc,           (vnodeopv_entry_t) spec_strategy },
-       { &vop_old_symlink_desc,        vop_panic },
-       { &vop_write_desc,              (vnodeopv_entry_t) spec_write },
-       { NULL, NULL }
+struct vop_ops spec_vnode_vops = {
+       .vop_default =          vop_defaultop,
+       .vop_access =           (void *)vop_ebadf,
+       .vop_advlock =          spec_advlock,
+       .vop_bmap =             spec_bmap,
+       .vop_close =            spec_close,
+       .vop_old_create =       (void *)vop_panic,
+       .vop_freeblks =         spec_freeblks,
+       .vop_fsync =            spec_fsync,
+       .vop_getpages =         spec_getpages,
+       .vop_inactive =         spec_inactive,
+       .vop_ioctl =            spec_ioctl,
+       .vop_old_link =         (void *)vop_panic,
+       .vop_old_mkdir =        (void *)vop_panic,
+       .vop_old_mknod =        (void *)vop_panic,
+       .vop_open =             spec_open,
+       .vop_pathconf =         vop_stdpathconf,
+       .vop_poll =             spec_poll,
+       .vop_kqfilter =         spec_kqfilter,
+       .vop_print =            spec_print,
+       .vop_read =             spec_read,
+       .vop_readdir =          (void *)vop_panic,
+       .vop_readlink =         (void *)vop_panic,
+       .vop_reallocblks =      (void *)vop_panic,
+       .vop_reclaim =          (void *)vop_null,
+       .vop_old_remove =       (void *)vop_panic,
+       .vop_old_rename =       (void *)vop_panic,
+       .vop_old_rmdir =        (void *)vop_panic,
+       .vop_setattr =          (void *)vop_ebadf,
+       .vop_strategy =         spec_strategy,
+       .vop_old_symlink =      (void *)vop_panic,
+       .vop_write =            spec_write
 };
-static struct vnodeopv_desc spec_vnodeop_opv_desc =
-       { &spec_vnode_vops, spec_vnodeop_entries, 0 };
-VNODEOP_SET(spec_vnodeop_opv_desc);
+
+struct vop_ops *spec_vnode_vops_p = &spec_vnode_vops;
+
+VNODEOP_SET(spec_vnode_vops);
 
 extern int dev_ref_debug;
 
@@ -123,7 +122,7 @@ extern int dev_ref_debug;
 int
 spec_vnoperate(struct vop_generic_args *ap)
 {
-       return (VOCALL(spec_vnode_vops, ap));
+       return (VOCALL(&spec_vnode_vops, ap));
 }
 
 static void spec_getpages_iodone (struct bio *bio);
index 191e869..2a9dbee 100644 (file)
@@ -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.19 2006/05/06 18:48:53 dillon Exp $
+ * $DragonFly: src/sys/vfs/udf/udf_vfsops.c,v 1.20 2006/07/18 22:22:16 dillon Exp $
  */
 
 /* udf_vfsops.c */
@@ -93,7 +93,7 @@
 #include <vfs/udf/udf.h>
 #include <vfs/udf/udf_mount.h>
 
-extern struct vnodeopv_entry_desc udf_vnodeop_entries[];
+extern struct vop_ops udf_vnode_vops;
 
 MALLOC_DEFINE(M_UDFNODE, "UDF node", "UDF node structure");
 MALLOC_DEFINE(M_UDFMOUNT, "UDF mount", "UDF mount structure");
@@ -361,8 +361,7 @@ udf_mountfs(struct vnode *devvp, struct mount *mp)
                goto bail;
        } 
 
-       vfs_add_vnodeops(mp, &mp->mnt_vn_norm_ops, 
-                        udf_vnodeop_entries, 0);
+       vfs_add_vnodeops(mp, &udf_vnode_vops, &mp->mnt_vn_norm_ops);
 
        /*
         * Find the file entry for the root directory.
index 7a28f62..a5e9ca8 100644 (file)
@@ -24,7 +24,7 @@
  * SUCH DAMAGE.
  *
  * $FreeBSD: src/sys/fs/udf/udf_vnops.c,v 1.33 2003/12/07 05:04:49 scottl Exp $
- * $DragonFly: src/sys/vfs/udf/udf_vnops.c,v 1.22 2006/05/26 16:56:32 dillon Exp $
+ * $DragonFly: src/sys/vfs/udf/udf_vnops.c,v 1.23 2006/07/18 22:22:16 dillon Exp $
  */
 
 /* udf_vnops.c */
@@ -66,20 +66,19 @@ static int udf_reclaim(struct vop_reclaim_args *);
 static int udf_readatoffset(struct udf_node *, int *, int, struct buf **, uint8_t **);
 static int udf_bmap_internal(struct udf_node *, uint32_t, daddr_t *, uint32_t *);
 
-struct vnodeopv_entry_desc udf_vnodeop_entries[] = {
-       { &vop_default_desc,            vop_defaultop },
-       { &vop_access_desc,             (vnodeopv_entry_t) udf_access },
-       { &vop_bmap_desc,               (vnodeopv_entry_t) udf_bmap },
-       { &vop_old_lookup_desc,         (vnodeopv_entry_t) udf_lookup },
-       { &vop_getattr_desc,            (vnodeopv_entry_t) udf_getattr },
-       { &vop_ioctl_desc,              (vnodeopv_entry_t) udf_ioctl },
-       { &vop_pathconf_desc,           (vnodeopv_entry_t) udf_pathconf },
-       { &vop_read_desc,               (vnodeopv_entry_t) udf_read },
-       { &vop_readdir_desc,            (vnodeopv_entry_t) udf_readdir },
-       { &vop_readlink_desc,           (vnodeopv_entry_t) udf_readlink },
-       { &vop_reclaim_desc,            (vnodeopv_entry_t) udf_reclaim },
-       { &vop_strategy_desc,           (vnodeopv_entry_t) udf_strategy },
-       { NULL, NULL }
+struct vop_ops udf_vnode_vops = {
+       .vop_default =          vop_defaultop,
+       .vop_access =           udf_access,
+       .vop_bmap =             udf_bmap,
+       .vop_old_lookup =       udf_lookup,
+       .vop_getattr =          udf_getattr,
+       .vop_ioctl =            udf_ioctl,
+       .vop_pathconf =         udf_pathconf,
+       .vop_read =             udf_read,
+       .vop_readdir =          udf_readdir,
+       .vop_readlink =         udf_readlink,
+       .vop_reclaim =          udf_reclaim,
+       .vop_strategy =         udf_strategy
 };
 
 MALLOC_DEFINE(M_UDFFID, "UDF FID", "UDF FileId structure");
index da8b093..a3b16b3 100644 (file)
@@ -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.44 2006/05/26 17:07:48 dillon Exp $
+ * $DragonFly: src/sys/vfs/ufs/ffs_vfsops.c,v 1.45 2006/07/18 22:22:16 dillon Exp $
  */
 
 #include "opt_quota.h"
@@ -87,10 +87,9 @@ static struct vfsops ufs_vfsops = {
 
 VFS_SET(ufs_vfsops, ufs, 0);
 
-extern struct vnodeopv_entry_desc ffs_vnodeop_entries[];
-extern struct vnodeopv_entry_desc ffs_specop_entries[];
-extern struct vnodeopv_entry_desc ffs_fifoop_entries[];
-
+extern struct vop_ops ffs_vnode_vops;
+extern struct vop_ops ffs_spec_vops;
+extern struct vop_ops ffs_fifo_vops;
 
 /*
  * ffs_mount
@@ -624,6 +623,11 @@ ffs_mountfs(struct vnode *devvp, struct mount *mp, struct malloc_type *mtype)
        if (mp->mnt_iosize_max > MAXPHYS)
                mp->mnt_iosize_max = MAXPHYS;
 
+       /*
+        * Filesystem supports native FSMIDs
+        */
+       mp->mnt_kern_flag |= MNTK_FSMID;
+
        /*
         * The backing device must be VMIO-capable because we use getblk().
         * NOTE: the MFS driver now returns a VMIO-enabled descriptor.
@@ -762,9 +766,9 @@ ffs_mountfs(struct vnode *devvp, struct mount *mp, struct malloc_type *mtype)
                fs->fs_clean = 0;
                (void) ffs_sbupdate(ump, MNT_WAIT);
        }
-       vfs_add_vnodeops(mp, &mp->mnt_vn_norm_ops, ffs_vnodeop_entries, VVF_SUPPORTS_FSMID);
-       vfs_add_vnodeops(mp, &mp->mnt_vn_spec_ops, ffs_specop_entries, VVF_SUPPORTS_FSMID);
-       vfs_add_vnodeops(mp, &mp->mnt_vn_fifo_ops, ffs_fifoop_entries, VVF_SUPPORTS_FSMID); 
+       vfs_add_vnodeops(mp, &ffs_vnode_vops, &mp->mnt_vn_norm_ops);
+       vfs_add_vnodeops(mp, &ffs_spec_vops, &mp->mnt_vn_spec_ops);
+       vfs_add_vnodeops(mp, &ffs_fifo_vops, &mp->mnt_vn_fifo_ops);
 
        return (0);
 out:
index 003f1d0..de2638b 100644 (file)
@@ -32,7 +32,7 @@
  *
  *     @(#)ffs_vnops.c 8.15 (Berkeley) 5/14/95
  * $FreeBSD: src/sys/ufs/ffs/ffs_vnops.c,v 1.64 2000/01/10 12:04:25 phk Exp $
- * $DragonFly: src/sys/vfs/ufs/ffs_vnops.c,v 1.16 2006/05/26 17:07:48 dillon Exp $
+ * $DragonFly: src/sys/vfs/ufs/ffs_vnops.c,v 1.17 2006/07/18 22:22:16 dillon Exp $
  */
 
 #include <sys/param.h>
@@ -71,28 +71,25 @@ static int  ffs_read (struct vop_read_args *);
 static int     ffs_write (struct vop_write_args *);
 
 /* Global vfs data structures for ufs. */
-struct vnodeopv_entry_desc ffs_vnodeop_entries[] = {
-       { &vop_default_desc,            (vnodeopv_entry_t) ufs_vnoperate },
-       { &vop_fsync_desc,              (vnodeopv_entry_t) ffs_fsync },
-       { &vop_getpages_desc,           (vnodeopv_entry_t) ffs_getpages },
-       { &vop_putpages_desc,           (vnodeopv_entry_t) ffs_putpages },
-       { &vop_read_desc,               (vnodeopv_entry_t) ffs_read },
-       { &vop_balloc_desc,             (vnodeopv_entry_t) ffs_balloc },
-       { &vop_reallocblks_desc,        (vnodeopv_entry_t) ffs_reallocblks },
-       { &vop_write_desc,              (vnodeopv_entry_t) ffs_write },
-       { NULL, NULL }
+struct vop_ops ffs_vnode_vops = {
+       .vop_default =          ufs_vnoperate,
+       .vop_fsync =            ffs_fsync,
+       .vop_getpages =         ffs_getpages,
+       .vop_putpages =         ffs_putpages,
+       .vop_read =             ffs_read,
+       .vop_balloc =           ffs_balloc,
+       .vop_reallocblks =      ffs_reallocblks,
+       .vop_write =            ffs_write
 };
 
-struct vnodeopv_entry_desc ffs_specop_entries[] = {
-       { &vop_default_desc,            (vnodeopv_entry_t) ufs_vnoperatespec },
-       { &vop_fsync_desc,              (vnodeopv_entry_t) ffs_fsync },
-       { NULL, NULL }
+struct vop_ops ffs_spec_vops = {
+       .vop_default =          ufs_vnoperatespec,
+       .vop_fsync =            ffs_fsync
 };
 
-struct vnodeopv_entry_desc ffs_fifoop_entries[] = {
-       { &vop_default_desc,            (vnodeopv_entry_t) ufs_vnoperatefifo },
-       { &vop_fsync_desc,              (vnodeopv_entry_t) ffs_fsync },
-       { NULL, NULL }
+struct vop_ops ffs_fifo_vops = {
+       .vop_default =          ufs_vnoperatefifo,
+       .vop_fsync =            ffs_fsync
 };
 
 #include "ufs_readwrite.c"
index a19dcae..0482c34 100644 (file)
@@ -37,7 +37,7 @@
  *
  *     @(#)ufs_vnops.c 8.27 (Berkeley) 5/27/95
  * $FreeBSD: src/sys/ufs/ufs/ufs_vnops.c,v 1.131.2.8 2003/01/02 17:26:19 bde Exp $
- * $DragonFly: src/sys/vfs/ufs/ufs_vnops.c,v 1.51 2006/05/26 19:57:33 dillon Exp $
+ * $DragonFly: src/sys/vfs/ufs/ufs_vnops.c,v 1.52 2006/07/18 22:22:16 dillon Exp $
  */
 
 #include "opt_quota.h"
@@ -1890,7 +1890,7 @@ ufsspec_read(struct vop_read_args *ap)
 
        uio = ap->a_uio;
        resid = uio->uio_resid;
-       error = VOCALL(spec_vnode_vops, &ap->a_head);
+       error = VOCALL(&spec_vnode_vops, &ap->a_head);
        /*
         * The inode may have been revoked during the call, so it must not
         * be accessed blindly here or in the other wrapper functions.
@@ -1917,7 +1917,7 @@ ufsspec_write(struct vop_write_args *ap)
 
        uio = ap->a_uio;
        resid = uio->uio_resid;
-       error = VOCALL(spec_vnode_vops, &ap->a_head);
+       error = VOCALL(&spec_vnode_vops, &ap->a_head);
        ip = VTOI(ap->a_vp);
        if (ip != NULL && (uio->uio_resid != resid || (error == 0 && resid != 0)))
                VTOI(ap->a_vp)->i_flag |= IN_CHANGE | IN_UPDATE;
@@ -1940,7 +1940,7 @@ ufsspec_close(struct vop_close_args *ap)
 
        if (vp->v_usecount > 1)
                ufs_itimes(vp);
-       return (VOCALL(spec_vnode_vops, &ap->a_head));
+       return (VOCALL(&spec_vnode_vops, &ap->a_head));
 }
 
 /*
@@ -1959,7 +1959,7 @@ ufsfifo_read(struct vop_read_args *ap)
 
        uio = ap->a_uio;
        resid = uio->uio_resid;
-       error = VOCALL(fifo_vnode_vops, &ap->a_head);
+       error = VOCALL(&fifo_vnode_vops, &ap->a_head);
        ip = VTOI(ap->a_vp);
        if ((ap->a_vp->v_mount->mnt_flag & MNT_NOATIME) == 0 && ip != NULL &&
            (uio->uio_resid != resid || (error == 0 && resid != 0)))
@@ -1983,7 +1983,7 @@ ufsfifo_write(struct vop_write_args *ap)
 
        uio = ap->a_uio;
        resid = uio->uio_resid;
-       error = VOCALL(fifo_vnode_vops, &ap->a_head);
+       error = VOCALL(&fifo_vnode_vops, &ap->a_head);
        ip = VTOI(ap->a_vp);
        if (ip != NULL && (uio->uio_resid != resid || (error == 0 && resid != 0)))
                VTOI(ap->a_vp)->i_flag |= IN_CHANGE | IN_UPDATE;
@@ -2006,7 +2006,7 @@ ufsfifo_close(struct vop_close_args *ap)
 
        if (vp->v_usecount > 1)
                ufs_itimes(vp);
-       return (VOCALL(fifo_vnode_vops, &ap->a_head));
+       return (VOCALL(&fifo_vnode_vops, &ap->a_head));
 }
 
 /*
@@ -2020,7 +2020,7 @@ ufsfifo_kqfilter(struct vop_kqfilter_args *ap)
 {
        int error;
 
-       error = VOCALL(fifo_vnode_vops, &ap->a_head);
+       error = VOCALL(&fifo_vnode_vops, &ap->a_head);
        if (error)
                error = ufs_kqfilter(ap);
        return (error);
@@ -2364,94 +2364,82 @@ filt_ufsvnode(struct knote *kn, long hint)
 }
 
 /* Global vfs data structures for ufs. */
-static struct vop_ops *ufs_vnode_vops;
-static struct vnodeopv_entry_desc ufs_vnodeop_entries[] = {
-       { &vop_default_desc,            vop_defaultop },
-       { &vop_fsync_desc,              (vnodeopv_entry_t) ufs_missingop },
-       { &vop_read_desc,               (vnodeopv_entry_t) ufs_missingop },
-       { &vop_reallocblks_desc,        (vnodeopv_entry_t) ufs_missingop },
-       { &vop_write_desc,              (vnodeopv_entry_t) ufs_missingop },
-       { &vop_access_desc,             (vnodeopv_entry_t) ufs_access },
-       { &vop_advlock_desc,            (vnodeopv_entry_t) ufs_advlock },
-       { &vop_bmap_desc,               (vnodeopv_entry_t) ufs_bmap },
-       { &vop_old_lookup_desc,         (vnodeopv_entry_t) ufs_lookup },
-       { &vop_close_desc,              (vnodeopv_entry_t) ufs_close },
-       { &vop_old_create_desc,         (vnodeopv_entry_t) ufs_create },
-       { &vop_getattr_desc,            (vnodeopv_entry_t) ufs_getattr },
-       { &vop_inactive_desc,           (vnodeopv_entry_t) ufs_inactive },
-       { &vop_islocked_desc,           (vnodeopv_entry_t) vop_stdislocked },
-       { &vop_old_link_desc,           (vnodeopv_entry_t) ufs_link },
-       { &vop_lock_desc,               (vnodeopv_entry_t) vop_stdlock },
-       { &vop_old_mkdir_desc,          (vnodeopv_entry_t) ufs_mkdir },
-       { &vop_old_mknod_desc,          (vnodeopv_entry_t) ufs_mknod },
-       { &vop_mmap_desc,               (vnodeopv_entry_t) ufs_mmap },
-       { &vop_open_desc,               (vnodeopv_entry_t) ufs_open },
-       { &vop_pathconf_desc,           (vnodeopv_entry_t) ufs_pathconf },
-       { &vop_poll_desc,               (vnodeopv_entry_t) vop_stdpoll },
-       { &vop_kqfilter_desc,           (vnodeopv_entry_t) ufs_kqfilter },
-       { &vop_print_desc,              (vnodeopv_entry_t) ufs_print },
-       { &vop_readdir_desc,            (vnodeopv_entry_t) ufs_readdir },
-       { &vop_readlink_desc,           (vnodeopv_entry_t) ufs_readlink },
-       { &vop_reclaim_desc,            (vnodeopv_entry_t) ufs_reclaim },
-       { &vop_old_remove_desc,         (vnodeopv_entry_t) ufs_remove },
-       { &vop_old_rename_desc,         (vnodeopv_entry_t) ufs_rename },
-       { &vop_old_rmdir_desc,          (vnodeopv_entry_t) ufs_rmdir },
-       { &vop_setattr_desc,            (vnodeopv_entry_t) ufs_setattr },
-       { &vop_strategy_desc,           (vnodeopv_entry_t) ufs_strategy },
-       { &vop_old_symlink_desc,        (vnodeopv_entry_t) ufs_symlink },
-       { &vop_unlock_desc,             (vnodeopv_entry_t) vop_stdunlock },
-       { &vop_old_whiteout_desc,       (vnodeopv_entry_t) ufs_whiteout },
-       { NULL, NULL }
+static struct vop_ops ufs_vnode_vops = {
+       .vop_default =          vop_defaultop,
+       .vop_fsync =            (void *)ufs_missingop,
+       .vop_read =             (void *)ufs_missingop,
+       .vop_reallocblks =      (void *)ufs_missingop,
+       .vop_write =            (void *)ufs_missingop,
+       .vop_access =           ufs_access,
+       .vop_advlock =          ufs_advlock,
+       .vop_bmap =             ufs_bmap,
+       .vop_old_lookup =       ufs_lookup,
+       .vop_close =            ufs_close,
+       .vop_old_create =       ufs_create,
+       .vop_getattr =          ufs_getattr,
+       .vop_inactive =         ufs_inactive,
+       .vop_islocked =         vop_stdislocked,
+       .vop_old_link =         ufs_link,
+       .vop_lock =             vop_stdlock,
+       .vop_old_mkdir =                ufs_mkdir,
+       .vop_old_mknod =                ufs_mknod,
+       .vop_mmap =             ufs_mmap,
+       .vop_open =             ufs_open,
+       .vop_pathconf =         ufs_pathconf,
+       .vop_poll =             vop_stdpoll,
+       .vop_kqfilter =         ufs_kqfilter,
+       .vop_print =            ufs_print,
+       .vop_readdir =          ufs_readdir,
+       .vop_readlink =         ufs_readlink,
+       .vop_reclaim =          ufs_reclaim,
+       .vop_old_remove =       ufs_remove,
+       .vop_old_rename =       ufs_rename,
+       .vop_old_rmdir =        ufs_rmdir,
+       .vop_setattr =          ufs_setattr,
+       .vop_strategy =         ufs_strategy,
+       .vop_old_symlink =      ufs_symlink,
+       .vop_unlock =           vop_stdunlock,
+       .vop_old_whiteout =     ufs_whiteout
 };
-static struct vnodeopv_desc ufs_vnodeop_opv_desc =
-       { &ufs_vnode_vops, ufs_vnodeop_entries, VVF_SUPPORTS_FSMID };
-
-static struct vop_ops *ufs_spec_vops;
-static struct vnodeopv_entry_desc ufs_specop_entries[] = {
-       { &vop_default_desc,            (vnodeopv_entry_t) spec_vnoperate },
-       { &vop_fsync_desc,              (vnodeopv_entry_t) ufs_missingop },
-       { &vop_access_desc,             (vnodeopv_entry_t) ufs_access },
-       { &vop_close_desc,              (vnodeopv_entry_t) ufsspec_close },
-       { &vop_getattr_desc,            (vnodeopv_entry_t) ufs_getattr },
-       { &vop_inactive_desc,           (vnodeopv_entry_t) ufs_inactive },
-       { &vop_islocked_desc,           (vnodeopv_entry_t) vop_stdislocked },
-       { &vop_lock_desc,               (vnodeopv_entry_t) vop_stdlock },
-       { &vop_print_desc,              (vnodeopv_entry_t) ufs_print },
-       { &vop_read_desc,               (vnodeopv_entry_t) ufsspec_read },
-       { &vop_reclaim_desc,            (vnodeopv_entry_t) ufs_reclaim },
-       { &vop_setattr_desc,            (vnodeopv_entry_t) ufs_setattr },
-       { &vop_unlock_desc,             (vnodeopv_entry_t) vop_stdunlock },
-       { &vop_write_desc,              (vnodeopv_entry_t) ufsspec_write },
-       { NULL, NULL }
+
+static struct vop_ops ufs_spec_vops = {
+       .vop_default =          spec_vnoperate,
+       .vop_fsync =            (void *)ufs_missingop,
+       .vop_access =           ufs_access,
+       .vop_close =            ufsspec_close,
+       .vop_getattr =          ufs_getattr,
+       .vop_inactive =         ufs_inactive,
+       .vop_islocked =         vop_stdislocked,
+       .vop_lock =             vop_stdlock,
+       .vop_print =            ufs_print,
+       .vop_read =             ufsspec_read,
+       .vop_reclaim =          ufs_reclaim,
+       .vop_setattr =          ufs_setattr,
+       .vop_unlock =           vop_stdunlock,
+       .vop_write =            ufsspec_write
 };
-static struct vnodeopv_desc ufs_specop_opv_desc =
-       { &ufs_spec_vops, ufs_specop_entries, VVF_SUPPORTS_FSMID };
-
-static struct vop_ops *ufs_fifo_vops;
-static struct vnodeopv_entry_desc ufs_fifoop_entries[] = {
-       { &vop_default_desc,            (vnodeopv_entry_t) fifo_vnoperate },
-       { &vop_fsync_desc,              (vnodeopv_entry_t) ufs_missingop },
-       { &vop_access_desc,             (vnodeopv_entry_t) ufs_access },
-       { &vop_close_desc,              (vnodeopv_entry_t) ufsfifo_close },
-       { &vop_getattr_desc,            (vnodeopv_entry_t) ufs_getattr },
-       { &vop_inactive_desc,           (vnodeopv_entry_t) ufs_inactive },
-       { &vop_islocked_desc,           (vnodeopv_entry_t) vop_stdislocked },
-       { &vop_kqfilter_desc,           (vnodeopv_entry_t) ufsfifo_kqfilter },
-       { &vop_lock_desc,               (vnodeopv_entry_t) vop_stdlock },
-       { &vop_print_desc,              (vnodeopv_entry_t) ufs_print },
-       { &vop_read_desc,               (vnodeopv_entry_t) ufsfifo_read },
-       { &vop_reclaim_desc,            (vnodeopv_entry_t) ufs_reclaim },
-       { &vop_setattr_desc,            (vnodeopv_entry_t) ufs_setattr },
-       { &vop_unlock_desc,             (vnodeopv_entry_t) vop_stdunlock },
-       { &vop_write_desc,              (vnodeopv_entry_t) ufsfifo_write },
-       { NULL, NULL }
+
+static struct vop_ops ufs_fifo_vops = {
+       .vop_default =          fifo_vnoperate,
+       .vop_fsync =            (void *)ufs_missingop,
+       .vop_access =           ufs_access,
+       .vop_close =            ufsfifo_close,
+       .vop_getattr =          ufs_getattr,
+       .vop_inactive =         ufs_inactive,
+       .vop_islocked =         vop_stdislocked,
+       .vop_kqfilter =         ufsfifo_kqfilter,
+       .vop_lock =             vop_stdlock,
+       .vop_print =            ufs_print,
+       .vop_read =             ufsfifo_read,
+       .vop_reclaim =          ufs_reclaim,
+       .vop_setattr =          ufs_setattr,
+       .vop_unlock =           vop_stdunlock,
+       .vop_write =            ufsfifo_write
 };
-static struct vnodeopv_desc ufs_fifoop_opv_desc =
-       { &ufs_fifo_vops, ufs_fifoop_entries, VVF_SUPPORTS_FSMID };
 
-VNODEOP_SET(ufs_vnodeop_opv_desc);
-VNODEOP_SET(ufs_specop_opv_desc);
-VNODEOP_SET(ufs_fifoop_opv_desc);
+VNODEOP_SET(ufs_vnode_vops);
+VNODEOP_SET(ufs_spec_vops);
+VNODEOP_SET(ufs_fifo_vops);
 
 /*
  * ufs_vnoperate(struct vnodeop_desc *a_desc)
@@ -2459,7 +2447,7 @@ VNODEOP_SET(ufs_fifoop_opv_desc);
 int
 ufs_vnoperate(struct vop_generic_args *ap)
 {
-       return (VOCALL(ufs_vnode_vops, ap));
+       return (VOCALL(&ufs_vnode_vops, ap));
 }
 
 /*
@@ -2468,7 +2456,7 @@ ufs_vnoperate(struct vop_generic_args *ap)
 int
 ufs_vnoperatefifo(struct vop_generic_args *ap)
 {
-       return (VOCALL(ufs_fifo_vops, ap));
+       return (VOCALL(&ufs_fifo_vops, ap));
 }
 
 /*
@@ -2477,5 +2465,5 @@ ufs_vnoperatefifo(struct vop_generic_args *ap)
 int
 ufs_vnoperatespec(struct vop_generic_args *ap)
 {
-       return (VOCALL(ufs_spec_vops, ap));
+       return (VOCALL(&ufs_spec_vops, ap));
 }
index 1b5959b..84e1bf2 100644 (file)
@@ -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.23 2006/05/06 18:48:53 dillon Exp $
+ * $DragonFly: src/sys/vfs/union/union_vfsops.c,v 1.24 2006/07/18 22:22:16 dillon Exp $
  */
 
 /*
@@ -56,7 +56,7 @@
 #include "union.h"
 #include <vm/vm_zone.h>
 
-extern struct vnodeopv_entry_desc union_vnodeop_entries[];
+extern struct vop_ops union_vnode_vops;
 
 static MALLOC_DEFINE(M_UNIONFSMNT, "UNION mount", "UNION mount structure");
 
@@ -272,8 +272,7 @@ union_mount(struct mount *mp, char *path, caddr_t data, struct ucred *cred)
        (void) copyinstr(args.target, cp, len - 1, &size);
        bzero(cp + size, len - size);
 
-       vfs_add_vnodeops(mp, &mp->mnt_vn_norm_ops,
-                        union_vnodeop_entries, 0);
+       vfs_add_vnodeops(mp, &union_vnode_vops, &mp->mnt_vn_norm_ops);
 
        (void)union_statfs(mp, &mp->mnt_stat, cred);
 
index 9be5e93..929fc47 100644 (file)
@@ -36,7 +36,7 @@
  *
  *     @(#)union_vnops.c       8.32 (Berkeley) 6/23/95
  * $FreeBSD: src/sys/miscfs/union/union_vnops.c,v 1.72 1999/12/15 23:02:14 eivind Exp $
- * $DragonFly: src/sys/vfs/union/union_vnops.c,v 1.29 2006/05/06 02:43:15 dillon Exp $
+ * $DragonFly: src/sys/vfs/union/union_vnops.c,v 1.30 2006/07/18 22:22:16 dillon Exp $
  */
 
 #include <sys/param.h>
@@ -1837,44 +1837,43 @@ union_strategy(struct vop_strategy_args *ap)
 /*
  * Global vfs data structures
  */
-struct vnodeopv_entry_desc union_vnodeop_entries[] = {
-       { &vop_default_desc,            vop_defaultop },
-       { &vop_access_desc,             (vnodeopv_entry_t) union_access },
-       { &vop_advlock_desc,            (vnodeopv_entry_t) union_advlock },
-       { &vop_bmap_desc,               (vnodeopv_entry_t) union_bmap },
-       { &vop_close_desc,              (vnodeopv_entry_t) union_close },
-       { &vop_old_create_desc,         (vnodeopv_entry_t) union_create },
-       { &vop_fsync_desc,              (vnodeopv_entry_t) union_fsync },
-       { &vop_getpages_desc,           (vnodeopv_entry_t) union_getpages },
-       { &vop_putpages_desc,           (vnodeopv_entry_t) union_putpages },
-       { &vop_getattr_desc,            (vnodeopv_entry_t) union_getattr },
-       { &vop_inactive_desc,           (vnodeopv_entry_t) union_inactive },
-       { &vop_ioctl_desc,              (vnodeopv_entry_t) union_ioctl },
-       { &vop_islocked_desc,           vop_stdislocked },
-       { &vop_old_link_desc,           (vnodeopv_entry_t) union_link },
-       { &vop_lock_desc,               (vnodeopv_entry_t) union_lock },
-       { &vop_old_lookup_desc,         (vnodeopv_entry_t) union_lookup },
-       { &vop_old_mkdir_desc,          (vnodeopv_entry_t) union_mkdir },
-       { &vop_old_mknod_desc,          (vnodeopv_entry_t) union_mknod },
-       { &vop_mmap_desc,               (vnodeopv_entry_t) union_mmap },
-       { &vop_open_desc,               (vnodeopv_entry_t) union_open },
-       { &vop_pathconf_desc,           (vnodeopv_entry_t) union_pathconf },
-       { &vop_poll_desc,               (vnodeopv_entry_t) union_poll },
-       { &vop_print_desc,              (vnodeopv_entry_t) union_print },
-       { &vop_read_desc,               (vnodeopv_entry_t) union_read },
-       { &vop_readdir_desc,            (vnodeopv_entry_t) union_readdir },
-       { &vop_readlink_desc,           (vnodeopv_entry_t) union_readlink },
-       { &vop_reclaim_desc,            (vnodeopv_entry_t) union_reclaim },
-       { &vop_old_remove_desc,         (vnodeopv_entry_t) union_remove },
-       { &vop_old_rename_desc,         (vnodeopv_entry_t) union_rename },
-       { &vop_revoke_desc,             (vnodeopv_entry_t) union_revoke },
-       { &vop_old_rmdir_desc,          (vnodeopv_entry_t) union_rmdir },
-       { &vop_setattr_desc,            (vnodeopv_entry_t) union_setattr },
-       { &vop_strategy_desc,           (vnodeopv_entry_t) union_strategy },
-       { &vop_old_symlink_desc,        (vnodeopv_entry_t) union_symlink },
-       { &vop_unlock_desc,             (vnodeopv_entry_t) union_unlock },
-       { &vop_old_whiteout_desc,       (vnodeopv_entry_t) union_whiteout },
-       { &vop_write_desc,              (vnodeopv_entry_t) union_write },
-       { NULL, NULL }
+struct vop_ops union_vnode_vops = {
+       .vop_default =          vop_defaultop,
+       .vop_access =           union_access,
+       .vop_advlock =          union_advlock,
+       .vop_bmap =             union_bmap,
+       .vop_close =            union_close,
+       .vop_old_create =       union_create,
+       .vop_fsync =            union_fsync,
+       .vop_getpages =         union_getpages,
+       .vop_putpages =         union_putpages,
+       .vop_getattr =          union_getattr,
+       .vop_inactive =         union_inactive,
+       .vop_ioctl =            union_ioctl,
+       .vop_islocked =         vop_stdislocked,
+       .vop_old_link =         union_link,
+       .vop_lock =             union_lock,
+       .vop_old_lookup =       union_lookup,
+       .vop_old_mkdir =        union_mkdir,
+       .vop_old_mknod =        union_mknod,
+       .vop_mmap =             union_mmap,
+       .vop_open =             union_open,
+       .vop_pathconf =         union_pathconf,
+       .vop_poll =             union_poll,
+       .vop_print =            union_print,
+       .vop_read =             union_read,
+       .vop_readdir =          union_readdir,
+       .vop_readlink =         union_readlink,
+       .vop_reclaim =          union_reclaim,
+       .vop_old_remove =       union_remove,
+       .vop_old_rename =       union_rename,
+       .vop_revoke =           union_revoke,
+       .vop_old_rmdir =        union_rmdir,
+       .vop_setattr =          union_setattr,
+       .vop_strategy =         union_strategy,
+       .vop_old_symlink =      union_symlink,
+       .vop_unlock =           union_unlock,
+       .vop_old_whiteout =     union_whiteout,
+       .vop_write =            union_write
 };
 
index 22c3d42..03d923d 100644 (file)
@@ -32,7 +32,7 @@
  *
  *     @(#)vm_swap.c   8.5 (Berkeley) 2/17/94
  * $FreeBSD: src/sys/vm/vm_swap.c,v 1.96.2.2 2001/10/14 18:46:47 iedowse Exp $
- * $DragonFly: src/sys/vm/vm_swap.c,v 1.26 2006/06/05 07:26:11 dillon Exp $
+ * $DragonFly: src/sys/vm/vm_swap.c,v 1.27 2006/07/18 22:22:16 dillon Exp $
  */
 
 #include "opt_swap.h"
@@ -153,16 +153,13 @@ swapdev_strategy(struct vop_strategy_args *ap)
  * Create a special vnode op vector for swapdev_vp - we only use
  * vn_strategy(), everything else returns an error.
  */
-struct vop_ops *swapdev_vnode_vops;
-static struct vnodeopv_entry_desc swapdev_vnodeop_entries[] = {  
-       { &vop_default_desc,            vop_defaultop },
-       { &vop_strategy_desc,           (void *) swapdev_strategy },
-       { NULL, NULL }
+static struct vop_ops swapdev_vnode_vops = {
+       .vop_default =          vop_defaultop,
+       .vop_strategy =         swapdev_strategy
 };
-static struct vnodeopv_desc swapdev_vnodeop_opv_desc =
-       { &swapdev_vnode_vops, swapdev_vnodeop_entries, 0 };
+static struct vop_ops *swapdev_vnode_vops_p = &swapdev_vnode_vops;
 
-VNODEOP_SET(swapdev_vnodeop_opv_desc);
+VNODEOP_SET(swapdev_vnode_vops);
 
 /*
  * swapon_args(char *name)
@@ -244,7 +241,7 @@ swaponvp(struct thread *td, struct vnode *vp, u_long nblks)
        cred = td->td_proc->p_ucred;
 
        if (!swapdev_vp) {
-               error = getspecialvnode(VT_NON, NULL, &swapdev_vnode_vops,
+               error = getspecialvnode(VT_NON, NULL, &swapdev_vnode_vops_p,
                                    &swapdev_vp, 0, 0);
                if (error)
                        panic("Cannot get vnode for swapdev");