openbsd-20021205
authorJim Rees <rees@umich.edu>
Thu, 5 Dec 2002 16:17:26 +0000 (16:17 +0000)
committerJim Rees <rees@umich.edu>
Thu, 5 Dec 2002 16:17:26 +0000 (16:17 +0000)
Change syscall from 210 to 208, by popular demand

src/afs/OBSD/osi_vfsops.c
src/config/param.i386_obsd31.h

index 5dcabf1..46cc7d7 100644 (file)
@@ -109,11 +109,11 @@ RCSID("$Header$");
 /* from /usr/src/sys/kern/vfs_subr.c */
 extern void insmntque(struct vnode *, struct mount *);
 
-#define NBSD_DONTFOLLOW_LINK 0
-#define NBSD_FOLLOW_LINK 1
+extern int sys_lkmnosys(), afs3_syscall(), afs_xioctl(), Afs_xsetgroups();
 
 static int lkmid = -1;
 static int afs_badcall(struct proc *p, void *xx, register_t *yy);
+static struct sysent old_sysent;
 
 char afs_NetBSD_osname[] = "OpenBSD";
 struct osi_vfs *afs_globalVFS;
@@ -166,7 +166,7 @@ afs_nbsd_lookupname(char *fnamep,
      * pathname is user or system space.
      */
     /* XXX LOCKLEAF ? */
-    niflag =  (followlink == NBSD_FOLLOW_LINK) ? FOLLOW : NOFOLLOW;
+    niflag = followlink ? FOLLOW : NOFOLLOW;
     if (dirvpp)
        niflag |= WANTPARENT;           /* XXX LOCKPARENT? */
     NDINIT(&nd, LOOKUP,
@@ -196,7 +196,7 @@ afs_sysctl()
 int
 afs_checkexp()
 {
-       return EOPNOTSUPP;
+    return EOPNOTSUPP;
 }
 
 int
@@ -454,7 +454,7 @@ static char afsbfrmem[] = "afsbfrmem";
 int
 afsinit()
 {
-    extern int afs3_syscall(), afs_xioctl(), Afs_xsetgroups(), afs_xflock();
+    old_sysent = sysent[AFS_SYSCALL];
 
     sysent[AFS_SYSCALL].sy_call = afs3_syscall;
     sysent[AFS_SYSCALL].sy_narg = 6;
@@ -487,11 +487,9 @@ afs_vfs_load(struct lkm_table *lkmtp,
 }
 
 int
-afs_vfs_unload(struct lkm_table *lktmp,
-            int cmd)
+afs_vfs_unload(struct lkm_table *lktmp, int cmd)
 {
     extern char *memname[];
-    extern int sys_lkmnosys();
 
     if (afs_globalVp)
        return EBUSY;
@@ -507,30 +505,24 @@ afs_vfs_unload(struct lkm_table *lktmp,
     if (memname[M_AFSBUFFER] == afsbfrmem)
        memname[M_AFSBUFFER] = NULL;
 
-    sysent[AFS_SYSCALL].sy_call = sys_lkmnosys;
+    sysent[AFS_SYSCALL] = old_sysent;
     printf("OpenAFS unloaded\n");
     return 0;
 }
 
-
-
 int
-afsmodload(struct lkm_table *lkmtp,
-          int cmd,
-          int ver)
+afsmodload(struct lkm_table *lkmtp, int cmd, int ver)
 {
-    extern int sys_lkmnosys();
-
     if (cmd == LKM_E_LOAD) {
-       if (strcmp(ostype,afs_NetBSD_osname)) {
+       if (strcmp(ostype, afs_NetBSD_osname)) {
            printf("This is %s version %s\n", ostype, osrelease);
            printf("This version of AFS is only for %s\n",
                   afs_NetBSD_osname);
-/*         return EPROGMISMATCH;*/
+           return EPROGMISMATCH;
        }
-       if (sysent[AFS_SYSCALL].sy_call != sys_lkmnosys) {
-           printf("AFS must be loaded with syscall %d assigned to sys_lkmnosys\nIs AFS already loaded?\n",
-                  AFS_SYSCALL);
+       if (sysent[AFS_SYSCALL].sy_call == afs3_syscall
+           || sysent[AFS_SYSCALL].sy_call == afs_badcall) {
+           printf("AFS already loaded\n");
            return EINVAL;
        }
     }
index ad72476..7190212 100644 (file)
@@ -1,6 +1,3 @@
-#ifndef UKERNEL
-/* This section for kernel libafs compiles only */
-
 /*
  * Jim Rees, University of Michigan CITI
  */
 #include <afs/afs_sysnames.h>
 #endif
 
-#define AFS_XBSD_ENV 1             /* {Free,Open,Net}BSD */
-#define AFS_X86_XBSD_ENV 1
+#define AFS_XBSD_ENV           1       /* {Free,Open,Net}BSD */
+#define AFS_X86_XBSD_ENV       1
 
-#define AFS_NAMEI_ENV     1   /* User space interface to file system */
-#define AFS_64BIT_IOPS_ENV 1  /* Needed for NAMEI */
-#define        AFS_OBSD_ENV    1
-#define AFS_NONFSTRANS 1
-#define AFS_KERBEROS_ENV 1
-#define AFS_VM_RDWR_ENV        1
-#define AFS_VFS_ENV    1
-#define AFS_VFSINCL_ENV 1
+#define AFS_NAMEI_ENV          1       /* User space interface to file system */
+#define AFS_64BIT_IOPS_ENV     1       /* Needed for NAMEI */
+#define        AFS_OBSD_ENV            1
+#define AFS_NONFSTRANS         1
+#define AFS_KERBEROS_ENV       1
+#define AFS_VM_RDWR_ENV                1
+#define AFS_VFS_ENV            1
+#define AFS_VFSINCL_ENV                1
 
 #define FTRUNC O_TRUNC
 
-#define AFS_SYSCALL    210
+#define AFS_SYSCALL    208
 #define AFS_MOUNT_AFS  "afs"
 
 #define SYS_NAME       "i386_obsd31"
 #define AFS_GCPAGS             0       /* if nonzero, garbage collect PAGs */
 #define AFS_USE_GETTIMEOFDAY    1       /* use gettimeofday to implement rx clock */
 
-#define AFSLITTLE_ENDIAN 1
+#define AFSLITTLE_ENDIAN       1
 
 /* Extra kernel definitions (from kdefs file) */
 #ifdef _KERNEL
-#define AFS_GLOBAL_SUNLOCK 1
-#define        AFS_SHORTGID    0       /* are group id's short? */
+#define AFS_GLOBAL_SUNLOCK     1
+#define        AFS_SHORTGID            0       /* are group id's short? */
 
 #if    !defined(ASSEMBLER) && !defined(__LANGUAGE_ASSEMBLY__)
 enum vcexcl {NONEXCL, EXCL};
@@ -57,71 +54,4 @@ enum vcexcl {NONEXCL, EXCL};
 #endif /* ! ASSEMBLER & ! __LANGUAGE_ASSEMBLY__ */
 #endif /* _KERNEL */
 
-#endif /* AFS_PARAM_H */
-
-#else /* !defined(UKERNEL) */
-
-/* This section for user space compiles only */
-
-/*
- * Jim Rees, University of Michigan CITI
- */
-
-#ifndef AFS_PARAM_H
-#define AFS_PARAM_H
-
-
-#define UKERNEL                        1       /* user space kernel */
-#define AFS_ENV                        1
-#define AFS_VFSINCL_ENV         1
-#define        AFS_OBSD_ENV    1
-#define AFS_386i_ENV   1       /* 386 Architecture--for lwp stuff */
-#define AFS_NONFSTRANS 1
-#define AFS_KERBEROS_ENV
-
-#define AFS_MOUNT_AFS "afs"    /* The name of the filesystem type. */
-#define AFS_SYSCALL 210
-#define AFS_NAMEI_ENV         1   /* User space interface to file system */
-#define AFS_64BIT_IOPS_ENV    1   /* Needed for NAMEI */
-#include <afs/afs_sysnames.h>
-
-#define AFS_USERSPACE_IP_ADDR 1
-#define RXK_LISTENER_ENV      1
-#define AFS_GCPAGS           0       /* if nonzero, garbage collect PAGs */
-
-/* Machine / Operating system information */
-#define SYS_NAME       "i386_obsd31"
-#define SYS_NAME_ID    2002
-#define AFSLITTLE_ENDIAN    1
-#define AFS_HAVE_FFS        1       /* Use system's ffs. */
-#define AFS_HAVE_STATVFS    0  /* System doesn't support statvfs */
-
-#define        afsio_iov       uio_iov
-#define        afsio_iovcnt    uio_iovcnt
-#define        afsio_offset    uio_offset
-#define        afsio_seg       uio_segflg
-#define        afsio_fmode     uio_fmode
-#define        afsio_resid     uio_resid
-#define        AFS_UIOSYS      1
-#define        AFS_UIOUSER     UIO_USERSPACE
-#define        AFS_CLBYTES     MB_CLBYTES
-#define        AFS_MINCHANGE   2
-#define        VATTR_NULL      usr_vattr_null
-
-#define AFS_DIRENT
-#ifndef CMSERVERPREF
-#define CMSERVERPREF
-#endif
-
-#include <limits.h>
-#include <sys/param.h>
-#include <sys/types.h>
-#include <sys/mount.h>
-#include <sys/fcntl.h>
-#include <netinet/in.h>
-#include <sys/uio.h>
-#include <sys/socket.h>
-
 #endif /* AFS_PARAM_H */
-
-#endif /* !defined(UKERNEL) */