AFS_GLOCK();
AFS_STATCNT(afs_mount);
-#ifdef DISCONN
+#ifdef AFS_DISCON_ENV
/* initialize the vcache entries before we start using them */
/* XXX find a better place for this if possible */
int flags;
struct proc *p;
{
- int err;
extern int sys_ioctl(), sys_setgroups();
- err = afs_unmount(afsp, flags);
- if (err == 0) {
- /* give up syscall entries for ioctl & setgroups, which we've stolen */
- sysent[SYS_ioctl].sy_call = sys_ioctl;
- sysent[SYS_setgroups].sy_call = sys_setgroups;
- /* give up the stolen syscall entry */
- sysent[AFS_SYSCALL].sy_narg = 0;
- sysent[AFS_SYSCALL].sy_argsize = 0;
- sysent[AFS_SYSCALL].sy_call = afs_badcall;
- printf("AFS unmounted--use `/sbin/modunload -i %d' to unload before restarting AFS\n", lkmid);
+ AFS_STATCNT(afs_unmount);
+#ifdef AFS_DISCON_ENV
+ give_up_cbs();
+#endif
+ if (!afs_globalVFS) {
+ printf("afs already unmounted\n");
+ return 0;
}
- return err;
+ if (afs_globalVp)
+ AFS_RELE(AFSTOV(afs_globalVp));
+ afs_globalVp = NULL;
+
+ vflush(afsp, NULLVP, 0); /* don't support forced */
+ afsp->mnt_data = NULL;
+#ifdef AFS_GLOBAL_SUNLOCK
+ mutex_enter(&afs_global_lock);
+#endif
+ afs_globalVFS = 0;
+ afs_cold_shutdown = 1;
+ afs_shutdown(); /* XXX */
+#ifdef AFS_GLOBAL_SUNLOCK
+ mutex_exit(&afs_global_lock);
+#endif
+
+ /* give up syscall entries for ioctl & setgroups, which we've stolen */
+ sysent[SYS_ioctl].sy_call = sys_ioctl;
+ sysent[SYS_setgroups].sy_call = sys_setgroups;
+
+ /* give up the stolen syscall entry */
+ sysent[AFS_SYSCALL].sy_narg = 0;
+ sysent[AFS_SYSCALL].sy_argsize = 0;
+ sysent[AFS_SYSCALL].sy_call = afs_badcall;
+ printf("AFS unmounted--use `/sbin/modunload -i %d' to unload before restarting AFS\n", lkmid);
+ return 0;
}
static int
afs_sync(struct osi_vfs *afsp)
{
AFS_STATCNT(afs_sync);
-#if defined(DISCONN) && !defined(AFS_OBSD_ENV)
+#if defined(AFS_DISCON_ENV) && !defined(AFS_OBSD_ENV)
/* Can't do this in OpenBSD 2.7, it faults when called from apm_suspend() */
store_dirty_vcaches();
#endif
sysent[AFS_SYSCALL].sy_call = afs3_syscall;
sysent[AFS_SYSCALL].sy_narg = 6;
- sysent[AFS_SYSCALL].sy_argsize = 6*sizeof(long);
+ sysent[AFS_SYSCALL].sy_argsize = 6 * sizeof(long);
sysent[54].sy_call = afs_xioctl;
sysent[80].sy_call = Afs_xsetgroups;
#include "afs/nfsclient.h"
#include "afs/afs_osidnlc.h"
-#ifdef DISCONN
+#ifdef AFS_DISCON_ENV
extern int afs_FlushVS(struct vcache *tvc);
#endif
vnode_pager_uncache(vp);
#endif
-#ifndef DISCONN
+#ifndef AFS_DISCON_ENV
error = afs_FlushVCache(avc, &slept); /* tosses our stuff from vnode */
#else
/* reclaim the vnode and the in-memory vcache, but keep the on-disk vcache */
AFS_STATCNT(afs_bmap);
if (ap->a_bnp)
- ap->a_bnp = ap->a_bn * (8192 / DEV_BSIZE);
+ ap->a_bnp = (daddr_t *) (ap->a_bn * (8192 / DEV_BSIZE));
if (ap->a_vpp)
*ap->a_vpp = (vcp) ? AFSTOV(vcp) : NULL;
return 0;
return 0;
}
+extern int
+afs_lockctl(struct vcache *avc, struct AFS_FLOCK *af, int acmd, struct AFS_UCRED *acred, pid_t clid);
+
/*
* Advisory record locking support (fcntl() POSIX style)
*/