FBSD: Give 0 'rootrefs' to vflush on unmount
[openafs.git] / src / afs / FBSD / osi_vfsops.c
index 54d3366..d8dabd1 100644 (file)
@@ -49,7 +49,11 @@ afs_init(struct vfsconf *vfc)
     int code;
     int offset = AFS_SYSCALL;
 #if defined(AFS_FBSD90_ENV) || defined(AFS_FBSD82_ENV)
+# if defined(FBSD_SYSCALL_REGISTER_FOUR_ARGS)
+    code = syscall_register(&offset, &afs_sysent, &old_sysent, 0);
+# else
     code = syscall_register(&offset, &afs_sysent, &old_sysent);
+# endif
     if (code) {
        printf("AFS_SYSCALL in use, error %i. aborting\n", code);
        return code;
@@ -218,19 +222,18 @@ afs_unmount(struct mount *mp, int flags, struct thread *p)
        error = EBUSY;
     AFS_GUNLOCK();
 
-    /*
-     * Release any remaining vnodes on this mount point.
-     * The `1' means that we hold one extra reference on
-     * the root vnode (this is just a guess right now).
-     * This has to be done outside the global lock.
-     */
     if (!error) {
+       /*
+        * Release any remaining vnodes on this mount point. The second
+        * argument is how many refs we hold on the root vnode. Since we
+        * released our reference to the root vnode up above, give 0.
+        */
 #if defined(AFS_FBSD80_ENV)
-       error = vflush(mp, 1, (flags & MNT_FORCE) ? FORCECLOSE : 0, curthread);
+       error = vflush(mp, 0, (flags & MNT_FORCE) ? FORCECLOSE : 0, curthread);
 #elif defined(AFS_FBSD53_ENV)
-       error = vflush(mp, 1, (flags & MNT_FORCE) ? FORCECLOSE : 0, p);
+       error = vflush(mp, 0, (flags & MNT_FORCE) ? FORCECLOSE : 0, p);
 #else
-       error = vflush(mp, 1, (flags & MNT_FORCE) ? FORCECLOSE : 0);
+       error = vflush(mp, 0, (flags & MNT_FORCE) ? FORCECLOSE : 0);
 #endif
     }
     if (error)
@@ -274,7 +277,7 @@ tryagain:
        error = 0;
     } else {
        if (!(error = afs_InitReq(&treq, cr)) && !(error = afs_CheckInit())) {
-           tvp = afs_GetVCache(&afs_rootFid, &treq, NULL, NULL);
+           tvp = afs_GetVCache(&afs_rootFid, &treq);
            /* we really want this to stay around */
            if (tvp) {
                gvp = afs_globalVp;
@@ -288,7 +291,7 @@ tryagain:
                    }
                }
            } else
-               error = ENOENT;
+               error = EIO;
        }
     }
     if (tvp) {