/* 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;
* 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,
int
afs_checkexp()
{
- return EOPNOTSUPP;
+ return EOPNOTSUPP;
}
int
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;
}
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;
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;
}
}
-#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};
#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) */