/*
* osi_vfsops.c for SOLARIS
*/
-#include "../afs/param.h" /* Should be always first */
+#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 */
#include "../afs/afs_stats.h" /* statistics stuff */
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;
}
afsp->vfs_bsize = 8192;
afsp->vfs_fsid.val[0] = AFS_VFSMAGIC; /* magic */
afsp->vfs_fsid.val[1] = AFS_VFSFSID;
+ afsp->vfs_dev = AFS_VFSMAGIC;
AFS_GUNLOCK();
return 0;
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
if ( !nfs_checkauth ) afs_warn("nfs_checkauth not initialised");
#endif
ufs_iallocp = (int (*)()) modlookup("ufs", "ufs_ialloc");
- ufs_iupdatp = (int (*)()) modlookup("ufs", "ufs_iupdat");
+ ufs_iupdatp = (void (*)()) modlookup("ufs", "ufs_iupdat");
ufs_igetp = (int (*)()) modlookup("ufs", "ufs_iget");
ufs_itimes_nolockp = (void (*)()) modlookup("ufs", "ufs_itimes_nolock");
udp_infop = (struct streamtab *) modlookup("udp", "udpinfo");
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;
}