FBSD: Use VM_CNT_INC/VM_CNT_ADD on FreeBSD 12
[openafs.git] / src / afs / FBSD / osi_vnodeops.c
index 9297273..e314e4c 100644 (file)
 #include <vm/vm_object.h>
 #include <vm/vm_pager.h>
 #include <vm/vnode_pager.h>
+#include <sys/vmmeter.h>
 extern int afs_pbuf_freecnt;
 
-static vop_access_t    afs_vop_access;
-static vop_advlock_t   afs_vop_advlock;
-static vop_close_t     afs_vop_close;
-static vop_create_t    afs_vop_create;
-static vop_fsync_t     afs_vop_fsync;
-static vop_getattr_t   afs_vop_getattr;
-static vop_getpages_t  afs_vop_getpages;
-static vop_inactive_t  afs_vop_inactive;
-static vop_ioctl_t     afs_vop_ioctl;
-static vop_link_t      afs_vop_link;
-static vop_lookup_t    afs_vop_lookup;
-static vop_mkdir_t     afs_vop_mkdir;
-static vop_mknod_t     afs_vop_mknod;
-static vop_open_t      afs_vop_open;
-static vop_pathconf_t  afs_vop_pathconf;
-static vop_print_t     afs_vop_print;
-static vop_putpages_t  afs_vop_putpages;
-static vop_read_t      afs_vop_read;
-static vop_readdir_t   afs_vop_readdir;
-static vop_readlink_t  afs_vop_readlink;
-static vop_reclaim_t   afs_vop_reclaim;
-static vop_remove_t    afs_vop_remove;
-static vop_rename_t    afs_vop_rename;
-static vop_rmdir_t     afs_vop_rmdir;
-static vop_setattr_t   afs_vop_setattr;
-static vop_strategy_t  afs_vop_strategy;
-static vop_symlink_t   afs_vop_symlink;
-static vop_write_t     afs_vop_write;
-
-struct vop_vector afs_vnodeops = {
-       .vop_default =          &default_vnodeops,
-       .vop_access =           afs_vop_access,
-       .vop_advlock =          afs_vop_advlock,
-       .vop_close =            afs_vop_close,
-       .vop_create =           afs_vop_create,
-       .vop_fsync =            afs_vop_fsync,
-       .vop_getattr =          afs_vop_getattr,
-       .vop_getpages =         afs_vop_getpages,
-       .vop_inactive =         afs_vop_inactive,
-       .vop_ioctl =            afs_vop_ioctl,
-       .vop_link =             afs_vop_link,
-       .vop_lookup =           afs_vop_lookup,
-       .vop_mkdir =            afs_vop_mkdir,
-       .vop_mknod =            afs_vop_mknod,
-       .vop_open =             afs_vop_open,
-       .vop_pathconf =         afs_vop_pathconf,
-       .vop_print =            afs_vop_print,
-       .vop_putpages =         afs_vop_putpages,
-       .vop_read =             afs_vop_read,
-       .vop_readdir =          afs_vop_readdir,
-       .vop_readlink =         afs_vop_readlink,
-       .vop_reclaim =          afs_vop_reclaim,
-       .vop_remove =           afs_vop_remove,
-       .vop_rename =           afs_vop_rename,
-       .vop_rmdir =            afs_vop_rmdir,
-       .vop_setattr =          afs_vop_setattr,
-       .vop_strategy =         afs_vop_strategy,
-       .vop_symlink =          afs_vop_symlink,
-       .vop_write =            afs_vop_write,
-};
-
 #define GETNAME()       \
     struct componentname *cnp = ap->a_cnp; \
     char *name; \
-    MALLOC(name, char *, cnp->cn_namelen+1, M_TEMP, M_WAITOK); \
+    name = malloc(cnp->cn_namelen+1, M_TEMP, M_WAITOK); \
     memcpy(name, cnp->cn_nameptr, cnp->cn_namelen); \
     name[cnp->cn_namelen] = '\0'
 
-#define DROPNAME() FREE(name, M_TEMP)
+#define DROPNAME() free(name, M_TEMP)
+
+#ifdef LINK_MAX
+# define AFS_LINK_MAX LINK_MAX
+#else
+# define AFS_LINK_MAX (32767)
+#endif
 
 /*
  * Here we define compatibility functions/macros for interfaces that
@@ -142,13 +88,6 @@ static __inline void ma_vm_page_unlock_queues(void) {};
 static __inline void ma_vm_page_lock(vm_page_t m) { vm_page_lock(m); };
 static __inline void ma_vm_page_unlock(vm_page_t m) { vm_page_unlock(m); };
 
-#define ma_vn_lock(vp, flags, p) (vn_lock(vp, flags))
-#define MA_VOP_LOCK(vp, flags, p) (VOP_LOCK(vp, flags))
-#define MA_VOP_UNLOCK(vp, flags, p) (VOP_UNLOCK(vp, flags))
-
-#define MA_PCPU_INC(c) PCPU_INC(c)
-#define        MA_PCPU_ADD(c, n) PCPU_ADD(c, n)
-
 #if __FreeBSD_version >= 1000030
 #define AFS_VM_OBJECT_WLOCK(o) VM_OBJECT_WLOCK(o)
 #define AFS_VM_OBJECT_WUNLOCK(o)       VM_OBJECT_WUNLOCK(o)
@@ -157,6 +96,14 @@ static __inline void ma_vm_page_unlock(vm_page_t m) { vm_page_unlock(m); };
 #define AFS_VM_OBJECT_WUNLOCK(o)       VM_OBJECT_UNLOCK(o)
 #endif
 
+#ifdef VM_CNT_ADD
+# define AFS_VM_CNT_ADD(var, x) VM_CNT_ADD(var, x)
+# define AFS_VM_CNT_INC(var)    VM_CNT_INC(var)
+#else
+# define AFS_VM_CNT_ADD(var, x) PCPU_ADD(cnt.var, x)
+# define AFS_VM_CNT_INC(var)    PCPU_INC(cnt.var)
+#endif
+
 /*
  * Mosty copied from sys/ufs/ufs/ufs_vnops.c:ufs_pathconf().
  * We should know the correct answers to these questions with
@@ -171,7 +118,7 @@ afs_vop_pathconf(struct vop_pathconf_args *ap)
        error = 0;
        switch (ap->a_name) {
        case _PC_LINK_MAX:
-               *ap->a_retval = LINK_MAX;
+               *ap->a_retval = AFS_LINK_MAX;
                break;
        case _PC_NAME_MAX:
                *ap->a_retval = NAME_MAX;
@@ -250,7 +197,7 @@ afs_vop_pathconf(struct vop_pathconf_args *ap)
        return (error);
 }
 
-int
+static int
 afs_vop_lookup(ap)
      struct vop_lookup_args    /* {
                                 * struct vnodeop_desc * a_desc;
@@ -263,8 +210,6 @@ afs_vop_lookup(ap)
     struct vcache *vcp;
     struct vnode *vp, *dvp;
     int flags = ap->a_cnp->cn_flags;
-    int lockparent;            /* 1 => lockparent flag is set */
-    int wantparent;            /* 1 => wantparent or lockparent flag */
 
     dvp = ap->a_dvp;
     if (dvp->v_type != VDIR) {
@@ -276,15 +221,30 @@ afs_vop_lookup(ap)
 
     GETNAME();
 
-    lockparent = flags & LOCKPARENT;
-    wantparent = flags & (LOCKPARENT | WANTPARENT);
-
 #if __FreeBSD_version < 1000021
     cnp->cn_flags |= MPSAFE; /* steel */
 #endif
 
+    /*
+     * Locking rules:
+     *
+     * - 'dvp' is locked by our caller. We must return it locked, whether we
+     * return success or error.
+     *
+     * - If the lookup succeeds, 'vp' must be locked before we return.
+     *
+     * - If we lock multiple vnodes, parent vnodes must be locked before
+     * children vnodes.
+     *
+     * As a result, looking up the parent directory (if 'flags' has ISDOTDOT
+     * set) is a bit of a special case. In that case, we must unlock 'dvp'
+     * before performing the lookup, since the lookup operation may lock the
+     * target vnode, and the target vnode is the parent of 'dvp' (so we must
+     * lock 'dvp' after locking the target vnode).
+     */
+
     if (flags & ISDOTDOT)
-       MA_VOP_UNLOCK(dvp, 0, p);
+       VOP_UNLOCK(dvp, 0);
 
     AFS_GLOCK();
     error = afs_lookup(VTOAFS(dvp), name, &vcp, cnp->cn_cred);
@@ -292,7 +252,7 @@ afs_vop_lookup(ap)
 
     if (error) {
        if (flags & ISDOTDOT)
-           MA_VOP_LOCK(dvp, LK_EXCLUSIVE | LK_RETRY, p);
+           vn_lock(dvp, LK_EXCLUSIVE | LK_RETRY);
        if ((cnp->cn_nameiop == CREATE || cnp->cn_nameiop == RENAME)
            && (flags & ISLASTCN) && error == ENOENT)
            error = EJUSTRETURN;
@@ -304,39 +264,26 @@ afs_vop_lookup(ap)
     }
     vp = AFSTOV(vcp);          /* always get a node if no error */
 
-    /* The parent directory comes in locked.  We unlock it on return
-     * unless the caller wants it left locked.
-     * we also always return the vnode locked. */
-
     if (flags & ISDOTDOT) {
-       /* vp before dvp since we go root to leaf, and .. comes first */
-       ma_vn_lock(vp, LK_EXCLUSIVE | LK_RETRY, p);
-       ma_vn_lock(dvp, LK_EXCLUSIVE | LK_RETRY, p);
-       /* always return the child locked */
-       if (lockparent && (flags & ISLASTCN)
-           && (error = ma_vn_lock(dvp, LK_EXCLUSIVE, p))) {
-           vput(vp);
-           DROPNAME();
-           return (error);
-       }
+       /* Must lock 'vp' before 'dvp', since 'vp' is the parent vnode. */
+       vn_lock(vp, LK_EXCLUSIVE | LK_RETRY);
+       vn_lock(dvp, LK_EXCLUSIVE | LK_RETRY);
     } else if (vp == dvp) {
        /* they're the same; afs_lookup() already ref'ed the leaf.
         * It came in locked, so we don't need to ref OR lock it */
     } else {
-       ma_vn_lock(vp, LK_EXCLUSIVE | LK_CANRECURSE | LK_RETRY, p);
-       /* always return the child locked */
+       vn_lock(vp, LK_EXCLUSIVE | LK_CANRECURSE | LK_RETRY);
     }
     *ap->a_vpp = vp;
 
-    if ((cnp->cn_nameiop == RENAME && wantparent && (flags & ISLASTCN))
-       || (cnp->cn_nameiop != LOOKUP && (flags & ISLASTCN)))
+    if (cnp->cn_nameiop != LOOKUP && (flags & ISLASTCN))
        cnp->cn_flags |= SAVENAME;
 
     DROPNAME();
     return error;
 }
 
-int
+static int
 afs_vop_create(ap)
      struct vop_create_args    /* {
                                 * struct vnode *a_dvp;
@@ -363,7 +310,7 @@ afs_vop_create(ap)
 
     if (vcp) {
        *ap->a_vpp = AFSTOV(vcp);
-       ma_vn_lock(AFSTOV(vcp), LK_EXCLUSIVE | LK_RETRY, p);
+       vn_lock(AFSTOV(vcp), LK_EXCLUSIVE | LK_RETRY);
     } else
        *ap->a_vpp = 0;
 
@@ -371,7 +318,7 @@ afs_vop_create(ap)
     return error;
 }
 
-int
+static int
 afs_vop_mknod(ap)
      struct vop_mknod_args     /* {
                                 * struct vnode *a_dvp;
@@ -383,7 +330,7 @@ afs_vop_mknod(ap)
     return (ENODEV);
 }
 
-int
+static int
 afs_vop_open(ap)
      struct vop_open_args      /* {
                                 * struct vnode *a_vp;
@@ -408,7 +355,7 @@ afs_vop_open(ap)
     return error;
 }
 
-int
+static int
 afs_vop_close(ap)
      struct vop_close_args     /* {
                                 * struct vnode *a_vp;
@@ -443,7 +390,7 @@ afs_vop_close(ap)
     return code;
 }
 
-int
+static int
 afs_vop_access(ap)
      struct vop_access_args    /* {
                                 * struct vnode *a_vp;
@@ -459,7 +406,7 @@ afs_vop_access(ap)
     return code;
 }
 
-int
+static int
 afs_vop_getattr(ap)
      struct vop_getattr_args   /* {
                                 * struct vnode *a_vp;
@@ -476,7 +423,7 @@ afs_vop_getattr(ap)
     return code;
 }
 
-int
+static int
 afs_vop_setattr(ap)
      struct vop_setattr_args   /* {
                                 * struct vnode *a_vp;
@@ -491,7 +438,7 @@ afs_vop_setattr(ap)
     return code;
 }
 
-int
+static int
 afs_vop_read(ap)
      struct vop_read_args      /* {
                                 * struct vnode *a_vp;
@@ -518,7 +465,7 @@ afs_vop_read(ap)
  *     int *a_rahead;
  * };
  */
-int
+static int
 afs_vop_getpages(struct vop_getpages_args *ap)
 {
     int code;
@@ -595,8 +542,8 @@ afs_vop_getpages(struct vop_getpages_args *ap)
 
     kva = (vm_offset_t) bp->b_data;
     pmap_qenter(kva, pages, npages);
-    MA_PCPU_INC(cnt.v_vnodein);
-    MA_PCPU_ADD(cnt.v_vnodepgsin, npages);
+    AFS_VM_CNT_INC(v_vnodein);
+    AFS_VM_CNT_ADD(v_vnodepgsin, npages);
 
 #ifdef FBSD_VOP_GETPAGES_BUSIED
     count = ctob(npages);
@@ -704,7 +651,7 @@ afs_vop_getpages(struct vop_getpages_args *ap)
     return VM_PAGER_OK;
 }
 
-int
+static int
 afs_vop_write(ap)
      struct vop_write_args     /* {
                                 * struct vnode *a_vp;
@@ -737,7 +684,7 @@ afs_vop_write(ap)
  * All of the pages passed to us in ap->a_m[] are already marked as busy,
  * so there is no additional locking required to set their flags.  -GAW
  */
-int
+static int
 afs_vop_putpages(struct vop_putpages_args *ap)
 {
     int code;
@@ -770,8 +717,8 @@ afs_vop_putpages(struct vop_putpages_args *ap)
 
     kva = (vm_offset_t) bp->b_data;
     pmap_qenter(kva, ap->a_m, npages);
-    MA_PCPU_INC(cnt.v_vnodeout);
-    MA_PCPU_ADD(cnt.v_vnodepgsout, ap->a_count);
+    AFS_VM_CNT_INC(v_vnodeout);
+    AFS_VM_CNT_ADD(v_vnodepgsout, ap->a_count);
 
     iov.iov_base = (caddr_t) kva;
     iov.iov_len = ap->a_count;
@@ -805,7 +752,7 @@ afs_vop_putpages(struct vop_putpages_args *ap)
     return ap->a_rtvals[0];
 }
 
-int
+static int
 afs_vop_ioctl(ap)
      struct vop_ioctl_args     /* {
                                 * struct vnode *a_vp;
@@ -834,7 +781,7 @@ afs_vop_ioctl(ap)
     }
 }
 
-int
+static int
 afs_vop_fsync(ap)
      struct vop_fsync_args     /* {
                                 * struct vnode *a_vp;
@@ -852,7 +799,7 @@ afs_vop_fsync(ap)
     return error;
 }
 
-int
+static int
 afs_vop_remove(ap)
      struct vop_remove_args    /* {
                                 * struct vnode *a_dvp;
@@ -873,7 +820,7 @@ afs_vop_remove(ap)
     return error;
 }
 
-int
+static int
 afs_vop_link(ap)
      struct vop_link_args      /* {
                                 * struct vnode *a_vp;
@@ -894,20 +841,20 @@ afs_vop_link(ap)
        error = EISDIR;
        goto out;
     }
-    if ((error = ma_vn_lock(vp, LK_CANRECURSE | LK_EXCLUSIVE, p)) != 0) {
+    if ((error = vn_lock(vp, LK_CANRECURSE | LK_EXCLUSIVE)) != 0) {
        goto out;
     }
     AFS_GLOCK();
     error = afs_link(VTOAFS(vp), VTOAFS(dvp), name, cnp->cn_cred);
     AFS_GUNLOCK();
     if (dvp != vp)
-       MA_VOP_UNLOCK(vp, 0, p);
+       VOP_UNLOCK(vp, 0);
   out:
     DROPNAME();
     return error;
 }
 
-int
+static int
 afs_vop_rename(ap)
      struct vop_rename_args    /* {
                                 * struct vnode *a_fdvp;
@@ -985,13 +932,13 @@ afs_vop_rename(ap)
        vput(fvp);
        return (error);
     }
-    if ((error = ma_vn_lock(fvp, LK_EXCLUSIVE, p)) != 0)
+    if ((error = vn_lock(fvp, LK_EXCLUSIVE)) != 0)
        goto abortit;
 
-    MALLOC(fname, char *, fcnp->cn_namelen + 1, M_TEMP, M_WAITOK);
+    fname = malloc(fcnp->cn_namelen + 1, M_TEMP, M_WAITOK);
     memcpy(fname, fcnp->cn_nameptr, fcnp->cn_namelen);
     fname[fcnp->cn_namelen] = '\0';
-    MALLOC(tname, char *, tcnp->cn_namelen + 1, M_TEMP, M_WAITOK);
+    tname = malloc(tcnp->cn_namelen + 1, M_TEMP, M_WAITOK);
     memcpy(tname, tcnp->cn_nameptr, tcnp->cn_namelen);
     tname[tcnp->cn_namelen] = '\0';
 
@@ -1002,8 +949,8 @@ afs_vop_rename(ap)
        afs_rename(VTOAFS(fdvp), fname, VTOAFS(tdvp), tname, tcnp->cn_cred);
     AFS_GUNLOCK();
 
-    FREE(fname, M_TEMP);
-    FREE(tname, M_TEMP);
+    free(fname, M_TEMP);
+    free(tname, M_TEMP);
     if (tdvp == tvp)
        vrele(tdvp);
     else
@@ -1015,7 +962,7 @@ afs_vop_rename(ap)
     return error;
 }
 
-int
+static int
 afs_vop_mkdir(ap)
      struct vop_mkdir_args     /* {
                                 * struct vnode *a_dvp;
@@ -1043,14 +990,14 @@ afs_vop_mkdir(ap)
     }
     if (vcp) {
        *ap->a_vpp = AFSTOV(vcp);
-       ma_vn_lock(AFSTOV(vcp), LK_EXCLUSIVE | LK_RETRY, p);
+       vn_lock(AFSTOV(vcp), LK_EXCLUSIVE | LK_RETRY);
     } else
        *ap->a_vpp = 0;
     DROPNAME();
     return error;
 }
 
-int
+static int
 afs_vop_rmdir(ap)
      struct vop_rmdir_args     /* {
                                 * struct vnode *a_dvp;
@@ -1077,7 +1024,7 @@ afs_vop_rmdir(ap)
  *     char *a_target;
  * };
  */
-int
+static int
 afs_vop_symlink(struct vop_symlink_args *ap)
 {
     struct vnode *dvp;
@@ -1098,7 +1045,7 @@ afs_vop_symlink(struct vop_symlink_args *ap)
        error = afs_lookup(VTOAFS(dvp), name, &vcp, cnp->cn_cred);
        if (error == 0) {
            newvp = AFSTOV(vcp);
-           ma_vn_lock(newvp, LK_EXCLUSIVE | LK_RETRY, cnp->cn_thread);
+           vn_lock(newvp, LK_EXCLUSIVE | LK_RETRY);
        }
     }
     AFS_GUNLOCK();
@@ -1107,7 +1054,7 @@ afs_vop_symlink(struct vop_symlink_args *ap)
     return error;
 }
 
-int
+static int
 afs_vop_readdir(ap)
      struct vop_readdir_args   /* {
                                 * struct vnode *a_vp;
@@ -1143,7 +1090,7 @@ afs_vop_readdir(ap)
             dp = (const struct dirent *)((const char *)dp + dp->d_reclen))
            ncookies++;
 
-       MALLOC(cookies, u_long *, ncookies * sizeof(u_long), M_TEMP,
+       cookies = malloc(ncookies * sizeof(u_long), M_TEMP,
               M_WAITOK);
        for (dp = dp_start, cookiep = cookies; dp < dp_end;
             dp = (const struct dirent *)((const char *)dp + dp->d_reclen)) {
@@ -1157,7 +1104,7 @@ afs_vop_readdir(ap)
     return error;
 }
 
-int
+static int
 afs_vop_readlink(ap)
      struct vop_readlink_args  /* {
                                 * struct vnode *a_vp;
@@ -1173,7 +1120,7 @@ afs_vop_readlink(ap)
     return error;
 }
 
-int
+static int
 afs_vop_inactive(ap)
      struct vop_inactive_args  /* {
                                 * struct vnode *a_vp;
@@ -1193,21 +1140,34 @@ afs_vop_inactive(ap)
  *     struct vnode *a_vp;
  * };
  */
-int
+static int
 afs_vop_reclaim(struct vop_reclaim_args *ap)
 {
-    /* copied from ../OBSD/osi_vnodeops.c:afs_nbsd_reclaim() */
     int code, slept;
     struct vnode *vp = ap->a_vp;
     struct vcache *avc = VTOAFS(vp);
     int haveGlock = ISAFS_GLOCK();
-    int haveVlock = CheckLock(&afs_xvcache);
+
+    /*
+     * In other code paths, we acquire the vnode lock while afs_xvcache is
+     * already held (e.g. afs_PutVCache() -> vrele()). Here, we already have
+     * the vnode lock, and we need afs_xvcache. So drop the vnode lock in order
+     * to hold afs_xvcache.
+     */
+    VOP_UNLOCK(vp, 0);
 
     if (!haveGlock)
        AFS_GLOCK();
-    if (!haveVlock)
-       ObtainWriteLock(&afs_xvcache, 901);
-    /* reclaim the vnode and the in-memory vcache, but keep the on-disk vcache */
+    ObtainWriteLock(&afs_xvcache, 901);
+
+    /*
+     * Note that we deliberately call VOP_LOCK() instead of vn_lock() here.
+     * vn_lock() will return an error for VI_DOOMED vnodes, but we know this
+     * vnode is already VI_DOOMED. We just want to lock it again, and skip the
+     * VI_DOOMED check.
+     */
+    VOP_LOCK(vp, LK_EXCLUSIVE);
+
     code = afs_FlushVCache(avc, &slept);
 
     if (avc->f.states & CVInit) {
@@ -1215,24 +1175,23 @@ afs_vop_reclaim(struct vop_reclaim_args *ap)
        afs_osi_Wakeup(&avc->f.states);
     }
 
-    if (!haveVlock)
-       ReleaseWriteLock(&afs_xvcache);
+    ReleaseWriteLock(&afs_xvcache);
     if (!haveGlock)
        AFS_GUNLOCK();
 
     if (code) {
        afs_warn("afs_vop_reclaim: afs_FlushVCache failed code %d vnode\n", code);
        VOP_PRINT(vp);
+       panic("afs: afs_FlushVCache failed during reclaim");
     }
 
-    /* basically, it must not fail */
     vnode_destroy_vobject(vp);
     vp->v_data = 0;
 
     return 0;
 }
 
-int
+static int
 afs_vop_strategy(ap)
      struct vop_strategy_args  /* {
                                 * struct buf *a_bp;
@@ -1245,7 +1204,7 @@ afs_vop_strategy(ap)
     return error;
 }
 
-int
+static int
 afs_vop_print(ap)
      struct vop_print_args     /* {
                                 * struct vnode *a_vp;
@@ -1270,7 +1229,7 @@ afs_vop_print(ap)
 /*
  * Advisory record locking support (fcntl() POSIX style)
  */
-int
+static int
 afs_vop_advlock(ap)
      struct vop_advlock_args   /* {
                                 * struct vnode *a_vp;
@@ -1304,3 +1263,35 @@ afs_vop_advlock(ap)
     AFS_GUNLOCK();
     return error;
 }
+
+struct vop_vector afs_vnodeops = {
+       .vop_default =          &default_vnodeops,
+       .vop_access =           afs_vop_access,
+       .vop_advlock =          afs_vop_advlock,
+       .vop_close =            afs_vop_close,
+       .vop_create =           afs_vop_create,
+       .vop_fsync =            afs_vop_fsync,
+       .vop_getattr =          afs_vop_getattr,
+       .vop_getpages =         afs_vop_getpages,
+       .vop_inactive =         afs_vop_inactive,
+       .vop_ioctl =            afs_vop_ioctl,
+       .vop_link =             afs_vop_link,
+       .vop_lookup =           afs_vop_lookup,
+       .vop_mkdir =            afs_vop_mkdir,
+       .vop_mknod =            afs_vop_mknod,
+       .vop_open =             afs_vop_open,
+       .vop_pathconf =         afs_vop_pathconf,
+       .vop_print =            afs_vop_print,
+       .vop_putpages =         afs_vop_putpages,
+       .vop_read =             afs_vop_read,
+       .vop_readdir =          afs_vop_readdir,
+       .vop_readlink =         afs_vop_readlink,
+       .vop_reclaim =          afs_vop_reclaim,
+       .vop_remove =           afs_vop_remove,
+       .vop_rename =           afs_vop_rename,
+       .vop_rmdir =            afs_vop_rmdir,
+       .vop_setattr =          afs_vop_setattr,
+       .vop_strategy =         afs_vop_strategy,
+       .vop_symlink =          afs_vop_symlink,
+       .vop_write =            afs_vop_write,
+};