Remove support for Solaris pre-8
[openafs.git] / src / afs / SOLARIS / osi_vfsops.c
index 254c9ac..7d69c34 100644 (file)
 #endif
 #include <sys/kobj.h>
 
-#ifdef AFS_SUN58_ENV
-# include <sys/mount.h>
-#endif
+#include <sys/mount.h>
 
 struct vfs *afs_globalVFS = 0;
 struct vcache *afs_globalVp = 0;
 
-#if defined(AFS_SUN57_64BIT_ENV)
+#if defined(AFS_SUN5_64BIT_ENV)
 extern struct sysent sysent32[];
 #endif
 
@@ -83,13 +81,8 @@ afs_freevfs(void)
     afs_shutdown();
 }
 
-#if defined(AFS_SUN58_ENV)
 int
 afs_unmount(struct vfs *afsp, int flag, afs_ucred_t *credp)
-#else
-int
-afs_unmount(struct vfs *afsp, afs_ucred_t *credp)
-#endif
 {
     struct vcache *rootvp = NULL;
 
@@ -105,7 +98,6 @@ afs_unmount(struct vfs *afsp, afs_ucred_t *credp)
         return (EPERM);
     }
 
-#ifdef AFS_SUN58_ENV
     if (flag & MS_FORCE) {
        AFS_GUNLOCK();
        return ENOTSUP;
@@ -126,7 +118,6 @@ afs_unmount(struct vfs *afsp, afs_ucred_t *credp)
     }
 
     afsp->vfs_flag |= VFS_UNMOUNTED;
-#endif /* AFS_SUN58_ENV */
 
     /* release the root vnode, which should be the last reference to us
      * besides the caller of afs_unmount */
@@ -134,16 +125,10 @@ afs_unmount(struct vfs *afsp, afs_ucred_t *credp)
     afs_globalVp = NULL;
     AFS_RELE(rootvp);
 
-#ifndef AFS_SUN58_ENV
-    /* shutdown now, since gafs_freevfs() will not be called */
-    afs_freevfs();
-#endif /* !AFS_SUN58_ENV */
-
     AFS_GUNLOCK();
     return 0;
 }
 
-#ifdef AFS_SUN58_ENV
 void
 gafs_freevfs(struct vfs *afsp)
 {
@@ -153,7 +138,6 @@ gafs_freevfs(struct vfs *afsp)
 
     AFS_GUNLOCK();
 }
-#endif /* AFS_SUN58_ENV */
 
 int
 afs_root(struct vfs *afsp, struct vnode **avpp)
@@ -235,13 +219,8 @@ again:
     return code;
 }
 
-#ifdef AFS_SUN56_ENV
 int
 afs_statvfs(struct vfs *afsp, struct statvfs64 *abp)
-#else
-int
-afs_statvfs(struct vfs *afsp, struct statvfs *abp)
-#endif
 {
     AFS_GLOCK();
 
@@ -353,9 +332,7 @@ struct vfsops Afs_vfsops = {
     afs_vget,
     afs_mountroot,
     afs_swapvp,
-#if defined(AFS_SUN58_ENV)
     gafs_freevfs,
-#endif
 };
 #endif
 
@@ -420,12 +397,12 @@ afsinit(struct vfssw *vfsswp, int fstype)
     sysent[SYS_setgroups].sy_callc = afs_xsetgroups;
     sysent[SYS_ioctl].sy_call = afs_xioctl;
 
-#if defined(AFS_SUN57_64BIT_ENV)
+#if defined(AFS_SUN5_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 /* AFS_SUN57_64BIT_ENV */
+#endif /* AFS_SUN5_64BIT_ENV */
 
 #ifdef AFS_SUN510_ENV
     vfs_setfsops(fstype, afs_vfsops_template, &afs_vfsopsp);
@@ -548,7 +525,7 @@ static struct modlsys afsmodlsys = {
   * land here from sysent or sysent32
   */
 
-# if defined(AFS_SUN57_64BIT_ENV)
+# if defined(AFS_SUN5_64BIT_ENV)
 extern struct mod_ops mod_syscallops32;
 
 static struct modlsys afsmodlsys32 = {
@@ -567,7 +544,7 @@ static struct modlinkage afs_modlinkage = {
     (void *)&afs_modldrv,
 #else
     (void *)&afsmodlsys,
-# ifdef AFS_SUN57_64BIT_ENV
+# ifdef AFS_SUN5_64BIT_ENV
     (void *)&afsmodlsys32,
 # endif
 #endif /* !AFS_SUN511_ENV */
@@ -580,7 +557,7 @@ reset_sysent(void)
     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)
+#if defined(AFS_SUN5_64BIT_ENV)
        sysent32[SYS_setgroups].sy_callc = afs_orig_setgroups32;
        sysent32[SYS_ioctl].sy_call = afs_orig_ioctl32;
 #endif
@@ -614,7 +591,6 @@ _init()
        return (ENOSYS);
     }
 #ifndef        AFS_NONFSTRANS
-#if     defined(AFS_SUN55_ENV)
     if ((!(mp = mod_find_by_filename("misc", "nfssrv"))
         && !(mp = mod_find_by_filename(NULL, NFSSRV))
         && !(mp = mod_find_by_filename(NULL, NFSSRV_V9))
@@ -626,59 +602,8 @@ _init()
            ("misc/nfssrv module must be loaded before loading afs with nfs-xlator\n");
        return (ENOSYS);
     }
-#else /* !AFS_SUN55_ENV */
-#if    defined(AFS_SUN52_ENV)
-    if ((!(mp = mod_find_by_filename("fs", "nfs"))
-        && !(mp = mod_find_by_filename(NULL, "/kernel/fs/nfs"))
-        && !(mp = mod_find_by_filename(NULL, "sys/nfs"))) || (mp
-                                                              && !mp->
-                                                              mod_installed))
-    {
-       printf
-           ("fs/nfs module must be loaded before loading afs with nfs-xlator\n");
-       return (ENOSYS);
-    }
-#endif /* AFS_SUN52_ENV */
-#endif /* AFS_SUN55_ENV */
 #endif /* !AFS_NONFSTRANS */
 
-#ifndef AFS_SUN511_ENV
-    /* syscall initialization stff */
-
-# if !defined(AFS_SUN58_ENV)
-    /* 
-     * Re-read the /etc/name_to_sysnum file to make sure afs isn't added after
-     * reboot.  Ideally we would like to call modctl_read_sysbinding_file() but
-     * unfortunately in Solaris 2.2 it became a local function so we have to do
-     * the read_binding_file() direct call with the appropriate text file and
-     * system call hashtable.  make_syscallname actually copies "afs" to the
-     * proper slot entry and we also actually have to properly initialize the
-     * global sysent[AFS_SYSCALL] entry!
-     */
-#  ifdef       AFS_SUN53_ENV
-#   ifndef     SYSBINDFILE
-#    define    SYSBINDFILE     "/etc/name_to_sysnum"
-#   endif /* SYSBINDFILE */
-    read_binding_file(SYSBINDFILE, sb_hashtab);
-#  else /* !AFS_SUN53_ENV */
-    read_binding_file(sysbind, sb_hashtab);
-#  endif /* AFS_SUN53_ENV */
-    make_syscallname("afs", AFS_SYSCALL);
-
-    if (sysent[AFS_SYSCALL].sy_call == nosys) {
-       if ((sysn = mod_getsysname(AFS_SYSCALL)) != NULL) {
-           sysent[AFS_SYSCALL].sy_lock =
-               (krwlock_t *) kobj_zalloc(sizeof(krwlock_t), KM_SLEEP);
-           rw_init(sysent[AFS_SYSCALL].sy_lock, "afs_syscall",
-#  ifdef AFS_SUN57_ENV
-                   RW_DEFAULT, NULL);
-#  else /* !AFS_SUN57_ENV */
-                   RW_DEFAULT, DEFAULT_WT);
-#  endif /* AFS_SUN57_ENV */
-       }
-    }
-# endif /* !AFS_SUN58_ENV */
-#endif /* !AFS_SUN511_ENV */
 
     osi_Init();                        /* initialize global lock, etc */