AFS_STATCNT(afs_mount);
- if (!suser(credp))
+ if (!suser(credp)) {
+ AFS_GUNLOCK();
return EPERM;
+ }
afsp->vfs_fstype = afsfstype;
if (afs_globalVFS) { /* Don't allow remounts. */
+ AFS_GUNLOCK();
return EBUSY;
}
AFS_GLOCK();
AFS_STATCNT(afs_unmount);
- if (!suser(credp))
+ if (!suser(credp)) {
+ AFS_GUNLOCK();
return EPERM;
+ }
afs_globalVFS = 0;
afs_shutdown();
int (*ufs_igetp)();
void (*ufs_itimes_nolockp)();
+int (*afs_orig_ioctl)(), (*afs_orig_ioctl32)();
+int (*afs_orig_setgroups)(), (*afs_orig_setgroups32)();
+
struct streamtab *udp_infop = 0;
struct ill_s *ill_g_headp = 0;
afsinit(struct vfssw *vfsswp, int fstype)
{
- extern int afs_xioctl(), afs_xflock();
+ extern int afs_xioctl();
extern int afs_xsetgroups();
AFS_STATCNT(afsinit);
+ afs_orig_setgroups = sysent[SYS_setgroups].sy_callc;
+ afs_orig_ioctl = sysent[SYS_ioctl].sy_call;
sysent[SYS_setgroups].sy_callc = afs_xsetgroups;
sysent[SYS_ioctl].sy_call = afs_xioctl;
#if defined(AFS_SUN57_64BIT_ENV)
+ afs_orig_setgroups32 = sysent32[SYS_setgroups].sy_callc;
+ afs_orig_ioctl32 = sysent32[SYS_ioctl].sy_call;
sysent32[SYS_setgroups].sy_callc = afs_xsetgroups;
sysent32[SYS_ioctl].sy_call = afs_xioctl;
#endif
extern struct bind *sb_hashtab[];
struct modctl *mp = 0;
+ if (afs_sinited)
+ return EBUSY;
+
if ((!(mp = mod_find_by_filename("fs", "ufs")) &&
!(mp = mod_find_by_filename(NULL, "/kernel/fs/ufs")) &&
!(mp = mod_find_by_filename(NULL, "sys/ufs"))) ||
{
int code;
- if (afs_sinited)
- return (EBUSY);
+ if (afs_globalVFS)
+ return EBUSY;
+
+ if (afs_sinited) {
+ sysent[SYS_setgroups].sy_callc = afs_orig_setgroups;
+ sysent[SYS_ioctl].sy_call = afs_orig_ioctl;
+#if defined(AFS_SUN57_64BIT_ENV)
+ sysent32[SYS_setgroups].sy_callc = afs_orig_setgroups32;
+ sysent32[SYS_ioctl].sy_call = afs_orig_ioctl32;
+#endif
+ }
code = mod_remove(&afs_modlinkage);
return code;
}