Rename afs_nbsd_* functions in OBSD
[openafs.git] / src / afs / OBSD / osi_vfsops.c
index 52385ea..94bf7e9 100644 (file)
@@ -93,8 +93,6 @@ NONINFRINGEMENT.
 #include <afsconfig.h>
 #include "afs/param.h"
 
-RCSID
-    ("$Header$");
 
 #include "afs/sysincludes.h"   /* Standard vendor system headers */
 #include "afs/afsincludes.h"   /* Afs-based standard headers */
@@ -110,7 +108,7 @@ RCSID
 /* from /usr/src/sys/kern/vfs_subr.c */
 extern void insmntque(struct vnode *, struct mount *);
 
-extern int sys_lkmnosys(), afs3_syscall(), afs_xioctl(), Afs_xsetgroups();
+extern int sys_lkmnosys(), afs_xioctl(), Afs_xsetgroups();
 
 static int lkmid = -1;
 static int afs_badcall(struct proc *p, void *xx, register_t * yy);
@@ -150,28 +148,23 @@ struct vfsops afs_vfsops = {
 };
 
 int
-afs_nbsd_lookupname(char *fnamep, enum uio_seg segflg, int followlink,
-                   struct vnode **dirvpp, struct vnode **compvpp)
+afs_obsd_lookupname(char *fnamep, enum uio_seg segflg, int followlink,
+                   struct vnode **compvpp)
 {
     struct nameidata nd;
     int niflag;
     int error;
 
     /*
-     * Lookup pathname "fnamep", returning parent directory in
-     * *dirvpp (if non-null) and leaf in *compvpp.  segflg says whether the
-     * pathname is user or system space.
+     * Lookup pathname "fnamep", returning leaf in *compvpp.  segflg says
+     * whether the pathname is user or system space.
      */
     /* XXX LOCKLEAF ? */
     niflag = followlink ? FOLLOW : NOFOLLOW;
-    if (dirvpp)
-       niflag |= WANTPARENT;   /* XXX LOCKPARENT? */
     NDINIT(&nd, LOOKUP, niflag, segflg, fnamep, osi_curproc());
     if ((error = namei(&nd)))
        return error;
     *compvpp = nd.ni_vp;
-    if (dirvpp)
-       *dirvpp = nd.ni_dvp;
     return error;
 }
 
@@ -275,6 +268,13 @@ afs_unmount(afsp, flags, p)
 {
     extern int sys_ioctl(), sys_setgroups();
 
+    struct vnode *vp;
+
+    for (vp = LIST_FIRST(&afsp->mnt_vnodelist); vp != NULL;
+       vp = LIST_NEXT(vp, v_mntvnodes)) {
+       if (vp->v_usecount) return EBUSY;
+    }
+
     AFS_STATCNT(afs_unmount);
 #ifdef AFS_DISCON_ENV
     give_up_cbs();
@@ -316,7 +316,7 @@ afs_badcall(struct proc *p, void *xx, register_t * yy)
 }
 
 void
-afs_nbsd_getnewvnode(struct vcache *tvc)
+afs_obsd_getnewvnode(struct vcache *tvc)
 {
     while (getnewvnode(VT_AFS, afs_globalVFS, afs_vnodeop_p, &tvc->v)) {
        /* no vnodes available, force an alloc (limits be damned)! */
@@ -347,7 +347,7 @@ afs_root(struct mount *mp, struct vnode **vpp)
                    AFS_RELE(AFSTOV(afs_globalVp));
 #endif
                afs_globalVp = tvp;
-               VREF(AFSTOV(afs_globalVp));
+               vref(AFSTOV(afs_globalVp));
            }
            AFSTOV(tvp)->v_flag |= VROOT;
            afs_globalVFS = mp;