]> git.michaelhowe.org Git - packages/o/openafs.git/commitdiff
This commit was generated by cvs2svn to compensate for changes in r528,
authorSam Hartman <hartmans@debian.org>
Thu, 26 Sep 2002 19:09:36 +0000 (19:09 +0000)
committerSam Hartman <hartmans@debian.org>
Thu, 26 Sep 2002 19:09:36 +0000 (19:09 +0000)
which included commits to RCS files with non-trunk default branches.

147 files changed:
README
acconfig.h
acinclude.m4
configure-libafs.in
src/WINNT/afsapplib/dialog.cpp
src/WINNT/doc/install/Documentation/en_US/html/CmdRef/auarf260.htm
src/afs/DARWIN/osi_machdep.h
src/afs/DARWIN/osi_module.c
src/afs/DARWIN/osi_prototypes.h
src/afs/DARWIN/osi_vm.c
src/afs/DARWIN/osi_vnodeops.c
src/afs/DUX/osi_vnodeops.c
src/afs/FBSD/osi_file.c
src/afs/FBSD/osi_groups.c
src/afs/FBSD/osi_inode.c
src/afs/FBSD/osi_machdep.h
src/afs/FBSD/osi_misc.c
src/afs/FBSD/osi_sleep.c
src/afs/FBSD/osi_vfsops.c
src/afs/FBSD/osi_vm.c
src/afs/FBSD/osi_vnodeops.c
src/afs/FBSD/vnode_if.h
src/afs/SOLARIS/osi_file.c
src/afs/VNOPS/afs_vnop_attrs.c
src/afs/VNOPS/afs_vnop_flock.c
src/afs/VNOPS/afs_vnop_read.c
src/afs/VNOPS/afs_vnop_strategy.c
src/afs/VNOPS/afs_vnop_write.c
src/afs/afs_analyze.c
src/afs/afs_buffer.c
src/afs/afs_cell.c
src/afs/afs_conn.c
src/afs/afs_init.c
src/afs/afs_mariner.c
src/afs/afs_nfsclnt.c
src/afs/afs_osi.c
src/afs/afs_server.c
src/afs/afs_user.c
src/afs/afs_util.c
src/afs/afs_vcache.c
src/afs/afs_volume.c
src/afs/lock.h
src/afs/sysincludes.h
src/afsd/afs.rc.darwin
src/afsd/afs.rc.fbsd
src/afsd/afsd.c
src/afsmonitor/afsmonitor.c
src/auth/cellconfig.c
src/bozo/bnode.c
src/bozo/bos.c
src/bozo/bosserver.c
src/bucoord/commands.c
src/bucoord/config.c
src/bucoord/dsvs.c
src/bucoord/tape_hosts.c
src/butc/dump.c
src/cf/linux-test4.m4
src/config/Makefile.alpha_dux40.in
src/config/Makefile.alpha_dux50.in
src/config/Makefile.alpha_linux_22.in
src/config/Makefile.alpha_linux_24.in
src/config/Makefile.hp_ux102.in
src/config/Makefile.hp_ux110.in
src/config/Makefile.i386_djgpp
src/config/Makefile.i386_fbsd_42.in
src/config/Makefile.i386_linux24.in
src/config/Makefile.i386_obsd29.in
src/config/Makefile.ia64_linux24.in
src/config/Makefile.parisc_linux24.in
src/config/Makefile.ppc_darwin_12.in
src/config/Makefile.ppc_darwin_13.in
src/config/Makefile.ppc_darwin_14.in
src/config/Makefile.rs_aix42.in
src/config/Makefile.s390_linux22.in
src/config/Makefile.s390_linux24.in
src/config/Makefile.sgi_62.in
src/config/Makefile.sgi_63.in
src/config/Makefile.sgi_64.in
src/config/Makefile.sgi_65.in
src/config/Makefile.sparc64_linux22.in
src/config/Makefile.sparc64_linux24.in
src/config/Makefile.sparc_linux22.in
src/config/Makefile.sparc_linux24.in
src/config/Makefile.sun4x_55.in
src/config/Makefile.sun4x_56.in
src/config/Makefile.sun4x_57.in
src/config/Makefile.sun4x_58.in
src/config/Makefile.sun4x_59.in
src/config/Makefile.sunx86_54.in
src/config/Makefile.sunx86_57.in
src/config/afs_sysnames.h
src/config/param.i386_fbsd_42.h
src/config/param.i386_fbsd_42_usr.h
src/config/param.ia64_linux24.h
src/config/param.ia64_linux24_usr.h
src/config/param.rs_aix42.h
src/config/stds.h
src/config/venus.h
src/dir/dir.c
src/fsint/afsaux.c
src/gtx/curseswindows.c
src/kauth/authclient.c
src/kauth/krb_udp.c
src/libafs/MakefileProto.DARWIN.in
src/libafs/MakefileProto.FBSD.in
src/libafsrpc/Makefile.in
src/libuafs/MakefileProto.FBSD.in
src/pam/Makefile.in
src/pinstall/install.c
src/ptserver/ptprocs.c
src/ptserver/testpt.c
src/rx/DARWIN/rx_kmutex.h
src/rx/FBSD/rx_kmutex.h
src/rx/FBSD/rx_knet.c
src/rx/LINUX/rx_kmutex.h
src/rx/rx.h
src/rx/rx_kcommon.c
src/rx/rx_kcommon.h
src/rx/rx_pthread.h
src/rx/rx_user.c
src/rx/rx_user.h
src/rx/rxdebug.c
src/rxdebug/rxdebug.c
src/rxgen/rpc_main.c
src/rxkad/rxkad_client.c
src/rxkad/rxkad_common.c
src/usd/usd_file.c
src/uss/uss_vol.c
src/util/assert.c
src/util/netutils.c
src/util/readdir_nt.c
src/util/snprintf.c
src/util/uuid.c
src/util/vice.h
src/venus/Makefile.in
src/venus/fs.c
src/viced/callback.c
src/viced/fsprobe.c
src/viced/host.c
src/viced/viced.c
src/vol/fssync.c
src/vol/listinodes.c
src/vol/namei_ops.c
src/vol/vol-salvage.c
src/vol/volume.c
src/volser/vos.c
src/volser/vsprocs.c

diff --git a/README b/README
index 44ed3d5e918f9d5494122bf467e03f6514e1482f..c99bbe2037bc51b7abfb9e7ed1f4fc4952d26658 100644 (file)
--- a/README
+++ b/README
@@ -32,8 +32,9 @@ A. Creating the proper directory structure.
 
       alpha_dux40
       alpha_dux50 (only tested on 5.0A)
+      i386_fbsd42 (gmake is required to build for FreeBSD)     
       i386_linux22
-      i386_linux24 (only tested with 2.4.0 kernel)
+      i386_linux24 
       rs_aix42
       sgi_65 (file server not tested)
       sun4x_56
@@ -43,8 +44,13 @@ A. Creating the proper directory structure.
       ppc_darwin_13
       ppc_linux22
       ppc_linux24
-      alpha_linux22 (DES does not work, will require one more change to
-                               compile)
+      alpha_linux22
+      alpha_linux24
+      ia64_linux24
+      sparc_linux22
+      sparc_linux24
+      sparc64_linux22
+      sparc64_linux24
       hp_ux110 (No client support, but db servers and utilities work)
       hp_ux102 (No client support, but db servers and utilities work)
 
index 5b182b46ac3bf47269ac8662fb5c6444c1df1327..cbac0c04c1f10f97a60e9a52050498b666878344 100644 (file)
@@ -9,6 +9,7 @@ static /**/const char *const rcsid[] = { (char *)rcsid, "\100(#)" msg }
 #undef HAVE_GETHOSTBYNAME
 #undef HAVE_RES_SEARCH
 #undef HAVE_SOCKET
+#undef STRUCT_SOCKADDR_HAS_SA_LEN
 
 #if ENDIANESS_IN_SYS_PARAM_H
 # ifndef KERNEL
@@ -34,6 +35,9 @@ static /**/const char *const rcsid[] = { (char *)rcsid, "\100(#)" msg }
 #undef STRUCT_INODE_HAS_I_TRUNCATE_SEM
 #undef STRUCT_INODE_HAS_I_DIRTY_DATA_BUFFERS
 #undef STRUCT_INODE_HAS_I_DEVICES
+#undef EXPORTED_TASKLIST_LOCK
+#undef COMPLETION_H_EXISTS
+#undef ssize_t
 
 /* glue for RedHat kernel bug */
 #undef ENABLE_REDHAT_BUILDSYS
index 171bbd30c19a3f0091df14c4ec70620b4385278e..3edbf24d519c22bb32f32c6d9a4a5cbf795744d2 100644 (file)
@@ -57,9 +57,6 @@ AC_ISC_POSIX
 AC_MINIX
 
 dnl Various compiler setup.
-AC_C_INLINE
-AC_C_CONST
-AC_PROG_CC
 AC_TYPE_PID_T
 AC_TYPE_SIZE_T
 AC_TYPE_SIGNAL
@@ -143,8 +140,16 @@ case $system in
                 LINUX_FS_STRUCT_INODE_HAS_I_DIRTY_DATA_BUFFERS
                 LINUX_FS_STRUCT_INODE_HAS_I_DEVICES
                 LINUX_INODE_SETATTR_RETURN_TYPE
+                LINUX_COMPLETION_H_EXISTS
+                LINUX_EXPORTS_TASKLIST_LOCK
                 LINUX_NEED_RHCONFIG
                 LINUX_WHICH_MODULES
+                if test "x$ac_cv_linux_exports_tasklist_lock" = "xyes" ; then
+                 AC_DEFINE(EXPORTED_TASKLIST_LOCK)
+                fi
+                if test "x$ac_cv_linux_completion_h_exists" = "xyes" ; then
+                 AC_DEFINE(COMPLETION_H_EXISTS)
+                fi
                 if test "x$ac_cv_linux_func_inode_setattr_returns_int" = "xyes" ; then
                  AC_DEFINE(INODE_SETATTR_NOT_VOID)
                 fi
@@ -172,6 +177,11 @@ case $system in
                SOLARIS_UFSVFS_HAS_DQRWLOCK
                SOLARIS_PROC_HAS_P_COREFILE
                 ;;
+        *-sunos*)
+               MKAFS_OSTYPE=SUNOS
+               enable_kernel_module=no
+                AC_MSG_RESULT(sun4)
+                ;;
         *-hpux*)
                MKAFS_OSTYPE=HPUX
                 AC_MSG_RESULT(hp_ux)
@@ -228,6 +238,18 @@ else
                i?86-*-freebsd4.2*)
                        AFS_SYSNAME="i386_fbsd_42"
                        ;;
+               i?86-*-freebsd4.3*)
+                       AFS_SYSNAME="i386_fbsd_43"
+                       ;;
+               i?86-*-freebsd4.4*)
+                       AFS_SYSNAME="i386_fbsd_44"
+                       ;;
+               i?86-*-freebsd4.5*)
+                       AFS_SYSNAME="i386_fbsd_45"
+                       ;;
+               i?86-*-freebsd4.6*)
+                       AFS_SYSNAME="i386_fbsd_46"
+                       ;;
                hppa*-hp-hpux11*)
                        AFS_SYSNAME="hp_ux110"
                        ;;
@@ -258,6 +280,12 @@ else
                powerpc-apple-darwin5.5*)
                        AFS_SYSNAME="ppc_darwin_14"
                        ;;
+               powerpc-apple-darwin6.0*)
+                       AFS_SYSNAME="ppc_darwin_60"
+                       ;;
+               powerpc-apple-darwin6.1*)
+                       AFS_SYSNAME="ppc_darwin_60"
+                       ;;
                sparc-sun-solaris2.5*)
                        AFS_SYSNAME="sun4x_55"
                        ;;
@@ -273,6 +301,9 @@ else
                sparc-sun-solaris2.9)
                        AFS_SYSNAME="sun4x_59"
                        ;;
+               sparc-sun-sunos4*)
+                       AFS_SYSNAME="sun4_413"
+                       ;;
                i386-pc-solaris2.7)
                        AFS_SYSNAME="sunx86_57"
                        ;;
@@ -345,7 +376,17 @@ case $AFS_SYSNAME in
                DARWIN_INFOFILE=afs.${AFS_SYSNAME}.plist
                ;;
 esac
-
+AC_CACHE_VAL(ac_cv_sockaddr_len,
+[
+AC_MSG_CHECKING([if struct sockaddr has sa_len field])
+AC_TRY_COMPILE( [#include <sys/types.h>
+#include <sys/socket.h>],
+[struct sockaddr *a;
+a->sa_len=0;], ac_cv_sockaddr_len=yes, ac_cv_sockaddr_len=no)
+AC_MSG_RESULT($ac_cv_sockaddr_len)])
+if test "$ac_cv_sockaddr_len" = "yes"; then
+   AC_DEFINE(STRUCT_SOCKADDR_HAS_SA_LEN)
+fi
 if test "x${MKAFS_OSTYPE}" = "xIRIX"; then
         echo Skipping library tests because they confuse Irix.
 else
@@ -476,10 +517,11 @@ AC_CHECK_HEADERS(netinet/in.h netdb.h sys/fcntl.h sys/mnttab.h sys/mntent.h)
 AC_CHECK_HEADERS(mntent.h sys/vfs.h sys/param.h sys/fs_types.h)
 AC_CHECK_HEADERS(sys/mount.h strings.h termios.h signal.h)
 AC_CHECK_HEADERS(windows.h malloc.h winsock2.h direct.h io.h)
-AC_CHECK_HEADERS(security/pam_modules.h siad.h usersec.h)
+AC_CHECK_HEADERS(security/pam_modules.h siad.h usersec.h ucontext.h)
 
 AC_CHECK_FUNCS(utimes random srandom getdtablesize snprintf re_comp re_exec)
-AC_CHECK_FUNCS(setprogname getprogname)
+AC_CHECK_FUNCS(setprogname getprogname sigaction)
+AC_CHECK_TYPE(ssize_t, int)
 
 dnl Directory PATH handling
 if test "x$enable_transarc_paths" = "xyes"  ; then 
index fe9f1102d5da42fca8def0a079f9cbd57c714e8c..8180d4b05ac56e619989b25dd3e8948c54237710 100644 (file)
@@ -1,8 +1,9 @@
 AC_INIT(Makefile.common)
-AM_INIT_AUTOMAKE(openafs-libafs,1.2.6)
+AM_INIT_AUTOMAKE(openafs-libafs,1.2.7)
 AC_CONFIG_HEADER(config/afsconfig.h)
 define(OPENAFS_CONFIGURE_LIBAFS)
 
+AC_PROG_CC
 OPENAFS_CONFIGURE_COMMON
 
 TOP_SRCDIR="${SRCDIR_PARENT}"
index 4c851e26f41d42dc9734974be90af44bbe605d0c..96243139f3eedcbbb537c66d337cb376adfa2ed8 100644 (file)
@@ -1835,7 +1835,7 @@ WORD NextControlID (HWND hParent)
       if ((wChild < 0) || (wChild >= 0xF000))
          continue;
 
-      wNext = max( wNext, wChild+1 );
+      wNext = max( wNext, (WORD) wChild+1 );
       }
 
    return wNext;
index 3f61803684701b78d87f9d6787bd590b54e37aeb..1a862f672b895b99f6648a62003ae1c45560a0bf 100755 (executable)
@@ -31,7 +31,7 @@
 <P>Converts a volume into ASCII format and writes it to a file
 <P><STRONG>Synopsis</STRONG>
 <PRE><B>vos dump -id</B> &lt;<VAR>volume&nbsp;name&nbsp;or&nbsp;ID</VAR>>  [<B>-time</B> &lt;<VAR>dump&nbsp;from&nbsp;time</VAR>>]  [<B>-file</B> &lt;<VAR>dump&nbsp;file</VAR>>]  
-         [<B>-server</B> &lt;<VAR>server</VAR>>]  [<B>-partition</B> &lt;<VAR>partition</VAR>>]  [<B>-cell</B> &lt;<VAR>cell&nbsp;name</VAR>>]  
+         [<B>-server</B> &lt;<VAR>server</VAR>>]  [<B>/partition</B> &lt;<VAR>partition</VAR>>]  [<B>-cell</B> &lt;<VAR>cell&nbsp;name</VAR>>]  
          [<B>-noauth</B>]  [<B>-localauth</B>]  [<B>-verbose</B>]  [<B>-help</B>]
     
 <B>vos du -i</B> &lt;<VAR>volume&nbsp;name&nbsp;or&nbsp;ID</VAR>>  [<B>-t</B> &lt;<VAR>dump&nbsp;from&nbsp;time</VAR>>]  [<B>-f</B> &lt;<VAR>dump&nbsp;file</VAR>>]  
index 0aa14a706a2a88b910393237f6d5a8078fda6444..9feda0345b9d9396d40ffa0cc89a533e90a91828 100644 (file)
@@ -42,7 +42,9 @@ enum vcexcl { EXCL, NONEXCL } ;
 /* 
  * Time related macros
  */
+#ifndef AFS_DARWIN60_ENV
 extern struct timeval time;
+#endif
 #define osi_Time() (time.tv_sec)
 #define afs_hz      hz
 
index 500b2421dce1a4854a4fdf5f3ff84f3dabd6814a..5de3cf224fb2a814d7fa7e92350ccaba042568c5 100644 (file)
@@ -1,11 +1,15 @@
 #include <afsconfig.h>
 #include "../afs/param.h"
 
-RCSID("$Header: /tmp/cvstemp/openafs/src/afs/DARWIN/osi_module.c,v 1.1.1.5 2002/01/22 19:48:05 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/afs/DARWIN/osi_module.c,v 1.1.1.6 2002/09/26 18:58:04 hartmans Exp $");
 
 #include "../afs/sysincludes.h"
 #include "../afs/afsincludes.h"
+#ifdef AFS_DARWIN60_ENV /* not in Kernel.framework anymore !?! */
+#include <sys/syscall.h>
+#else
 #include "../sys/syscall.h"
+#endif
 #include <mach/kmod.h>
 
 struct vfsconf afs_vfsconf;
index 852e1c388f738e0ad12d8f2064840cff9069f76b..ed68243c1814d3e8c6edfc34bb633777b5ec0b18 100644 (file)
@@ -19,5 +19,5 @@ extern int osi_lookupname(char *aname, enum uio_seg seg, int followlink,
                          struct vnode **dirvpp, struct vnode **vpp);
 /* osi_vm.c */
 extern void osi_VM_NukePages(struct vnode *vp, off_t offset, off_t size);
-extern int osi_VM_Setup(struct vcache *avc);
+extern int osi_VM_Setup(struct vcache *avc, int force);
 #endif /* _OSI_PROTO_H_ */
index 7c133b81f296299916994a80026628c0e221aa15..f52b152e682edd254754605f9456d4d83c521a62 100644 (file)
@@ -10,7 +10,7 @@
 #include <afsconfig.h>
 #include "../afs/param.h"
 
-RCSID("$Header: /tmp/cvstemp/openafs/src/afs/DARWIN/osi_vm.c,v 1.1.1.6 2002/08/02 04:28:49 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/afs/DARWIN/osi_vm.c,v 1.1.1.7 2002/09/26 18:58:05 hartmans Exp $");
 
 #include "../afs/sysincludes.h" /* Standard vendor system headers */
 #include "../afs/afsincludes.h" /* Afs-based standard headers */
@@ -320,16 +320,18 @@ void osi_VM_NukePages(struct vnode *vp, off_t offset, off_t size) {
 #endif
 
 }
-int osi_VM_Setup(struct vcache *avc) {
+int osi_VM_Setup(struct vcache *avc, int force) {
    int error;
    struct vnode *vp=AFSTOV(avc);
 
-   if (UBCISVALID(vp) && (avc->states & CStatd)) {
+   if (UBCISVALID(vp) && ((avc->states & CStatd) || force)) {
       if (!UBCINFOEXISTS(vp) && !ISSET(vp->v_flag, VTERMINATE)) {
          osi_vnhold(avc,0);  
+         avc->states  |= CUBCinit;
          AFS_GUNLOCK();
          if ((error=ubc_info_init(&avc->v)))  {
              AFS_GLOCK();
+             avc->states  &= ~CUBCinit;
              AFS_RELE(avc);
              return error;
          }
@@ -345,6 +347,7 @@ int osi_VM_Setup(struct vcache *avc) {
          simple_unlock(&avc->v.v_interlock);
 #endif
          AFS_GLOCK();
+         avc->states  &= ~CUBCinit;
          AFS_RELE(avc);
       }
       if (UBCINFOEXISTS(&avc->v))
index 0da0a11157b85debf818452c37432bb6daf00d24..153c49536a55b04c33d7dc1c7ab835c380d238ee 100644 (file)
@@ -1,7 +1,7 @@
 #include <afsconfig.h>
 #include <afs/param.h>
 
-RCSID("$Header: /tmp/cvstemp/openafs/src/afs/DARWIN/osi_vnodeops.c,v 1.1.1.6 2002/05/10 23:43:37 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/afs/DARWIN/osi_vnodeops.c,v 1.1.1.7 2002/09/26 18:58:05 hartmans Exp $");
 
 #include <afs/sysincludes.h>            /* Standard vendor system headers */
 #include <afs/afsincludes.h>            /* Afs-based standard headers */
@@ -309,6 +309,17 @@ afs_vop_close(ap)
     osi_FlushPages(avc);        /* hold bozon lock, but not basic vnode lock */
     afs_BozonUnlock(&avc->pvnLock, avc);
     AFS_GUNLOCK();
+#ifdef AFS_DARWIN14_ENV
+    if (UBCINFOEXISTS(ap->a_vp) && ap->a_vp->v_ubcinfo->ui_refcount < 2) {
+      ubc_hold(ap->a_vp);
+      if (ap->a_vp->v_ubcinfo->ui_refcount < 2) {
+         printf("afs: Imminent ui_refcount panic\n");
+       } else {
+         printf("afs: WARNING: ui_refcount panic averted\n");
+       }
+    }
+#endif
+
     return code;
 }
 
@@ -1214,21 +1225,23 @@ afs_vop_print(ap)
     register struct vnode *vp = ap->a_vp;
     register struct vcache *vc = VTOAFS(ap->a_vp);
     int s = vc->states;
-    char buf[20];
     printf("tag %d, fid: %ld.%x.%x.%x, opens %d, writers %d", vp->v_tag, vc->fid.Cell,
           vc->fid.Fid.Volume, vc->fid.Fid.Vnode, vc->fid.Fid.Unique, vc->opens,
           vc->execsOrWriters);
     printf("\n  states%s%s%s%s%s", (s&CStatd) ? " statd" : "", (s&CRO) ? " readonly" : "",(s&CDirty) ? " dirty" : "",(s&CMAPPED) ? " mapped" : "", (s&CVFlushed) ? " flush in progress" : "");
-    if (UBCISVALID(vp))
-        printf("\n  UBC: %s%s",
-               UBCINFOEXISTS(vp) ? "exists, " : "does not exist",
+    if (UBCISVALID(vp)) {
+        printf("\n  UBC: ");
+        if (UBCINFOEXISTS(vp)) {
+               printf("exists, ") ;
 #ifdef AFS_DARWIN14_ENV
-               UBCINFOEXISTS(vp) ?
-                 sprintf(buf, "refs %d", vp->v_ubcinfo->ui_refcount),buf : "");
+                 printf("refs %d%s%s", vp->v_ubcinfo->ui_refcount,
+                         ubc_issetflags(vp, UI_HASOBJREF) ? " HASOBJREF" : "",
+                         ubc_issetflags(vp, UI_WASMAPPED) ? " WASMAPPED" : "");
 #else
-               UBCINFOEXISTS(vp) ?
-                 sprintf(buf, "holdcnt %d", vp->v_ubcinfo->ui_holdcnt),buf : "");
+                 printf("holdcnt %d", vp->v_ubcinfo->ui_holdcnt);
 #endif
+        } else printf("does not exist");
+    }
     printf("\n");
     return 0;
 }
index cc14fe5dfa4a9f025a9a218e547f26793b716815..c14e967a053b6c9176270cd9a6de5b51f749b9e9 100644 (file)
@@ -14,7 +14,7 @@
 #include <afsconfig.h>
 #include "../afs/param.h"
 
-RCSID("$Header: /tmp/cvstemp/openafs/src/afs/DUX/osi_vnodeops.c,v 1.1.1.6 2002/05/10 23:43:41 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/afs/DUX/osi_vnodeops.c,v 1.1.1.7 2002/09/26 18:58:07 hartmans Exp $");
 
 
 #include "../afs/sysincludes.h"        /* Standard vendor system headers */
@@ -450,7 +450,7 @@ mp_afs_ubcrdwr(avc, uio, ioflag, cred)
        return EISDIR;  /* can't read or write other things */
     }
     afs_BozonLock(&avc->pvnLock, avc);
-    osi_FlushPages(avc);       /* hold bozon lock, but not basic vnode lock */
+    osi_FlushPages(avc, cred); /* hold bozon lock, but not basic vnode lock */
     ObtainWriteLock(&avc->lock,162);
     /* adjust parameters when appending files */
     if ((ioflag & IO_APPEND) && uio->uio_rw == UIO_WRITE)
@@ -718,7 +718,7 @@ mp_afs_mmap(avc, offset, map, addrp, len, prot, maxprot, flags, cred)
       return code;
     }
     afs_BozonLock(&avc->pvnLock, avc);
-    osi_FlushPages(avc);       /* ensure old pages are gone */
+    osi_FlushPages(avc, cred); /* ensure old pages are gone */
     afs_BozonUnlock(&avc->pvnLock, avc);
     ObtainWriteLock(&avc->lock,166);
     avc->states |= CMAPPED;
index 9bc6ad875a8f051993d68c4258921da44490c546..d8688f59c2c47ea695726f782c12cc6d3c764c7e 100644 (file)
@@ -10,7 +10,7 @@
 #include <afsconfig.h>
 #include "../afs/param.h"
 
-RCSID("$Header: /tmp/cvstemp/openafs/src/afs/FBSD/osi_file.c,v 1.1.1.4 2001/09/11 14:24:57 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/afs/FBSD/osi_file.c,v 1.1.1.5 2002/09/26 18:58:08 hartmans Exp $");
 
 #include "../afs/sysincludes.h"        /* Standard vendor system headers */
 #include "../afs/afsincludes.h"        /* Afs-based standard headers */
@@ -50,8 +50,8 @@ void *osi_UFSOpen(ainode)
        osi_FreeSmallSpace(afile);
        osi_Panic("UFSOpen: igetinode failed");
     }
-    IN_UNLOCK(ip);
     afile->vnode = ITOV(ip);
+    VOP_UNLOCK(afile->vnode, 0, curproc);
     afile->size = VTOI(afile->vnode)->i_size;
     afile->offset = 0;
     afile->proc = (int (*)()) 0;
@@ -67,7 +67,7 @@ afs_osi_Stat(afile, astat)
     AFS_STATCNT(osi_Stat);
     MObtainWriteLock(&afs_xosi,320);
     AFS_GUNLOCK();
-    VOP_GETATTR(afile->vnode, &tvattr, &afs_osi_cred, code);
+    code=VOP_GETATTR(afile->vnode, &tvattr, &afs_osi_cred, curproc);
     AFS_GLOCK();
     if (code == 0) {
        astat->size = tvattr.va_size;
@@ -94,7 +94,6 @@ osi_UFSClose(afile)
 osi_UFSTruncate(afile, asize)
     register struct osi_file *afile;
     afs_int32 asize; {
-    struct AFS_UCRED *oldCred;
     struct vattr tvattr;
     register afs_int32 code;
     struct osi_stat tstat;
@@ -108,17 +107,10 @@ osi_UFSTruncate(afile, asize)
     if (code || tstat.size <= asize) return code;
     MObtainWriteLock(&afs_xosi,321);    
     VATTR_NULL(&tvattr);
-    /* note that this credential swapping stuff is only necessary because
-       of ufs's references directly to cred instead of to
-       credentials parameter.  Probably should fix ufs some day. */
-    oldCred = curproc->p_cred->pc_ucred; /* remember old credentials pointer  */
-    curproc->p_cred->pc_ucred = &afs_osi_cred;
-    /* temporarily use superuser credentials */
     tvattr.va_size = asize;
     AFS_GUNLOCK();
-    VOP_SETATTR(afile->vnode, &tvattr, &afs_osi_cred, code);
+    code=VOP_SETATTR(afile->vnode, &tvattr, &afs_osi_cred, curproc);
     AFS_GLOCK();
-    curproc->p_cred->pc_ucred = oldCred;     /* restore */
     MReleaseWriteLock(&afs_xosi);
     return code;
 }
@@ -127,7 +119,7 @@ void osi_DisableAtimes(avp)
 struct vnode *avp;
 {
    struct inode *ip = VTOI(avp);
-   ip->i_flag &= ~IACC;
+   ip->i_flag &= ~IN_ACCESS;
 }
 
 
@@ -137,7 +129,6 @@ afs_osi_Read(afile, offset, aptr, asize)
     int offset;
     char *aptr;
     afs_int32 asize; {
-    struct AFS_UCRED *oldCred;
     unsigned int resid;
     register afs_int32 code;
     register afs_int32 cnt1=0;
@@ -178,7 +169,6 @@ afs_osi_Write(afile, offset, aptr, asize)
     char *aptr;
     afs_int32 offset;
     afs_int32 asize; {
-    struct AFS_UCRED *oldCred;
     unsigned int resid;
     register afs_int32 code;
     AFS_STATCNT(osi_Write);
@@ -186,13 +176,10 @@ afs_osi_Write(afile, offset, aptr, asize)
         osi_Panic("afs_osi_Write called with null param");
     if (offset != -1) afile->offset = offset;
     {
-        struct ucred *tmpcred = curproc->p_cred->pc_ucred;
-       curproc->p_cred->pc_ucred = &afs_osi_cred;
        AFS_GUNLOCK();
        code = gop_rdwr(UIO_WRITE, afile->vnode, (caddr_t) aptr, asize, afile->offset,
                   AFS_UIOSYS, IO_UNIT, &afs_osi_cred, &resid);
        AFS_GLOCK();
-       curproc->p_cred->pc_ucred = tmpcred;
     }
     if (code == 0) {
        code = asize - resid;
index dd912a2b8efd3967d0c61c077c7c7aa0cb6258d4..f49c0d27b5dc0a4d7dc893ad4ba6e2e554b22d31 100644 (file)
@@ -6,7 +6,6 @@
  * License.  For details, see the LICENSE file in the top-level source
  * directory or online at http://www.openafs.org/dl/license10.html
  */
-
 /*
  * osi_groups.c
  *
 #include <afsconfig.h>
 #include "../afs/param.h"
 
-RCSID("$Header: /tmp/cvstemp/openafs/src/afs/FBSD/osi_groups.c,v 1.1.1.3 2001/07/14 22:20:03 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/afs/FBSD/osi_groups.c,v 1.1.1.4 2002/09/26 18:58:08 hartmans Exp $");
 
 #include "../afs/sysincludes.h"
 #include "../afs/afsincludes.h"
 #include "../afs/afs_stats.h"  /* statistics */
 
-#define NOCRED  ((struct ucred *) -1)
-#define NOUID   ((uid_t) -1)
-#define NOGID   ((gid_t) -1)
-
-
 static int
 afs_getgroups(
     struct ucred *cred,
@@ -51,27 +45,33 @@ Afs_xsetgroups(p, args, retval)
 {
     int code = 0;
     struct vrequest treq;
+    struct ucred *cr;
+
+    cr=crdup(p->p_cred->pc_ucred);
 
     AFS_STATCNT(afs_xsetgroups);
     AFS_GLOCK();
-
-    /*    code = afs_InitReq(&treq, u.u_cred); */
-    code = afs_InitReq(&treq, curproc->p_cred->pc_ucred);
+    
+    code = afs_InitReq(&treq, cr);
     AFS_GUNLOCK();
-    if (code) return code;
+    crfree(cr);
+    if (code) return setgroups(p, args, retval); /* afs has shut down */
 
     code = setgroups(p, args, retval);
     /* Note that if there is a pag already in the new groups we don't
      * overwrite it with the old pag.
      */
-    if (PagInCred(curproc->p_cred->pc_ucred) == NOPAG) {
+    cr=crdup(p->p_cred->pc_ucred);
+
+    if (PagInCred(cr) == NOPAG) {
        if (((treq.uid >> 24) & 0xff) == 'A') {
            AFS_GLOCK();
            /* we've already done a setpag, so now we redo it */
-           AddPag(p, treq.uid, &p->p_rcred);
+           AddPag(p, treq.uid, &cr );
            AFS_GUNLOCK();
        }
     }
+    crfree(cr);
     return code;
 }
 
@@ -90,18 +90,18 @@ setpag(proc, cred, pagvalue, newpag, change_parent)
 
     AFS_STATCNT(setpag);
     ngroups = afs_getgroups(*cred, NGROUPS, gidset);
-    if (afs_get_pag_from_groups(gidset[0], gidset[1]) == NOPAG) {
+    if (afs_get_pag_from_groups(gidset[1], gidset[2]) == NOPAG) {
        /* We will have to shift grouplist to make room for pag */
        if (ngroups + 2 > NGROUPS) {
            return (E2BIG);
        }
-       for (j = ngroups -1; j >= 0; j--) {
-           gidset[j+2] = gidset[j];
-       }
+       for (j = ngroups -1; j >= 1; j--) {
+           gidset[j+2] = gidset[j];
+       }
        ngroups += 2;
     }
     *newpag = (pagvalue == -1 ? genpag(): pagvalue);
-    afs_get_groups_from_pag(*newpag, &gidset[0], &gidset[1]);
+    afs_get_groups_from_pag(*newpag, &gidset[1], &gidset[2]);
     code = afs_setgroups(proc, cred, ngroups, gidset, change_parent);
     return code;
 }
@@ -137,7 +137,7 @@ afs_setgroups(
     int ngrps;
     int i;
     gid_t *gp;
-    struct ucred *newcr, *cr;
+    struct ucred *oldcr, *cr;
 
     AFS_STATCNT(afs_setgroups);
     /*
@@ -147,18 +147,19 @@ afs_setgroups(
     if (ngroups > NGROUPS)
        return EINVAL;
     cr = *cred;
-    if (!change_parent) {
-       crhold(cr);
-       newcr = crcopy(cr);
-    } else
-       newcr = cr;
-    newcr->cr_ngroups = ngroups;
-    gp = newcr->cr_groups;
+    cr->cr_ngroups = ngroups;
+    gp = cr->cr_groups;
     while (ngroups--)
        *gp++ = *gidset++;
-    if (!change_parent) {
-       substitute_real_creds(proc, NOUID, NOUID, NOGID, NOGID, newcr);
+    if (change_parent) {
+       crhold(cr);
+       oldcr=proc->p_pptr->p_cred->pc_ucred;
+       proc->p_pptr->p_cred->pc_ucred=cr;
+       crfree(oldcr);
     }
-    *cred = newcr;
+    crhold(cr);
+    oldcr=proc->p_cred->pc_ucred;
+    proc->p_cred->pc_ucred=cr;
+    crfree(oldcr);
     return(0);
 }
index 6a213dfd2b6655bb6d82d25e68afdc6383b6ee1e..ef70494f664941ef98d5db78ab424f3ee3424361 100644 (file)
@@ -16,7 +16,7 @@
 #include <afsconfig.h>
 #include "../afs/param.h"
 
-RCSID("$Header: /tmp/cvstemp/openafs/src/afs/FBSD/osi_inode.c,v 1.1.1.3 2001/07/14 22:20:04 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/afs/FBSD/osi_inode.c,v 1.1.1.4 2002/09/26 18:58:08 hartmans Exp $");
 
 #include "../afs/sysincludes.h"        /* Standard vendor system headers */
 #include "../afs/afsincludes.h"        /* Afs-based standard headers */
@@ -34,19 +34,16 @@ getinode(fs, dev, inode, ipp, perror)
      ino_t inode;
      int *perror;
 {
-    register struct vnode *vp;
-    char fake_vnode[FAKE_INODE_SIZE];
-    struct inode *ip;
+    struct vnode *vp;
     int code;
 
     *ipp = 0;
     *perror = 0;
     if (!fs) {
        register struct ufsmount *ump;
-       register struct vnode *vp;
        register struct mount *mp;
        
-       MOUNTLIST_LOCK();
+        simple_lock(&mountlist_slock);
        if (mp = TAILQ_FIRST(&mountlist)) do {
            /*
             * XXX Also do the test for MFS 
@@ -54,29 +51,25 @@ getinode(fs, dev, inode, ipp, perror)
 #undef m_data
 #undef m_next
            if (mp->mnt_stat.f_type == MOUNT_UFS) {     
-               MOUNTLIST_UNLOCK();
                ump = VFSTOUFS(mp);
                if (ump->um_fs == NULL)
                    break;
                if (ump->um_dev == dev) {
                    fs = ump->um_mountp;
                }
-               MOUNTLIST_LOCK();
            }
            mp = TAILQ_NEXT(mp, mnt_list);
        } while (mp != TAILQ_FIRST(&mountlist));
-       MOUNTLIST_UNLOCK();
+        simple_unlock(&mountlist_slock);
        if (!fs)
            return(ENXIO);
     }
-    vp = (struct vnode *) fake_vnode;
-    fake_inode_init(vp, fs);
-    code = iget(VTOI(vp), inode, &ip, 0);
+    code = VFS_VGET(fs,inode, &vp);
     if (code != 0) {
        *perror = BAD_IGET;
         return code;
     } else {
-       *ipp = ip;
+       *ipp = VTOI(vp);
         return(0);
     }
 }
@@ -102,12 +95,12 @@ igetinode(vfsp, dev, inode, ipp, perror)
 
     if (ip->i_mode == 0) {
        /* Not an allocated inode */
-       iforget(ip);        
+       vput(ITOV(ip));     
        return(ENOENT);
     }
 
     if (ip->i_nlink == 0 || (ip->i_mode&IFMT) != IFREG) {
-       iput(ip);
+       vput(ITOV(ip));     
        return(ENOENT);
     }
 
@@ -115,23 +108,7 @@ igetinode(vfsp, dev, inode, ipp, perror)
     return(0);
 }
 
-iforget(ip)
-struct inode *ip;
-{
-    struct vnode *vp = ITOV(ip);
-
-    AFS_STATCNT(iforget);
-
-    VN_LOCK(vp);
-    /* this whole thing is too wierd.  Why??? XXX */
-    if (vp->v_usecount == 1) {
-       VN_UNLOCK(vp);
-       idrop(ip);
-    } else {
-       VN_UNLOCK(vp);
-    }
-}
-
+#if 0
 /*
  * icreate system call -- create an inode
  */
@@ -281,3 +258,23 @@ afs_syscall_iincdec(dev, inode, inode_p1, amount)
     iput(ip);
     return(0);
 }
+#else
+afs_syscall_icreate(dev, near_inode, param1, param2, param3, param4, retval)
+     long *retval;
+     long dev, near_inode, param1, param2, param3, param4;
+{
+     return EOPNOTSUPP;
+}
+afs_syscall_iopen(dev, inode, usrmod, retval)
+     long *retval;
+     int dev, inode, usrmod;
+{
+     return EOPNOTSUPP;
+}
+afs_syscall_iincdec(dev, inode, inode_p1, amount)
+     int dev, inode, inode_p1, amount;
+{
+     return EOPNOTSUPP;
+}
+#endif
+
index b0c044266da1b2ad4a094d24124112fd6855b956..b134ad6d19f675f1c247d474887ddf8304a8df64 100644 (file)
@@ -9,7 +9,7 @@
 
 /*
  *
- * DUX OSI header file. Extends afs_osi.h.
+ * FBSD OSI header file. Extends afs_osi.h.
  *
  * afs_osi.h includes this file, which is the only way this file should
  * be included in a source file. This file can redefine macros declared in
@@ -20,6 +20,7 @@
 #define _OSI_MACHDEP_H_
 
 #include <sys/lock.h>
+#include <sys/time.h>
 /* #include <kern/sched_prim.h> */
 /* #include <sys/unix_defs.h> */
 
@@ -29,8 +30,7 @@ extern struct simplelock afs_rxglobal_lock;
 /* 
  * Time related macros
  */
-extern struct timeval time;
-#define osi_Time() (time.tv_sec)
+#define osi_Time() time_second
 #define        afs_hz      hz
 
 #define PAGESIZE 8192
@@ -40,52 +40,43 @@ extern struct timeval time;
 
 #define afs_bufferpages bufpages
 
-#define osi_vnhold(avc,r)  do { \
-       if ((avc)->vrefCount) { VN_HOLD((struct vnode *)(avc)); } \
-       else osi_Panic("refcnt==0");  } while(0)
+#define osi_vnhold(avc,r) do { VN_HOLD((struct vnode *)(avc)); } while (0)
 
 #define        gop_rdwr(rw,gp,base,len,offset,segflg,unit,cred,aresid) \
   vn_rdwr((rw),(gp),(base),(len),(offset),(segflg),(unit),(cred),(aresid), curproc)
+#undef gop_lookupname
+#define gop_lookupname osi_lookupname
 
 #undef afs_suser
 
 #ifdef KERNEL
-extern struct simplelock afs_global_lock;
-#if 0
-extern thread_t afs_global_owner;
+extern struct proc * afs_global_owner;
+extern struct lock afs_global_lock;
 #define AFS_GLOCK() \
     do { \
-       usimple_lock(&afs_global_lock); \
-       osi_Assert(afs_global_owner == (thread_t)0); \
-       afs_global_owner = current_thread(); \
+        osi_Assert(curproc); \
+       lockmgr(&afs_global_lock, LK_EXCLUSIVE, 0, curproc); \
+        osi_Assert(afs_global_owner == 0); \
+       afs_global_owner = curproc; \
     } while (0)
 #define AFS_GUNLOCK() \
     do { \
-       osi_Assert(afs_global_owner == current_thread()); \
-        afs_global_owner = (thread_t)0; \
-       usimple_unlock(&afs_global_lock); \
+        osi_Assert(curproc); \
+       osi_Assert(afs_global_owner == curproc); \
+        afs_global_owner = 0; \
+        lockmgr(&afs_global_lock, LK_RELEASE, 0, curproc); \
     } while(0)
-#define ISAFS_GLOCK() (afs_global_owner == current_thread())
-#else
-#define AFS_GLOCK() \
-    do { \
-       simple_lock(&afs_global_lock); \
-    } while (0)
-#define AFS_GUNLOCK() \
-    do { \
-       simple_unlock(&afs_global_lock); \
-    } while(0)
-#endif /* 0 */
+#define ISAFS_GLOCK() (afs_global_owner == curproc && curproc)
 #define AFS_RXGLOCK()
 #define AFS_RXGUNLOCK()
 #define ISAFS_RXGLOCK() 1
 
 #undef SPLVAR
-#define SPLVAR
+#define SPLVAR int splvar
 #undef NETPRI
-#define NETPRI
+#define NETPRI splvar=splnet()
 #undef USERPRI
-#define USERPRI
+#define USERPRI splx(splvar)
 #endif /* KERNEL */
 
 #endif /* _OSI_MACHDEP_H_ */
index ad4d3aa93a397531b383ffd0164574412e7eb18a..1040984fe5006a7eccf5035e5004fb563c7ac797 100644 (file)
 #include <afsconfig.h>
 #include "../afs/param.h"
 
-RCSID("$Header: /tmp/cvstemp/openafs/src/afs/FBSD/osi_misc.c,v 1.1.1.3 2001/07/14 22:20:04 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/afs/FBSD/osi_misc.c,v 1.1.1.4 2002/09/26 18:58:09 hartmans Exp $");
 
 #include "../afs/sysincludes.h"        /* Standard vendor system headers */
 #include "../afs/afsincludes.h"        /* Afs-based standard headers */
-
+#include <sys/namei.h>
 /*
  * afs_suser() returns true if the caller is superuser, false otherwise.
  *
@@ -36,3 +36,29 @@ afs_suser() {
     }
     return(0);
 }
+
+int osi_lookupname(char *aname, enum uio_seg seg, int followlink,
+                          struct vnode **dirvpp, struct vnode **vpp)
+{
+   struct nameidata n;
+   int flags,error;
+   flags=0;
+   flags=LOCKLEAF;
+   if (followlink)
+     flags|=FOLLOW;
+   else 
+     flags|=NOFOLLOW;
+/*   if (dirvpp) flags|=WANTPARENT;*/ /* XXX LOCKPARENT? */
+   NDINIT(&n, LOOKUP, flags, seg, aname, curproc);
+   if (error=namei(&n))
+      return error;
+   *vpp=n.ni_vp;
+/*
+   if (dirvpp)
+      *dirvpp = n.ni_dvp;
+*/
+   /* should we do this? */
+   VOP_UNLOCK(n.ni_vp, 0, curproc);
+   NDFREE(&n, NDF_ONLY_PNBUF);
+   return 0;
+}
index 6512f54d5cb0cbaeb0962c3f0e9de6a3f48d020b..4728a201a6d561a4f7c4e26c2dd89896610a2215 100644 (file)
@@ -11,7 +11,7 @@
 #include <afsconfig.h>
 #include "../afs/param.h"
 
-RCSID("$Header: /tmp/cvstemp/openafs/src/afs/FBSD/osi_sleep.c,v 1.1.1.3 2001/07/14 22:20:03 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/afs/FBSD/osi_sleep.c,v 1.1.1.4 2002/09/26 18:58:09 hartmans Exp $");
 
 #include "../afs/sysincludes.h"        /* Standard vendor system headers */
 #include "../afs/afsincludes.h"        /* Afs-based standard headers */
@@ -134,14 +134,19 @@ void afs_osi_Sleep(char *event)
     seq = evp->seq;
     while (seq == evp->seq) {
        AFS_ASSERT_GLOCK();
-       assert_wait((vm_offset_t)(&evp->cond), 0);
        AFS_GUNLOCK();
-       thread_block();
+        tsleep(event, PVFS, "afs_osi_Sleep", 0);
        AFS_GLOCK();
     }
     relevent(evp);
 }
 
+int afs_osi_SleepSig(char *event)
+{
+    afs_osi_Sleep(event);
+    return 0;
+}
+
 /* osi_TimedSleep
  * 
  * Arguments:
@@ -156,20 +161,22 @@ static int osi_TimedSleep(char *event, afs_int32 ams, int aintok)
     int code = 0;
     struct afs_event *evp;
     int ticks;
-
+    int seq,prio;
     ticks = ( ams * afs_hz )/1000;
 
 
     evp = afs_getevent(event);
-
-    assert_wait((vm_offset_t)(&evp->cond), aintok);
+    seq=evp->seq;
     AFS_GUNLOCK();
-    thread_set_timeout(ticks);
-    thread_block();
+    if (aintok)
+       prio=PCATCH|PPAUSE;
+    else
+       prio=PVFS;
+    code=tsleep(event, prio, "afs_osi_TimedSleep", ticks);
     AFS_GLOCK();
-    /*    if (current_thread()->wait_result != THREAD_AWAKENED)
-         code = EINTR; */
-    
+    if (seq == evp->seq)
+       code=EINTR;
     relevent(evp);
     return code;
 }
@@ -182,7 +189,7 @@ void afs_osi_Wakeup(char *event)
     evp = afs_getevent(event);
     if (evp->refcount > 1) {
        evp->seq++;    
-       thread_wakeup((vm_offset_t)(&evp->cond));
+       wakeup(event);
     }
     relevent(evp);
 }
index 09563a03b66a2881f88f96e861a7ecc37dbf9ae7..1617010fdb8ae1d05d888a12238e83c58619fa51 100644 (file)
@@ -1,52 +1,69 @@
-/*
- * Copyright 2000, International Business Machines Corporation and others.
- * All Rights Reserved.
- * 
- * This software has been released under the terms of the IBM Public
- * License.  For details, see the LICENSE file in the top-level source
- * directory or online at http://www.openafs.org/dl/license10.html
- */
-
-/*
- * osi_vfsops.c for DUX
- */
 #include <afsconfig.h>
-#include "../afs/param.h"
+#include <afs/param.h>
 
-RCSID("$Header: /tmp/cvstemp/openafs/src/afs/FBSD/osi_vfsops.c,v 1.1.1.5 2002/05/10 23:43:46 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/afs/FBSD/osi_vfsops.c,v 1.1.1.6 2002/09/26 18:58:09 hartmans Exp $");
 
-#include "../afs/sysincludes.h"        /* Standard vendor system headers */
-#include "../afs/afsincludes.h"        /* Afs-based standard headers */
-#include "../afs/afs_stats.h"   /* statistics stuff */
-#include <sys/types.h>
-#include <kern/mach_param.h>
-#include <sys/sysconfig.h>
-#include <sys/systm.h>
-#include <sys/resource.h>
-#include <sys/errno.h>
+#include <afs/sysincludes.h>            /* Standard vendor system headers */
+#include <afs/afsincludes.h>            /* Afs-based standard headers */
+#include <afs/afs_stats.h>              /* statistics */
+#include <sys/malloc.h>
+#include <sys/namei.h>
 #include <sys/conf.h>
-#include <machine/machlimits.h>
-
+#include <sys/syscall.h>
 
 struct vcache *afs_globalVp = 0;
 struct mount *afs_globalVFS = 0;
+int afs_pbuf_freecnt=-1;
+int
+afs_quotactl()
+{
+       return EOPNOTSUPP;
+}
 
-static u_char afs_mntid;
-int afs_vfsdev = 0;
-udecl_simple_lock_data(, afsmntid_lock)
-#define AFSMNTID_LOCK()         usimple_lock(&afsmntid_lock)
-#define AFSMNTID_UNLOCK()       usimple_unlock(&afsmntid_lock)
-#define AFSMNTID_LOCK_INIT()    usimple_lock_init(&afsmntid_lock)
+int
+afs_fhtovp(mp, fhp, vpp)
+struct mount *mp;
+struct fid *fhp;
+struct vnode **vpp;
+{
 
+       return (EINVAL);
+}
 
-int mp_afs_mount(struct mount *afsp,char * path, caddr_t data,
-                struct nameidata *ndp)
+int
+afs_vptofh(vp, fhp)
+struct vnode *vp;
+struct fid *fhp;
 {
-    u_int size;
 
-    fsid_t tfsid;
-    struct mount *xmp, *getvfs();
-    int code;
+       return (EINVAL);
+}
+
+int
+afs_start(mp, flags, p)
+struct mount *mp;
+int flags;
+struct proc *p;
+{
+    afs_pbuf_freecnt = nswbuf / 2 + 1;
+    return (0);                         /* nothing to do. ? */
+}
+
+int
+afs_mount(mp, path, data, ndp, p)
+register struct mount *mp;
+char *path;
+caddr_t data;
+struct nameidata *ndp;
+struct proc *p;
+{
+    /* ndp contains the mounted-from device.  Just ignore it.
+       we also don't care about our proc struct. */
+    size_t size;
+    int error;
+
+    if (mp->mnt_flag & MNT_UPDATE)
+       return EINVAL;
 
     AFS_GLOCK();
     AFS_STATCNT(afs_mount);
@@ -56,130 +73,111 @@ int mp_afs_mount(struct mount *afsp,char * path, caddr_t data,
        return (EBUSY);
     }
 
-    afs_globalVFS = afsp;
-    afsp->vfs_bsize = 8192;
-/*
- * Generate a unique afs mount i.d. ( see nfs_mount() ).
- */
-    afsp->m_stat.f_fsid.val[0] = makedev(130, 0);
-    afsp->m_stat.f_fsid.val[1] = MOUNT_AFS;
-    AFSMNTID_LOCK();
-    if (++afs_mntid == 0)
-        ++afs_mntid;
-    AFSMNTID_UNLOCK();
-    BM(AFSMNTID_LOCK());
-    tfsid.val[0] = makedev(130, afs_mntid);
-    tfsid.val[1] = MOUNT_AFS;
-    BM(AFSMNTID_UNLOCK());
-
-    while (xmp = getvfs(&tfsid)) {
-        UNMOUNT_READ_UNLOCK(xmp);
-        tfsid.val[0]++;
-        AFSMNTID_LOCK();
-        afs_mntid++;
-        AFSMNTID_UNLOCK();
-    }
-    if (major(tfsid.val[0]) != 130) {
-       AFS_GUNLOCK();
-        return (ENOENT);
-    }
-    afsp->m_stat.f_fsid.val[0] = tfsid.val[0];
-
-    afsp->m_stat.f_mntonname = AFS_KALLOC(MNAMELEN);
-    afsp->m_stat.f_mntfromname = AFS_KALLOC(MNAMELEN); 
-    if ( !afsp->m_stat.f_mntonname || !afsp->m_stat.f_mntfromname)
-       panic("malloc failure in afs_mount\n");
-
-    memset(afsp->m_stat.f_mntonname, 0, MNAMELEN);
-    memset(afsp->m_stat.f_mntfromname, 0, MNAMELEN);
-    AFS_COPYINSTR(path, (caddr_t)afsp->m_stat.f_mntonname, MNAMELEN, &size, code);
-    memcpy(afsp->m_stat.f_mntfromname, "AFS", 4);
-    AFS_GUNLOCK();
-    (void) mp_afs_statfs(afsp);
-    AFS_GLOCK();
-    afs_vfsdev = afsp->m_stat.f_fsid.val[0];
-
-#ifndef        AFS_NONFSTRANS
-    /* Set up the xlator in case it wasn't done elsewhere */
-    afs_xlatorinit_v2();
-    afs_xlatorinit_v3();
-#endif
+    afs_globalVFS = mp;
+    mp->vfs_bsize = 8192;
+    vfs_getnewfsid(mp);
+    mp->mnt_stat.f_iosize=8192;
+    
+    (void) copyinstr(path, mp->mnt_stat.f_mntonname, MNAMELEN-1, &size);
+    memset(mp->mnt_stat.f_mntonname + size, 0, MNAMELEN - size);
+    memset(mp->mnt_stat.f_mntfromname, 0, MNAMELEN);
+    strcpy(mp->mnt_stat.f_mntfromname, "AFS");
+    /* null terminated string "AFS" will fit, just leave it be. */
+    strcpy(mp->mnt_stat.f_fstypename, "afs");
     AFS_GUNLOCK();
+    (void) afs_statfs(mp, &mp->mnt_stat, p);
     return 0;
 }
 
-
-int mp_afs_unmount (struct mount *afsp, int flag)
+int
+afs_unmount(mp, flags, p)
+struct mount *mp;
+int flags;
+struct proc *p;
 {
+    
     AFS_GLOCK();
     AFS_STATCNT(afs_unmount);
     afs_globalVFS = 0;
     afs_shutdown();
     AFS_GUNLOCK();
-    return 0;
-}
 
-
-int mp_afs_start(struct mount *mp, int flags)
-{
-    return(0);
+    return 0;
 }
 
-int mp_afs_root (struct mount *afsp, struct vnode **avpp)
+int
+afs_root(struct mount *mp,
+             struct vnode **vpp)
 {
-    register afs_int32 code = 0;
+    int error;
     struct vrequest treq;
     register struct vcache *tvp=0;
+    struct proc *p=curproc;
+    struct ucred cr;
 
+    cr=*p->p_cred->pc_ucred;
     AFS_GLOCK();
     AFS_STATCNT(afs_root);
     if (afs_globalVp && (afs_globalVp->states & CStatd)) {
        tvp = afs_globalVp;
+        error=0;
     } else {
-       if (!(code = afs_InitReq(&treq, cred)) &&
-           !(code = afs_CheckInit())) {
+       
+       if (!(error = afs_InitReq(&treq, &cr)) &&
+           !(error = afs_CheckInit())) {
            tvp = afs_GetVCache(&afs_rootFid, &treq, (afs_int32 *)0,
-                               (struct vcache*)0, WRITE_LOCK);
+                               (struct vcache*)0, WRITE_LOCK);
            /* we really want this to stay around */
            if (tvp) {
-               afs_globalVp = tvp;
+               afs_globalVp = tvp;
            } else
-               code = ENOENT;
+               error = ENOENT;
        }
     }
     if (tvp) {
-       AFS_GUNLOCK();
-       VN_HOLD((struct vnode *)tvp);
-       VN_LOCK(AFSTOV(tvp));
-       tvp->v.v_flag |= VROOT;     /* No-op on Ultrix 2.2 */
-       VN_UNLOCK((struct vnode *)tvp);
-       AFS_GLOCK();
-
-       afs_globalVFS = afsp;
-       *avpp = AFSTOV(tvp);
+        osi_vnhold(tvp,0);
+    AFS_GUNLOCK();
+        vn_lock(AFSTOV(tvp), LK_EXCLUSIVE | LK_RETRY, p);
+    AFS_GLOCK();
+       afs_globalVFS = mp;
+       *vpp = AFSTOV(tvp);
+        tvp->v.v_flag |= VROOT;
     }
 
-    afs_Trace2(afs_iclSetp, CM_TRACE_VFSROOT, ICL_TYPE_POINTER, *avpp,
-              ICL_TYPE_INT32, code);
+    afs_Trace2(afs_iclSetp, CM_TRACE_VFSROOT, ICL_TYPE_POINTER, *vpp,
+              ICL_TYPE_INT32, error);
     AFS_GUNLOCK();
-    return code;
+    return error;
 }
 
-
-mp_afs_quotactl(struct mount *mp, int cmd, uid_t uid, caddr_t arg)
+int
+afs_vget(mp, lfl, vp)
+struct mount *mp;
+struct vnode *vp;
+int lfl;
 {
-    return EOPNOTSUPP;
+    int error;
+    printf("vget called. help!\n");
+    if (vp->v_usecount < 0) {
+       vprint("bad usecount", vp);
+       panic("afs_vget");
+    }
+    error = vget(vp, lfl, curproc);
+    if (!error)
+       insmntque(vp, afs_globalVFS);   /* take off free list */
+    return error;
 }
 
-int mp_afs_statfs(struct mount *afsp)
+int afs_statfs(struct mount *mp, struct statfs *abp, struct proc *p)
 {
-    struct nstatfs *abp = &afsp->m_stat;
-
     AFS_GLOCK();
     AFS_STATCNT(afs_statfs);
 
+#if 0
     abp->f_type = MOUNT_AFS;
-    abp->f_bsize = afsp->vfs_bsize;
+#endif
+    abp->f_bsize = mp->vfs_bsize;
+    abp->f_iosize = mp->vfs_bsize;
 
     /* Fake a high number below to satisfy programs that use the statfs call
      * to make sure that there's enough space in the device partition before
@@ -187,299 +185,48 @@ int mp_afs_statfs(struct mount *afsp)
      */
     abp->f_blocks = abp->f_bfree = abp->f_bavail = abp->f_files =
        abp->f_ffree  = 2000000;
-    abp->f_fsize = 1024;
-
-    abp->f_fsid.val[0] = afsp->m_stat.f_fsid.val[0];
-    abp->f_fsid.val[1] = afsp->m_stat.f_fsid.val[1];
-
-    AFS_GUNLOCK();
-    return 0;
-}
-
-
-int mp_afs_sync(struct mount *mp, int flags)
-{
-    AFS_STATCNT(afs_sync);
-    return 0;
-}
-
-
-int mp_afs_fhtovp(struct mount *afsp, struct fid *fidp, struct vnode **avcp)
-{
-    struct vrequest treq;
-    register code = 0;
-
-    AFS_GLOCK();
-    AFS_STATCNT(afs_vget);
-
-    *avcp = NULL;
 
-    if ((code = afs_InitReq(&treq, cred)) == 0) {
-       code = afs_osi_vget((struct vcache**)avcp, fidp, &treq);
+    abp->f_fsid.val[0] = mp->mnt_stat.f_fsid.val[0];
+    abp->f_fsid.val[1] = mp->mnt_stat.f_fsid.val[1];
+    if (abp != &mp->mnt_stat) {
+       abp->f_type = mp->mnt_vfc->vfc_typenum;
+       memcpy((caddr_t)&abp->f_mntonname[0], (caddr_t)mp->mnt_stat.f_mntonname, MNAMELEN);
+       memcpy((caddr_t)&abp->f_mntfromname[0], (caddr_t)mp->mnt_stat.f_mntfromname, MNAMELEN);
     }
 
-    afs_Trace3(afs_iclSetp, CM_TRACE_VGET, ICL_TYPE_POINTER, *avcp,
-              ICL_TYPE_INT32, treq.uid, ICL_TYPE_FID, fidp);
-
-    code = afs_CheckCode(code, &treq, 42);
-    AFS_GUNLOCK();
-    return code;
-}
-
-
-/*
- *  afs_vptofh
- * 
- * afs_vptofh can return two flavors of NFS fid, depending on if submounts are
- * allowed. The reason for this is that we can't guarantee that we found all 
- * the entry points any OS might use to get the fid for the NFS mountd.
- * Hence we return a "magic" fid for all but /afs. If it goes through the
- * translator code, it will get transformed into a SmallFid that we recognize.
- * So, if submounts are disallowed, and an NFS client tries a submount, it will
- * get a fid which we don't recognize and the mount will either fail or we
- * will ignore subsequent requests for that mount.
- *
- * The Alpha fid is organized differently than for other platforms. Their
- * intention was to have the data portion of the fid aligned on a 4 byte
- * boundary. To do so, the fid is organized as:
- * u_short reserved
- * u_short len
- * char data[8]
- * The len field is the length of the entire fid, from reserved through data.
- * This length is used by fid_copy to include copying the reserved field. 
- * Alpha's zero the reserved field before handing us the fid, but they use
- * it in fid_cmp. We use the reserved field to store the 16 bits of the Vnode.
- *
- * Note that the SmallFid only allows for 8 bits of the cell index and
- * 16 bits of the vnode. 
- */
-
-#define AFS_FIDDATASIZE 8
-#define AFS_SIZEOFSMALLFID 12 /* full size of fid, including len field */
-extern int afs_NFSRootOnly; /* 1 => only allow NFS mounts of /afs. */
-int afs_fid_vnodeoverflow=0, afs_fid_uniqueoverflow=0;
-
-int mp_afs_vptofh(struct vnode *avn, struct fid *fidp)
-{
-    struct SmallFid Sfid;
-    long addr[2];
-    register struct cell *tcell;
-    int rootvp = 0;
-    struct vcache *avc = (struct vcache *)avn;
-
-    AFS_GLOCK();
-    AFS_STATCNT(afs_fid);
-
-    if (afs_shuttingdown) {
-       AFS_GUNLOCK();
-       return EIO;
-    }
-
-    if (afs_NFSRootOnly && (avc == afs_globalVp)) rootvp = 1;
-    if (!afs_NFSRootOnly || rootvp) {
-       tcell = afs_GetCell(avc->fid.Cell, READ_LOCK);
-       Sfid.Volume = avc->fid.Fid.Volume;
-       fidp->fid_reserved = avc->fid.Fid.Vnode;
-       Sfid.CellAndUnique = ((tcell->cellIndex << 24) +
-                             (avc->fid.Fid.Unique & 0xffffff));
-       afs_PutCell(tcell, READ_LOCK);
-       if (avc->fid.Fid.Vnode > 0xffff)
-           afs_fid_vnodeoverflow++;
-       if (avc->fid.Fid.Unique > 0xffffff)
-           afs_fid_uniqueoverflow++;
-    } else {
-       fidp->fid_reserved = AFS_XLATOR_MAGIC;
-       addr[0] = (long)avc;
-       AFS_GUNLOCK();
-       VN_HOLD((struct vnode *)avc);
-       AFS_GLOCK();
-    }
-
-    /* Use the fid pointer passed to us. */
-    fidp->fid_len = AFS_SIZEOFSMALLFID;
-    if (afs_NFSRootOnly) {
-       if (rootvp) {
-           memcpy(fidp->fid_data, (caddr_t)&Sfid, AFS_FIDDATASIZE);   
-       } else {
-           memcpy(fidp->fid_data, (caddr_t)addr, AFS_FIDDATASIZE);   
-       }
-    } else {
-       memcpy(fidp->fid_data, (caddr_t)&Sfid, AFS_FIDDATASIZE);   
-    }
     AFS_GUNLOCK();
     return 0;
 }
 
-
-int mp_Afs_init(void); /* vfs_init - defined below */
-
-
-/* This is only called by vfs_mount when afs is going to be mounted as root.
- * Since we don't support diskless clients we shouldn't come here.
- */
-int afsmountroot=0;
-int mp_afs_mountroot(struct mount *afsp, struct vnode **vp)
+int afs_sync(mp, waitfor, cred, p) 
+struct mount *mp;
+int waitfor;
+struct ucred *cred;
+struct prioc *p;
 {
-    AFS_GLOCK();
-    AFS_STATCNT(afs_mountroot);
-    afsmountroot++;
-    AFS_GUNLOCK();
-    return EINVAL;
+return 0;
 }
 
-
-/* It's called to setup swapping over the net for diskless clients; again
- * not for us.
- */
-int afsswapvp=0;
-int mp_afs_swapvp(void)
-{
-    AFS_GLOCK();
-    AFS_STATCNT(afs_swapvp);
-    afsswapvp++;
-    AFS_GUNLOCK();
-    return EINVAL;
+int afs_sysctl() {
+   return EOPNOTSUPP;
 }
 
 
-struct vfsops afs_vfsops = {
-    mp_afs_mount,
-    mp_afs_start,
-    mp_afs_unmount,
-    mp_afs_root,
-    mp_afs_quotactl,
-    mp_afs_statfs,
-    mp_afs_sync,
-    mp_afs_fhtovp,     /* afs_vget */
-    mp_afs_vptofh,
-    mp_Afs_init,
-    mp_afs_mountroot,
-    mp_afs_swapvp
-};
-
-
-/*
- * System Call Entry Points
- */
-#define NULL_FUNC          (int (*)(int))0
-
-int     (*afs_syscall_func)() = NULL_FUNC;
-int     (*afs_xsetgroups_func)() = NULL_FUNC;
-int     (*afs_xioctl_func)() = NULL_FUNC;
-
-afssyscall(p, args, retval)
-    struct proc *p;
-    void *args;
-    long *retval;
-{
-    int     (*func)();
-    int code;
-
-    AFS_GLOCK();
-    func = afs_syscall_func;
-    if (func == NULL_FUNC) {
-       code = nosys(p, args, retval);
-    } else {
-       code = (*func)(p, args, retval);
-    }
-    AFS_GUNLOCK();
-    return code;
+int afs_init(struct vfsconf *vfc) {
+   return 0;
 }
 
-afsxsetgroups(p, args, retval)
-    struct proc *p;
-    void *args;
-    long *retval;
-{
-    int     (*func)();
-    int code;
-
-    AFS_GLOCK();
-    func = afs_xsetgroups_func;
-    if (func == NULL_FUNC) {
-       code = nosys(p, args, retval);
-    } else {
-       code = (*func)(p, args, retval);
-    }
-    AFS_GUNLOCK();
-    return code;
-}
-
-afsxioctl(p, args, retval)
-    struct proc *p;
-    void *args;
-    long *retval;
-{
-    int     (*func)();
-    int code;
-
-    AFS_GLOCK();
-    func = afs_xioctl_func;
-    if (func == NULL_FUNC) {
-       code = nosys(p, args, retval);
-    } else {
-       code = (*func)(p, args, retval);
-    }
-    AFS_GUNLOCK();
-    return code;
-}
-
-
-/*
- * VFS initialization and unload
- */
-
-afs_unconfig()
-{
-    return EBUSY;
-}
-
-
-cfg_subsys_attr_t afs_attributes[]  = {
-    {"", 0, 0, 0, 0, 0, 0}     /* must be the last element */
+struct vfsops afs_vfsops = {
+  afs_mount,
+  afs_start,
+  afs_unmount,
+  afs_root,
+  afs_quotactl,
+  afs_statfs,
+  afs_sync,
+  afs_vget,
+  afs_fhtovp,
+  afs_vptofh,
+  afs_init,
+  afs_sysctl
 };
-
-afs_configure(cfg_op_t op, caddr_t indata, size_t indata_size, caddr_t outdata, size_t outdata_size)
-{
-    cfg_attr_t *attributes;
-    int        ret = ESUCCESS;
-    int        i, j, size;
-    caddr_t p;
-
-    switch (op) {
-    case CFG_OP_CONFIGURE:
-       /*
-        * The indata parameter is a list of attributes to be configured, and 
-        * indata_size is the count of attributes.
-        */
-       if ((ret = vfssw_add_fsname(MOUNT_AFS, &afs_vfsops, "afs")) != 0)
-           return(ret);
-       break;
-    case CFG_OP_UNCONFIGURE:
-       if ((ret = afs_unconfig()) != 0)
-           return(ret);
-       break;
-    default:
-       ret = EINVAL;
-       break;
-    }
-    return ret;
-}
-
-
-int mp_Afs_init(void)
-{
-    extern int Afs_xsetgroups(), afs_xioctl(), afs3_syscall();
-    
-    AFS_GLOCK();
-    sysent[AFS_SYSCALL].sy_call = afs3_syscall;
-    sysent[AFS_SYSCALL].sy_parallel = 0;
-    sysent[AFS_SYSCALL].sy_narg = 6;
-    sysent[SYS_setgroups].sy_call = Afs_xsetgroups;
-    afs_xioctl_func = afsxioctl;    
-    afs_xsetgroups_func = afsxsetgroups;
-    afs_syscall_func = afssyscall;
-    AFS_GUNLOCK();
-
-    return 0;
-}
index 76402da1ca97bbddfaa256209d84434aa7a1cc48..7dddab8adafde6ba07ea095ec35cce0d0770626e 100644 (file)
 #include <afsconfig.h>
 #include "../afs/param.h"
 
-RCSID("$Header: /tmp/cvstemp/openafs/src/afs/FBSD/osi_vm.c,v 1.1.1.4 2002/05/10 23:43:47 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/afs/FBSD/osi_vm.c,v 1.1.1.5 2002/09/26 18:58:09 hartmans Exp $");
 
 #include "../afs/sysincludes.h"        /* Standard vendor system headers */
 #include "../afs/afsincludes.h"        /* Afs-based standard headers */
 #include "../afs/afs_stats.h"  /* statistics */
-/* #include <vm/vm_ubc.h> */
+#include <vm/vm_object.h>
+#include <vm/vm_map.h>
 #include <limits.h>
 #include <float.h>
 
@@ -51,8 +52,9 @@ osi_VM_FlushVCache(avc, slept)
     struct vcache *avc;
     int *slept;
 {
-#ifdef SECRETLY_OSF1
-    if (avc->vrefCount > 1)
+    struct vm_object *obj;
+    struct vnode *vp;
+    if (VREFCOUNT(avc) > 1)
        return EBUSY;
 
     if (avc->opens)
@@ -63,80 +65,25 @@ osi_VM_FlushVCache(avc, slept)
        return EBUSY;
 
     AFS_GUNLOCK();
-    ubc_invalidate(((struct vnode *)avc)->v_object, 0, 0, B_INVAL);
+    vp=avc;
+    simple_lock(&vp->v_interlock);
+    if (VOP_GETVOBJECT(vp, &obj) == 0) {
+       vm_object_page_remove(obj, 0, 0, FALSE);
+#if 0
+        if (obj->ref_count == 0) {
+           vgonel(vp,curproc);
+           simple_lock(&vp->v_interlock);
+           vp->v_tag=VT_AFS;
+           SetAfsVnode(vp);
+        }
+#endif
+    } 
+    simple_unlock(&vp->v_interlock);
     AFS_GLOCK();
-#endif /* SECRETLY_OSF1 */
 
     return 0;
 }
 
-/*
- * osi_ubc_flush_dirty_and_wait -- ensure all dirty pages cleaned
- *
- * Alpha OSF/1 doesn't make it easy to wait for all dirty pages to be cleaned.
- * NFS tries to do this by calling waitforio(), which waits for v_numoutput
- * to go to zero.  But that isn't good enough, because afs_putpage() doesn't
- * increment v_numoutput until it has obtained the vcache entry lock.  Suppose
- * that Process A, trying to flush a page, is waiting for that lock, and
- * Process B tries to close the file.  Process B calls waitforio() which thinks
- * that everything is cool because v_numoutput is still zero.  Process B then
- * proceeds to call afs_StoreAllSegments().  Finally when B is finished, A gets
- * to proceed and flush its page.  But then it's too late because the file is
- * already closed.
- *
- * (I suspect that waitforio() is not adequate for NFS, just as it isn't
- * adequate for us.  But that's not my problem.)
- *
- * The only way we can be sure that there are no more dirty pages is if there
- * are no more pages with pg_busy set.  We look for them on the cleanpl.
- *
- * For some reason, ubc_flush_dirty() only looks at the dirtypl, not the
- * dirtywpl.  I don't know why this is good enough, but I assume it is.  By
- * the same token, I only look for busy pages on the cleanpl, not the cleanwpl.
- *
- * Called with the global lock NOT held.
- */
-void
-osi_ubc_flush_dirty_and_wait(vp, flags)
-struct vnode *vp;
-int flags; {
-    int retry;
-    vm_page_t pp;
-    int first;
-
-#ifdef SECRETLY_OSF1
-    do {
-       struct vm_ubc_object* vop;
-       vop = (struct vm_ubc_object*)(vp->v_object);
-       ubc_flush_dirty(vop, flags); 
-
-       vm_object_lock(vop);
-       if (vop->vu_dirtypl)
-           /* shouldn't happen, but who knows */
-           retry = 1;
-       else {
-           retry = 0;
-           if (vop->vu_cleanpl) {
-               for (first = 1, pp = vop->vu_cleanpl;
-                    first || pp != vop->vu_cleanpl;
-                    first = 0, pp = pp->pg_onext) {
-                   if (pp->pg_busy) {
-                       retry = 1;
-                       pp->pg_wait = 1;
-                       assert_wait_mesg((vm_offset_t)pp, FALSE, "pg_wait");
-                       vm_object_unlock(vop);
-                       thread_block();
-                       break;
-                   }
-               }
-           }
-           if (retry) continue;
-       }
-       vm_object_unlock(vop);
-    } while (retry);
-#endif /* SECRETLY_OSF1 */
-}
-
 /* Try to store pages to cache, in order to store a file back to the server.
  *
  * Locking:  the vcache entry's lock is held.  It will usually be dropped and
@@ -146,13 +93,32 @@ void
 osi_VM_StoreAllSegments(avc)
     struct vcache *avc;
 {
-#ifdef SECRETLY_OSF1
+    struct vnode *vp;
+    struct vm_object *obj;
+    int anyio,tries;
     ReleaseWriteLock(&avc->lock);
     AFS_GUNLOCK();
-    osi_ubc_flush_dirty_and_wait((struct vnode *)avc, 0);
+    tries=5;
+    vp=avc;
+    do {
+    anyio=0;
+    simple_lock(&vp->v_interlock);
+    if (VOP_GETVOBJECT(vp, &obj) == 0 &&
+       (obj->flags & OBJ_MIGHTBEDIRTY)) {
+        if (!vget(vp,
+            LK_INTERLOCK | LK_EXCLUSIVE | LK_RETRY | LK_NOOBJ, curproc)) {
+            if (VOP_GETVOBJECT(vp, &obj) == 0) {
+               vm_object_page_clean(obj, 0, 0, OBJPC_SYNC);
+               anyio = 1;
+            }
+            vput(vp);
+        }
+    } else {
+        simple_unlock(&vp->v_interlock);
+    }
+    } while (anyio && (--tries > 0));
     AFS_GLOCK();
     ObtainWriteLock(&avc->lock,94);
-#endif /* SECRETLY_OSF1 */
 }
 
 /* Try to invalidate pages, for "fs flush" or "fs flushv"; or
@@ -170,14 +136,38 @@ osi_VM_TryToSmush(avc, acred, sync)
     struct AFS_UCRED *acred;
     int sync;
 {
-#ifdef SECRETLY_OSF1
+    struct vnode *vp;
+    struct vm_object *obj;
+    int anyio, tries;
     ReleaseWriteLock(&avc->lock);
     AFS_GUNLOCK();
-    osi_ubc_flush_dirty_and_wait(AFSTOV(avc), 0);
-    ubc_invalidate((AFSTOV(avc))->v_object, 0, 0, B_INVAL);
+    tries=5;
+    vp=avc;
+    do {
+       anyio=0;
+       simple_lock(&vp->v_interlock);
+       if (VOP_GETVOBJECT(vp, &obj) == 0 &&
+          (obj->flags & OBJ_MIGHTBEDIRTY)) {
+           if (!vget(vp,
+               LK_INTERLOCK | LK_EXCLUSIVE | LK_RETRY | LK_NOOBJ, curproc)) {
+               if (VOP_GETVOBJECT(vp, &obj) == 0) {
+                  vm_object_page_clean(obj, 0, 0, OBJPC_SYNC);
+                  anyio = 1;
+               }
+               vput(vp);
+           }
+       } else {
+           simple_unlock(&vp->v_interlock);
+       }
+    } while (anyio && (--tries > 0));
+    simple_lock(&vp->v_interlock);
+    if (VOP_GETVOBJECT(vp, &obj) == 0) {
+       vm_object_page_remove(obj, 0, 0, FALSE);
+    }
+    simple_unlock(&vp->v_interlock);
+    /*vinvalbuf(AFSTOV(avc),0, NOCRED, curproc, 0,0);*/
     AFS_GLOCK();
     ObtainWriteLock(&avc->lock,59);
-#endif /* SECRETLY_OSF1 */
 }
 
 /* Purge VM for a file when its callback is revoked.
@@ -189,10 +179,15 @@ osi_VM_FlushPages(avc, credp)
     struct vcache *avc;
     struct AFS_UCRED *credp;
 {
-#ifdef SECRETLY_OSF1
-    ubc_flush_dirty((AFSTOV(avc))->v_object, 0);
-    ubc_invalidate((AFSTOV(avc))->v_object, 0, 0, B_INVAL);
-#endif /* SECRETLY_OSF1 */
+    struct vnode *vp;
+    struct vm_object *obj;
+    vp=avc;
+    simple_lock(&vp->v_interlock);
+    if (VOP_GETVOBJECT(vp, &obj) == 0) {
+       vm_object_page_remove(obj, 0, 0, FALSE);
+    }
+    simple_unlock(&vp->v_interlock);
+    /*vinvalbuf(AFSTOV(avc),0, NOCRED, curproc, 0,0);*/
 }
 
 /* Purge pages beyond end-of-file, when truncating a file.
@@ -207,8 +202,5 @@ osi_VM_Truncate(avc, alen, acred)
     int alen;
     struct AFS_UCRED *acred;
 {
-#ifdef SECRETLY_OSF1
-    ubc_invalidate((AFSTOV(avc))->v_object, alen,
-                        MAXINT - alen, B_INVAL);
-#endif /* SECRETLY_OSF1 */
+    vnode_pager_setsize(AFSTOV(avc), alen);
 }
index 7fc2498b36a84236664b94002b7bc6d529435d97..574d0a4930a0148fc6cfa9ff4217f52eae67b499 100644 (file)
-/*
- * Copyright 2000, International Business Machines Corporation and others.
- * All Rights Reserved.
- * 
- * This software has been released under the terms of the IBM Public
- * License.  For details, see the LICENSE file in the top-level source
- * directory or online at http://www.openafs.org/dl/license10.html
- */
-
-/*
- * vnodeops structure and Digital Unix specific ops and support routines.
- */
-
 #include <afsconfig.h>
-#include "../afs/param.h"
-
-RCSID("$Header: /tmp/cvstemp/openafs/src/afs/FBSD/osi_vnodeops.c,v 1.1.1.3 2001/07/14 22:20:04 hartmans Exp $");
+#include <afs/param.h>
+
+RCSID("$Header: /tmp/cvstemp/openafs/src/afs/FBSD/osi_vnodeops.c,v 1.1.1.4 2002/09/26 18:58:10 hartmans Exp $");
+
+#include <afs/sysincludes.h>            /* Standard vendor system headers */
+#include <afs/afsincludes.h>            /* Afs-based standard headers */
+#include <afs/afs_stats.h>              /* statistics */
+#include <sys/malloc.h>
+#include <sys/namei.h>
+#include <vm/vm_zone.h>
+#include <vm/vm_page.h>
+#include <vm/vm_object.h>
+#include <vm/vm_pager.h>
+#include <vm/vnode_pager.h>
+extern int afs_pbuf_freecnt;
+
+int afs_vop_lookup(struct vop_lookup_args *);
+int afs_vop_create(struct vop_create_args *);
+int afs_vop_mknod(struct vop_mknod_args *);
+int afs_vop_open(struct vop_open_args *);
+int afs_vop_close(struct vop_close_args *);
+int afs_vop_access(struct vop_access_args *);
+int afs_vop_getattr(struct vop_getattr_args *);
+int afs_vop_setattr(struct vop_setattr_args *);
+int afs_vop_read(struct vop_read_args *);
+int afs_vop_write(struct vop_write_args *);
+int afs_vop_getpages(struct vop_getpages_args *);
+int afs_vop_putpages(struct vop_putpages_args *);
+int afs_vop_ioctl(struct vop_ioctl_args *);
+int afs_vop_poll(struct vop_poll_args *);
+int afs_vop_mmap(struct vop_mmap_args *);
+int afs_vop_fsync(struct vop_fsync_args *);
+int afs_vop_remove(struct vop_remove_args *);
+int afs_vop_link(struct vop_link_args *);
+int afs_vop_rename(struct vop_rename_args *);
+int afs_vop_mkdir(struct vop_mkdir_args *);
+int afs_vop_rmdir(struct vop_rmdir_args *);
+int afs_vop_symlink(struct vop_symlink_args *);
+int afs_vop_readdir(struct vop_readdir_args *);
+int afs_vop_readlink(struct vop_readlink_args *);
+int afs_vop_inactive(struct vop_inactive_args *);
+int afs_vop_reclaim(struct vop_reclaim_args *);
+int afs_vop_lock(struct vop_lock_args *);
+int afs_vop_unlock(struct vop_unlock_args *);
+int afs_vop_bmap(struct vop_bmap_args *);
+int afs_vop_strategy(struct vop_strategy_args *);
+int afs_vop_print(struct vop_print_args *);
+int afs_vop_islocked(struct vop_islocked_args *);
+int afs_vop_advlock(struct vop_advlock_args *);
+
+
+
+/* Global vfs data structures for AFS. */
+vop_t **afs_vnodeop_p;
+struct vnodeopv_entry_desc afs_vnodeop_entries[] = {
+       { &vop_default_desc, (vop_t *) vop_eopnotsupp },
+       { &vop_access_desc, (vop_t *) afs_vop_access },          /* access */
+       { &vop_advlock_desc, (vop_t *) afs_vop_advlock },        /* advlock */
+       { &vop_bmap_desc, (vop_t *) afs_vop_bmap },              /* bmap */
+       { &vop_bwrite_desc, (vop_t *) vop_stdbwrite },
+       { &vop_close_desc, (vop_t *) afs_vop_close },            /* close */
+        { &vop_createvobject_desc,  (vop_t *) vop_stdcreatevobject },
+        { &vop_destroyvobject_desc, (vop_t *) vop_stddestroyvobject },
+       { &vop_create_desc, (vop_t *) afs_vop_create },          /* create */
+       { &vop_fsync_desc, (vop_t *) afs_vop_fsync },            /* fsync */
+       { &vop_getattr_desc, (vop_t *) afs_vop_getattr },        /* getattr */
+       { &vop_getpages_desc, (vop_t *) afs_vop_getpages },              /* read */
+        { &vop_getvobject_desc, (vop_t *) vop_stdgetvobject },
+       { &vop_putpages_desc, (vop_t *) afs_vop_putpages },            /* write */
+       { &vop_inactive_desc, (vop_t *) afs_vop_inactive },      /* inactive */
+       { &vop_islocked_desc, (vop_t *) afs_vop_islocked },      /* islocked */
+        { &vop_lease_desc, (vop_t *) vop_null },
+       { &vop_link_desc, (vop_t *) afs_vop_link },              /* link */
+       { &vop_lock_desc, (vop_t *) afs_vop_lock },              /* lock */
+       { &vop_lookup_desc, (vop_t *) afs_vop_lookup },          /* lookup */
+       { &vop_mkdir_desc, (vop_t *) afs_vop_mkdir },            /* mkdir */
+       { &vop_mknod_desc, (vop_t *) afs_vop_mknod },            /* mknod */
+       { &vop_mmap_desc, (vop_t *) afs_vop_mmap },              /* mmap */
+       { &vop_open_desc, (vop_t *) afs_vop_open },              /* open */
+       { &vop_poll_desc, (vop_t *) afs_vop_poll },          /* select */
+       { &vop_print_desc, (vop_t *) afs_vop_print },            /* print */
+       { &vop_read_desc, (vop_t *) afs_vop_read },              /* read */
+       { &vop_readdir_desc, (vop_t *) afs_vop_readdir },        /* readdir */
+       { &vop_readlink_desc, (vop_t *) afs_vop_readlink },      /* readlink */
+       { &vop_reclaim_desc, (vop_t *) afs_vop_reclaim },        /* reclaim */
+       { &vop_remove_desc, (vop_t *) afs_vop_remove },          /* remove */
+       { &vop_rename_desc, (vop_t *) afs_vop_rename },          /* rename */
+       { &vop_rmdir_desc, (vop_t *) afs_vop_rmdir },            /* rmdir */
+       { &vop_setattr_desc, (vop_t *) afs_vop_setattr },        /* setattr */
+       { &vop_strategy_desc, (vop_t *) afs_vop_strategy },      /* strategy */
+       { &vop_symlink_desc, (vop_t *) afs_vop_symlink },        /* symlink */
+       { &vop_unlock_desc, (vop_t *) afs_vop_unlock },          /* unlock */
+       { &vop_write_desc, (vop_t *) afs_vop_write },            /* write */
+       { &vop_ioctl_desc, (vop_t *) afs_vop_ioctl }, /* XXX ioctl */
+       /*{ &vop_seek_desc, afs_vop_seek },*/              /* seek */
+       { NULL, NULL }
+};
+struct vnodeopv_desc afs_vnodeop_opv_desc =
+       { &afs_vnodeop_p, afs_vnodeop_entries };
 
+#define GETNAME()       \
+    struct componentname *cnp = ap->a_cnp; \
+    char *name; \
+    MALLOC(name, char *, cnp->cn_namelen+1, M_TEMP, M_WAITOK); \
+    memcpy(name, cnp->cn_nameptr, cnp->cn_namelen); \
+    name[cnp->cn_namelen] = '\0'
 
-#include "../afs/sysincludes.h"        /* Standard vendor system headers */
-#include "../afs/afsincludes.h"        /* Afs-based standard headers */
-#include "../afs/afs_stats.h" /* statistics */
-#include <vm/vm.h>
-#include <vm/vnode_pager.h>
-#include <vm/vm_map.h>
-/* #include <vm/vm_ubc.h> */
-#include "../afs/afs_cbqueue.h"
-#include "../afs/nfsclient.h"
-#include "../afs/afs_osidnlc.h"
-
-
-extern int afs_lookup(), afs_create(), afs_noop(), afs_open(), afs_close();
-extern int afs_access(), afs_getattr(), afs_setattr(), afs_badop();
-extern int afs_fsync(), afs_seek(), afs_remove(), afs_link(), afs_rename();
-extern int afs_mkdir(), afs_rmdir(), afs_symlink(), afs_readdir();
-extern int afs_readlink(), afs_lockctl();
-extern int vn_pathconf_default(), seltrue();
-
-int mp_afs_lookup(), mp_afs_create(), mp_afs_open();
-int mp_afs_access(), mp_afs_getattr(), mp_afs_setattr(), mp_afs_ubcrdwr();
-int mp_afs_ubcrdwr(), mp_afs_mmap();
-int mp_afs_fsync(), mp_afs_seek(), mp_afs_remove(), mp_afs_link();
-int mp_afs_rename(), mp_afs_mkdir(), mp_afs_rmdir(), mp_afs_symlink();
-int mp_afs_readdir(), mp_afs_readlink(), mp_afs_abortop(), mp_afs_inactive();
-int mp_afs_reclaim(), mp_afs_bmap(), mp_afs_strategy(), mp_afs_print();
-int mp_afs_page_read(), mp_afs_page_write(), mp_afs_swap(), mp_afs_bread();
-int mp_afs_brelse(), mp_afs_lockctl(), mp_afs_syncdata(), mp_afs_close();
-int mp_afs_closex();
+#define DROPNAME() FREE(name, M_TEMP)
+       
 
-#if 0
-/* AFS vnodeops */
-struct vnodeops Afs_vnodeops = {
-       mp_afs_lookup,
-       mp_afs_create,
-       afs_noop,       /* vn_mknod */
-       mp_afs_open,
-       mp_afs_close,
-       mp_afs_access,
-       mp_afs_getattr,
-       mp_afs_setattr,
-       mp_afs_ubcrdwr,
-       mp_afs_ubcrdwr,
-       afs_badop,      /* vn_ioctl */
-       seltrue,        /* vn_select */
-       mp_afs_mmap,
-       mp_afs_fsync,
-       mp_afs_seek,
-       mp_afs_remove,
-       mp_afs_link,
-       mp_afs_rename,
-       mp_afs_mkdir,
-       mp_afs_rmdir,
-       mp_afs_symlink,
-       mp_afs_readdir,
-       mp_afs_readlink,
-       mp_afs_abortop,
-       mp_afs_inactive,
-       mp_afs_reclaim,
-       mp_afs_bmap,
-       mp_afs_strategy,
-       mp_afs_print,
-       mp_afs_page_read,
-       mp_afs_page_write,
-       mp_afs_swap,
-       mp_afs_bread,
-       mp_afs_brelse,
-       mp_afs_lockctl,
-       mp_afs_syncdata,
-       afs_noop,       /* Lock */
-       afs_noop,       /* unLock */
-       afs_noop,       /* get ext attrs */
-       afs_noop,       /* set ext attrs */
-       afs_noop,       /* del ext attrs */
-       vn_pathconf_default,
-};
-struct vnodeops *afs_ops = &Afs_vnodeops;
-#endif /* 0 */
-
-/* vnode file operations, and our own */
-extern int vn_read();
-extern int vn_write();
-extern int vn_ioctl();
-extern int vn_select();
-extern int afs_closex();
-
-struct fileops afs_fileops = {
-    vn_read,
-    vn_write,
-    vn_ioctl,
-    vn_select,
-    mp_afs_closex,
-};
 
-#if 0
-mp_afs_lookup(adp, ndp)
-    struct vcache *adp;
-    struct nameidata *ndp;
+int
+afs_vop_lookup(ap)
+struct vop_lookup_args /* {
+                         struct vnodeop_desc * a_desc;
+                         struct vnode *a_dvp;
+                         struct vnode **a_vpp;
+                         struct componentname *a_cnp;
+                         } */ *ap;
 {
-    int code;
+    int error;
+    struct vcache *vcp;
+    struct vnode *vp, *dvp;
+    register int flags = ap->a_cnp->cn_flags;
+    int lockparent;                     /* 1 => lockparent flag is set */
+    int wantparent;                     /* 1 => wantparent or lockparent flag */
+    struct proc *p;
+    GETNAME();
+    p=cnp->cn_proc;
+    lockparent = flags & LOCKPARENT;
+    wantparent = flags & (LOCKPARENT|WANTPARENT);
+
+    if (ap->a_dvp->v_type != VDIR) {
+       *ap->a_vpp = 0;
+       DROPNAME();
+       return ENOTDIR;
+    }
+    dvp = ap->a_dvp;
+    if (flags & ISDOTDOT) 
+       VOP_UNLOCK(dvp, 0, p);
     AFS_GLOCK();
-    code = afs_lookup(adp, ndp);
+    error = afs_lookup(VTOAFS(dvp), name, &vcp, cnp->cn_cred);
     AFS_GUNLOCK();
-    return code;
-}
+    if (error) {
+        if (flags & ISDOTDOT) 
+           VOP_LOCK(dvp, LK_EXCLUSIVE | LK_RETRY, p);
+       if ((cnp->cn_nameiop == CREATE || cnp->cn_nameiop == RENAME) &&
+           (flags & ISLASTCN) && error == ENOENT)
+           error = EJUSTRETURN;
+       if (cnp->cn_nameiop != LOOKUP && (flags & ISLASTCN))
+           cnp->cn_flags |= SAVENAME;
+       DROPNAME();
+       *ap->a_vpp = 0;
+       return (error);
+    }
+    vp = AFSTOV(vcp);  /* always get a node if no error */
+
+    /* The parent directory comes in locked.  We unlock it on return
+       unless the caller wants it left locked.
+       we also always return the vnode locked. */
+
+    if (flags & ISDOTDOT) {
+       vn_lock(vp, LK_EXCLUSIVE | LK_RETRY, p);
+        /* always return the child locked */
+        if (lockparent && (flags & ISLASTCN) &&
+           (error = vn_lock(dvp, LK_EXCLUSIVE, p))) {
+            vput(vp);
+            DROPNAME();
+            return (error);
+        }
+    } else if (vp == dvp) {
+       /* they're the same; afs_lookup() already ref'ed the leaf.
+          It came in locked, so we don't need to ref OR lock it */
+    } else {
+       if (!lockparent || !(flags & ISLASTCN))
+           VOP_UNLOCK(dvp, 0, p);         /* done with parent. */
+       vn_lock(vp, LK_EXCLUSIVE | LK_RETRY, p);
+        /* always return the child locked */
+    }
+    *ap->a_vpp = vp;
 
-mp_afs_create(ndp, attrs)
-    struct nameidata *ndp;
-    struct vattr *attrs;
-{
-    int code;
-    AFS_GLOCK();
-    code = afs_create(ndp, attrs);
-    AFS_GUNLOCK();
-    return code;
-}
+    if ((cnp->cn_nameiop == RENAME && wantparent && (flags & ISLASTCN)) ||
+        (cnp->cn_nameiop != LOOKUP && (flags & ISLASTCN)))
+       cnp->cn_flags |= SAVENAME;
 
-mp_afs_open(avcp, aflags, acred)
-    struct vcache **avcp;
-    afs_int32 aflags;
-    struct AFS_UCRED *acred;
-{
-    int code;
-    AFS_GLOCK();
-    code = afs_open(avcp, aflags, acred);
-    AFS_GUNLOCK();
-    return code;
+    DROPNAME();
+    return error;
 }
 
-mp_afs_access(avc, amode, acred)
-    struct vcache *avc;
-    afs_int32 amode;
-    struct AFS_UCRED *acred;
+int
+afs_vop_create(ap)
+       struct vop_create_args /* {
+               struct vnode *a_dvp;
+               struct vnode **a_vpp;
+               struct componentname *a_cnp;
+               struct vattr *a_vap;
+       } */ *ap;
 {
-    int code;
-    AFS_GLOCK();
-    code = afs_access(avc, amode, acred);
-    AFS_GUNLOCK();
-    return code;
-}
+    int error = 0;
+    struct vcache *vcp;
+    register struct vnode *dvp = ap->a_dvp;
+    struct proc *p;
+    GETNAME();
+    p=cnp->cn_proc;
 
-mp_afs_close(avc, flags, cred)
-    struct vnode *avc;
-    int flags;
-    struct ucred *cred;
-{
-    int code;
     AFS_GLOCK();
-    code = afs_close(avc, flags, cred);
+    error = afs_create(VTOAFS(dvp), name, ap->a_vap, ap->a_vap->va_vaflags & VA_EXCLUSIVE? EXCL : NONEXCL,
+                      ap->a_vap->va_mode, &vcp,
+                      cnp->cn_cred);
     AFS_GUNLOCK();
-    return code;
-}
+    if (error) {
+       DROPNAME();
+       return(error);
+    }
 
-mp_afs_getattr(avc, attrs, acred)
-    struct vcache *avc;
-    struct vattr *attrs;
-    struct AFS_UCRED *acred;
-{
-    int code;
-    AFS_GLOCK();
-    code = afs_getattr(avc, attrs, acred);
-    AFS_GUNLOCK();
-    return code;
-}
+    if (vcp) {
+       *ap->a_vpp = AFSTOV(vcp);
+       vn_lock(AFSTOV(vcp), LK_EXCLUSIVE| LK_RETRY, p);
+    }
+    else *ap->a_vpp = 0;
 
-mp_afs_setattr(avc, attrs, acred)
-    struct vcache *avc;
-    struct vattr *attrs;
-    struct AFS_UCRED *acred;
-{
-    int code;
-    AFS_GLOCK();
-    code = afs_setattr(avc, attrs, acred);
-    AFS_GUNLOCK();
-    return code;
+    DROPNAME();
+    return error;
 }
 
-mp_afs_fsync(avc, fflags, acred, waitfor)
-    struct vcache *avc;
-    int fflags;
-    struct AFS_UCRED *acred;
-    int waitfor;
+int
+afs_vop_mknod(ap)
+       struct vop_mknod_args /* {
+               struct vnode *a_dvp;
+               struct vnode **a_vpp;
+               struct componentname *a_cnp;
+               struct vattr *a_vap;
+       } */ *ap;
 {
-    int code;
-    AFS_GLOCK();
-    code = afs_fsync(avc, fflags, acred, waitfor);
-    AFS_GUNLOCK();
-    return code;
+    return(ENODEV);
 }
 
-mp_afs_remove(ndp)
-    struct nameidata *ndp;
+#if 0
+static int validate_vops(struct vnode *vp, int after) 
 {
-    int code;
-    AFS_GLOCK();
-    code = afs_remove(ndp);
-    AFS_GUNLOCK();
-    return code;
-}
-
-mp_afs_link(avc, ndp)
-    struct vcache *avc;
-    struct nameidata *ndp;
+   int ret=0;
+   struct vnodeopv_entry_desc *this;
+   for (this=afs_vnodeop_entries; this->opve_op; this++) {
+       if (vp->v_op[this->opve_op->vdesc_offset] != this->opve_impl) {
+            if (!ret) {
+                printf("v_op %d ", after);
+                vprint("check", vp);
+            }
+            ret=1;
+            printf("For oper %d (%s), func is %p, not %p",
+                    this->opve_op->vdesc_offset, this->opve_op->vdesc_name,
+                    vp->v_op[this->opve_op->vdesc_offset],  this->opve_impl);
+        }
+   }
+   return ret;
+} 
+#endif
+int
+afs_vop_open(ap)
+       struct vop_open_args /* {
+               struct vnode *a_vp;
+               int  a_mode;
+               struct ucred *a_cred;
+               struct proc *a_p;
+       } */ *ap;
 {
-    int code;
+    int error;
+    int bad;
+    struct vcache *vc = VTOAFS(ap->a_vp);
+    bad=0;
     AFS_GLOCK();
-    code = afs_link(avc, ndp);
+    error = afs_open(&vc, ap->a_mode, ap->a_cred);
+#ifdef DIAGNOSTIC
+    if (AFSTOV(vc) != ap->a_vp)
+       panic("AFS open changed vnode!");
+#endif
+    afs_BozonLock(&vc->pvnLock, vc);
+    osi_FlushPages(vc);
+    afs_BozonUnlock(&vc->pvnLock, vc);
     AFS_GUNLOCK();
-    return code;
+    return error;
 }
 
-mp_afs_rename(fndp, tndp)
-    struct nameidata *fndp, *tndp;
+int
+afs_vop_close(ap)
+       struct vop_close_args /* {
+               struct vnode *a_vp;
+               int  a_fflag;
+               struct ucred *a_cred;
+               struct proc *a_p;
+       } */ *ap;
 {
     int code;
+    struct vcache *avc=ap->a_vp;
     AFS_GLOCK();
-    code = afs_rename(fndp, tndp);
+    if (ap->a_cred) 
+        code=afs_close(avc, ap->a_fflag, ap->a_cred, ap->a_p);
+    else
+        code=afs_close(avc, ap->a_fflag, &afs_osi_cred, ap->a_p);
+    afs_BozonLock(&avc->pvnLock, avc);
+    osi_FlushPages(avc);        /* hold bozon lock, but not basic vnode lock */
+    afs_BozonUnlock(&avc->pvnLock, avc);
     AFS_GUNLOCK();
     return code;
 }
 
-mp_afs_mkdir(ndp, attrs)
-    struct nameidata *ndp;
-    struct vattr *attrs;
+int
+afs_vop_access(ap)
+       struct vop_access_args /* {
+               struct vnode *a_vp;
+               int  a_mode;
+               struct ucred *a_cred;
+               struct proc *a_p;
+       } */ *ap;
 {
     int code;
     AFS_GLOCK();
-    code = afs_mkdir(ndp, attrs);
+    code=afs_access(VTOAFS(ap->a_vp), ap->a_mode, ap->a_cred);
     AFS_GUNLOCK();
     return code;
 }
-
-mp_afs_rmdir(ndp)
-    struct nameidata *ndp;
+int
+afs_vop_getattr(ap)
+       struct vop_getattr_args /* {
+               struct vnode *a_vp;
+               struct vattr *a_vap;
+               struct ucred *a_cred;
+               struct proc *a_p;
+       } */ *ap;
 {
     int code;
     AFS_GLOCK();
-    code = afs_rmdir(ndp);
+    code=afs_getattr(VTOAFS(ap->a_vp), ap->a_vap, ap->a_cred);
     AFS_GUNLOCK();
     return code;
 }
-
-mp_afs_symlink(ndp, attrs, atargetName)
-    struct nameidata *ndp;
-    struct vattr *attrs;
-    register char *atargetName;
+int
+afs_vop_setattr(ap)
+       struct vop_setattr_args /* {
+               struct vnode *a_vp;
+               struct vattr *a_vap;
+               struct ucred *a_cred;
+               struct proc *a_p;
+       } */ *ap;
 {
     int code;
     AFS_GLOCK();
-    code = afs_symlink(ndp, attrs, atargetName);
+    code=afs_setattr(VTOAFS(ap->a_vp), ap->a_vap, ap->a_cred);
     AFS_GUNLOCK();
     return code;
-}
-
-mp_afs_readdir(avc, auio, acred, eofp)
-    struct vcache *avc;
-    struct uio *auio;
-    struct AFS_UCRED *acred;
-    int *eofp;
+}int
+afs_vop_read(ap)
+       struct vop_read_args /* {
+               struct vnode *a_vp;
+               struct uio *a_uio;
+               int a_ioflag;
+               struct ucred *a_cred;
+       
+} */ *ap;
 {
     int code;
+    struct vcache *avc=VTOAFS(ap->a_vp);
     AFS_GLOCK();
-    code = afs_readdir(avc, auio, acred, eofp);
+    afs_BozonLock(&avc->pvnLock, avc);
+    osi_FlushPages(avc);        /* hold bozon lock, but not basic vnode lock */
+    code=afs_read(avc, ap->a_uio, ap->a_cred, 0, 0, 0);
+    afs_BozonUnlock(&avc->pvnLock, avc);
     AFS_GUNLOCK();
     return code;
 }
-
-mp_afs_readlink(avc, auio, acred)
-    struct vcache *avc;
-    struct uio *auio;
-    struct AFS_UCRED *acred;
+int
+afs_vop_getpages(ap)
+       struct vop_getpages_args /* {
+               struct vnode *a_vp;
+                vm_page_t *a_m;
+                int a_count;
+                int a_reqpage;
+                vm_oofset_t a_offset;
+        } */ *ap;
 {
     int code;
+    int i, nextoff, size, toff, npages;
+    struct uio uio;
+    struct iovec iov;
+    struct buf *bp;
+    vm_offset_t kva;
+    struct vcache *avc=VTOAFS(ap->a_vp);
+
+    if (avc->v.v_object == NULL) {
+        printf("afs_getpages: called with non-merged cache vnode??\n");
+        return VM_PAGER_ERROR;
+    }
+    npages=btoc(ap->a_count);
+    /*
+     * If the requested page is partially valid, just return it and
+     * allow the pager to zero-out the blanks.  Partially valid pages
+     * can only occur at the file EOF.
+     */
+
+    {
+       vm_page_t m = ap->a_m[ap->a_reqpage];
+
+       if (m->valid != 0) {
+               /* handled by vm_fault now        */
+               /* vm_page_zero_invalid(m, TRUE); */
+               for (i = 0; i < npages; ++i) {
+                       if (i != ap->a_reqpage)
+                               vnode_pager_freepage(ap->a_m[i]);
+               }
+               return(0);
+       }
+    }
+    bp = getpbuf(&afs_pbuf_freecnt);
+    kva = (vm_offset_t) bp->b_data;
+    pmap_qenter(kva, ap->a_m, npages);
+    iov.iov_base=(caddr_t)kva;
+    iov.iov_len=ap->a_count;
+    uio.uio_iov=&iov;
+    uio.uio_iovcnt=1;
+    uio.uio_offset=IDX_TO_OFF(ap->a_m[0]->pindex);
+    uio.uio_resid=ap->a_count;
+    uio.uio_segflg=UIO_SYSSPACE;
+    uio.uio_rw=UIO_READ;
+    uio.uio_procp=curproc;
     AFS_GLOCK();
-    code = afs_readlink(avc, auio, acred);
+    afs_BozonLock(&avc->pvnLock, avc);
+    osi_FlushPages(avc);        /* hold bozon lock, but not basic vnode lock */
+    code=afs_read(avc, &uio, curproc->p_cred->pc_ucred, 0, 0, 0);
+    afs_BozonUnlock(&avc->pvnLock, avc);
     AFS_GUNLOCK();
-    return code;
+    pmap_qremove(kva, npages);
+
+    relpbuf(bp, &afs_pbuf_freecnt);
+    if (code && (uio.uio_resid == ap->a_count)) {
+           for (i = 0; i < npages; ++i) {
+               if (i != ap->a_reqpage)
+                   vnode_pager_freepage(ap->a_m[i]);
+           }
+           return VM_PAGER_ERROR;
+    }
+    size = ap->a_count - uio.uio_resid;
+    for (i = 0, toff = 0; i < npages; i++, toff = nextoff) {
+        vm_page_t m;
+        nextoff = toff + PAGE_SIZE;
+        m = ap->a_m[i];
+
+        m->flags &= ~PG_ZERO;
+
+        if (nextoff <= size) {
+                /*
+                 * Read operation filled an entire page
+                 */
+                m->valid = VM_PAGE_BITS_ALL;
+                vm_page_undirty(m);
+        } else if (size > toff) {
+                /*
+                 * Read operation filled a partial page.
+                 */
+                m->valid = 0;
+                vm_page_set_validclean(m, 0, size - toff);
+                /* handled by vm_fault now        */
+                /* vm_page_zero_invalid(m, TRUE); */
+        }
+        
+        if (i != ap->a_reqpage) {
+                /*
+                 * Whether or not to leave the page activated is up in
+                 * the air, but we should put the page on a page queue
+                 * somewhere (it already is in the object).  Result:
+                 * It appears that emperical results show that
+                 * deactivating pages is best.
+                 */
+
+                /*
+                 * Just in case someone was asking for this page we
+                 * now tell them that it is ok to use.
+                 */
+                if (!code) {
+                        if (m->flags & PG_WANTED)
+                                vm_page_activate(m);
+                        else
+                                vm_page_deactivate(m);
+                        vm_page_wakeup(m);
+                } else {
+                        vnode_pager_freepage(m);
+                }
+        }
+    }
+    return 0;
 }
-
-mp_afs_lockctl(avc, af, flag, acred, clid, offset)
-    struct vcache *avc;
-    struct eflock *af;
-    struct AFS_UCRED *acred;
-    int flag;
-    pid_t clid;
-    off_t offset;
+       
+int
+afs_vop_write(ap)
+       struct vop_write_args /* {
+               struct vnode *a_vp;
+               struct uio *a_uio;
+               int a_ioflag;
+               struct ucred *a_cred;
+       } */ *ap;
 {
     int code;
+    struct vcache *avc=VTOAFS(ap->a_vp);
     AFS_GLOCK();
-    code = afs_lockctl(avc, af, flag, acred, clid, offset);
+    afs_BozonLock(&avc->pvnLock, avc);
+    osi_FlushPages(avc);        /* hold bozon lock, but not basic vnode lock */
+    code=afs_write(VTOAFS(ap->a_vp), ap->a_uio, ap->a_ioflag, ap->a_cred, 0);
+    afs_BozonUnlock(&avc->pvnLock, avc);
     AFS_GUNLOCK();
     return code;
 }
 
-mp_afs_closex(afd)
-    struct file *afd;
+int
+afs_vop_putpages(ap)
+       struct vop_putpages_args /* {
+               struct vnode *a_vp;
+                vm_page_t *a_m;
+                int a_count;
+                int a_sync;
+                int *a_rtvals;
+                vm_oofset_t a_offset;
+        } */ *ap;
 {
     int code;
+    int i, size, npages, sync;
+    struct uio uio;
+    struct iovec iov;
+    struct buf *bp;
+    vm_offset_t kva;
+    struct vcache *avc=VTOAFS(ap->a_vp);
+
+    if (avc->v.v_object == NULL) {
+        printf("afs_putpages: called with non-merged cache vnode??\n");
+        return VM_PAGER_ERROR;
+    }
+    if (vType(avc) != VREG) {
+        printf("afs_putpages: not VREG");
+        return VM_PAGER_ERROR;
+    }
+    npages=btoc(ap->a_count);
+    for (i=0; i < npages; i++ ) ap->a_rtvals[i]=VM_PAGER_AGAIN;
+    bp = getpbuf(&afs_pbuf_freecnt);
+    kva = (vm_offset_t) bp->b_data;
+    pmap_qenter(kva, ap->a_m, npages);
+    iov.iov_base=(caddr_t)kva;
+    iov.iov_len=ap->a_count;
+    uio.uio_iov=&iov;
+    uio.uio_iovcnt=1;
+    uio.uio_offset=IDX_TO_OFF(ap->a_m[0]->pindex);
+    uio.uio_resid=ap->a_count;
+    uio.uio_segflg=UIO_SYSSPACE;
+    uio.uio_rw=UIO_WRITE;
+    uio.uio_procp=curproc;
+    sync=IO_VMIO;
+    if (ap->a_sync & VM_PAGER_PUT_SYNC)
+       sync|=IO_SYNC;
+    /*if (ap->a_sync & VM_PAGER_PUT_INVAL)
+       sync|=IO_INVAL;*/
+
     AFS_GLOCK();
-    code = afs_closex(afd);
+    afs_BozonLock(&avc->pvnLock, avc);
+    code=afs_write(avc, &uio, sync, curproc->p_cred->pc_ucred,  0);
+    afs_BozonUnlock(&avc->pvnLock, avc);
     AFS_GUNLOCK();
-    return code;
-}
-
-mp_afs_seek(avc, oldoff, newoff, cred)
-    struct vcache *avc;
-    off_t oldoff, newoff;
-    struct ucred *cred;
-{
-    if ((int) newoff < 0)
-       return(EINVAL);
-    else
-       return(0);
-}
+    pmap_qremove(kva, npages);
 
-mp_afs_abortop(ndp)
-    struct nameidata *ndp;
-{
-    return(0);
+    relpbuf(bp, &afs_pbuf_freecnt);
+    if (!code) {
+           size = ap->a_count - uio.uio_resid;
+           for (i = 0; i < round_page(size) / PAGE_SIZE; i++) {
+               ap->a_rtvals[i]=VM_PAGER_OK;
+               ap->a_m[i]->dirty=0;
+           }
+           return VM_PAGER_ERROR;
+    }
+    return ap->a_rtvals[0];
 }
-
-mp_afs_inactive(avc, acred)
-    register struct vcache *avc;
-    struct AFS_UCRED *acred;
+int
+afs_vop_ioctl(ap)
+       struct vop_ioctl_args /* {
+               struct vnode *a_vp;
+               int  a_command;
+               caddr_t  a_data;
+               int  a_fflag;
+               struct ucred *a_cred;
+               struct proc *a_p;
+       } */ *ap;
 {
+    struct vcache *tvc = VTOAFS(ap->a_vp);
+    struct afs_ioctl data;
+    int error = 0;
+  
+    /* in case we ever get in here... */
+
+    AFS_STATCNT(afs_ioctl);
+    if (((ap->a_command >> 8) & 0xff) == 'V') {
+       /* This is a VICEIOCTL call */
     AFS_GLOCK();
-    afs_InactiveVCache(avc, acred);
+       error = HandleIoctl(tvc, (struct file *)0/*Not used*/,
+                           ap->a_command, ap->a_data);
     AFS_GUNLOCK();
+       return(error);
+    } else {
+       /* No-op call; just return. */
+       return(ENOTTY);
+    }
 }
 
-
-mp_afs_reclaim(avc)
-    struct vcache *avc;
+/* ARGSUSED */
+int
+afs_vop_poll(ap)
+       struct vop_poll_args /* {
+               struct vnode *a_vp;
+               int  a_events;
+               struct ucred *a_cred;
+               struct proc *a_p;
+       } */ *ap;
 {
-    return(0);
+       /*
+        * We should really check to see if I/O is possible.
+        */
+       return (1);
 }
-
-mp_afs_print(avc)
-    struct vcache *avc;
+/*
+ * Mmap a file
+ *
+ * NB Currently unsupported.
+ */
+/* ARGSUSED */
+int
+afs_vop_mmap(ap)
+       struct vop_mmap_args /* {
+               struct vnode *a_vp;
+               int  a_fflags;
+               struct ucred *a_cred;
+               struct proc *a_p;
+       } */ *ap;
 {
-    return(0);
+       return (EINVAL);
 }
 
-mp_afs_page_read(avc, uio, acred)
-    struct vcache *avc;
-    struct uio *uio;
-    struct ucred *acred;
+int
+afs_vop_fsync(ap)
+       struct vop_fsync_args /* {
+               struct vnode *a_vp;
+               struct ucred *a_cred;
+               int a_waitfor;
+               struct proc *a_p;
+       } */ *ap;
 {
+    int wait = ap->a_waitfor == MNT_WAIT;
     int error;
-    struct vrequest treq;
+    register struct vnode *vp = ap->a_vp;
 
     AFS_GLOCK();
-    error = afs_rdwr(avc, uio, UIO_READ, 0, acred);
-    afs_Trace3(afs_iclSetp, CM_TRACE_PAGE_READ, ICL_TYPE_POINTER, avc,
-              ICL_TYPE_INT32, error,  ICL_TYPE_INT32, avc->states);
-    if (error) {
-       error = EIO;
-    } else if ((avc->states) == 0) {
-       afs_InitReq(&treq, acred);
-       ObtainWriteLock(&avc->lock,161);
-       afs_Wire(avc, &treq);
-       ReleaseWriteLock(&avc->lock);
-    }
+    /*vflushbuf(vp, wait);*/
+    if (ap->a_cred)
+      error=afs_fsync(VTOAFS(vp), ap->a_cred);
+    else
+      error=afs_fsync(VTOAFS(vp), &afs_osi_cred);
     AFS_GUNLOCK();
-    return(error);
+    return error;
 }
 
-
-mp_afs_page_write(avc, uio, acred, pager, offset)
-    struct vcache *avc;
-    struct uio *uio;
-    struct ucred *acred;
-    memory_object_t pager;
-    vm_offset_t     offset;
+int
+afs_vop_remove(ap)
+       struct vop_remove_args /* {
+               struct vnode *a_dvp;
+               struct vnode *a_vp;
+               struct componentname *a_cnp;
+       } */ *ap;
 {
-    int error;
+    int error = 0;
+    register struct vnode *vp = ap->a_vp;
+    register struct vnode *dvp = ap->a_dvp;
 
+    GETNAME();
     AFS_GLOCK();
-    error = afs_rdwr(avc, uio, UIO_WRITE, 0, acred);
-    afs_Trace3(afs_iclSetp, CM_TRACE_PAGE_WRITE, ICL_TYPE_POINTER, avc,
-              ICL_TYPE_INT32, error, ICL_TYPE_INT32, avc->states);
-    if (error) {
-       error = EIO;
-    }
+    error =  afs_remove(VTOAFS(dvp), name, cnp->cn_cred);
     AFS_GUNLOCK();
-    return(error);
+    cache_purge(vp);
+    DROPNAME();
+    return error;
 }
 
-
-int DO_FLUSH=1;
-mp_afs_ubcrdwr(avc, uio, ioflag, cred)
-    struct vcache *avc;
-    struct uio *uio;
-    int ioflag;
-    struct ucred *cred;
+int
+afs_vop_link(ap)
+       struct vop_link_args /* {
+               struct vnode *a_vp;
+               struct vnode *a_tdvp;
+               struct componentname *a_cnp;
+       } */ *ap;
 {
-    register afs_int32 code;
-    register char *data;
-    afs_int32 fileBase, size, cnt=0;
-    afs_int32 pageBase;
-    register afs_int32 tsize;
-    register afs_int32 pageOffset;
-    int eof;
-    struct vrequest treq;
-    int rw = uio->uio_rw;
-    int rv, flags;
-    int newpage=0;
-    vm_page_t page;
-    afs_int32 save_resid;
-    struct dcache *tdc;
-    int didFakeOpen=0;
-    int counter=0;
-
-    AFS_GLOCK();
-    afs_InitReq(&treq, cred);
-    if (AFS_NFSXLATORREQ(cred) && rw == UIO_READ) {
-       if (!afs_AccessOK(avc, PRSFS_READ, &treq,
-                         CHECK_MODE_BITS|CMB_ALLOW_EXEC_AS_READ))  {
-           AFS_GUNLOCK();
-           return EACCES;
-       }
-    }
-    afs_Trace4(afs_iclSetp, CM_TRACE_VMRW, ICL_TYPE_POINTER, avc,
-              ICL_TYPE_INT32, (rw==UIO_WRITE? 1 : 0),
-              ICL_TYPE_LONG, uio->uio_offset,
-              ICL_TYPE_LONG, uio->uio_resid);
-    code = afs_VerifyVCache(avc, &treq);
-    if (code) {
-       code = afs_CheckCode(code, &treq, 35);
-       AFS_GUNLOCK();
-       return code;
+    int error = 0;
+    register struct vnode *dvp = ap->a_tdvp;
+    register struct vnode *vp = ap->a_vp;
+    struct proc *p;
+
+    GETNAME();
+    p=cnp->cn_proc;
+    if (dvp->v_mount != vp->v_mount) {
+       error = EXDEV;
+       goto out;
     }
-    if (vType(avc) != VREG) {
-       AFS_GUNLOCK();
-       return EISDIR;  /* can't read or write other things */
-    }
-    afs_BozonLock(&avc->pvnLock, avc);
-    osi_FlushPages(avc);       /* hold bozon lock, but not basic vnode lock */
-    ObtainWriteLock(&avc->lock,162);
-    /* adjust parameters when appending files */
-    if ((ioflag & IO_APPEND) && uio->uio_rw == UIO_WRITE)
-       uio->uio_offset = avc->m.Length;        /* write at EOF position */
-    if (uio->uio_rw == UIO_WRITE) {
-       avc->states |= CDirty;
-       afs_FakeOpen(avc);
-       didFakeOpen=1;
-       /*
-        * before starting any I/O, we must ensure that the file is big enough
-        * to hold the results (since afs_putpage will be called to force
-        * the I/O.
-        */
-       size = uio->afsio_resid + uio->afsio_offset;    /* new file size */
-       if (size > avc->m.Length) avc->m.Length = size; /* file grew */
-       avc->m.Date = osi_Time();       /* Set file date (for ranlib) */
-       if (uio->afsio_resid > PAGE_SIZE)
-           cnt = uio->afsio_resid / PAGE_SIZE;
-       save_resid = uio->afsio_resid;
-    }
-
-    while (1) {
-       /*
-        * compute the amount of data to move into this block,
-        * based on uio->afsio_resid.
-        */
-       size = uio->afsio_resid;                /* transfer size */
-       fileBase = uio->afsio_offset;           /* start file position */
-       pageBase = fileBase & ~(PAGE_SIZE-1);   /* file position of the page */
-       pageOffset = fileBase & (PAGE_SIZE-1);  /* start offset within page */
-       tsize = PAGE_SIZE-pageOffset;           /* amount left in this page */
-       /*
-        * we'll read tsize bytes,
-        * but first must make sure tsize isn't too big
-        */
-       if (tsize > size) tsize = size; /* don't read past end of request */
-       eof = 0;        /* flag telling us if we hit the EOF on the read */
-       if (uio->uio_rw == UIO_READ) {  /* we're doing a read operation */
-           /* don't read past EOF */
-           if (tsize + fileBase > avc->m.Length) {
-               tsize = avc->m.Length - fileBase;
-               eof = 1;        /* we did hit the EOF */
-               if (tsize < 0) tsize = 0;       /* better safe than sorry */
-           }
-       }
-       if (tsize <= 0) break;  /* nothing to transfer, we're done */
-
-       /* Purge dirty chunks of file if there are too many dirty chunks.
-        * Inside the write loop, we only do this at a chunk boundary.
-        * Clean up partial chunk if necessary at end of loop.
-        */
-       if (uio->uio_rw == UIO_WRITE && counter > 0
-           && AFS_CHUNKOFFSET(fileBase) == 0) {
-           code = afs_DoPartialWrite(avc, &treq);
-           avc->states |= CDirty;
-       }
-
-       if (code) {
-           break;
-       }
-
-       flags = 0;
-       ReleaseWriteLock(&avc->lock);
-       AFS_GUNLOCK();
-       code = ubc_lookup(((struct vnode *)avc)->v_object, pageBase,
-                         PAGE_SIZE, PAGE_SIZE, &page, &flags);
-       AFS_GLOCK();
-       ObtainWriteLock(&avc->lock,163);
-
-       if (code) {
-           break;
-       }
-       if (flags & B_NOCACHE) {
-           /*
-              No page found. We should not read the page in if
-              1. the write starts on a page edge (ie, pageoffset == 0)
-              and either
-                    1. we will fill the page  (ie, size == PAGESIZE), or
-                    2. we are writing past eof
-            */
-           if ((uio->uio_rw == UIO_WRITE) &&
-               ((pageOffset == 0 && (size == PAGE_SIZE || fileBase >= avc->m.Length)))) {
-               struct vnode *vp = (struct vnode *)avc;
-               /* we're doing a write operation past eof; no need to read it */
-               newpage = 1;
-               AFS_GUNLOCK();
-               ubc_page_zero(page, 0, PAGE_SIZE);
-               ubc_page_release(page, B_DONE);
-               AFS_GLOCK();
-           } else {
-               /* page wasn't cached, read it in. */
-               struct buf *bp;
-
-               AFS_GUNLOCK();
-               bp = ubc_bufalloc(page, 1, PAGE_SIZE, 1, B_READ);
-               AFS_GLOCK();
-               bp->b_dev = 0;
-               bp->b_vp = (struct vnode *)avc;
-               bp->b_blkno = btodb(pageBase);
-               ReleaseWriteLock(&avc->lock);
-               code = afs_ustrategy(bp, cred); /* do the I/O */
-               ObtainWriteLock(&avc->lock,164);
-               AFS_GUNLOCK();
-               ubc_sync_iodone(bp);
-               AFS_GLOCK();
-               if (code) {
-                   AFS_GUNLOCK();
-                   ubc_page_release(page, 0);
-                   AFS_GLOCK();
-                   break;
-               }
-           }
-       }
-       AFS_GUNLOCK();
-       ubc_page_wait(page);
-       data = (char *)page->pg_addr; /* DUX 4.0D */
-       if (data == 0)
-            data = (char *)PHYS_TO_KSEG(page->pg_phys_addr);  /* DUX 4.0E */
-       AFS_GLOCK();
-       ReleaseWriteLock(&avc->lock);   /* uiomove may page fault */
-       AFS_GUNLOCK();
-       code = uiomove(data+pageOffset, tsize, uio);
-       ubc_unload(page, pageOffset, page_size);
-       if (uio->uio_rw == UIO_WRITE) {
-               vm_offset_t toffset;
-
-               /* Mark the page dirty and release it to avoid a deadlock
-                * in ubc_dirty_kluster when more than one process writes
-                * this page at the same time. */
-               toffset = page->pg_offset;
-               flags |= B_DIRTY;
-               ubc_page_release(page, flags);
-
-               if (cnt > 10) {
-                   vm_page_t pl;
-                   int kpcnt;
-                   struct buf *bp;
-
-                   /* We released the page, so we can get a null page
-                    * list if another thread calls the strategy routine.
-                    */
-                   pl = ubc_dirty_kluster(((struct vnode *)avc)->v_object, 
-                          NULL, toffset, 0, B_WANTED, FALSE, &kpcnt);
-                   if (pl) {
-                       bp = ubc_bufalloc(pl, 1, PAGE_SIZE, 1, B_WRITE);
-                       bp->b_dev = 0;
-                       bp->b_vp = (struct vnode *)avc;
-                       bp->b_blkno = btodb(pageBase);
-                       AFS_GLOCK();
-                       code = afs_ustrategy(bp, cred); /* do the I/O */
-                       AFS_GUNLOCK();
-                       ubc_sync_iodone(bp);
-                       if (code) {
-                           AFS_GLOCK();
-                           ObtainWriteLock(&avc->lock,415);
-                           break;
-                       }
-                   }
-               }
-       } else {
-           ubc_page_release(page, flags);
-       }
-       AFS_GLOCK();
-       ObtainWriteLock(&avc->lock,165);
-       /*
-        * If reading at a chunk boundary, start prefetch of next chunk.
-        */
-       if (uio->uio_rw == UIO_READ
-           && (counter == 0 || AFS_CHUNKOFFSET(fileBase) == 0)) {
-           tdc = afs_FindDCache(avc, fileBase);
-           if (tdc) {
-               if (!(tdc->flags & DFNextStarted))
-                   afs_PrefetchChunk(avc, tdc, cred, &treq);
-               afs_PutDCache(tdc);
-           }
-       }
-       counter++;
-       if (code) break;
+    if (vp->v_type == VDIR) {
+       error = EISDIR;
+       goto out;
     }
-    if (didFakeOpen)
-       afs_FakeClose(avc, cred);
-    if (uio->uio_rw == UIO_WRITE && code == 0 && (avc->states & CDirty)) {
-       code = afs_DoPartialWrite(avc, &treq);
-    }
-    ReleaseWriteLock(&avc->lock);
-    afs_BozonUnlock(&avc->pvnLock, avc);
-    if (DO_FLUSH || (!newpage && (cnt < 10))) {
-       AFS_GUNLOCK();
-       ubc_flush_dirty(((struct vnode *)avc)->v_object, flags); 
-       AFS_GLOCK();
+    if (error = vn_lock(vp, LK_EXCLUSIVE, p)) {
+       goto out;
     }
+    AFS_GLOCK();
+    error = afs_link(VTOAFS(vp), VTOAFS(dvp), name, cnp->cn_cred);
+    AFS_GUNLOCK();
+    if (dvp != vp)
+       VOP_UNLOCK(vp,0, p);
+out:
+    DROPNAME();
+    return error;
+}
 
-    ObtainSharedLock(&avc->lock, 409);
-    if (!code) {
-       if (avc->vc_error) {
-           code = avc->vc_error;
-       }
-    }
-    /* This is required since we may still have dirty pages after the write.
-     * I could just let close do the right thing, but stat's before the close
-     * return the wrong length.
+int
+afs_vop_rename(ap)
+       struct vop_rename_args  /* {
+               struct vnode *a_fdvp;
+               struct vnode *a_fvp;
+               struct componentname *a_fcnp;
+               struct vnode *a_tdvp;
+               struct vnode *a_tvp;
+               struct componentname *a_tcnp;
+       } */ *ap;
+{
+    int error = 0;
+    struct componentname *fcnp = ap->a_fcnp;
+    char *fname;
+    struct componentname *tcnp = ap->a_tcnp;
+    char *tname;
+    struct vnode *tvp = ap->a_tvp;
+    register struct vnode *tdvp = ap->a_tdvp;
+    struct vnode *fvp = ap->a_fvp;
+    register struct vnode *fdvp = ap->a_fdvp;
+    struct proc *p=fcnp->cn_proc;
+
+    /*
+     * Check for cross-device rename.
      */
-    if (code == EDQUOT || code == ENOSPC) {
-       uio->uio_resid = save_resid;
-       UpgradeSToWLock(&avc->lock, 410);
-       osi_ReleaseVM(avc, cred);
-       ConvertWToSLock(&avc->lock);
+    if ((fvp->v_mount != tdvp->v_mount) ||
+       (tvp && (fvp->v_mount != tvp->v_mount))) {
+       error = EXDEV;
+abortit:
+       if (tdvp == tvp)
+           vrele(tdvp);
+       else
+           vput(tdvp);
+       if (tvp)
+           vput(tvp);
+       vrele(fdvp);
+       vrele(fvp);
+       return (error);
     }
-    ReleaseSharedLock(&avc->lock);
+    /*
+     * if fvp == tvp, we're just removing one name of a pair of
+     * directory entries for the same element.  convert call into rename.
+     ( (pinched from FreeBSD 4.4's ufs_rename())
+       
+     */
+    if (fvp == tvp) {
+       if (fvp->v_type == VDIR) {
+           error = EINVAL;
+           goto abortit;
+       }
 
-    if (!code && (ioflag & IO_SYNC) && (uio->uio_rw == UIO_WRITE)
-       && !AFS_NFSXLATORREQ(cred)) {
-       code = afs_fsync(avc, 0, cred, 0);
+       /* Release destination completely. */
+       vput(tdvp);
+       vput(tvp);
+
+       /* Delete source. */
+       vrele(fdvp);
+       vrele(fvp);
+       fcnp->cn_flags &= ~MODMASK;
+       fcnp->cn_flags |= LOCKPARENT | LOCKLEAF;
+       if ((fcnp->cn_flags & SAVESTART) == 0)
+           panic("afs_rename: lost from startdir");
+       fcnp->cn_nameiop = DELETE;
+        VREF(fdvp);
+       error=relookup(fdvp, &fvp, fcnp);
+        if (error == 0)
+                vrele(fdvp);
+        if (fvp == NULL) {
+                return (ENOENT);
+        }
+        
+       error=VOP_REMOVE(fdvp, fvp, fcnp);
+        if (fdvp == fvp)
+            vrele(fdvp);
+        else
+            vput(fdvp);
+        vput(fvp);
+        return (error);
     }
-out:
-    code = afs_CheckCode(code, &treq, 36);
-    AFS_GUNLOCK();
-    return code;
-}
+    if (error = vn_lock(fvp, LK_EXCLUSIVE, p))
+       goto abortit;
 
+    MALLOC(fname, char *, fcnp->cn_namelen+1, M_TEMP, M_WAITOK);
+    memcpy(fname, fcnp->cn_nameptr, fcnp->cn_namelen);
+    fname[fcnp->cn_namelen] = '\0';
+    MALLOC(tname, char *, tcnp->cn_namelen+1, M_TEMP, M_WAITOK);
+    memcpy(tname, tcnp->cn_nameptr, tcnp->cn_namelen);
+    tname[tcnp->cn_namelen] = '\0';
 
-/*
- * Now for some bad news.  Since we artificially hold on to vnodes by doing
- * and extra VNHOLD in afs_NewVCache(), there is no way for us to know
- * when we need to flush the pages when a program exits.  Particularly
- * if it closes the file after mapping it R/W.
- *
- */
-
-mp_afs_mmap(avc, offset, map, addrp, len, prot, maxprot, flags, cred)
-    register struct vcache *avc;
-    vm_offset_t offset;
-    vm_map_t map;
-    vm_offset_t *addrp;
-    vm_size_t len;
-    vm_prot_t prot;
-    vm_prot_t maxprot;
-    int flags;
-    struct ucred *cred;
-{
-    struct vp_mmap_args args;
-    register struct vp_mmap_args *ap = &args;
-    struct vnode *vp = (struct vnode *)avc;
-    int code;
-    struct vrequest treq;
-#if    !defined(DYNEL)
-    extern kern_return_t u_vp_create();
-#endif
 
     AFS_GLOCK();
-    afs_InitReq(&treq, cred);
-    code = afs_VerifyVCache(avc, &treq);
-    if (code) {
-      code = afs_CheckCode(code, &treq, 37);
-      AFS_GUNLOCK();
-      return code;
-    }
-    afs_BozonLock(&avc->pvnLock, avc);
-    osi_FlushPages(avc);       /* ensure old pages are gone */
-    afs_BozonUnlock(&avc->pvnLock, avc);
-    ObtainWriteLock(&avc->lock,166);
-    avc->states |= CMAPPED;
-    ReleaseWriteLock(&avc->lock);
-    ap->a_offset = offset;
-    ap->a_vaddr = addrp;
-    ap->a_size = len;
-    ap->a_prot = prot,
-    ap->a_maxprot = maxprot;
-    ap->a_flags = flags;
+    /* XXX use "from" or "to" creds? NFS uses "to" creds */
+    error = afs_rename(VTOAFS(fdvp), fname, VTOAFS(tdvp), tname, tcnp->cn_cred);
     AFS_GUNLOCK();
-    code = u_vp_create(map, vp->v_object, (vm_offset_t) ap);
-    AFS_GLOCK();
-    code = afs_CheckCode(code, &treq, 38);
-    AFS_GUNLOCK();
-    return code;
-}
 
+    FREE(fname, M_TEMP);
+    FREE(tname, M_TEMP);
+    if (tdvp == tvp)
+       vrele(tdvp);
+    else
+       vput(tdvp);
+    if (tvp)
+       vput(tvp);
+    vrele(fdvp);
+    vput(fvp);
+    return error;
+}
 
-int mp_afs_getpage(vop, offset, len, protp, pl, plsz, mape, addr, rw, cred)
-    vm_ubc_object_t vop;
-    vm_offset_t offset;
-    vm_size_t len;
-    vm_prot_t *protp;
-    vm_page_t *pl;
-    int plsz;
-    vm_map_entry_t mape;
-    vm_offset_t addr;
-    int rw;
-    struct ucred *cred;
+int
+afs_vop_mkdir(ap)
+       struct vop_mkdir_args /* {
+               struct vnode *a_dvp;
+               struct vnode **a_vpp;
+               struct componentname *a_cnp;
+               struct vattr *a_vap;
+       } */ *ap;
 {
-    register afs_int32 code;
-    struct vrequest treq;
-    int flags = 0;
-    int i, pages = (len + PAGE_SIZE - 1) >> page_shift;
-    vm_page_t *pagep;
-    vm_offset_t off;
-
-   struct vcache *avc =  (struct vcache *)vop->vu_vp;
-
-    /* first, obtain the proper lock for the VM system */
-
+    register struct vnode *dvp = ap->a_dvp;
+    register struct vattr *vap = ap->a_vap;
+    int error = 0;
+    struct vcache *vcp;
+    struct proc *p;
+
+    GETNAME();
+    p=cnp->cn_proc;
+#ifdef DIAGNOSTIC
+    if ((cnp->cn_flags & HASBUF) == 0)
+       panic("afs_vop_mkdir: no name");
+#endif
     AFS_GLOCK();
-    afs_InitReq(&treq, cred);
-    code = afs_VerifyVCache(avc, &treq);
-    if (code) {
-       *pl = VM_PAGE_NULL;
-       code = afs_CheckCode(code, &treq, 39); /* failed to get it */
-       AFS_GUNLOCK();
-       return code;
-    }
-       
-    /* clean all dirty pages for this vnode */
+    error = afs_mkdir(VTOAFS(dvp), name, vap, &vcp, cnp->cn_cred);
     AFS_GUNLOCK();
-    ubc_flush_dirty(vop,0);
-    AFS_GLOCK();
-
-    afs_BozonLock(&avc->pvnLock, avc);
-    ObtainWriteLock(&avc->lock,167);
-    afs_Trace4(afs_iclSetp, CM_TRACE_PAGEIN, ICL_TYPE_POINTER, avc,
-              ICL_TYPE_LONG, offset, ICL_TYPE_LONG, len,
-              ICL_TYPE_INT32, (int) rw);
-    for (i = 0; i < pages; i++) {
-       pagep = &pl[i];
-       off = offset + PAGE_SIZE * i;
-       if (protp) protp[i] = 0;
-       flags = 0;
-       ReleaseWriteLock(&avc->lock);
-       AFS_GUNLOCK();
-       code = ubc_lookup(((struct vnode *)avc)->v_object, off,
-                       PAGE_SIZE, PAGE_SIZE, pagep, &flags);
-       AFS_GLOCK();
-       ObtainWriteLock(&avc->lock,168);
-       if (code) {
-           goto out;
-       }
-       if(flags & B_NOCACHE) {         /* if (page) */
-           if ((rw & B_WRITE) && (offset+len >= avc->m.Length)) {
-               struct vnode *vp = (struct vnode *)avc;
-               /* we're doing a write operation past eof; no need to read it */
-               AFS_GUNLOCK();
-               ubc_page_zero(*pagep, 0, PAGE_SIZE);
-               ubc_page_release(*pagep, B_DONE);
-               AFS_GLOCK();
-           } else {
-               /* page wasn't cached, read it in. */
-               struct buf *bp;
-
-               AFS_GUNLOCK();
-               bp = ubc_bufalloc(*pagep, 1, PAGE_SIZE, 1, B_READ);
-               AFS_GLOCK();
-               bp->b_dev = 0;
-               bp->b_vp = (struct vnode *)avc;
-               bp->b_blkno = btodb(off);
-               ReleaseWriteLock(&avc->lock);
-               code = afs_ustrategy(bp, cred); /* do the I/O */
-               ObtainWriteLock(&avc->lock,169);
-               AFS_GUNLOCK();
-               ubc_sync_iodone(bp);
-               AFS_GLOCK();
-               if (code) {
-                   AFS_GUNLOCK();
-                   ubc_page_release(pl[i], 0);
-                   AFS_GLOCK();
-                   goto out;
-               }
-           }
-       }
-       if ((rw & B_READ) == 0) {
-           AFS_GUNLOCK();
-           ubc_page_dirty(pl[i]);
-           AFS_GLOCK();
-       } else {
-           if (protp && (flags & B_DIRTY) == 0) {
-               protp[i] = VM_PROT_WRITE;
-           }
-       }
+    if (error) {
+       vput(dvp);
+       DROPNAME();
+       return(error);
     }
-out:
-    pl[i] = VM_PAGE_NULL;
-    ReleaseWriteLock(&avc->lock);
-    afs_BozonUnlock(&avc->pvnLock, avc);
-    afs_Trace3(afs_iclSetp, CM_TRACE_PAGEINDONE, ICL_TYPE_INT32, code,
-              ICL_TYPE_POINTER, *pagep, ICL_TYPE_INT32, flags);
-    code = afs_CheckCode(code, &treq, 40);
-    AFS_GUNLOCK();
-    return code;
+    if (vcp) {
+       *ap->a_vpp = AFSTOV(vcp);
+       vn_lock(AFSTOV(vcp), LK_EXCLUSIVE|LK_RETRY, p);
+    } else
+       *ap->a_vpp = 0;
+    DROPNAME();
+    return error;
 }
 
-
-int mp_afs_putpage(vop, pl, pcnt, flags, cred)
-    vm_ubc_object_t vop;
-    vm_page_t *pl;
-    int pcnt;
-    int flags;
-    struct ucred *cred;
+int
+afs_vop_rmdir(ap)
+       struct vop_rmdir_args /* {
+               struct vnode *a_dvp;
+               struct vnode *a_vp;
+               struct componentname *a_cnp;
+       } */ *ap;
 {
-    register afs_int32 code=0;
-    struct vcache *avc = (struct vcache *)vop->vu_vp;
-    struct vnode *vp = (struct vnode *)avc;
-    int i;
+    int error = 0;
+    register struct vnode *vp = ap->a_vp;
+    register struct vnode *dvp = ap->a_dvp;
 
+    GETNAME();
     AFS_GLOCK();
-    afs_Trace4(afs_iclSetp, CM_TRACE_PAGEOUT, ICL_TYPE_POINTER, avc,
-              ICL_TYPE_INT32, pcnt, ICL_TYPE_INT32, vp->v_flag,
-              ICL_TYPE_INT32, flags);
-    if (flags & B_UBC) {
-       AFS_GUNLOCK();
-       VN_LOCK(vp);
-       if (vp->v_flag & VXLOCK) {
-           VN_UNLOCK(vp);
-           for (i = 0; i < pcnt; i++) {
-               ubc_page_release(pl[i], B_DONE|B_DIRTY);
-               pl[i] = VM_PAGE_NULL;
-           }
-           return(0);
-       } else {
-           VN_UNLOCK(vp);
-       }
-       AFS_GLOCK();
-    }
-
-    /* first, obtain the proper lock for the VM system */
-    afs_BozonLock(&avc->pvnLock, avc);
-    ObtainWriteLock(&avc->lock,170);
-    for (i = 0; i < pcnt; i++) {
-       vm_page_t page = pl[i];
-       struct buf *bp;
-
-       /* write it out */
-       AFS_GUNLOCK();
-       bp = ubc_bufalloc(page, 1, PAGE_SIZE, 1, B_WRITE);
-       AFS_GLOCK();
-       bp->b_dev = 0;
-       bp->b_vp = (struct vnode *)avc;
-       bp->b_blkno = btodb(page->pg_offset);
-       ReleaseWriteLock(&avc->lock);
-       code = afs_ustrategy(bp, cred); /* do the I/O */
-       ObtainWriteLock(&avc->lock,171);
-       AFS_GUNLOCK();
-       ubc_sync_iodone(bp);
-       AFS_GLOCK();
-       if (code) {
-           goto done;
-       } else {
-           pl[i] = VM_PAGE_NULL;
-       }
-    }
-done:
-    ReleaseWriteLock(&avc->lock);
-    afs_BozonUnlock(&avc->pvnLock, avc);
-    afs_Trace2(afs_iclSetp, CM_TRACE_PAGEOUTDONE, ICL_TYPE_INT32, code,
-              ICL_TYPE_INT32, avc->m.Length);
+    error = afs_rmdir(VTOAFS(dvp), name, cnp->cn_cred);
     AFS_GUNLOCK();
-    return code;
+    DROPNAME();
+    return error;
 }
 
-
-int mp_afs_swap(avc, swapop, argp)
-    struct vcache *avc;
-    vp_swap_op_t swapop;
-    vm_offset_t argp;
+int
+afs_vop_symlink(ap)
+       struct vop_symlink_args /* {
+               struct vnode *a_dvp;
+               struct vnode **a_vpp;
+               struct componentname *a_cnp;
+               struct vattr *a_vap;
+               char *a_target;
+       } */ *ap;
 {
-    return EIO;
-}
+    register struct vnode *dvp = ap->a_dvp;
+    int error = 0;
+    /* NFS ignores a_vpp; so do we. */
 
-int mp_afs_syncdata(avc, flag, offset, length, cred)
-    struct vcache *avc;
-    int flag;
-    vm_offset_t offset;
-    vm_size_t length;
-    struct ucred *cred;
-{
-    /* NFS V3 makes this call, ignore it. We'll sync the data in afs_fsync. */
-    if (AFS_NFSXLATORREQ(cred))
-       return 0;
-    else
-       return EINVAL;
+    GETNAME();
+    AFS_GLOCK();
+    error = afs_symlink(VTOAFS(dvp), name, ap->a_vap, ap->a_target,
+                       cnp->cn_cred);
+    AFS_GUNLOCK();
+    DROPNAME();
+    return error;
 }
 
-/* a freelist of one */
-struct buf *afs_bread_freebp = 0;
-
-/*
- *  Only rfs_read calls this, and it only looks at bp->b_un.b_addr.
- *  Thus we can use fake bufs (ie not from the real buffer pool).
- */
-mp_afs_bread(vp, lbn, bpp, cred)
-       struct ucred *cred;
-       struct vnode *vp;
-       daddr_t lbn;
-       struct buf **bpp;
+int
+afs_vop_readdir(ap)
+       struct vop_readdir_args /* {
+               struct vnode *a_vp;
+               struct uio *a_uio;
+               struct ucred *a_cred;
+               int *a_eofflag;
+               u_long *a_cookies;
+               int ncookies;
+       } */ *ap;
 {
-       int offset, fsbsize, error;
-       struct buf *bp;
-       struct iovec iov;
-       struct uio uio;
-
-       AFS_GLOCK();
-       AFS_STATCNT(afs_bread);
-       fsbsize = vp->v_vfsp->vfs_bsize;
-       offset = lbn * fsbsize;
-       if (afs_bread_freebp) {
-               bp = afs_bread_freebp;
-               afs_bread_freebp = 0;
-       } else {
-               bp = (struct buf *) AFS_KALLOC(sizeof(*bp));
-               bp->b_un.b_addr = (caddr_t) AFS_KALLOC(fsbsize);
+    int error;
+    off_t off;
+/*    printf("readdir %x cookies %x ncookies %d\n", ap->a_vp, ap->a_cookies,
+          ap->a_ncookies); */
+    off=ap->a_uio->uio_offset;
+    AFS_GLOCK();
+    error= afs_readdir(VTOAFS(ap->a_vp), ap->a_uio, ap->a_cred,
+                      ap->a_eofflag);
+    AFS_GUNLOCK();
+    if (!error && ap->a_ncookies != NULL) {
+       struct uio *uio = ap->a_uio;
+       const struct dirent *dp, *dp_start, *dp_end;
+       int ncookies;
+       u_long *cookies, *cookiep;
+
+       if (uio->uio_segflg != UIO_SYSSPACE || uio->uio_iovcnt != 1)
+           panic("afs_readdir: burned cookies");
+       dp = (const struct dirent *)
+           ((const char *)uio->uio_iov->iov_base - (uio->uio_offset - off));
+
+       dp_end = (const struct dirent *) uio->uio_iov->iov_base;
+       for (dp_start = dp, ncookies = 0;
+            dp < dp_end;
+            dp = (const struct dirent *)((const char *) dp + dp->d_reclen))
+           ncookies++;
+
+       MALLOC(cookies, u_long *, ncookies * sizeof(u_long),
+              M_TEMP, M_WAITOK);
+       for (dp = dp_start, cookiep = cookies;
+            dp < dp_end;
+            dp = (const struct dirent *)((const char *) dp + dp->d_reclen)) {
+           off += dp->d_reclen;
+           *cookiep++ = off;
        }
+       *ap->a_cookies = cookies;
+       *ap->a_ncookies = ncookies;
+    }
 
-       iov.iov_base = bp->b_un.b_addr;
-       iov.iov_len = fsbsize;
-       uio.afsio_iov = &iov;
-       uio.afsio_iovcnt = 1;
-       uio.afsio_seg = AFS_UIOSYS;
-       uio.afsio_offset = offset;
-       uio.afsio_resid = fsbsize;
-       *bpp = 0;
-       error = afs_read((struct vcache *)vp, &uio, cred, lbn, bpp, 0);
-       if (error) {
-               afs_bread_freebp = bp;
-               AFS_GUNLOCK();
-               return error;
-       }
-       if (*bpp) {
-               afs_bread_freebp = bp;
-       } else {
-               *(struct buf **)&bp->b_vp = bp; /* mark as fake */
-               *bpp = bp;
-       }
-       AFS_GUNLOCK();
-       return 0;
+    return error;
 }
 
-
-mp_afs_brelse(vp, bp)
-struct vnode *vp;
-struct buf *bp;
+int
+afs_vop_readlink(ap)
+       struct vop_readlink_args /* {
+               struct vnode *a_vp;
+               struct uio *a_uio;
+               struct ucred *a_cred;
+       } */ *ap;
 {
+    int error;
+/*    printf("readlink %x\n", ap->a_vp);*/
     AFS_GLOCK();
-    AFS_STATCNT(afs_brelse);
-       if ((struct buf *)bp->b_vp != bp) { /* not fake */
-           brelse(bp);
-       } else if (afs_bread_freebp) {
-               AFS_KFREE(bp->b_un.b_addr, vp->v_vfsp->vfs_bsize);
-               AFS_KFREE(bp, sizeof(*bp));
-       } else {
-               afs_bread_freebp = bp;
-       }
+    error= afs_readlink(VTOAFS(ap->a_vp), ap->a_uio, ap->a_cred);
     AFS_GUNLOCK();
+    return error;
 }
 
+extern int prtactive;
 
-mp_afs_bmap(avc, abn, anvp, anbn)
-    register struct vcache *avc;
-    afs_int32 abn, *anbn;
-    struct vcache **anvp;
+int
+afs_vop_inactive(ap)
+       struct vop_inactive_args /* {
+               struct vnode *a_vp;
+                struct proc *a_p;
+       } */ *ap;
 {
+    register struct vnode *vp = ap->a_vp;
+
+    if (prtactive && vp->v_usecount != 0)
+       vprint("afs_vop_inactive(): pushing active", vp);
+
     AFS_GLOCK();
-    AFS_STATCNT(afs_bmap);
-    if (anvp)
-       *anvp = avc;
-    if (anbn)
-       *anbn = abn * (8192 / DEV_BSIZE);   /* in 512 byte units */
+    afs_InactiveVCache(VTOAFS(vp), 0);   /* decrs ref counts */
     AFS_GUNLOCK();
+    VOP_UNLOCK(vp, 0, ap->a_p);
     return 0;
 }
 
-
-/* real strategy */
-mp_afs_strategy (abp)
-    register struct buf *abp;
+int
+afs_vop_reclaim(ap)
+       struct vop_reclaim_args /* {
+               struct vnode *a_vp;
+       } */ *ap;
 {
-    register afs_int32 code;
+    int error;
+    int sl;
+    register struct vnode *vp = ap->a_vp;
+
+    cache_purge(vp);                    /* just in case... */
 
+#if 0 
     AFS_GLOCK();
-    AFS_STATCNT(afs_strategy);
-    code = afs_osi_MapStrategy(afs_ustrategy, abp);
+    error = afs_FlushVCache(VTOAFS(vp), &sl); /* tosses our stuff from vnode */
     AFS_GUNLOCK();
-    return code;
+    ubc_unlink(vp);
+    if (!error && vp->v_data)
+       panic("afs_reclaim: vnode not cleaned");
+    return error;
+#else
+   if (vp->v_usecount == 2) {
+        vprint("reclaim count==2", vp);
+   } else if (vp->v_usecount == 1) {
+        vprint("reclaim count==1", vp);
+   } else 
+        vprint("reclaim bad count", vp);
+
+   return 0;
+#endif
 }
 
-
-mp_afs_refer(vm_ubc_object_t vop)
+int
+afs_vop_lock(ap)
+       struct vop_lock_args /* {
+               struct vnode *a_vp;
+       } */ *ap;
 {
-        VREF(vop->vu_vp);
-}
+       register struct vnode *vp = ap->a_vp;
+       register struct vcache *avc = VTOAFS(vp);
 
+       if (vp->v_tag == VT_NON)
+               return (ENOENT);
+       return (lockmgr(&avc->rwlock, ap->a_flags, &vp->v_interlock,
+                ap->a_p));
+}
 
-mp_afs_release(vm_ubc_object_t vop)
+int
+afs_vop_unlock(ap)
+       struct vop_unlock_args /* {
+               struct vnode *a_vp;
+       } */ *ap;
 {
-        vrele(vop->vu_vp);
-}
+    struct vnode *vp = ap->a_vp;
+    struct vcache *avc = VTOAFS(vp);
+    return (lockmgr(&avc->rwlock, ap->a_flags | LK_RELEASE,
+            &vp->v_interlock, ap->a_p));
 
+}
 
-mp_afs_write_check(vm_ubc_object_t vop, vm_page_t pp)
+int
+afs_vop_bmap(ap)
+       struct vop_bmap_args /* {
+               struct vnode *a_vp;
+               daddr_t  a_bn;
+               struct vnode **a_vpp;
+               daddr_t *a_bnp;
+               int *a_runp;
+               int *a_runb;
+       } */ *ap;
 {
-        return TRUE;
+    struct vcache *vcp;
+    int error;
+    if (ap->a_bnp) {
+       *ap->a_bnp = ap->a_bn * (PAGE_SIZE / DEV_BSIZE);
+    }
+    if (ap->a_vpp) {
+       *ap->a_vpp = ap->a_vp;
+    }
+       if (ap->a_runp != NULL)
+               *ap->a_runp = 0;
+       if (ap->a_runb != NULL)
+               *ap->a_runb = 0;
+    return 0;
+}
+int
+afs_vop_strategy(ap)
+       struct vop_strategy_args /* {
+               struct buf *a_bp;
+       } */ *ap;
+{
+    int error;
+    AFS_GLOCK();
+    error= afs_ustrategy(ap->a_bp);
+    AFS_GUNLOCK();
+    return error;
+}
+int
+afs_vop_print(ap)
+       struct vop_print_args /* {
+               struct vnode *a_vp;
+       } */ *ap;
+{
+    register struct vnode *vp = ap->a_vp;
+    register struct vcache *vc = VTOAFS(ap->a_vp);
+    int s = vc->states;
+    printf("tag %d, fid: %ld.%x.%x.%x, opens %d, writers %d", vp->v_tag, vc->fid.Cell,
+          vc->fid.Fid.Volume, vc->fid.Fid.Vnode, vc->fid.Fid.Unique, vc->opens,
+          vc->execsOrWriters);
+    printf("\n  states%s%s%s%s%s", (s&CStatd) ? " statd" : "", (s&CRO) ? " readonly" : "",(s&CDirty) ? " dirty" : "",(s&CMAPPED) ? " mapped" : "", (s&CVFlushed) ? " flush in progress" : "");
+    printf("\n");
+    return 0;
 }
 
-
-
-struct vfs_ubcops afs_ubcops = {
-        mp_afs_refer,              /* refer vnode */
-        mp_afs_release,            /* release vnode */
-        mp_afs_getpage,            /* get page */
-        mp_afs_putpage,            /* put page */
-        mp_afs_write_check,        /* check writablity */
-};
-#endif /* 0 */
+int
+afs_vop_islocked(ap)
+       struct vop_islocked_args /* {
+               struct vnode *a_vp;
+       } */ *ap;
+{
+    struct vcache *vc = VTOAFS(ap->a_vp);
+    return lockstatus(&vc->rwlock, ap->a_p);
+}
 
 /*
- * Cover function for lookup name using OSF equivalent, namei()
- *
- * Note, the result vnode (ni_vp) in the namei data structure is remains
- * locked after return.
+ * Advisory record locking support (fcntl() POSIX style)
  */
-lookupname(namep, seg, follow, dvpp, cvpp)
-    char *namep;               /* path name */
-    int seg;           /* address space containing name */
-    int follow;                /* follow symbolic links */
-    struct vnode **dvpp;       /* result, containing parent vnode */
-    struct vnode **cvpp;       /* result, containing final component vnode */
+int
+afs_vop_advlock(ap)
+       struct vop_advlock_args /* {
+               struct vnode *a_vp;
+               caddr_t  a_id;
+               int  a_op;
+               struct flock *a_fl;
+               int  a_flags;
+       } */ *ap;
 {
-    /* Should I use free-bee in u-area? */
-    struct nameidata *ndp = &u.u_nd;
     int error;
-
-    ndp->ni_nameiop = ((follow) ? (LOOKUP|FOLLOW) : (LOOKUP));
-    ndp->ni_segflg = seg;
-    ndp->ni_dirp = namep;
-    error = namei(ndp);
-    if (dvpp != (struct vnode **)0)
-       *dvpp = ndp->ni_dvp;
-    if (cvpp != (struct vnode **)0)
-       *cvpp = ndp->ni_vp;
-    return(error);
+    struct proc *p=curproc;
+    struct ucred cr;
+    cr=*p->p_cred->pc_ucred;
+    AFS_GLOCK();
+    error= afs_lockctl(VTOAFS(ap->a_vp), ap->a_fl, ap->a_op, &cr,
+                      (int) ap->a_id);
+    AFS_GUNLOCK();
+    return error;
 }
 
index 7c4da8ffe57786d703b6a3ca602208e6bac82c48..ded87a16d47d2b1e4cf598a86641cacb1709580e 100644 (file)
@@ -1,12 +1,3 @@
-/*
- * Copyright 2000, International Business Machines Corporation and others.
- * All Rights Reserved.
- * 
- * This software has been released under the terms of the IBM Public
- * License.  For details, see the LICENSE file in the top-level source
- * directory or online at http://www.openafs.org/dl/license10.html
- */
-
 /*
  * This file is produced automatically.
  * Do not modify anything in here by hand.
@@ -467,6 +458,27 @@ static __inline int VOP_POLL(vp, events, cred, p)
        rc = VCALL(vp, VOFFSET(vop_poll), &a);
        return (rc);
 }
+struct vop_kqfilter_args {
+       struct vnodeop_desc *a_desc;
+       struct vnode *a_vp;
+       struct knote *a_kn;
+};
+extern struct vnodeop_desc vop_kqfilter_desc;
+static __inline int VOP_KQFILTER __P((
+       struct vnode *vp,
+       struct knote *kn));
+static __inline int VOP_KQFILTER(vp, kn)
+       struct vnode *vp;
+       struct knote *kn;
+{
+       struct vop_kqfilter_args a;
+       int rc;
+       a.a_desc = VDESC(vop_kqfilter);
+       a.a_vp = vp;
+       a.a_kn = kn;
+       rc = VCALL(vp, VOFFSET(vop_kqfilter), &a);
+       return (rc);
+}
 struct vop_revoke_args {
        struct vnodeop_desc *a_desc;
        struct vnode *a_vp;
@@ -1346,3 +1358,66 @@ static __inline int VOP_SETEXTATTR(vp, name, uio, cred, p)
        rc = VCALL(vp, VOFFSET(vop_setextattr), &a);
        return (rc);
 }
+struct vop_createvobject_args {
+       struct vnodeop_desc *a_desc;
+       struct vnode *a_vp;
+       struct ucred *a_cred;
+       struct proc *a_p;
+};
+extern struct vnodeop_desc vop_createvobject_desc;
+static __inline int VOP_CREATEVOBJECT __P((
+       struct vnode *vp,
+       struct ucred *cred,
+       struct proc *p));
+static __inline int VOP_CREATEVOBJECT(vp, cred, p)
+       struct vnode *vp;
+       struct ucred *cred;
+       struct proc *p;
+{
+       struct vop_createvobject_args a;
+       int rc;
+       a.a_desc = VDESC(vop_createvobject);
+       a.a_vp = vp;
+       a.a_cred = cred;
+       a.a_p = p;
+       rc = VCALL(vp, VOFFSET(vop_createvobject), &a);
+       return (rc);
+}
+struct vop_destroyvobject_args {
+       struct vnodeop_desc *a_desc;
+       struct vnode *a_vp;
+};
+extern struct vnodeop_desc vop_destroyvobject_desc;
+static __inline int VOP_DESTROYVOBJECT __P((
+       struct vnode *vp));
+static __inline int VOP_DESTROYVOBJECT(vp)
+       struct vnode *vp;
+{
+       struct vop_destroyvobject_args a;
+       int rc;
+       a.a_desc = VDESC(vop_destroyvobject);
+       a.a_vp = vp;
+       rc = VCALL(vp, VOFFSET(vop_destroyvobject), &a);
+       return (rc);
+}
+struct vop_getvobject_args {
+       struct vnodeop_desc *a_desc;
+       struct vnode *a_vp;
+       struct vm_object **a_objpp;
+};
+extern struct vnodeop_desc vop_getvobject_desc;
+static __inline int VOP_GETVOBJECT __P((
+       struct vnode *vp,
+       struct vm_object **objpp));
+static __inline int VOP_GETVOBJECT(vp, objpp)
+       struct vnode *vp;
+       struct vm_object **objpp;
+{
+       struct vop_getvobject_args a;
+       int rc;
+       a.a_desc = VDESC(vop_getvobject);
+       a.a_vp = vp;
+       a.a_objpp = objpp;
+       rc = VCALL(vp, VOFFSET(vop_getvobject), &a);
+       return (rc);
+}
index 7d7a3bd5b2016a9ed932edbe97a6643ecebd3b8d..afe36c49a45b6906528fcd5e0f91e348b63cdb0b 100644 (file)
@@ -10,7 +10,7 @@
 #include <afsconfig.h>
 #include "../afs/param.h"
 
-RCSID("$Header: /tmp/cvstemp/openafs/src/afs/SOLARIS/osi_file.c,v 1.1.1.7 2001/10/14 17:59:09 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/afs/SOLARIS/osi_file.c,v 1.1.1.8 2002/09/26 18:58:18 hartmans Exp $");
 
 #include "../afs/sysincludes.h"        /* Standard vendor system headers */
 #include "../afs/afsincludes.h"        /* Afs-based standard headers */
@@ -339,13 +339,9 @@ afs_osi_Write(afile, offset, aptr, asize)
         osi_Panic("afs_osi_Write called with null param");
     if (offset != -1) afile->offset = offset;
     AFS_GUNLOCK();
-#ifdef AFS_SUN59_ENV
-    code = gop_rdwr(UIO_WRITE, afile->vnode, (caddr_t) aptr, asize, afile->offset,
-                 AFS_UIOSYS, 0, curproc->p_fsz_ctl.rlim_cur, &afs_osi_cred, &resid);
-#else
-    code = gop_rdwr(UIO_WRITE, afile->vnode, (caddr_t) aptr, asize, afile->offset,
-                 AFS_UIOSYS, 0,  (u.u_rlimit[RLIMIT_FSIZE].rlim_cur), &afs_osi_cred, &resid);
-#endif
+    code = gop_rdwr(UIO_WRITE, afile->vnode, (caddr_t) aptr, asize,
+                   afile->offset, AFS_UIOSYS, 0, RLIM64_INFINITY,
+                   &afs_osi_cred, &resid);
     AFS_GLOCK();
     if (code == 0) {
        code = asize - resid;
index 3b2a3160aed363bb05a0058bfb533f44bda4deb6..af39ae4e64e3897faac75ec5aca2ad697da65bdc 100644 (file)
@@ -21,7 +21,7 @@
 #include <afsconfig.h>
 #include "../afs/param.h"
 
-RCSID("$Header: /tmp/cvstemp/openafs/src/afs/VNOPS/afs_vnop_attrs.c,v 1.1.1.10 2002/08/02 04:29:00 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/afs/VNOPS/afs_vnop_attrs.c,v 1.1.1.11 2002/09/26 18:58:21 hartmans Exp $");
 
 #include "../afs/sysincludes.h"        /* Standard vendor system headers */
 #include "../afs/afsincludes.h"        /* Afs-based standard headers */
@@ -105,7 +105,17 @@ afs_CopyOutAttrs(avc, attrs)
      * anyway, so the difference between 512K and 1000000 shouldn't matter
      * much, and "&" is a lot faster than "%".
      */
-#if defined(AFS_SGI_ENV) || defined(AFS_SUN5_ENV) || defined(AFS_AIX41_ENV) || defined(AFS_DARWIN_ENV) || defined(AFS_FBSD_ENV)
+#if defined(AFS_DARWIN_ENV) || defined(AFS_FBSD_ENV)
+    /* nfs on these systems puts an 0 in nsec and stores the nfs usec (aka 
+       dataversion) in va_gen */
+
+    attrs->va_atime.tv_nsec = attrs->va_mtime.tv_nsec =
+       attrs->va_ctime.tv_nsec =0;
+    attrs->va_blocksize = PAGESIZE;            /* XXX Was 8192 XXX */
+    attrs->va_gen = hgetlo(avc->m.DataVersion);
+    attrs->va_flags = 0;
+#else
+#if defined(AFS_SGI_ENV) || defined(AFS_SUN5_ENV) || defined(AFS_AIX41_ENV) 
     attrs->va_atime.tv_nsec = attrs->va_mtime.tv_nsec =
        attrs->va_ctime.tv_nsec =
            (hgetlo(avc->m.DataVersion) & 0x7ffff) * 1000;
@@ -120,6 +130,7 @@ afs_CopyOutAttrs(avc, attrs)
            (hgetlo(avc->m.DataVersion) & 0x7ffff);
     attrs->va_blocksize = PAGESIZE;            /* XXX Was 8192 XXX */
 #endif
+#endif
 #ifdef AFS_DEC_ENV
     /* Have to use real device #s in Ultrix, since that's how FS type is
      * encoded.  If rdev doesn't match Ultrix equivalent of statfs's rdev, then
@@ -136,14 +147,14 @@ afs_CopyOutAttrs(avc, attrs)
      * Below return 0 (and not 1) blocks if the file is zero length. This conforms
      * better with the other filesystems that do return 0.     
      */
-#if   defined(AFS_OSF_ENV) || defined(AFS_DARWIN_ENV)
+#if   defined(AFS_OSF_ENV)
 #ifdef va_size_rsv
     attrs->va_size_rsv = 0;
 #endif
 /* XXX do this */
 /*    attrs->va_gen = avc->m.DataVersion;*/
     attrs->va_flags = 0;
-#endif /* AFS_OSF_ENV || AFS_DARWIN_ENV */
+#endif /* AFS_OSF_ENV */
 
 #if !defined(AFS_OSF_ENV) && !defined(AFS_DARWIN_ENV) && !defined(AFS_FBSD_ENV)
 #if !defined(AFS_HPUX_ENV)
@@ -219,6 +230,12 @@ afs_getattr(OSI_VC_ARG(avc), attrs, acred)
        return code;
     }
 #endif
+#if defined(AFS_DARWIN_ENV)
+    if (avc->states & CUBCinit) {
+       code = afs_CopyOutAttrs(avc, attrs);
+       return code;
+    }
+#endif
 
 #if defined(AFS_SUN_ENV) || defined(AFS_ALPHA_ENV) || defined(AFS_SUN5_ENV)
     afs_BozonLock(&avc->pvnLock, avc);
index 09e7f390b213117635473ebac169b695d02af8fc..23e8685c25b0feae085fe47a9ea92e3c7b9ff776 100644 (file)
@@ -15,7 +15,7 @@
 #include <afsconfig.h>
 #include "../afs/param.h"
 
-RCSID("$Header: /tmp/cvstemp/openafs/src/afs/VNOPS/afs_vnop_flock.c,v 1.1.1.10 2002/08/02 04:29:01 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/afs/VNOPS/afs_vnop_flock.c,v 1.1.1.11 2002/09/26 18:58:22 hartmans Exp $");
 
 #include "../afs/sysincludes.h"        /* Standard vendor system headers */
 #include "../afs/afsincludes.h"        /* Afs-based standard headers */
@@ -37,7 +37,7 @@ RCSID("$Header: /tmp/cvstemp/openafs/src/afs/VNOPS/afs_vnop_flock.c,v 1.1.1.10 2
 static int GetFlockCount(struct vcache *avc, struct vrequest *areq);
 
 void lockIdSet(flock, slp, clid)
-   int clid;  /* non-zero on SGI, OSF, SunOS */
+   int clid;  /* non-zero on SGI, OSF, SunOS, Darwin, xBSD *//* XXX ptr type */
     struct SimpleLocks *slp;
     struct AFS_FLOCK *flock;
 {
@@ -175,10 +175,11 @@ static int lockIdcmp2(flock1, vp, alp, onlymine, clid)
       }
 #endif
       if ((flock1->l_pid == alp->pid) || 
-#if defined(AFS_AIX41_ENV) || defined(AFS_LINUX20_ENV) || defined(AFS_HPUX_ENV) || defined(AFS_DARWIN_ENV) || defined(AFS_FBSD_ENV)
+#if defined(AFS_AIX41_ENV) || defined(AFS_LINUX20_ENV) || defined(AFS_HPUX_ENV)
          (!onlymine && (flock1->l_pid == getppid()))
 #else
-#if defined(AFS_SGI65_ENV)
+#if defined(AFS_SGI65_ENV) || defined(AFS_DARWIN_ENV) || defined(AFS_FBSD_ENV) 
+          /* XXX check this. used to be *only* irix for some reason. */ 
          (!onlymine && (flock1->l_pid == clid))
 #else
          (!onlymine && (flock1->l_pid == procp->p_ppid))
@@ -886,11 +887,7 @@ afs_xflock () {
     uap = (struct a *)args;
     getf(&fd, uap->fd, FILE_FLAGS_NULL, &u.u_file_state);
 #else /* AFS_OSF_ENV */
-#if defined(AFS_FBSD_ENV)
-    uap = (struct a *)u.u_ap;
-#else
     uap = (struct a *)u.u_ap;
-#endif /* AFS_FBSD_ENV */
     fd = getf(uap->fd);
 #endif
     if (!fd) {
index 13b686c61d516204617a0a6517d5a21f043670b9..12e7f4260193cfb07c6c531cb88c0d1f63c332a9 100644 (file)
@@ -19,7 +19,7 @@
 #include <afsconfig.h>
 #include "../afs/param.h"
 
-RCSID("$Header: /tmp/cvstemp/openafs/src/afs/VNOPS/afs_vnop_read.c,v 1.1.1.6 2002/08/02 04:29:03 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/afs/VNOPS/afs_vnop_read.c,v 1.1.1.7 2002/09/26 18:58:24 hartmans Exp $");
 
 #include "../afs/sysincludes.h"        /* Standard vendor system headers */
 #include "../afs/afsincludes.h"        /* Afs-based standard headers */
@@ -430,6 +430,13 @@ afs_UFSReadFast(avc, auio, acred, albn, abpp, noLock)
             code = VOP_READ(tfile->vnode, auio, 0, &afs_osi_cred);
             VOP_UNLOCK(tfile->vnode, 0, current_proc());
             AFS_GLOCK();
+#else
+#if defined(AFS_FBSD_ENV)
+            AFS_GUNLOCK();
+            VOP_LOCK(tfile->vnode, LK_EXCLUSIVE, curproc);
+            code = VOP_READ(tfile->vnode, auio, 0, &afs_osi_cred);
+            VOP_UNLOCK(tfile->vnode, 0, curproc);
+            AFS_GLOCK();
 #else
            code = VOP_RDWR(tfile->vnode, auio, UIO_READ, 0, &afs_osi_cred);
 #endif
@@ -438,6 +445,7 @@ afs_UFSReadFast(avc, auio, acred, albn, abpp, noLock)
 #endif
 #endif
 #endif
+#endif
 #endif
            auio->afsio_offset += avc->quick.minLoc;
            osi_UFSClose(tfile);
@@ -768,8 +776,16 @@ tagain:
             code = VOP_READ(tfile->vnode, &tuio, 0, &afs_osi_cred);
             VOP_UNLOCK(tfile->vnode, 0, current_proc());
             AFS_GLOCK();
+#else  
+#if defined(AFS_FBSD_ENV)
+            AFS_GUNLOCK();
+            VOP_LOCK(tfile->vnode, LK_EXCLUSIVE, curproc);
+            code = VOP_READ(tfile->vnode, &tuio, 0, &afs_osi_cred);
+            VOP_UNLOCK(tfile->vnode, 0, curproc);
+            AFS_GLOCK();
 #else
-           code = VOP_RDWR(tfile->vnode, &tuio, UIO_READ, 0, &afs_osi_cred);
+    code = VOP_RDWR(tfile->vnode, &tuio, UIO_READ, 0, &afs_osi_cred);
+#endif
 #endif
 #endif
 #endif
index 3b1a57609b815a925859bb0ad92698c866c5e186..84765b8b354ba8b9f5e4d84cdb6d44fca96e1f60 100644 (file)
@@ -15,7 +15,7 @@
 #include <afsconfig.h>
 #include "../afs/param.h"
 
-RCSID("$Header: /tmp/cvstemp/openafs/src/afs/VNOPS/afs_vnop_strategy.c,v 1.1.1.8 2002/05/10 23:44:25 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/afs/VNOPS/afs_vnop_strategy.c,v 1.1.1.9 2002/09/26 18:58:25 hartmans Exp $");
 
 #if !defined(AFS_HPUX_ENV) && !defined(AFS_SGI_ENV) && !defined(AFS_LINUX20_ENV)
 
@@ -171,12 +171,13 @@ afs_ustrategy(abp)
 #endif
     }
 #if    !defined(AFS_AIX32_ENV) && !defined(AFS_SUN5_ENV)
-#ifdef AFS_DUX40_ENV
+#if defined(AFS_DUX40_ENV) || defined(AFS_FBSD_ENV)
     if (code) {
        abp->b_error = code;
        abp->b_flags |= B_ERROR;
     }
     biodone(abp);
+#if defined(AFS_DUX40_ENV)
     if (code && !(abp->b_flags & B_READ)) {
        /* prevent ubc from retrying writes */
        AFS_GUNLOCK();
@@ -185,9 +186,10 @@ afs_ustrategy(abp)
                       PAGE_SIZE, B_INVAL);
        AFS_GLOCK();
     }
-#else  /* AFS_DUX40_ENV */
+#endif
+#else  /* AFS_DUX40_ENV || AFS_FBSD_ENV */
     iodone(abp);
-#endif /* AFS_DUX40_ENV */
+#endif /* AFS_DUX40_ENV || AFS_FBSD_ENV */
 #endif
 #ifdef AFS_AIX32_ENV
     crfree(credp);
index cdfbca7260c0ef186328c1642e878d38c82a25ba..933cc4dcf98edda05e9618030ec4ca326e06fd67 100644 (file)
@@ -20,7 +20,7 @@
 #include <afsconfig.h>
 #include "../afs/param.h"
 
-RCSID("$Header: /tmp/cvstemp/openafs/src/afs/VNOPS/afs_vnop_write.c,v 1.1.1.11 2002/08/02 04:29:04 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/afs/VNOPS/afs_vnop_write.c,v 1.1.1.12 2002/09/26 18:58:25 hartmans Exp $");
 
 #include "../afs/sysincludes.h"        /* Standard vendor system headers */
 #include "../afs/afsincludes.h"        /* Afs-based standard headers */
@@ -536,15 +536,23 @@ afs_UFSWrite(avc, auio, aio, acred, noLock)
        code = osi_file_uio_rdwr(tfile, &tuio, UIO_WRITE);
        AFS_GLOCK();
 #else
-#if defined(AFS_DARWIN_ENV) || defined(AFS_FBSD_ENV)
+#if defined(AFS_DARWIN_ENV)
         AFS_GUNLOCK();
         VOP_LOCK(tfile->vnode, LK_EXCLUSIVE, current_proc());
         code = VOP_WRITE(tfile->vnode, &tuio, 0, &afs_osi_cred);
         VOP_UNLOCK(tfile->vnode, 0, current_proc());
         AFS_GLOCK();
+#else
+#if defined(AFS_FBSD_ENV)
+        AFS_GUNLOCK();
+        VOP_LOCK(tfile->vnode, LK_EXCLUSIVE, curproc);
+        code = VOP_WRITE(tfile->vnode, &tuio, 0, &afs_osi_cred);
+        VOP_UNLOCK(tfile->vnode, 0, curproc);
+        AFS_GLOCK();
 #else
        code = VOP_RDWR(tfile->vnode, &tuio, UIO_WRITE, 0, &afs_osi_cred);
-#endif /* AFS_DARWIN_ENV || AFS_FBSD_ENV */
+#endif /* AFS_FBSD_ENV */
+#endif /* AFS_DARWIN_ENV */
 #endif /* AFS_LINUX20_ENV */
 #endif /* AFS_HPUX100_ENV */
 #endif /* AFS_OSF_ENV */
index 01a40e76546e1fd32a90c3ae35245e1ff27f637e..35c94e23cfd416b84ba98de02665b6d9707ce2b3 100644 (file)
@@ -13,7 +13,7 @@
 #include <afsconfig.h>
 #include "../afs/param.h"
 
-RCSID("$Header: /tmp/cvstemp/openafs/src/afs/afs_analyze.c,v 1.1.1.8 2001/10/14 17:58:52 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/afs/afs_analyze.c,v 1.1.1.9 2002/09/26 18:57:48 hartmans Exp $");
 
 #include "../afs/stds.h"
 #include "../afs/sysincludes.h"        /* Standard vendor system headers */
@@ -27,7 +27,7 @@ RCSID("$Header: /tmp/cvstemp/openafs/src/afs/afs_analyze.c,v 1.1.1.8 2001/10/14
 #ifdef AFS_SGI62_ENV
 #include "../h/hashing.h"
 #endif
-#if !defined(AFS_HPUX110_ENV) && !defined(AFS_LINUX20_ENV) && !defined(AFS_FBSD_ENV)
+#if !defined(AFS_HPUX110_ENV) && !defined(AFS_LINUX20_ENV) && !defined(AFS_FBSD_ENV) && !defined(AFS_DARWIN60_ENV)
 #include <netinet/in_var.h>
 #endif
 #endif /* !UKERNEL */
index a09225c42527bb0b1642759b30913e420ffd72d7..b950c3fafe856883d8cbccfaf8c5dc67919868c4 100644 (file)
@@ -10,7 +10,7 @@
 #include <afsconfig.h>
 #include "../afs/param.h"
 
-RCSID("$Header: /tmp/cvstemp/openafs/src/afs/afs_buffer.c,v 1.1.1.6 2001/10/14 17:58:52 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/afs/afs_buffer.c,v 1.1.1.7 2002/09/26 18:57:48 hartmans Exp $");
 
 #include "../afs/sysincludes.h"
 #if !defined(UKERNEL)
@@ -94,6 +94,9 @@ char *BufferData;
 #ifdef AFS_AIX_ENV
 extern struct buf *geteblk();
 #endif
+#ifdef AFS_FBSD_ENV
+#define timecounter afs_timecounter
+#endif
 /* The locks for individual buffer entries are now sometimes obtained while holding the
  * afs_bufferLock. Thus we now have a locking hierarchy: afs_bufferLock -> Buffers[].lock.
  */
index ec8bb1870a0893c3597e468f072807d227c222d5..f514304e3c8009995c34e784b65ae14a6b401c0f 100644 (file)
@@ -13,7 +13,7 @@
 #include <afsconfig.h>
 #include "../afs/param.h"
 
-RCSID("$Header: /tmp/cvstemp/openafs/src/afs/afs_cell.c,v 1.1.1.10 2002/08/02 04:28:38 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/afs/afs_cell.c,v 1.1.1.11 2002/09/26 18:57:50 hartmans Exp $");
 
 #include "../afs/stds.h"
 #include "../afs/sysincludes.h"        /* Standard vendor system headers */
@@ -25,7 +25,7 @@ RCSID("$Header: /tmp/cvstemp/openafs/src/afs/afs_cell.c,v 1.1.1.10 2002/08/02 04
 #ifdef AFS_SGI62_ENV
 #include "../h/hashing.h"
 #endif
-#if !defined(AFS_HPUX110_ENV) && !defined(AFS_LINUX20_ENV)
+#if !defined(AFS_HPUX110_ENV) && !defined(AFS_LINUX20_ENV) && !defined(AFS_DARWIN60_ENV)
 #include <netinet/in_var.h>
 #endif /* ! ASF_HPUX110_ENV */
 #endif /* !defined(UKERNEL) */
@@ -509,7 +509,7 @@ afs_int32 afs_NewCell(acellName, acellHosts, aflags, linkedcname, fsport, vlport
        tc->vlport = (vlport ? vlport : AFS_VLPORT);
        afs_stats_cmperf.numCellsVisible++;
        newc++;
-       if (!aflags & CAlias) {
+       if (!(aflags & CAlias)) {
            tc->realcellIndex = afs_realcellindex++;
        } else {
            tc->realcellIndex = -1;
@@ -543,7 +543,7 @@ afs_int32 afs_NewCell(acellName, acellHosts, aflags, linkedcname, fsport, vlport
     tc->timeout = timeout;
 
     /* Allow converting an alias into a real cell */
-    if (!(aflags & CAlias)) {
+    if ((!(aflags & CAlias)) && (tc->states & CAlias)) {
        tc->states &= ~CAlias;
        tc->realcellIndex = afs_realcellindex++;
     }
index d596287c20596b75bf9004dd55104e9b3aac9ab8..7230f6eeaac4ba3c1b2daa8da1973e9769767849 100644 (file)
@@ -13,7 +13,7 @@
 #include <afsconfig.h>
 #include "../afs/param.h"
 
-RCSID("$Header: /tmp/cvstemp/openafs/src/afs/afs_conn.c,v 1.1.1.7 2001/09/11 14:24:38 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/afs/afs_conn.c,v 1.1.1.8 2002/09/26 18:57:50 hartmans Exp $");
 
 #include "../afs/stds.h"
 #include "../afs/sysincludes.h"        /* Standard vendor system headers */
@@ -25,7 +25,7 @@ RCSID("$Header: /tmp/cvstemp/openafs/src/afs/afs_conn.c,v 1.1.1.7 2001/09/11 14:
 #ifdef AFS_SGI62_ENV
 #include "../h/hashing.h"
 #endif
-#if !defined(AFS_HPUX110_ENV) && !defined(AFS_LINUX20_ENV)
+#if !defined(AFS_HPUX110_ENV) && !defined(AFS_LINUX20_ENV) && !defined(AFS_DARWIN60_ENV)
 #include <netinet/in_var.h>
 #endif /* ! AFS_HPUX110_ENV */
 #endif /* !defined(UKERNEL) */
index e9673fc49c84ff4dde8bf45bbb0f1bf104d867f0..d12bdbeff70e4d4c8a6d7ef268d46c710b50a24a 100644 (file)
@@ -16,7 +16,7 @@
 #include <afsconfig.h>
 #include "../afs/param.h"
 
-RCSID("$Header: /tmp/cvstemp/openafs/src/afs/afs_init.c,v 1.1.1.7 2001/09/11 14:24:40 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/afs/afs_init.c,v 1.1.1.8 2002/09/26 18:57:51 hartmans Exp $");
 
 #include "../afs/stds.h"
 #include "../afs/sysincludes.h"        /* Standard vendor system headers */
@@ -102,7 +102,7 @@ extern afs_lock_t afs_ftf;
 /* Exported variables */
 struct osi_dev cacheDev;           /*Cache device*/
 afs_int32 cacheInfoModTime;                    /*Last time cache info modified*/
-#if defined(AFS_OSF_ENV) || defined(AFS_DEC_ENV) || defined(AFS_DARWIN_ENV)
+#if defined(AFS_OSF_ENV) || defined(AFS_DEC_ENV) || defined(AFS_DARWIN_ENV) || defined(AFS_FBSD_ENV)
 struct mount *afs_cacheVfsp=0;
 #elif defined(AFS_LINUX20_ENV)
 struct super_block *afs_cacheSBp = 0;
@@ -439,11 +439,15 @@ afs_InitCacheInfo(afile)
              TO_KERNEL_SPACE();
          }
 #else
-#if defined(AFS_DARWIN_ENV) || defined(AFS_FBSD_ENV)
+#if defined(AFS_DARWIN_ENV)
         if (!VFS_STATFS(filevp->v_mount, &st, current_proc()))
+#else 
+#if defined(AFS_FBSD_ENV)
+        if (!VFS_STATFS(filevp->v_mount, &st, curproc))
 #else 
        if (!VFS_STATFS(filevp->v_vfsp, &st))  
-#endif /* AFS_DARWIN_ENV || AFS_FBSD_ENV */
+#endif /* AFS_FBSD_ENV */
+#endif /* AFS_DARWIN_ENV */
 #endif /* AFS_LINUX20_ENV */
 #endif /* AIX41 */
 #endif /* OSF */
index 5517f13165b59ce7f76ecabb959bb3e03fe5ab64..e414700beba078c2010561b1f9657c99a3a47329 100644 (file)
@@ -16,7 +16,7 @@
 #include <afsconfig.h>
 #include "../afs/param.h"
 
-RCSID("$Header: /tmp/cvstemp/openafs/src/afs/afs_mariner.c,v 1.1.1.4 2001/07/14 22:19:21 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/afs/afs_mariner.c,v 1.1.1.5 2002/09/26 18:57:52 hartmans Exp $");
 
 #include "../afs/sysincludes.h" /*Standard vendor system headers*/
 #include "../afs/afsincludes.h" /*AFS-based standard headers*/
@@ -81,9 +81,9 @@ void afs_MarinerLogFetch(avc, off, bytes, idx)
     taddr.sin_family = AF_INET;
     taddr.sin_addr.s_addr = afs_marinerHost;
     taddr.sin_port = htons(2106);
-#ifdef  AFS_OSF_ENV
+#ifdef  STRUCT_SOCKADDR_HAS_SA_LEN
     taddr.sin_len = sizeof(taddr);
-#endif  /* AFS_OSF_ENV */
+#endif /* STRUCT_SOCKADDR_HAS_SA_LEN */
     tp = tp1 = (char *) osi_AllocSmallSpace(AFS_SMALLOCSIZ);
     strcpy(tp, "fetch$Fetching ");
     tp += 15; /* change it if string changes */
@@ -114,6 +114,9 @@ void afs_MarinerLog(astring, avc)
     taddr.sin_family = AF_INET;
     taddr.sin_addr.s_addr = afs_marinerHost;
     taddr.sin_port = htons(2106);
+#ifdef  STRUCT_SOCKADDR_HAS_SA_LEN
+    taddr.sin_len = sizeof(taddr);
+#endif /* STRUCT_SOCKADDR_HAS_SA_LEN */
     tp = buf = (char *) osi_AllocSmallSpace(AFS_SMALLOCSIZ);
 
     strcpy(tp, astring);
index c83173b0575a619229315487ecfeaab1c512c82c..3d240a7127a54f5719e91beaa80fd88156bee87d 100644 (file)
@@ -10,7 +10,7 @@
 #include <afsconfig.h>
 #include "../afs/param.h"
 
-RCSID("$Header: /tmp/cvstemp/openafs/src/afs/afs_nfsclnt.c,v 1.1.1.5 2001/09/11 14:24:41 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/afs/afs_nfsclnt.c,v 1.1.1.6 2002/09/26 18:57:52 hartmans Exp $");
 
 #if !defined(AFS_NONFSTRANS) || defined(AFS_AIX_IAUTH_ENV)
 #ifndef        AFS_DEC_ENV
@@ -425,7 +425,9 @@ void afs_iauth_unregister()
 
 
 shutdown_nfsclnt() {
+#if 0
     extern int afs_allnfsreqs, afs_nfscalls;
+#endif
 
 #if defined(AFS_SGIMP_ENV)
     osi_Assert(ISAFS_GLOCK());
@@ -436,8 +438,10 @@ shutdown_nfsclnt() {
 #endif
     afs_nfsclient_GC(afs_nfsexporter, -1);
     init_nfsexporter = 0;
+#if 0
     /* The following are for the nfs/afs server */
     afs_allnfsreqs = afs_nfscalls = 0;
+#endif
 }
 #endif /* AFS_DEC_ENV */
 #endif /* AFS_NONFSTRANS */
index a7b1f7f28dccb0a76566da3d8fb750e802f9e327..f8babf1b25997f0d3be698c015318f43ecf66137 100644 (file)
@@ -10,7 +10,7 @@
 #include <afsconfig.h>
 #include "../afs/param.h"
 
-RCSID("$Header: /tmp/cvstemp/openafs/src/afs/afs_osi.c,v 1.1.1.11 2002/08/02 04:28:40 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/afs/afs_osi.c,v 1.1.1.12 2002/09/26 18:57:53 hartmans Exp $");
 
 #include "../afs/sysincludes.h"        /* Standard vendor system headers */
 #include "../afs/afsincludes.h"        /* Afs-based standard headers */
@@ -56,7 +56,7 @@ void osi_Init()
     afs_global_owner = (thread_t)0;
 #elif defined(AFS_DARWIN_ENV) || defined(AFS_FBSD_ENV)
     lockinit(&afs_global_lock, PLOCK, "afs global lock", 0, 0);
-    afs_global_owner = (thread_t)0;
+    afs_global_owner = 0;
 #elif defined(AFS_AIX41_ENV)
     lock_alloc((void*)&afs_global_lock, LOCK_ALLOC_PIN, 1, 1);
     simple_lock_init((void *)&afs_global_lock);
@@ -315,10 +315,13 @@ void afs_osi_Invisible() {
 #if AFS_HPUX101_ENV
     set_system_proc(u.u_procp);
 #endif
-#if defined(AFS_DARWIN_ENV) || defined(AFS_FBSD_ENV)
+#if defined(AFS_DARWIN_ENV)
     /* maybe call init_process instead? */
     current_proc()->p_flag |= P_SYSTEM;
 #endif
+#if defined(AFS_FBSD_ENV)
+    curproc->p_flag |= P_SYSTEM;
+#endif
 #if defined(AFS_SGI_ENV)
     vrelvm();
 #endif /* AFS_SGI_ENV */
@@ -368,7 +371,27 @@ afs_osi_SetTime(atv)
     stime(&sta);
     AFS_GLOCK();
 #else
-#if defined(AFS_DARWIN_ENV) || defined(AFS_FBSD_ENV)
+#if defined(AFS_FBSD_ENV)
+    /* does not impliment security features of kern_time.c:settime() */
+    struct timespec ts;
+    struct timeval tv,delta;
+    extern void (*lease_updatetime)();
+    int s;
+    AFS_GUNLOCK();
+    s=splclock();
+    microtime(&tv);
+    delta=*atv;
+    timevalsub(&delta, &tv);
+    ts.tv_sec=atv->tv_sec;
+    ts.tv_nsec=atv->tv_usec * 1000;
+    set_timecounter(&ts);
+    (void) splsoftclock();
+    lease_updatetime(delta.tv_sec);
+    splx(s);
+    resettodr();
+    AFS_GLOCK();
+#else
+#if defined(AFS_DARWIN_ENV)
     AFS_GUNLOCK();
     setthetime(atv);
     AFS_GLOCK();
@@ -396,7 +419,8 @@ afs_osi_SetTime(atv)
 #ifdef AFS_AUX_ENV
     logtchg(atv->tv_sec);
 #endif
-#endif  /* AFS_DARWIN_ENV || AFS_FBSD_ENV */
+#endif  /* AFS_DARWIN_ENV */
+#endif  /* AFS_FBSD_ENV */
 #endif /* AFS_SGI_ENV */
 #endif /* AFS_SUN55_ENV */
 #endif /* AFS_SUN5_ENV */
@@ -779,15 +803,18 @@ void afs_osi_TraverseProcTable()
 void afs_osi_TraverseProcTable()
 {   
     struct task_struct *p;
+
+#ifdef EXPORTED_TASKLIST_LOCK
+    read_lock(&tasklist_lock);
+#endif
     for_each_task(p) if (p->pid) {
         if (p->state & TASK_ZOMBIE)
             continue;
-#if 0
-        if (p->flags & )
-            continue;
-#endif
        afs_GCPAGs_perproc_func(p);
     }
+#ifdef EXPORTED_TASKLIST_LOCK
+    read_unlock(&tasklist_lock);
+#endif
 }   
 #endif
 
@@ -986,13 +1013,11 @@ const struct AFS_UCRED *afs_osi_proc2cred(AFS_PROC *pr)
        (pr->state == TASK_INTERRUPTIBLE) ||
        (pr->state == TASK_UNINTERRUPTIBLE) ||
        (pr->state == TASK_STOPPED)) {
-       read_lock(&tasklist_lock);
-       cr.cr_ref=1;
-       cr.cr_uid=pr->uid;
-       cr.cr_ngroups=pr->ngroups;
-       memcpy(cr.cr_groups, pr->groups, NGROUPS * sizeof(gid_t));
-       read_unlock(&tasklist_lock);  
-       rv = &cr;
+       cr.cr_ref=1;
+       cr.cr_uid=pr->uid;
+       cr.cr_ngroups=pr->ngroups;
+       memcpy(cr.cr_groups, pr->groups, NGROUPS * sizeof(gid_t));
+       rv = &cr;
     }
     
     return rv;
index 51fdb27fbbdd772eeacd0543ddf61970a85b82c3..65313c7c128fbbaa4bcec24af4b25851259cf9b8 100644 (file)
@@ -32,7 +32,7 @@
 #include <afsconfig.h>
 #include "../afs/param.h"
 
-RCSID("$Header: /tmp/cvstemp/openafs/src/afs/afs_server.c,v 1.1.1.12 2002/05/10 23:43:22 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/afs/afs_server.c,v 1.1.1.13 2002/09/26 18:57:56 hartmans Exp $");
 
 #include "../afs/stds.h"
 #include "../afs/sysincludes.h"        /* Standard vendor system headers */
@@ -44,9 +44,12 @@ RCSID("$Header: /tmp/cvstemp/openafs/src/afs/afs_server.c,v 1.1.1.12 2002/05/10
 #ifdef AFS_SGI62_ENV
 #include "../h/hashing.h"
 #endif
-#if !defined(AFS_HPUX110_ENV) && !defined(AFS_LINUX20_ENV)
+#if !defined(AFS_HPUX110_ENV) && !defined(AFS_LINUX20_ENV) && !defined(AFS_DARWIN60_ENV)
 #include <netinet/in_var.h>
 #endif /* AFS_HPUX110_ENV */
+#ifdef AFS_DARWIN60_ENV
+#include <net/if_var.h>
+#endif
 #endif /* !defined(UKERNEL) */
 
 #include "../afs/afsincludes.h"        /* Afs-based standard headers */
@@ -1039,7 +1042,7 @@ afsi_SetServerIPRank(sa, addr, subnetmask)
    }
 }
 #else /* AFS_USERSPACE_IP_ADDR */
-#if (! defined(AFS_SUN5_ENV)) && defined(USEIFADDR)
+#if (! defined(AFS_SUN5_ENV)) && !defined(AFS_DARWIN60_ENV) && defined(USEIFADDR)
 void
 afsi_SetServerIPRank(sa, ifa)
     struct srvAddr *sa;
@@ -1078,6 +1081,65 @@ afsi_SetServerIPRank(sa, ifa)
 #endif /* IFF_POINTTOPOINT */
 }
 #endif /*(!defined(AFS_SUN5_ENV)) && defined(USEIFADDR)*/
+#if defined(AFS_DARWIN60_ENV) && defined(USEIFADDR)
+#ifndef afs_min
+#define afs_min(A,B) ((A)<(B)) ? (A) : (B)
+#endif
+void
+afsi_SetServerIPRank(sa, ifa)
+    struct srvAddr *sa;
+    struct ifaddr *ifa;
+{
+    struct sockaddr_in *sin;
+    int t;
+    
+   afs_uint32 subnetmask, myAddr, myNet, myDstaddr, mySubnet, netMask;
+   afs_uint32 serverAddr ; 
+
+   if (ifa->ifa_addr->sa_family != AF_INET)
+      return;
+   sin=(struct sockaddr_in *)ifa->ifa_addr;
+   myAddr = ntohl(sin->sin_addr.s_addr);   /* one of my IP addr in host order */
+   serverAddr = ntohl(sa->sa_ip); /* server's IP addr in host order */
+   sin=(struct sockaddr_in *)ifa->ifa_netmask;
+   subnetmask = ntohl(sin->sin_addr.s_addr);/* subnet mask in host order */
+   sin=(struct sockaddr_in *)ifa->ifa_dstaddr;
+   if (sin)
+      myDstaddr=sin->sin_addr.s_addr;
+
+   if      ( IN_CLASSA(myAddr) ) netMask = IN_CLASSA_NET;
+   else if ( IN_CLASSB(myAddr) ) netMask = IN_CLASSB_NET;
+   else if ( IN_CLASSC(myAddr) ) netMask = IN_CLASSC_NET;
+   else                          netMask = 0;
+
+   myNet    =  myAddr & netMask;
+   mySubnet =  myAddr & subnetmask;
+
+   if ( (serverAddr & netMask ) == myNet ) {
+      if ( (serverAddr & subnetmask ) == mySubnet) {
+        if ( serverAddr == myAddr ) {    /* same machine */
+          sa->sa_iprank = afs_min(sa->sa_iprank, TOPR);
+        } else {                           /* same subnet */
+           sa->sa_iprank = afs_min(sa->sa_iprank, HI + ifa->ifa_metric);
+        }
+      } else {                               /* same net */
+        sa->sa_iprank = afs_min(sa->sa_iprank, MED + ifa->ifa_metric);
+      }
+   }
+#ifdef  IFF_POINTTOPOINT
+    /* check for case #4 -- point-to-point link */
+    if ((ifa->ia_ifp->if_flags & IFF_POINTOPOINT) &&
+       (myDstaddr == serverAddr))) {
+       if (ifa->ia_ifp->if_metric >= (MAXDEFRANK - MED)/PPWEIGHT) 
+           t = MAXDEFRANK;
+       else 
+           t = MED + (PPWEIGHT << ifa->->ifa_metric);
+       if (sa->sa_iprank > t)
+           sa->sa_iprank = t;
+    }
+#endif /* IFF_POINTTOPOINT */
+}
+#endif /*(!defined(AFS_SUN5_ENV)) && defined(USEIFADDR)*/
 #endif /* else AFS_USERSPACE_IP_ADDR */
 
 #ifdef AFS_SGI62_ENV
@@ -1235,6 +1297,16 @@ static afs_SetServerPrefs(sa)
 #ifdef AFS_SGI62_ENV
     (void) hash_enum(&hashinfo_inaddr, afsi_enum_set_rank, HTF_INET, NULL,
                     (caddr_t)sa, NULL);
+#elif defined(AFS_DARWIN60_ENV)
+    {
+        struct ifnet *ifn;
+        struct ifaddr *ifa;
+        TAILQ_FOREACH(ifn , &ifnet, if_link) {
+            TAILQ_FOREACH(ifa , &ifn->if_addrhead, ifa_link) {
+                afsi_SetServerIPRank(sa, ifa);
+            }
+        }
+    }
 #elif defined(AFS_DARWIN_ENV) || defined(AFS_FBSD_ENV)
     {
         struct in_ifaddr *ifa;
index 81c08b7aaed255cbe17feec37d91696e65c479b0..d5c2581cdec04a951fed4e59234d4861cb52263c 100644 (file)
@@ -13,7 +13,7 @@
 #include <afsconfig.h>
 #include "../afs/param.h"
 
-RCSID("$Header: /tmp/cvstemp/openafs/src/afs/afs_user.c,v 1.1.1.7 2001/09/11 14:24:47 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/afs/afs_user.c,v 1.1.1.8 2002/09/26 18:57:57 hartmans Exp $");
 
 #include "../afs/stds.h"
 #include "../afs/sysincludes.h"        /* Standard vendor system headers */
@@ -25,7 +25,7 @@ RCSID("$Header: /tmp/cvstemp/openafs/src/afs/afs_user.c,v 1.1.1.7 2001/09/11 14:
 #ifdef AFS_SGI62_ENV
 #include "../h/hashing.h"
 #endif
-#if !defined(AFS_HPUX110_ENV) && !defined(AFS_LINUX20_ENV)
+#if !defined(AFS_HPUX110_ENV) && !defined(AFS_LINUX20_ENV) && !defined(AFS_DARWIN60_ENV)
 #include <netinet/in_var.h>
 #endif /* ! AFS_HPUX110_ENV */
 #endif /* !defined(UKERNEL) */
index 769f19c03956bc08b895fc32efa0492c3cb3c22b..6b158dd6ec166bb3c1b0ab0f3f9f0e0dd7471456 100644 (file)
@@ -15,7 +15,7 @@
 #include <afsconfig.h>
 #include "../afs/param.h"
 
-RCSID("$Header: /tmp/cvstemp/openafs/src/afs/afs_util.c,v 1.1.1.6 2001/10/14 17:58:58 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/afs/afs_util.c,v 1.1.1.7 2002/09/26 18:57:57 hartmans Exp $");
 
 #include "../afs/stds.h"
 #include "../afs/sysincludes.h"        /* Standard vendor system headers */
@@ -27,7 +27,7 @@ RCSID("$Header: /tmp/cvstemp/openafs/src/afs/afs_util.c,v 1.1.1.6 2001/10/14 17:
 #ifdef AFS_SGI62_ENV
 #include "../h/hashing.h"
 #endif
-#if !defined(AFS_HPUX110_ENV) && !defined(AFS_LINUX20_ENV)
+#if !defined(AFS_HPUX110_ENV) && !defined(AFS_LINUX20_ENV) && !defined(AFS_DARWIN60_ENV)
 #include <netinet/in_var.h>
 #endif /* ! AFS_HPUX110_ENV */
 #endif /* !defined(UKERNEL) */
index 5e461cab4eb93f3f14c34c672f88299fc6a97dcd..52d20a2d3cc8e705352c4eb4cb53e822513b09ad 100644 (file)
@@ -38,7 +38,7 @@
 #include <afsconfig.h>
 #include "../afs/param.h"
 
-RCSID("$Header: /tmp/cvstemp/openafs/src/afs/afs_vcache.c,v 1.1.1.13 2002/08/02 04:28:44 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/afs/afs_vcache.c,v 1.1.1.14 2002/09/26 18:57:58 hartmans Exp $");
 
 #include "../afs/sysincludes.h" /*Standard vendor system headers*/
 #include "../afs/afsincludes.h" /*AFS-based standard headers*/
@@ -70,7 +70,7 @@ extern struct vcache *afs_globalVp;
 #ifdef AFS_OSF_ENV
 extern struct mount *afs_globalVFS;
 extern struct vnodeops Afs_vnodeops;
-#elif defined(AFS_DARWIN_ENV)
+#elif defined(AFS_DARWIN_ENV) || defined(AFS_FBSD_ENV)
 extern struct mount *afs_globalVFS;
 #else
 extern struct vfs *afs_globalVFS;
@@ -490,6 +490,7 @@ restart:
     cur = head;
     while ((cur = cur->next) != head) {
        dentry = list_entry(cur, struct dentry, d_alias);
+#ifdef notdef
        if (DCOUNT(dentry)) {
            this_parent = dentry;
        repeat:
@@ -528,6 +529,7 @@ restart:
                goto resume;
            }
        }
+#endif
 
        if (!DCOUNT(dentry)) {
            AFS_GUNLOCK();
@@ -907,6 +909,14 @@ struct vcache *afs_NewVCache(struct VenusFid *afid, struct server *serverp,
     tvc->v.v_freelist.tqe_prev=(struct vnode **)0xdeadb;
     /*tvc->vrefCount++;*/
 #endif 
+#ifdef AFS_FBSD_ENV
+    lockinit(&tvc->rwlock, PINOD, "vcache rwlock", 0, 0);
+    cache_purge(AFSTOV(tvc)); 
+    tvc->v.v_data=tvc;
+    tvc->v.v_tag=VT_AFS;
+    tvc->v.v_usecount++; /* steal an extra ref for now so vfree never happens */
+                         /* This extra ref is dealt with above... */
+#endif
     /*
      * The proper value for mvstat (for root fids) is setup by the caller.
      */
@@ -1529,6 +1539,9 @@ afs_ProcessFS(avc, astat, areq)
 #ifdef AFS_LINUX22_ENV
     vcache2inode(avc);    /* Set the inode attr cache */
 #endif
+#ifdef AFS_DARWIN_ENV
+   osi_VM_Setup(avc,1);
+#endif
 
 } /*afs_ProcessFS*/
 
@@ -1670,7 +1683,7 @@ loop:
 #endif
        ReleaseWriteLock(&tvc->lock);
 #ifdef AFS_DARWIN_ENV
-        osi_VM_Setup(tvc);
+        osi_VM_Setup(tvc,0);
 #endif
        return tvc;
     }
@@ -1735,9 +1748,6 @@ loop:
     }
 
     ReleaseWriteLock(&tvc->lock);
-#ifdef AFS_DARWIN_ENV
-    osi_VM_Setup(avc);
-#endif
     return tvc;
 
 } /*afs_GetVCache*/
@@ -1893,9 +1903,6 @@ struct vcache *afs_LookupVCache(struct VenusFid *afid, struct vrequest *areq,
     afs_ProcessFS(tvc, &OutStatus, areq);
 
     ReleaseWriteLock(&tvc->lock);
-#ifdef AFS_DARWIN_ENV
-    osi_VM_Setup(tvc);
-#endif
     return tvc;
 
 }
@@ -2465,7 +2472,7 @@ struct vcache *afs_FindVCache(struct VenusFid *afid, afs_int32 lockit,
 #endif
 #ifdef AFS_DARWIN_ENV
     if (tvc)
-        osi_VM_Setup(tvc);
+        osi_VM_Setup(tvc, 0);
 #endif
     return tvc;
 } /*afs_FindVCache*/
index 3c7f1f4406b240ca6d053531a13c5f55eaf8297d..dbf9ca5bbfde2ac9378c95c7dbd34926e4d02b12 100644 (file)
@@ -18,7 +18,7 @@
 #include <afsconfig.h>
 #include "../afs/param.h"
 
-RCSID("$Header: /tmp/cvstemp/openafs/src/afs/afs_volume.c,v 1.1.1.10 2002/05/10 23:43:27 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/afs/afs_volume.c,v 1.1.1.11 2002/09/26 18:57:58 hartmans Exp $");
 
 #include "../afs/stds.h"
 #include "../afs/sysincludes.h"        /* Standard vendor system headers */
@@ -30,7 +30,7 @@ RCSID("$Header: /tmp/cvstemp/openafs/src/afs/afs_volume.c,v 1.1.1.10 2002/05/10
 #ifdef AFS_SGI62_ENV
 #include "../h/hashing.h"
 #endif
-#if !defined(AFS_HPUX110_ENV) && !defined(AFS_LINUX20_ENV)
+#if !defined(AFS_HPUX110_ENV) && !defined(AFS_LINUX20_ENV) && !defined(AFS_DARWIN60_ENV)
 #include <netinet/in_var.h>
 #endif /* ! AFS_HPUX110_ENV */
 #endif /* !defined(UKERNEL) */
index 33565093f365081b7a045d1f31f02bf22207f538..02adc86291ee43974fbe370e5f6d876a14d61348 100644 (file)
@@ -106,10 +106,14 @@ extern tid_t thread_self();
 #ifdef AFS_LINUX20_ENV
 #define MyPidxx current->pid
 #else
-#if defined(AFS_DARWIN_ENV) || defined(AFS_FBSD_ENV)
+#if defined(AFS_DARWIN_ENV)
 #define MyPidxx (current_proc()->p_pid )
 #else
+#if defined(AFS_FBSD_ENV)
+#define MyPidxx (curproc->p_pid )
+#else
 #define MyPidxx (u.u_procp->p_pid )
+#endif /* AFS_FBSD_ENV */
 #endif /* AFS_DARWIN_ENV */
 #endif /* AFS_LINUX20_ENV */
 #endif /* AFS_SGI64_ENV */
index 197f68dcce84f862c82a8fc9f749f3d1144cf9ba..ecaa173b95391416258e5fd0cdcceecbaba01770 100644 (file)
@@ -74,7 +74,7 @@ struct xfs_inode_info {};
 #include <linux/errno.h>
 
 #else /* AFS_LINUX22_ENV */
-#if defined(AFS_DARWIN_ENV) || defined(AFS_FBSD_ENV)
+#if defined(AFS_DARWIN_ENV)
 #define _MACH_ETAP_H_   
 typedef unsigned short                  etap_event_t; 
 #endif
@@ -180,7 +180,7 @@ typedef unsigned short                  etap_event_t;
 #endif /* AFS_DEC_ENV */
 
 
-#ifndef AFS_SGI64_ENV
+#if !defined(AFS_SGI64_ENV) && !defined(AFS_FBSD_ENV)
 #include "../h/user.h"
 #endif /* AFS_SGI64_ENV */
 #define        MACH_USER_API   1
@@ -223,17 +223,20 @@ struct vfspage;                   /* for vnode.h compiler warnings */
 #  include <sys/namei.h>
 #  include <sys/vnode.h>  
 #  include <sys/queue.h>    
+#  include <sys/malloc.h>    
 #ifndef AFS_FBSD_ENV
 #  include <sys/ubc.h>
 #define timeout_fcn_t mach_timeout_fcn_t
 #  include <kern/sched_prim.h>
 #else
+MALLOC_DECLARE(M_AFS);
 #  include <ufs/ufs/dinode.h>
 #  include <vm/vm.h>
 #  include <vm/vm_extern.h>
 #  include <vm/pmap.h>
 #  include <vm/vm_map.h>
 #  include <sys/lock.h>
+#  include <sys/user.h>
 #endif
 #undef timeout_fcn_t
 #define _DIR_H_
index ed0509004cf6ff4040e2614751a4fa90ed97e3cd..a8240b39dff5bae1446f7bc46511b8d8531c360b 100644 (file)
@@ -30,12 +30,20 @@ SMALL="-stat 300 -dcache 100 -daemons 2 -volumes 50"
 if [ -f $AFSDOPT ]; then
     OPTIONS=`cat $AFSDOPT`
 else
-    OPTIONS=$MEDIUM
+    OPTIONS="$MEDIUM -fakestat"
+fi
+
+if [ -x /usr/sbin/kmodstat ]; then
+   KMODSTAT=/usr/sbin/kmodstat
+else
+  if [ -x /usr/sbin/kextstat ]; then
+     KMODSTAT=/usr/sbin/kextstat
+fi
 fi
 
 # Need the commands ps, awk, kill, sleep
 PATH=${PATH}${PATH:+:}/sbin:/bin:/usr/bin
-if kmodstat | grep -q openafs ; then
+if $KMODSTAT | grep -q openafs ; then
 :
 else
 if [ -d $VICEETC/afs.kext ]; then
@@ -46,7 +54,7 @@ else
        exit 1
 fi
 fi
-if kmodstat | grep -q openafs ; then
+if $KMODSTAT | grep -q openafs ; then
 :
 else
        echo "AFS kernel extensions failed to initialize. Skipping AFS startup."
index c261fc9a9a53f0b7b715abbd3040d2b69c505cd9..d7d77e41ce8211cd37908f1f04181130f5dee933 100644 (file)
@@ -6,19 +6,8 @@
 # License.  For details, see the LICENSE file in the top-level source
 # directory or online at http://www.openafs.org/dl/license10.html
 
-. /etc/rc.common
-
-CheckForNetwork 
-
-if [ "${NETWORKUP}" = "-NO-" ]; then exit; fi
-
-if [ -r /var/db/openafs ]; then
-   VICEETC=/var/db/openafs/etc
-   AFSD=/usr/sbin/afsd
-else
-   VICEETC=/usr/vice/etc
-   AFSD=$VICEETC/afsd
-fi
+VICEETC=/usr/vice/etc
+AFSD=$VICEETC/afsd
 CONFIG=$VICEETC/config
 AFSDOPT=$CONFIG/afsd.options
 PACKAGE=$CONFIG/package.options
@@ -35,10 +24,10 @@ fi
 
 # Need the commands ps, awk, kill, sleep
 PATH=${PATH}${PATH:+:}/sbin:/bin:/usr/bin
-if kmodstat | grep -q openafs ; then
+if kmodstat | grep -q afs.ko ; then
 :
 else
-if [ -d $VICEETC/afs.ko ]; then
+if [ -f $VICEETC/afs.ko ]; then
        echo "Loading AFS kernel extensions"
        kldload $VICEETC/afs.ko
 else
@@ -46,10 +35,11 @@ else
        exit 1
 fi
 fi
-if kldstat | grep -q openafs ; then
+if kldstat | grep -q afs.ko ; then
 :
 else
        echo "AFS kernel extensions failed to initialize. Skipping AFS startup."
+       exit
 fi
 
 #
index 814bef8263034c9ba45d39d5b5299061531fb685..3795f038fc2d80a6456f4ef3d114542cf35ea3eb 100644 (file)
@@ -55,7 +55,7 @@
 #include <afsconfig.h>
 #include <afs/param.h>
 
-RCSID("$Header: /tmp/cvstemp/openafs/src/afsd/afsd.c,v 1.1.1.14 2002/08/02 04:33:53 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/afsd/afsd.c,v 1.1.1.15 2002/09/26 19:04:22 hartmans Exp $");
 
 #define VFS 1
 
@@ -154,10 +154,14 @@ void set_staticaddrs(void);
 #if AFS_HAVE_STATVFS
 #include <sys/statvfs.h>
 #else
+#if defined(AFS_SUN_ENV)
+#include <sys/vfs.h>
+#else
 #if !defined(AFS_OSF_ENV) && !defined(AFS_DARWIN_ENV) && !defined(AFS_XBSD_ENV)
 #include <sys/statfs.h>
 #endif
 #endif
+#endif
 
 #undef VIRTUE
 #undef VICE
index 070765b66ff63a27cd7cdffc93a7a63c115a5b1f..74d4309ebadbb9d28448a49ac0aded9dd48a785a 100644 (file)
@@ -16,7 +16,7 @@
 #include <afsconfig.h>
 #include <afs/param.h>
 
-RCSID("$Header: /tmp/cvstemp/openafs/src/afsmonitor/afsmonitor.c,v 1.1.1.7 2001/09/11 14:31:07 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/afsmonitor/afsmonitor.c,v 1.1.1.8 2002/09/26 19:04:39 hartmans Exp $");
 
 #include <stdio.h>
 #include <math.h>
@@ -274,6 +274,7 @@ extern char *cm_categories[]; /* cache manager data category names */
 
 
 
+#ifndef AFS_FBSD_ENV
 /*     
         strcasestr(): Return first occurence of pattern s2 in s1, case 
        insensitive. 
@@ -305,7 +306,7 @@ char *s2;
         }
         return ((char *)NULL);
 }
-
+#endif
 
 struct hostent *GetHostByName(name)
 char *name;
@@ -3491,6 +3492,9 @@ afsmon_execute()
        memcpy(&(curr_skt->sin_addr.s_addr), he->h_addr, 4);
        curr_skt->sin_family = htons(AF_INET);    /*Internet family*/
        curr_skt->sin_port   = htons(7000);       /*FileServer port*/
+#ifdef STRUCT_SOCKADDR_HAS_SA_LEN
+       curr_skt->sin_len = sizeof(struct sockaddr_in);
+#endif
 
        /* get the next dude */
        curr_skt++;
@@ -3562,6 +3566,9 @@ afsmon_execute()
        memcpy(&(curr_skt->sin_addr.s_addr), he->h_addr, 4);
        curr_skt->sin_family = htons(AF_INET);    /*Internet family*/
        curr_skt->sin_port   = htons(7001);       /*Cache Manager port*/
+#ifdef STRUCT_SOCKADDR_HAS_SA_LEN
+       curr_skt->sin_len = sizeof(struct sockaddr_in);
+#endif
 
        /* get the next dude */
        curr_skt++;
index 9c1fc5860823562bbc56f9e17e2418e65ece3618..4b54607a4dea5dccf0fa7a3e1c564ba5971040d3 100644 (file)
@@ -10,7 +10,7 @@
 #include <afsconfig.h>
 #include <afs/param.h>
 
-RCSID("$Header: /tmp/cvstemp/openafs/src/auth/cellconfig.c,v 1.1.1.12 2002/01/22 19:52:29 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/auth/cellconfig.c,v 1.1.1.13 2002/09/26 19:04:53 hartmans Exp $");
 
 #include <afs/stds.h>
 #include <afs/pthread_glock.h>
@@ -61,6 +61,10 @@ RCSID("$Header: /tmp/cvstemp/openafs/src/auth/cellconfig.c,v 1.1.1.12 2002/01/22
 #include "cellconfig.h"
 #include "keys.h"
 
+#ifndef T_AFSDB
+#define T_AFSDB 18  /* per RFC1183 section 1 */
+#endif
+
 static ParseHostLine();
 static ParseCellLine();
 static afsconf_OpenInternal();
@@ -539,6 +543,9 @@ static ParseHostLine(aline, addr, aname, aclone)
     if (code != 5) return AFSCONF_SYNTAX;
     addr->sin_family = AF_INET;
     addr->sin_port = 0;
+#ifdef STRUCT_SOCKADDR_HAS_SA_LEN
+    addr->sin_len = sizeof(struct sockaddr_in);
+#endif
     tp = (char *) &addr->sin_addr;
     *tp++ = c1;
     *tp++ = c2;
index 50da68a64b6512349430d5e6f2e90fc3b9740d2a..fc0f01b56bfdb2cbf9b2f6f98fb81879af06d212 100644 (file)
@@ -10,7 +10,7 @@
 #include <afsconfig.h>
 #include <afs/param.h>
 
-RCSID("$Header: /tmp/cvstemp/openafs/src/bozo/bnode.c,v 1.1.1.8 2002/01/22 19:52:31 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/bozo/bnode.c,v 1.1.1.9 2002/09/26 19:04:55 hartmans Exp $");
 
 #include <stddef.h>
 #include <stdlib.h>
@@ -34,7 +34,7 @@ RCSID("$Header: /tmp/cvstemp/openafs/src/bozo/bnode.c,v 1.1.1.8 2002/01/22 19:52
 #include <afs/fileutil.h>
 #include "bnode.h"
 
-#ifdef AFS_AIX_ENV
+#if defined(AFS_AIX_ENV) || defined(AFS_SUN4_ENV)
 /* All known versions of AIX lack WCOREDUMP but this works */
 #define WCOREDUMP(x) ((x) & 0x80)
 #endif
index 26f92e2894a648918c40481ca50501fedad29a95..07fc18b9a8fbd1de5f523097e1c682abb7a09445 100644 (file)
@@ -10,7 +10,7 @@
 #include <afsconfig.h>
 #include <afs/param.h>
 
-RCSID("$Header: /tmp/cvstemp/openafs/src/bozo/bos.c,v 1.1.1.9 2001/10/14 18:04:04 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/bozo/bos.c,v 1.1.1.10 2002/09/26 19:04:56 hartmans Exp $");
 
 #include <afs/stds.h>
 #include <stdlib.h>
@@ -1828,7 +1828,7 @@ main(argc, argv)
     cmd_AddParm(ts, "-instance", CMD_LIST, CMD_OPTIONAL, "instances");
     add_std_args (ts);
 
-    ts = cmd_CreateSyntax("restart", Restart, 0, "restart all processes");
+    ts = cmd_CreateSyntax("restart", Restart, 0, "restart processes");
     cmd_AddParm(ts, "-server", CMD_SINGLE, 0, "machine name");
     cmd_AddParm(ts, "-instance", CMD_LIST, CMD_OPTIONAL, "instances");
     cmd_AddParm(ts, "-bosserver", CMD_FLAG, CMD_OPTIONAL, "restart bosserver");
index c20b028a6fbb2406132cdf33b5b0ae13bcfa08b2..84920e6958f60bedcbf3712ee4de47357d310634 100644 (file)
@@ -10,7 +10,7 @@
 #include <afsconfig.h>
 #include <afs/param.h>
 
-RCSID("$Header: /tmp/cvstemp/openafs/src/bozo/bosserver.c,v 1.1.1.12 2002/05/10 23:57:25 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/bozo/bosserver.c,v 1.1.1.13 2002/09/26 19:04:58 hartmans Exp $");
 
 #include <afs/stds.h>
 #include <sys/types.h>
@@ -180,15 +180,26 @@ register char *adir; {
 /* create all the bozo dirs */
 static CreateDirs() {
     
-    MakeDir(AFSDIR_USR_DIRPATH);
-    MakeDir(AFSDIR_SERVER_AFS_DIRPATH);
+    if ((!strncmp(AFSDIR_USR_DIRPATH, AFSDIR_CLIENT_ETC_DIRPATH, 
+                 strlen(AFSDIR_USR_DIRPATH))) || 
+       (!strncmp(AFSDIR_USR_DIRPATH, AFSDIR_SERVER_BIN_DIRPATH,
+                 strlen(AFSDIR_USR_DIRPATH)))) {
+      MakeDir(AFSDIR_USR_DIRPATH);
+    }
+    if (!strncmp(AFSDIR_SERVER_AFS_DIRPATH, AFSDIR_SERVER_BIN_DIRPATH, 
+                strlen(AFSDIR_SERVER_AFS_DIRPATH))) {
+      MakeDir(AFSDIR_SERVER_AFS_DIRPATH);
+    }
     MakeDir(AFSDIR_SERVER_BIN_DIRPATH);
     MakeDir(AFSDIR_SERVER_ETC_DIRPATH); 
     MakeDir(AFSDIR_SERVER_LOCAL_DIRPATH);
     MakeDir(AFSDIR_SERVER_DB_DIRPATH); 
     MakeDir(AFSDIR_SERVER_LOGS_DIRPATH);
 #ifndef AFS_NT40_ENV
-    MakeDir(AFSDIR_CLIENT_VICE_DIRPATH);
+    if (!strncmp(AFSDIR_CLIENT_VICE_DIRPATH, AFSDIR_CLIENT_ETC_DIRPATH, 
+                strlen(AFSDIR_CLIENT_VICE_DIRPATH))) {
+      MakeDir(AFSDIR_CLIENT_VICE_DIRPATH);
+    }
     MakeDir(AFSDIR_CLIENT_ETC_DIRPATH);
 
     symlink(AFSDIR_SERVER_THISCELL_FILEPATH, AFSDIR_CLIENT_THISCELL_FILEPATH); 
index ca1183832e2ff97106b74eedc046e91f39a79871..4ef23a0e7ecbbf54f66930a8a6357b43f26c4a23 100644 (file)
@@ -10,7 +10,7 @@
 #include <afsconfig.h>
 #include <afs/param.h>
 
-RCSID("$Header: /tmp/cvstemp/openafs/src/bucoord/commands.c,v 1.1.1.6 2001/09/11 14:31:33 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/bucoord/commands.c,v 1.1.1.7 2002/09/26 19:05:02 hartmans Exp $");
 
 #include <afs/stds.h>
 #include <sys/types.h>
@@ -325,6 +325,9 @@ int EvalVolumeSet2(aconfig, avs, avols, uclient)
              tvd->server.sin_addr.s_addr = entries[e].serverNumber[ei];
              tvd->server.sin_port        = 0; /* default FS port */
              tvd->server.sin_family      = AF_INET;
+#ifdef STRUCT_SOCKADDR_HAS_SA_LEN
+             tvd->server.sin_len         = sizeof(struct sockaddr_in);
+#endif 
 
              /* String tvd off of partition struct */
              tvd->next  = ps->vdlist;
index 873273855c48a5d1128f857a21cf529bb9076af1..ac6bc993a81af346e29322a25b4c6d37a04759b1 100644 (file)
@@ -10,7 +10,7 @@
 #include <afsconfig.h>
 #include <afs/param.h>
 
-RCSID("$Header: /tmp/cvstemp/openafs/src/bucoord/config.c,v 1.1.1.5 2001/09/11 14:31:33 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/bucoord/config.c,v 1.1.1.6 2002/09/26 19:05:03 hartmans Exp $");
 
 #include <sys/types.h>
 #ifdef AFS_NT40_ENV
@@ -116,6 +116,9 @@ char *aname; {
     tentry->addr.sin_family = AF_INET;
     memcpy(&tentry->addr.sin_addr.s_addr, th->h_addr, sizeof(afs_int32));
     tentry->addr.sin_port = 0;
+#ifdef STRUCT_SOCKADDR_HAS_SA_LEN
+    tentry->addr.sin_len = sizeof(struct sockaddr_in);
+#endif
     tentry->portOffset = aport;
     return 0;
 }
index e27c84ab0d000fb5b7d0c550dfce866a6cf0bfcc..5e86ae6e0de30a7b3db1061b524f44bd85f72bf8 100644 (file)
@@ -18,7 +18,7 @@
 #include <afsconfig.h>
 #include <afs/param.h>
 
-RCSID("$Header: /tmp/cvstemp/openafs/src/bucoord/dsvs.c,v 1.1.1.5 2001/09/11 14:31:35 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/bucoord/dsvs.c,v 1.1.1.6 2002/09/26 19:05:04 hartmans Exp $");
 
 #include <sys/types.h>
 #include <afs/cmd.h>
@@ -151,6 +151,9 @@ int bc_ParseHost(aname, asockaddr)
        /*
         * Four chunks were read, so we assume success.  Construct the socket.
         */
+#ifdef STRUCT_SOCKADDR_HAS_SA_LEN
+       asockaddr->sin_len=sizeof(struct sockaddr_in);
+#endif
        asockaddr->sin_family = AF_INET;
        asockaddr->sin_port   = 0;
        addr = (b1<<24) | (b2<<16) | (b3<<8) | b4;
@@ -180,6 +183,9 @@ int bc_ParseHost(aname, asockaddr)
     /*
      * We found a mapping; construct the socket.
      */
+#ifdef STRUCT_SOCKADDR_HAS_SA_LEN
+    asockaddr->sin_len=sizeof(struct sockaddr_in);
+#endif
     asockaddr->sin_family = AF_INET;
     asockaddr->sin_port   = 0;
     memcpy(&tmp1, th->h_addr, sizeof(afs_int32));
index ea9163d84a8634e90e576e7ed9b8a2aa11e2ba61..53107e3d9ad449535854856417133d71f3d2450e 100644 (file)
@@ -10,7 +10,7 @@
 #include <afsconfig.h>
 #include <afs/param.h>
 
-RCSID("$Header: /tmp/cvstemp/openafs/src/bucoord/tape_hosts.c,v 1.1.1.5 2001/09/11 14:31:38 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/bucoord/tape_hosts.c,v 1.1.1.6 2002/09/26 19:05:06 hartmans Exp $");
 
 #include <afs/stds.h>
 #include <sys/types.h>
@@ -285,6 +285,9 @@ int bc_ParseHosts()
        the->portOffset = port;
        if (th) {
            memcpy(&the->addr.sin_addr.s_addr, th->h_addr, 4);
+#ifdef STRUCT_SOCKADDR_HAS_SA_LEN
+           the->addr.sin_len = sizeof(struct sockaddr_in);
+#endif
            the->addr.sin_family = AF_INET;
            the->addr.sin_port = 0;
        }
index ee163d52abd4bfe186ac1665d9bc5b844e472b8d..23a90a55ca93f6029dd8063511bc84b6685ed8b1 100644 (file)
@@ -10,7 +10,7 @@
 #include <afsconfig.h>
 #include <afs/param.h>
 
-RCSID("$Header: /tmp/cvstemp/openafs/src/butc/dump.c,v 1.1.1.6 2001/09/11 14:31:47 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/butc/dump.c,v 1.1.1.7 2002/09/26 19:05:11 hartmans Exp $");
 
 #include <sys/types.h>
 #ifdef AFS_NT40_ENV
@@ -101,7 +101,7 @@ afs_int32 tapeblocks;      /* Number of 16K tape datablocks in buffer (!CONF_XBS
    else \
      sprintf(dumpname, "%s (DumpId %u)", name, dbDumpId);
 
-#if defined(AFS_NT40_ENV) || defined(AFS_DARWIN_ENV)
+#if defined(AFS_NT40_ENV) || (defined(AFS_DARWIN_ENV) && !defined(AFS_DARWIN60_ENV)) || defined(AFS_SUN4_ENV)
 localtime_r(t, tm)
    time_t *t;
    struct tm *tm;
@@ -914,6 +914,9 @@ dumpPass(dparamsPtr, passNumber)
            server.sin_addr.s_addr = vldbEntry.serverNumber[e];
            server.sin_port        = 0;
            server.sin_family      = AF_INET;
+#ifdef STRUCT_SOCKADDR_HAS_SA_LEN
+           server.sin_len         = sizeof(struct sockaddr_in);
+#endif
            curDump->hostAddr      = HOSTADDR(&server);
            curDump->partition     = vldbEntry.serverPartition[e];
 
index a21a2365fbf5f91553ba0e67399b9e45f754d43d..69473275391b95a089300894b26b7961f790d36c 100644 (file)
@@ -1,3 +1,33 @@
+AC_DEFUN(LINUX_EXPORTS_TASKLIST_LOCK, [
+AC_MSG_CHECKING(for exported tasklist_lock)
+save_CPPFLAGS="$CPPFLAGS"
+CPPFLAGS="-I${LINUX_KERNEL_PATH}/include -D__KERNEL__ $CPPFLAGS"
+AC_CACHE_VAL(ac_cv_linux_exports_tasklist_lock,
+[
+AC_TRY_COMPILE(
+[#include <linux/modversions.h>],
+[#ifndef __ver_tasklist_lock
+#error tasklist_lock not exported
+#endif],
+ac_cv_linux_exports_tasklist_lock=yes,
+ac_cv_linux_exports_tasklist_lock=no)])
+AC_MSG_RESULT($ac_cv_linux_exports_tasklist_lock)
+CPPFLAGS="$save_CPPFLAGS"])
+
+AC_DEFUN(LINUX_COMPLETION_H_EXISTS, [
+AC_MSG_CHECKING(for linux/completion.h existance)
+save_CPPFLAGS="$CPPFLAGS"
+CPPFLAGS="-I${LINUX_KERNEL_PATH}/include -D__KERNEL__ $CPPFLAGS"
+AC_CACHE_VAL(ac_cv_linux_completion_h_exists,
+[
+AC_TRY_COMPILE(
+[#include <linux/completion.h>],
+[struct completion _c;],
+ac_cv_linux_completion_h_exists=yes,
+ac_cv_linux_completion_h_exists=no)])
+AC_MSG_RESULT($ac_cv_linux_completion_h_exists)
+CPPFLAGS="$save_CPPFLAGS"])
+
 AC_DEFUN(LINUX_FS_STRUCT_INODE_HAS_I_MMAP_SHARED, [
 AC_MSG_CHECKING(for i_mmap_shared in struct inode)
 save_CPPFLAGS="$CPPFLAGS"
index 9884a72e70005687df61db1c88fa55133ed6fc1a..e0f9ce2214eb366f61b1043c1651ec041313db68 100644 (file)
@@ -12,6 +12,7 @@ XCFLAGS= -D_NO_PROTO -DOSF
 MT_CFLAGS=-D_REENTRANT=1 -pthread -DAFS_PTHREAD_ENV ${XCFLAGS}
 SHLIB_SUFFIX=so
 SHLIB_CFLAGS=
+SHLIB_LINKER=${CC} -all -shared -expect_unresolved "*"
 XLIBS=@LIB_AFSDB@
 MTLIBS=-pthread -lpthread -lmach -lexc -lc
 NON_SHARED=-non_shared
@@ -23,6 +24,7 @@ CSTATIC=-non_shared
 RANLIB=/bin/true
 INSTALL=${TOP_SRCDIR}/pinstall/pinstall
 CP=cp
+RM=rm
 
 #this is for the vol package
 FS_CONV_OSF40D         = fs_conv_dux40D
index 9c9546ec108fa45d2fde9d29938d374f3b42c99c..f4f1d76b7e34086c173838164aa5b953d418073d 100644 (file)
@@ -12,6 +12,7 @@ XCFLAGS= -D_NO_PROTO -DOSF
 MT_CFLAGS=-D_REENTRANT=1 -pthread -DAFS_PTHREAD_ENV ${XCFLAGS}
 SHLIB_SUFFIX=so
 SHLIB_CFLAGS=
+SHLIB_LINKER=${CC} -all -shared -expect_unresolved "*"
 XLIBS=@LIB_AFSDB@
 MTLIBS=-pthread -lpthread -lmach -lexc -lc
 NON_SHARED=-non_shared
@@ -20,6 +21,7 @@ LWP_OPTMZ=-O2
 OPTMZ=-O2
 DBG=-g3
 CP=cp
+RM=rm
 CSTATIC=-non_shared
 RANLIB=/bin/true
 INSTALL=${TOP_SRCDIR}/pinstall/pinstall
index eb760eef33060b1552f99a3708b7ff720806d3ca..4f663fe733740cb9bed0c6563a7810e4f52a2206 100644 (file)
@@ -18,11 +18,11 @@ PAM_CFLAGS = -O2 -Dlinux -DLINUX_PAM -fPIC
 # Put -O2 here to _ensure_ all Makefiles pick it up.
 XCFLAGS= -O2
 MT_CFLAGS=-DAFS_PTHREAD_ENV -pthread -D_REENTRANT ${XCFLAGS}
-XLDFLAGS=
-SHARE_LDFLAGS = -shared -Xlinker -x
+XLDFLAGS=#
+SHLIB_LDFLAGS = -shared -Xlinker -x
 SHLIB_SUFFIX=so
 SHLIB_CFLAGS=
-#
+SHLIB_LINKER=${MT_CC} -shared
 # libraries
 MTLIBS=-lpthread
 TXLIBS= /usr/lib/libncurses.so
index 83fba93d4d0b28f92a326312d786463d681c0942..c7c12e4ca4e54eab52b19fbd1e141aedf3ea2bff 100644 (file)
@@ -19,9 +19,10 @@ PAM_CFLAGS = -O2 -Dlinux -DLINUX_PAM -fPIC
 XCFLAGS= -O2
 MT_CFLAGS=-DAFS_PTHREAD_ENV -pthread -D_REENTRANT ${XCFLAGS}
 XLDFLAGS=
-SHARE_LDFLAGS = -shared -Xlinker -x
+SHLIB_LDFLAGS = -shared -Xlinker -x
 SHLIB_SUFFIX=so
 SHLIB_CFLAGS=
+SHLIB_LINKER=${MT_CC} -shared
 #
 # libraries
 MTLIBS=-lpthread
index b0b318d5593f474beea188a8173b49348e51c8e0..6dea19b124bc3c9712245e5953da18fb00825ad0 100644 (file)
@@ -31,6 +31,6 @@ LD=/bin/ld
 LEX=/opt/langtools/bin/lex
 DBM=/lib/libndbm.a
 PAM_CFLAGS=+DA1.0 +z -Wl,+k
-SHARE_LDFLAGS=-b -Bsymbolic
+SHLIB_LDFLAGS=-b -Bsymbolic
 PAMLIBS=/usr/lib/libpam.1
 YACC=/opt/langtools/bin/yacc
index c07be9a6725cced4408903ffd992340d523e326e..ca42600c91c00bf1e0e366d583ca1ae8d0872d45 100644 (file)
@@ -17,6 +17,8 @@ XLIBELFA=-lelf
 TXLIBS=/usr/lib/libHcurses.a
 MTLIBS=-lpthread
 SHLIB_SUFFIX=sl
+SHLIB_LDFLAGS=-b -Bsymbolic
+SHLIB_LINKER=ld -b
 LWP_OPTMZ=-O
 OPTMZ=-O
 DBG=-g
@@ -31,6 +33,5 @@ LD=/bin/ld
 LEX=/opt/langtools/bin/lex
 DBM=/lib/libndbm.a
 PAM_CFLAGS=+DA1.0 +z -Wl,+k
-SHARE_LDFLAGS=-b -Bsymbolic
 PAMLIBS=/usr/lib/libpam.1
 YACC=/opt/langtools/bin/yacc
index ddbacc3083f82033ce5b819470d47c6c735dd01e..42be7c3ba7567aa3cf91dcbc2fd01b9f245eb6e9 100644 (file)
@@ -18,7 +18,7 @@ OPTMZ=-O2
 XCFLAGS= ${DBG} -Dfds_bits=fd_bits -DAFS_AFSDB_ENV -DAFS_FREELANCE_CLIENT
 MT_CFLAGS=${XCFLAGS}
 XLDFLAGS=
-SHARE_LDFLAGS = -shared -Xlinker -x
+SHLIB_LDFLAGS = -shared -Xlinker -x
 SHLIB_SUFFIX=so
 SHLIB_CFLAGS=
 #
index a8a0001c0be8ed2bdbc99f4424d8a6d1a949d34e..d3164238ed3148fb0a2de74c47c55f732c8388f8 100644 (file)
@@ -4,12 +4,6 @@
 #
 # AFS_OSTYPE used to indicate suffixes and os specific subdirectories.
 AFS_OSTYPE = FBSD
-# Base directory for linux kernel source. Actually a prefix which is complete
-# when LINUX_VERS is appended to it.
-# LINUX_SRCDIR = /usr/src/linux-
-# Default list of Linux kernels to build. Build will run only if all
-# can be built. To build a different set, specify LINUX_VERS to make.
-# LINUX_VERS = 2.2.5-15 2.2.10 2.2.12 2.2.12-20 2.2.13 2.2.14
 
 #
 # compilation and link editor flags
@@ -20,7 +14,7 @@ PAM_CFLAGS = -O2 -pipe -fPIC
 XCFLAGS= -O2 -pipe
 MT_CFLAGS=-DAFS_PTHREAD_ENV -pthread -D_REENTRANT ${XCFLAGS}
 XLDFLAGS=
-SHARE_LDFLAGS = -shared -Xlinker -x
+SHLIB_LDFLAGS = -shared -Xlinker -x
 SHLIB_SUFFIX=so
 SHLIB_CFLAGS=
 #
index 9635c318eb5b6f7fe38c1a290d67002fe8ab7ba2..e905612e242009cbc9fc2f7b5ed69008f4e656ad 100644 (file)
@@ -17,9 +17,10 @@ PAM_CFLAGS = -O2 -Dlinux -DLINUX_PAM -fPIC
 XCFLAGS= -O2
 MT_CFLAGS=-DAFS_PTHREAD_ENV -pthread -D_REENTRANT ${XCFLAGS}
 XLDFLAGS=
-SHARE_LDFLAGS = -shared -Xlinker -x
+SHLIB_LDFLAGS = -shared -Xlinker -x
 SHLIB_SUFFIX=so
 SHLIB_CFLAGS=
+SHLIB_LINKER=${MT_CC} -shared
 #
 # libraries
 MTLIBS=-lpthread
index 1682fe4f5e80137fb177637ce0de23d8a14f0a82..8d7c6d2cb56bb0f9df3ec0c7e02fd003476a75c7 100644 (file)
@@ -12,7 +12,7 @@ PAM_CFLAGS = -O2 -pipe -fpic
 XCFLAGS= -O2
 MT_CFLAGS=-DAFS_PTHREAD_ENV -pthread -D_REENTRANT ${XCFLAGS}
 XLDFLAGS=
-SHARE_LDFLAGS = -shared -Xlinker -x
+SHLIB_LDFLAGS = -shared -Xlinker -x
 SHLIB_SUFFIX=so
 SHLIB_CFLAGS= -fpic
 #
index ee51affbf7a8dd5f4c17afccf0156f7f98a8810e..7f8f2c195bb1fe3b1594fbc1fd4857a8aefa3a04 100644 (file)
@@ -17,9 +17,10 @@ PAM_CFLAGS = -O2 -Dlinux -DLINUX_PAM -fPIC
 XCFLAGS= -O2 -G0
 MT_CFLAGS=-DAFS_PTHREAD_ENV -pthread -D_REENTRANT ${XCFLAGS}
 XLDFLAGS=
-SHARE_LDFLAGS = -shared -Xlinker -x
+SHLIB_LDFLAGS = -shared -Xlinker -x
 SHLIB_SUFFIX=so
 SHLIB_CFLAGS=
+SHLIB_LINKER=${MT_CC} -shared
 #
 # libraries
 MTLIBS=-lpthread
index 9635c318eb5b6f7fe38c1a290d67002fe8ab7ba2..5541cd51b721ed76003a4d2707347b94b2eae4cc 100644 (file)
@@ -17,7 +17,7 @@ PAM_CFLAGS = -O2 -Dlinux -DLINUX_PAM -fPIC
 XCFLAGS= -O2
 MT_CFLAGS=-DAFS_PTHREAD_ENV -pthread -D_REENTRANT ${XCFLAGS}
 XLDFLAGS=
-SHARE_LDFLAGS = -shared -Xlinker -x
+SHLIB_LDFLAGS = -shared -Xlinker -x
 SHLIB_SUFFIX=so
 SHLIB_CFLAGS=
 #
index be76178b7271317fbe67e641b980da4e8b69af53..24504f0425137feeabb34f3390ffcd0f3ef41481 100644 (file)
@@ -10,7 +10,6 @@ XCFLAGS=-traditional-cpp
 #MT_CC=cc
 KROOT=
 KINCLUDES=-I$(KROOT)/System/Library/Frameworks/Kernel.framework/Headers
-#SHARE_LDFLAGS =
 LWP_OPTMZ=-g
 OPTMZ=-g
 DBG=-g
index 3dfaaaa015b19ee1096825a4ee596846fdd0315f..dd7910f8e09a3898bd3980173586350ede8e51d2 100644 (file)
@@ -10,7 +10,6 @@ XCFLAGS=-no-cpp-precomp
 #MT_CC=cc
 KROOT=
 KINCLUDES=-I$(KROOT)/System/Library/Frameworks/Kernel.framework/Headers
-#SHARE_LDFLAGS =
 LWP_OPTMZ=-O2
 OPTMZ=-O2
 DBG=-g
index 3dfaaaa015b19ee1096825a4ee596846fdd0315f..dd7910f8e09a3898bd3980173586350ede8e51d2 100644 (file)
@@ -10,7 +10,6 @@ XCFLAGS=-no-cpp-precomp
 #MT_CC=cc
 KROOT=
 KINCLUDES=-I$(KROOT)/System/Library/Frameworks/Kernel.framework/Headers
-#SHARE_LDFLAGS =
 LWP_OPTMZ=-O2
 OPTMZ=-O2
 DBG=-g
index 7ad11f211b8a6b139046307c729a6a7bc27b45cf..db80c9bbb29a921f7cdd3181ae06166b29f6e341 100644 (file)
@@ -18,6 +18,7 @@ XCFLAGS=-K -D_NO_PROTO -D_NONSTD_TYPES -D_MBI=void
 MT_CFLAGS=-DAFS_PTHREAD_ENV ${XCFLAGS}
 SHLIB_SUFFIX=o
 SHLIB_CFLAGS=
+SHLIB_LINKER=${MT_CC} -bM:SRE -berok
 #
 # libraries
 TXLIBS=-lcurses
index 9f7232bffd6132bf3ea8e894867f3ef31b09e7de..3c1d57b8e62fced0c43b21f0a14fbda4be3eee79 100644 (file)
@@ -22,9 +22,10 @@ PAM_CFLAGS= -O -Dlinux -DLINUX_PAM -fPIC
 XCFLAGS= -O -g
 MT_CFLAGS=-DAFS_PTHREAD_ENV -pthread -D_REENTRANT ${XCFLAGS}
 XLDFLAGS=
-SHARE_LDFLAGS = -shared -Xlinker -x
+SHLIB_LDFLAGS = -shared -Xlinker -x
 SHLIB_SUFFIX=so
 SHLIB_CFLAGS=
+SHLIB_LINKER=${MT_CC} -shared
 #
 # libraries
 MTLIBS=-lpthread
index 421f6216aeaaaecf9375b8911ccc87331c6fec32..bcf649eb7b95f77d2bfed3da6b9ea569037e69b2 100644 (file)
@@ -22,9 +22,10 @@ PAM_CFLAGS= -O -Dlinux -DLINUX_PAM -fPIC
 XCFLAGS= -O -g
 MT_CFLAGS=-DAFS_PTHREAD_ENV -pthread -D_REENTRANT ${XCFLAGS}
 XLDFLAGS=
-SHARE_LDFLAGS = -shared -Xlinker -x
+SHLIB_LDFLAGS = -shared -Xlinker -x
 SHLIB_SUFFIX=so
 SHLIB_CFLAGS=
+SHLIB_LINKER=${MT_CC} -shared
 #
 # libraries
 MTLIBS=-lpthread
index 8a7d9d6ca586bbcbdd44d84f1a4ed31869ad2861..1bfadab6967d794d002ee38b70ab454e939547f3 100644 (file)
@@ -27,6 +27,7 @@ TXLIBS= -lcurses
 XLIBS=@LIB_AFSDB@
 MTLIBS=-lpthread
 SHLIB_SUFFIX=so
+SHLIB_LINKER=${CC} -shared
 #
 # programs
 AR=ar
index fd33e43b079e9fa207643fecce89820a61a8a17e..4bac72ae34a3ba5d179f588904c80e9a7161b6f1 100644 (file)
@@ -27,6 +27,7 @@ TXLIBS= -lcurses
 XLIBS=@LIB_AFSDB@
 MTLIBS=-lpthread
 SHLIB_SUFFIX=so
+SHLIB_LINKER=${CC} -shared
 #
 # programs
 AR=ar
index f8c75148e54efa31affe49d797c82e776b3f8379..5fe6924e96c2c01490e95c018137b725142f30ac 100644 (file)
@@ -28,6 +28,7 @@ XLIBS=@LIB_AFSDB@
 MTLIBS=-lpthread
 SHLIB_SUFFIX=so
 SHLIB_CFLAGS=
+SHLIB_LINKER=${CC} -shared
 #
 # programs
 AR=ar
index a0a0c87ca0b23006a8e13bb8450c4d5360972d50..dc9a661f0a7525e9c1821dfcef016f34b793c8bb 100644 (file)
@@ -28,6 +28,7 @@ XLIBS=@LIB_AFSDB@
 MTLIBS=-lpthread
 SHLIB_SUFFIX=so
 SHLIB_CFLAGS=
+SHLIB_LINKER=${CC} -shared
 #
 # programs
 AR=ar
index b550bd7d90593e3fe344da05a522947e3bc0e8f0..4c412cdb9a74021bcdc4868b25d50c06bc4844bd 100644 (file)
@@ -21,9 +21,10 @@ PAM_CFLAGS = -O2 -Dlinux -DLINUX_PAM -fPIC
 XCFLAGS= -O2
 MT_CFLAGS=-DAFS_PTHREAD_ENV -pthread -D_REENTRANT ${XCFLAGS}
 XLDFLAGS=
-SHARE_LDFLAGS = -shared -Xlinker -x
+SHLIB_LDFLAGS = -shared -Xlinker -x
 SHLIB_SUFFIX=so
 SHLIB_CFLAGS=
+SHLIB_LINKER=${MT_CC} -shared
 #
 # libraries
 MTLIBS=-lpthread
index b550bd7d90593e3fe344da05a522947e3bc0e8f0..4c412cdb9a74021bcdc4868b25d50c06bc4844bd 100644 (file)
@@ -21,9 +21,10 @@ PAM_CFLAGS = -O2 -Dlinux -DLINUX_PAM -fPIC
 XCFLAGS= -O2
 MT_CFLAGS=-DAFS_PTHREAD_ENV -pthread -D_REENTRANT ${XCFLAGS}
 XLDFLAGS=
-SHARE_LDFLAGS = -shared -Xlinker -x
+SHLIB_LDFLAGS = -shared -Xlinker -x
 SHLIB_SUFFIX=so
 SHLIB_CFLAGS=
+SHLIB_LINKER=${MT_CC} -shared
 #
 # libraries
 MTLIBS=-lpthread
index b550bd7d90593e3fe344da05a522947e3bc0e8f0..4c412cdb9a74021bcdc4868b25d50c06bc4844bd 100644 (file)
@@ -21,9 +21,10 @@ PAM_CFLAGS = -O2 -Dlinux -DLINUX_PAM -fPIC
 XCFLAGS= -O2
 MT_CFLAGS=-DAFS_PTHREAD_ENV -pthread -D_REENTRANT ${XCFLAGS}
 XLDFLAGS=
-SHARE_LDFLAGS = -shared -Xlinker -x
+SHLIB_LDFLAGS = -shared -Xlinker -x
 SHLIB_SUFFIX=so
 SHLIB_CFLAGS=
+SHLIB_LINKER=${MT_CC} -shared
 #
 # libraries
 MTLIBS=-lpthread
index b550bd7d90593e3fe344da05a522947e3bc0e8f0..4c412cdb9a74021bcdc4868b25d50c06bc4844bd 100644 (file)
@@ -21,9 +21,10 @@ PAM_CFLAGS = -O2 -Dlinux -DLINUX_PAM -fPIC
 XCFLAGS= -O2
 MT_CFLAGS=-DAFS_PTHREAD_ENV -pthread -D_REENTRANT ${XCFLAGS}
 XLDFLAGS=
-SHARE_LDFLAGS = -shared -Xlinker -x
+SHLIB_LDFLAGS = -shared -Xlinker -x
 SHLIB_SUFFIX=so
 SHLIB_CFLAGS=
+SHLIB_LINKER=${MT_CC} -shared
 #
 # libraries
 MTLIBS=-lpthread
index e7bc37788441eaabc63f34e4f4e14677b5278f3c..b6f1f6c4be5103224727681c145a69d2a6c5c342 100644 (file)
@@ -16,6 +16,10 @@ MT_CFLAGS=-mt -DAFS_PTHREAD_ENV ${XCFLAGS}
 LWP_OPTMZ=-g
 OPTMZ=-O
 DBG=-g
+
+SHLIB_SUFFIX=so
+SHLIB_LINKER=${CC} -G -dy -Wl,-Mmapfile -Bsymbolic -z text
+
 #
 # libraries
 XLIBS=@LIB_AFSDB@ -lsocket -lnsl -lintl -ldl
index 8055c01a46ca35807e171236f20c0986392c59d1..34cd12c213c7d56a85f39f10ed8ab8b4b2deca06 100644 (file)
@@ -15,10 +15,13 @@ XCFLAGS=-dy -Bdynamic
 MT_CFLAGS=-mt -DAFS_PTHREAD_ENV ${XCFLAGS}
 PAM_CFLAGS = -KPIC
 PAMLIBS= -lc -lpam -lsocket -lnsl -lm
-SHARE_LDFLAGS = -G -Bsymbolic
+SHLIB_LDFLAGS = -G -Bsymbolic
 LWP_OPTMZ=-g
 OPTMZ=-O
 DBG=-g
+
+SHLIB_SUFFIX=so
+SHLIB_LINKER=${CC} -G -dy -Wl,-Mmapfile -Bsymbolic -z text
 #
 # libraries
 XLIBS=@LIB_AFSDB@ -lsocket -lnsl -lintl -ldl
index 5b8a3ea4218dd4ece8fb9ac9f78a9543e1a4b64d..3ed29a1cd972173be347288a582de80dabd05de4 100644 (file)
@@ -15,7 +15,7 @@ XCFLAGS=-dy -Bdynamic
 MT_CFLAGS=-mt -DAFS_PTHREAD_ENV ${XCFLAGS}
 PAM_CFLAGS = -KPIC
 PAMLIBS= -lc -lpam -lsocket -lnsl -lm
-SHARE_LDFLAGS = -G -Bsymbolic
+SHLIB_LDFLAGS = -G -Bsymbolic
 LWP_OPTMZ=-g
 OPTMZ=-O
 DBG=-g
@@ -23,6 +23,9 @@ DBG=-g
 ## Compilation flags for 64 bit Solaris
 XCFLAGS64 = ${XCFLAGS} -xarch=v9
 
+SHLIB_SUFFIX=so
+SHLIB_LINKER=${CC} -G -dy -Wl,-Mmapfile -Bsymbolic -z text
+
 #
 # libraries
 XLIBS=@LIB_AFSDB@ -lsocket -lnsl -lintl -ldl
index e1fb1301ac2b3917a7a306bfcaff8a3509edb25e..7b082e24c65174e6103e9a4b2dab187901c3df6f 100644 (file)
@@ -8,7 +8,7 @@ XCFLAGS=-dy -Bdynamic
 MT_CFLAGS=-mt -DAFS_PTHREAD_ENV ${XCFLAGS}
 PAM_CFLAGS = -KPIC
 PAMLIBS= -lc -lpam -lsocket -lnsl -lm
-SHARE_LDFLAGS = -G -Bsymbolic
+SHLIB_LDFLAGS = -G -Bsymbolic
 LWP_OPTMZ=-g
 OPTMZ=-O
 DBG=-g
@@ -16,6 +16,8 @@ DBG=-g
 ## Compilation flags for 64 bit Solaris
 XCFLAGS64 = ${XCFLAGS} -xarch=v9
 
+SHLIB_SUFFIX=so
+SHLIB_LINKER=${CC} -G -dy -Wl,-Mmapfile -Bsymbolic -z text
 #
 # libraries
 XLIBS=@LIB_AFSDB@ -lsocket -lnsl -lintl -ldl 
index e1fb1301ac2b3917a7a306bfcaff8a3509edb25e..cf69f345d41f202889c324b768fe07177cd73da2 100644 (file)
@@ -8,7 +8,6 @@ XCFLAGS=-dy -Bdynamic
 MT_CFLAGS=-mt -DAFS_PTHREAD_ENV ${XCFLAGS}
 PAM_CFLAGS = -KPIC
 PAMLIBS= -lc -lpam -lsocket -lnsl -lm
-SHARE_LDFLAGS = -G -Bsymbolic
 LWP_OPTMZ=-g
 OPTMZ=-O
 DBG=-g
@@ -24,8 +23,10 @@ MTLIBS=-lpthread -lsocket
 XLIBELFA=-lelf
 XLIBKVM=-lkvm
 #
+SHLIB_LINKER=${CC} -G -dy -Wl,-Mmapfile -Bsymbolic -z text
 SHLIB_SUFFIX=so
 SHLIB_CFLAGS=-KPIC
+SHLIB_LDFLAGS = -G -Bsymbolic
 #
 # programs
 AR=/usr/ccs/bin/ar
index 1c60eca7c454cea8fb509cf4acdfe708178839e9..4252f86857998bbd405d129d1adefe03334251e7 100644 (file)
@@ -9,6 +9,9 @@
 # AFS_OSTYPE used to indicate suffixes and os specific subdirectories.
 AFS_OSTYPE = NCR
 
+SHLIB_SUFFIX=so
+SHLIB_LINKER=${CC} -G -dy -Wl,-Mmapfile -Bsymbolic -z text
+
 # compilation and link editor flags
 #
 # libraries
index e1fb1301ac2b3917a7a306bfcaff8a3509edb25e..7b082e24c65174e6103e9a4b2dab187901c3df6f 100644 (file)
@@ -8,7 +8,7 @@ XCFLAGS=-dy -Bdynamic
 MT_CFLAGS=-mt -DAFS_PTHREAD_ENV ${XCFLAGS}
 PAM_CFLAGS = -KPIC
 PAMLIBS= -lc -lpam -lsocket -lnsl -lm
-SHARE_LDFLAGS = -G -Bsymbolic
+SHLIB_LDFLAGS = -G -Bsymbolic
 LWP_OPTMZ=-g
 OPTMZ=-O
 DBG=-g
@@ -16,6 +16,8 @@ DBG=-g
 ## Compilation flags for 64 bit Solaris
 XCFLAGS64 = ${XCFLAGS} -xarch=v9
 
+SHLIB_SUFFIX=so
+SHLIB_LINKER=${CC} -G -dy -Wl,-Mmapfile -Bsymbolic -z text
 #
 # libraries
 XLIBS=@LIB_AFSDB@ -lsocket -lnsl -lintl -ldl 
index 4cdc5e61cd5cc368708b0f310784615b640f9877..e55a01efb1c7e2249e7b9a0729a62319950a8684 100644 (file)
@@ -50,6 +50,7 @@
 #define SYS_NAME_ID_ppc_darwin_12        503
 #define SYS_NAME_ID_ppc_darwin_13        504
 #define SYS_NAME_ID_ppc_darwin_14        505
+#define SYS_NAME_ID_ppc_darwin_60        506
 
 #define SYS_NAME_ID_next_mach20                 601
 #define SYS_NAME_ID_next_mach30                 602
 #define SYS_NAME_ID_alpha_linux_24      2002
 
 #define SYS_NAME_ID_i386_fbsd_42        2100
+#define SYS_NAME_ID_i386_fbsd_43        2101
+#define SYS_NAME_ID_i386_fbsd_44        2102
+#define SYS_NAME_ID_i386_fbsd_45        2103
+#define SYS_NAME_ID_i386_fbsd_46        2103
 
 #define SYS_NAME_ID_ia64_linux2                2200
 #define SYS_NAME_ID_ia64_linux22       2201
index 15fd469d8580047ad334e3d75af421196a5c1fef..7e3a55751325b46b2cb48918cbc843a9e451aabc 100644 (file)
@@ -16,7 +16,6 @@
 #define AFS_X86_FBSD42_ENV 1
 #define AFS_X86_ENV 1
 #define AFS_NONFSTRANS 1
-#define AFS_KERBEROS_ENV 1
 #define O_SYNC O_FSYNC
 #define FTRUNC O_TRUNC
 
@@ -54,6 +53,7 @@
 #define AFS_HAVE_FFS            1       /* Use system's ffs. */
 #define AFS_HAVE_STATVFS       0       /* System doesn't supports statvfs */
 
+#define RXK_LISTENER_ENV 1
 #define AFS_GCPAGS             0       /* if nonzero, garbage collect PAGs */
 #define AFS_USE_GETTIMEOFDAY    1       /* use gettimeofday to implement rx clock */
 
@@ -73,8 +73,8 @@
 #define        AFS_UIOUSER     UIO_USERSPACE
 #define        AFS_CLBYTES     CLBYTES
 #define        osi_GetTime(x)  microtime(x)
-#define        AFS_KALLOC(x)   kalloc(x)
-#define        AFS_KFREE(x,y)  kfree(x,y)
+#define        AFS_KALLOC(x)   malloc(x, M_AFS, M_WAITOK)
+#define        AFS_KFREE(x,y)  free(x,M_AFS)
 #define        v_count         v_usecount
 #define v_vfsp         v_mount
 #define vfs_bsize      mnt_stat.f_bsize
index 1d8e79c559630c6085b546c42ea964d3ba59ff18..b9abf7d4d49ff1f4a58702838d1bacb6cb20f1b0 100644 (file)
@@ -9,7 +9,6 @@
 #define AFS_USR_FBSD42_ENV     1
 #define AFS_USR_FBSD_ENV       1
 #define AFS_NONFSTRANS 1
-#define AFS_KERBEROS_ENV
 
 #define O_SYNC O_FSYNC
 
index 63e5f45a84f40a1d1feeb587667cee8d83515bc5..58d31d9a8bb549103e707f0f0c3b1c7f87d5519d 100644 (file)
@@ -75,6 +75,6 @@
 #endif
 #endif /* KERNEL */
 
-#define HAVE_UCONTEXT_H                /* should be in afsconfig.h */
+#define USE_UCONTEXT           /* should be in afsconfig.h */
 
 #endif /* _PARAM_IA64_LINUX20_H_ */
index a15d41e0acbf3e394930dd00281ec5752452a51d..377971baf18bed00b3d026ef22e50656af1fa056 100644 (file)
@@ -54,6 +54,6 @@
 #define CMSERVERPREF
 #endif
 
-#define HAVE_UCONTEXT_H                /* should be in afsconfig.h */
+#define USE_UCONTEXT           /* should be in afsconfig.h */
 
 #endif /* AFS_PARAM_H */
index f25ec5d4e4a32c062643a452e7ad03e79b17062d..b2f3d291d795e470b6a5d6939f7b8c815bfe5613 100644 (file)
 #define        AFS_AIX41_ENV           1
 #define AFS_AIX42_ENV          1
 
+#ifdef AFS_NAMEI_ENV
+#define AFS_64BIT_IOPS_ENV      1       /* needed for NAMEI... */
+#endif
+
 #include <afs/afs_sysnames.h>
 
 /* Global lock in AFS part of client. */
index b55170eb7cd05fc62e37bac67ccb965a9b59a4a9..435a79dfa651302d3bff4eace94969a1d53f38d2 100644 (file)
@@ -54,8 +54,8 @@ typedef  unsigned long long afs_uint64;
 #define ZeroInt64(a)       (a) = 0
 #define AssignInt64(a, b)   *(a) = (b)
 #define AddInt64(a,b,c) *(c) = (a) + (b)
-#define SubtractInt64(a,b,c) *(c) = (a) - (b)
-#define CompareInt64(a,b) (a) - (b)
+#define SubtractInt64(a,b,c) *(c) = (afs_int64)(a) - (afs_int64)(b)
+#define CompareInt64(a,b) (afs_int64)(a) - (afs_int64)(b)
 #define NonZeroInt64(a)                (a)
 #define Int64ToInt32(a)    (a) & 0xFFFFFFFFL
 #define FillInt64(t,h,l) (t) = (h); (t) <<= 32; (t) |= (l);
index 26801268d4bccbf1b4929637dfefbe86ecc432dd..4dc155ec115dbd185735913cb6b2b499784c4ea7 100644 (file)
@@ -179,7 +179,7 @@ struct cm_initparams {
 #define VIOC_STATISTICS         _VICEIOCTL(68)  /* arla: fetch statistics */
 
 /* Coordinated 'C' pioctl's */
-#define VIOC_NEWALIAS          _VICEIOCTL2('C', 1) /* create new cell alias */
-#define VIOC_GETALIAS          _VICEIOCTL2('C', 2) /* get alias info */
+#define VIOC_NEWALIAS          _CVICEIOCTL(1)  /* create new cell alias */
+#define VIOC_GETALIAS          _CVICEIOCTL(2)  /* get alias info */
 
 #endif /* AFS_VENUS_H */
index 5c76a7c144f9a1646c47a648b8928fea80250ac3..e6f59d901670d282f5c4b6aa292b7f4bd0b46a1c 100644 (file)
@@ -10,7 +10,7 @@
 #include <afsconfig.h>
 #include <afs/param.h>
 
-RCSID("$Header: /tmp/cvstemp/openafs/src/dir/dir.c,v 1.1.1.5 2001/07/14 22:21:40 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/dir/dir.c,v 1.1.1.6 2002/09/26 19:05:59 hartmans Exp $");
 
 #ifdef KERNEL
 #if !defined(UKERNEL)
@@ -34,7 +34,6 @@ RCSID("$Header: /tmp/cvstemp/openafs/src/dir/dir.c,v 1.1.1.5 2001/07/14 22:21:40
 #if    defined(AFS_SUN56_ENV) || defined(AFS_HPUX_ENV)
 #include "../afs/sysincludes.h"
 #endif
-#ifndef AFS_SGI64_ENV
 #if defined(AFS_FBSD_ENV)
 #include "../h/lock.h"
 #include "../vm/vm.h"
@@ -42,6 +41,7 @@ RCSID("$Header: /tmp/cvstemp/openafs/src/dir/dir.c,v 1.1.1.5 2001/07/14 22:21:40
 #include "../vm/pmap.h"
 #include "../vm/vm_map.h"
 #endif /* AFS_FBSD_ENV */
+#if !defined(AFS_SGI64_ENV) && !defined(AFS_DARWIN60_ENV)
 #include "../h/user.h"
 #endif /* AFS_SGI64_ENV */
 #include "../h/uio.h"
index 8a5f354f1e030472c0b03327a6a0cb2e30b63cee..3a4d427150450526e279b08c300ec360c6b678c0 100644 (file)
@@ -14,7 +14,7 @@
 #include <afs/param.h>
 #endif
 
-RCSID("$Header: /tmp/cvstemp/openafs/src/fsint/afsaux.c,v 1.1.1.6 2002/06/10 11:45:59 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/fsint/afsaux.c,v 1.1.1.7 2002/09/26 19:06:03 hartmans Exp $");
 
 #ifdef KERNEL
 #if defined(UKERNEL)
@@ -22,7 +22,7 @@ RCSID("$Header: /tmp/cvstemp/openafs/src/fsint/afsaux.c,v 1.1.1.6 2002/06/10 11:
 #include "../afs/afsincludes.h"
 #include "../rx/xdr.h"
 #else /* defined(UKERNEL) */
-#if defined(AFS_ALPHA_ENV) || defined(AFS_LINUX20_ENV) || defined(AFS_DARWIN_ENV)
+#if defined(AFS_ALPHA_ENV) || defined(AFS_LINUX20_ENV) || defined(AFS_DARWIN_ENV) || defined(AFS_FBSD_ENV)
 #include "../afs/sysincludes.h"
 #include "../afs/afsincludes.h"
 #else
@@ -65,7 +65,7 @@ static afs_int32 bslosers = 0;
 #endif
 #if (defined(AFS_AIX_ENV) && !defined(AUTH_DES)) || (!defined(AFS_SUN_ENV)) && !defined(AFS_SGI_ENV) && !defined(AFS_ALPHA_ENV) && !defined(AFS_SUN5_ENV)
 #ifndef        AFS_AIX32_ENV
-#if !defined(AFS_HPUX110_ENV) && !defined(AFS_LINUX20_ENV) && !defined(AFS_DARWIN_ENV)
+#if !defined(AFS_HPUX110_ENV) && !defined(AFS_LINUX20_ENV) && !defined(AFS_DARWIN_ENV) && !defined(AFS_FBSD_ENV)
 /*
  * XDR chars; from user mode xdr package.
  */
index 075cc15f85cf4faeec10a3eb983623efcbb2f41b..020e5bafbdea791ab0960ed62319753d4c06b5f5 100644 (file)
@@ -18,7 +18,7 @@
 #include <afsconfig.h>
 #include <afs/param.h>
 
-RCSID("$Header: /tmp/cvstemp/openafs/src/gtx/curseswindows.c,v 1.1.1.5 2001/07/14 22:22:01 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/gtx/curseswindows.c,v 1.1.1.6 2002/09/26 19:06:06 hartmans Exp $");
 
 
 #if defined(AFS_HPUX110_ENV) && !defined(__HP_CURSES)
@@ -758,7 +758,7 @@ int gator_cursesgwin_getdimensions(gwp, aparms)
     struct gator_cursesgwin *cwp;      /*Curses-specific data*/
 
     cwp = (struct gator_cursesgwin *)(gwp->w_data);
-#ifdef AFS_DARWIN_ENV
+#if defined(AFS_DARWIN_ENV) && !defined(AFS_DARWIN60_ENV)
     aparms->maxx = cwp->wp->maxx;
     aparms->maxy = cwp->wp->maxy;
 #else
index 359896c1906bb762500267f118e040cffab62fda..47e3c77ae2551cd817052d1c57fb305d2706d8ea 100644 (file)
@@ -16,7 +16,7 @@
 #include <afs/param.h>
 #endif
 
-RCSID("$Header: /tmp/cvstemp/openafs/src/kauth/authclient.c,v 1.1.1.9 2001/10/14 18:05:03 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/kauth/authclient.c,v 1.1.1.10 2002/09/26 19:06:14 hartmans Exp $");
 
 #if defined(UKERNEL)
 #include "../afs/sysincludes.h"
@@ -91,6 +91,10 @@ void ka_ExplicitCell (
            explicit_cell_server_list.hostName[i][0] = 0;
            explicit_cell_server_list.hostAddr[i].sin_port =
                htons(AFSCONF_KAUTHPORT);
+#ifdef STRUCT_SOCKADDR_HAS_SA_LEN
+           explicit_cell_server_list.hostAddr[i].sin_len =
+               sizeof(struct sockaddr_in);
+#endif
            explicit = 1;
        }           
        else break;
index 6fc3de348eda3d0ecc1f26544484570c0c080dc2..43ddd1eac1425334e55745f260c1a8d1022c677a 100644 (file)
@@ -15,7 +15,7 @@
 #include <afsconfig.h>
 #include <afs/param.h>
 
-RCSID("$Header: /tmp/cvstemp/openafs/src/kauth/krb_udp.c,v 1.1.1.12 2002/08/02 04:35:18 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/kauth/krb_udp.c,v 1.1.1.13 2002/09/26 19:06:20 hartmans Exp $");
 
 #include <afs/stds.h>
 #include <sys/types.h>
@@ -857,6 +857,9 @@ afs_int32 init_krb_udp ()
     krb4name = "kerberos4";
     sp = getservbyname(krb4name, "udp");
     taddr.sin_family = AF_INET;  /* added for NCR port */
+#ifdef STRUCT_SOCKADDR_HAS_SA_LEN
+    taddr.sin_len = sizeof(struct sockaddr_in);
+#endif
     if ( !sp ) 
     {
        /* if kerberos-4 is not available, try "kerberos-iv" */
index 45b4a87cb0782530d0240791e85ef4bae0b2a3af..fabee072b444bc2fd0f17888215547fa684e3e28 100644 (file)
@@ -1,5 +1,5 @@
 #/* Copyright (C) 1995, 1989 Transarc Corporation - All rights reserved */
-# $Header: /tmp/cvstemp/openafs/src/libafs/MakefileProto.DARWIN.in,v 1.1.1.5 2002/06/10 11:46:33 hartmans Exp $
+# $Header: /tmp/cvstemp/openafs/src/libafs/MakefileProto.DARWIN.in,v 1.1.1.6 2002/09/26 19:06:44 hartmans Exp $
 # 
 # MakefileProto for Digital Unix systems
 #
@@ -46,7 +46,11 @@ AFS_OS_NONFSOBJS = osi_vfsops.o
 KDEFS=
 DBUG = 
 DEFINES= -D_KERNEL -DKERNEL -DKERNEL_PRIVATE -DDIAGNOSTIC -DUSE_SELECT -DMACH_USER_API -DMACH_KERNEL
+<ppc_darwin_60>
+KOPTS=-no-cpp-precomp -static -fno-common -finline -fno-keep-inline-functions -force_cpusubtype_ALL -msoft-float -mlong-branch 
+<ppc_darwin_14 ppc_darwin_13 ppc_darwin_12>
 KOPTS=-no-precomp -static -fno-common -finline -fno-keep-inline-functions -force_cpusubtype_ALL -msoft-float -mlong-branch 
+<all>
 #CFLAGS=-Werror-implicit-function-declaration -I. -I.. ${KINCLUDES} $(DEFINES) $(KDEFS) $(KOPTS) ${DBUG}
 #CFLAGS=-framework Kernel -I. -I.. ${KINCLUDES} $(DEFINES) $(KDEFS) $(KOPTS) ${DBUG}
 CFLAGS=-I. -I.. -I${TOP_SRCDIR}/config ${KINCLUDES} $(DEFINES) $(KDEFS) $(KOPTS) ${DBUG} ${OPTMZ}
index 8f74f1a161957ec4bcc387cdc7c4cd670802e106..e60178dbf83e7e0a2f0b6b3449230205261f383d 100644 (file)
@@ -1,4 +1,3 @@
-#/* Copyright (C) 1995, 1989 Transarc Corporation - All rights reserved */
 #
 # MakefileProto for FreeBSD systems
 #
@@ -20,7 +19,7 @@ afssrvlibexecdir=@afssrvlibexecdir@
 afskerneldir=@afskerneldir@
 SYS_NAME=@AFS_SYSNAME@
 
-include config/Makefile.${SYS_NAME}
+include config/Makefile.${SYS_NAME}
 
 # OS specific object files:
 AFS_OS_OBJS = \
@@ -30,7 +29,8 @@ AFS_OS_OBJS = \
        osi_misc.o \
        osi_sleep.o \
        osi_vm.o \
-       osi_vnodeops.o
+       osi_vnodeops.o \
+       osi_module.o 
 
 AFS_OS_NFSOBJS = \
        osi_vfsops_nfs.o
@@ -45,7 +45,7 @@ AFS_OS_NONFSOBJS = \
 #      -DSWAPTYPE=1 -DUERF -DOSF -DCOMPAT_43 -DUFS \
 #      -DRT -DKERNEL -D_KERNEL
 KDEFS=-Wall -fformat-extensions -ansi -nostdinc -I/usr/include -D_KERNEL \
-       -elf -mpreferred-stack-boundary=2 -I/usr/src/sys/sys -I../afs
+       -DKLD_MODULE -elf -mpreferred-stack-boundary=2 -I.. -I../afs
 DBUG = -O2
 DEFINES= -DAFSDEBUG -DKERNEL -DAFS -DVICE -DNFS -DUFS -DINET -DQUOTA -DGETMOUNT
 OPTF=${OPT} 
@@ -83,8 +83,8 @@ setup:
 
 
 # Below this line are targets when in the COMMON directory:
-LIBAFS = libafs.o
-LIBAFSNONFS = libafs.nonfs.o
+LIBAFS = libafs.ko
+LIBAFSNONFS = libafs.nonfs.ko
 
 INST_LIBAFS = ${DESTDIR}${afskerneldir}/${LIBAFS}
 INST_LIBAFSNONFS = ${DESTDIR}${afskerneldir}/${LIBAFSNONFS}
@@ -92,21 +92,15 @@ INST_LIBAFSNONFS = ${DESTDIR}${afskerneldir}/${LIBAFSNONFS}
 DEST_LIBAFS = ${DEST}/root.client/bin/${LIBAFS}
 DEST_LIBAFSNONFS = ${DEST}/root.client/bin/${LIBAFSNONFS}
 
+# Without this line, gmake tries to build libafs.o
+.PHONY: libafs
 
 # libafs:      $(LIBAFS) $(LIBAFSNONFS)
-# libafs:      $(LIBAFSNONFS)
+libafs:        $(LIBAFSNONFS)
 # install_libafs:      $(INST_LIBAFS) $(INST_LIBAFSNONFS)
-# install_libafs:      $(INST_LIBAFSNONFS)
+install_libafs:        $(INST_LIBAFSNONFS)
 # dest_libafs: $(DEST_LIBAFS) $(DEST_LIBAFSNONFS)
-# dest_libafs: $(DEST_LIBAFSNONFS)
-libafs:
-       echo WARNING: No kernel module for ${SYS_NAME}
-
-install_libafs:
-       echo WARNING: No kernel module for ${SYS_NAME}
-
-dest_libafs:
-       echo WARNING: No kernel module for ${SYS_NAME}
+dest_libafs:   $(DEST_LIBAFSNONFS)
 
 
 $(INST_LIBAFS): $(LIBAFS)
@@ -122,10 +116,16 @@ $(DEST_LIBAFSNONFS): $(LIBAFSNONFS)
        $(INSTALL) -f $? $@
 
 ${LIBAFS}: $(AFSAOBJS) $(AFSNFSOBJS)
-       $(LD) -r -o ${LIBAFS} ${AFSAOBJS} ${AFSNFSOBJS}
+       $(LD) -r -o ${LIBAFS}.kld ${AFSAOBJS} ${AFSNFSOBJS}
+       gensetdefs ${LIBAFS}.kld
+       $(MAKE) setdef0.o setdef1.o
+       $(LD) -Bshareable -o ${LIBAFS} setdef0.o ${LIBAFS}.kld setdef1.o
 
 ${LIBAFSNONFS}:  $(AFSAOBJS) $(AFSNONFSOBJS)
-       $(LD) -r -o ${LIBAFSNONFS} ${AFSAOBJS} ${AFSNONFSOBJS}
+       $(LD) -r -o ${LIBAFSNONFS}.kld ${AFSAOBJS} ${AFSNONFSOBJS}
+       gensetdefs ${LIBAFSNONFS}.kld
+       $(MAKE) setdef0.o setdef1.o
+       $(LD) -Bshareable -o ${LIBAFSNONFS} setdef0.o ${LIBAFSNONFS}.kld setdef1.o
 
 
 # Object build rules:
@@ -147,3 +147,9 @@ osi_vm.o: $(AFS)/osi_vm.c
        $(CRULE1)
 osi_vnodeops.o: $(AFS)/osi_vnodeops.c
        $(CRULE1)
+osi_module.o: $(AFS)/osi_module.c
+       $(CRULE1)   
+setdef0.o: setdef0.c
+       $(CRULE1)
+setdef1.o: setdef1.c
+       $(CRULE1)
index c8eb620c283f88d316d77be30c4fa4a1a51a1ff4..b0ae1e8e1981bcb7e0bac61def4359646ff62b23 100644 (file)
@@ -57,6 +57,8 @@ COMERROBJS =\
        com_err.o
 
 XDROBJS =\
+       xdr.o \
+       xdr_array.o \
        xdr_arrayn.o \
        xdr_rx.o \
        xdr_int64.o \
@@ -256,7 +258,7 @@ xdr_afsuuid.o: ${RX}/xdr_afsuuid.c
 #
 #   $ what /opt/langtools/bin/pxdb32
 #   /opt/langtools/bin/pxdb32:
-#           HP92453-02 A.10.0A HP-UX SYMBOLIC DEBUGGER (PXDB) $Revision: 1.1.1.2 $
+#           HP92453-02 A.10.0A HP-UX SYMBOLIC DEBUGGER (PXDB) $Revision: 1.1.1.3 $
 #
 # The problem occurs when -g and -O are both used when compiling des.c.
 # The simplest way to work around the problem is to leave out either -g or -O.
index e597b89effe7775097e1c7021bc71e5f99ec6ccb..27ab64820dbdb36b8ecea756ae5db8573365c0b1 100644 (file)
@@ -72,7 +72,7 @@ UAFS/$(LIBUAFS): setup_uafs
        $(MAKE) $(LIBUAFS) DESTDIR=${DESTDIR}
 
 AFSWEB/$(LIBAFSWEB): setup_nsafs
-cd AFSWEB; \
+       cd AFSWEB; \
        $(MAKE) $(LIBAFSWEB) DESTDIR=${DESTDIR}
 
 AFSWEB/$(LIBAFSWEBKRB): setup_nsafs
index 521a8ca9f349b30f3f487ea4398d38a3a72a5aae..ba61bb8bd135dc043fecc05fbf497d9934ba2bad 100644 (file)
@@ -35,7 +35,7 @@ AFSLIBS = ${TOP_LIBDIR}/librxkad.a ${TOP_LIBDIR}/libsys.a \
           ${TOP_LIBDIR}/libcmd.a ${TOP_LIBDIR}/libcom_err.a \
          ${TOP_LIBDIR}/util.a
 
-LDFLAGS = ${SHARE_LDFLAGS}
+LDFLAGS = ${SHLIB_LDFLAGS}
    LIBS = ${TOP_LIBDIR}/libkauth.a ${LIBSA} ${TOP_LIBDIR}/libauth.a \
          ${AFSLIBS} ${PAMLIBS} @LIB_AFSDB@
   KLIBS = ${TOP_LIBDIR}/libkauth.krb.a ${LIBSA} ${TOP_LIBDIR}/libauth.krb.a \
index 6099b3a59406a0cbfdbfaf7bc07b5cf997dfc565..1b14158df68c44ad6302f643468de61b9cccf630 100644 (file)
@@ -49,7 +49,7 @@ Generic install command.  Options are:
 #include <afsconfig.h>
 #include <afs/param.h>
 
-RCSID("$Header: /tmp/cvstemp/openafs/src/pinstall/install.c,v 1.1.1.8 2001/10/14 18:06:07 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/pinstall/install.c,v 1.1.1.9 2002/09/26 19:07:22 hartmans Exp $");
 
 #include <stdio.h>
 #include <pwd.h>
@@ -86,7 +86,9 @@ RCSID("$Header: /tmp/cvstemp/openafs/src/pinstall/install.c,v 1.1.1.8 2001/10/14
 struct stat istat, ostat;
 
 extern int errno;
+#if !defined(AFS_DARWIN60_ENV)
 extern int sys_nerr;
+#endif
 #if !defined(AFS_LINUX20_ENV) && !defined(AFS_DARWIN_ENV) && !defined(AFS_FBSD_ENV)
 extern char *sys_errlist[];
 #endif
@@ -476,10 +478,8 @@ main (argc, argv)
 #endif /* AFS_HPUX_ENV */
     char pnametmp[1024];
     int pnamelen;
-#if defined (AFS_AIX_ENV) || defined(AFS_XBSD_ENV)
     afs_int32 newcode;
     static char diskBuffer[BUFSIZE];   /* must be static to avoid compiler bugs for large stuff */
-#endif
     char myHostName[100];
     struct timeval tvp[2];
     int isDir;
index 9132a33c52734b6cc364f68717ad0c390f219659..51c624c21cbbd9b832b26d9ad6320cd23df0a1b5 100644 (file)
@@ -10,7 +10,7 @@
 #include <afsconfig.h>
 #include <afs/param.h>
 
-RCSID("$Header: /tmp/cvstemp/openafs/src/ptserver/ptprocs.c,v 1.1.1.9 2002/05/11 00:00:47 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/ptserver/ptprocs.c,v 1.1.1.10 2002/09/26 19:07:27 hartmans Exp $");
 
 #include <afs/stds.h>
 #include <ctype.h>
@@ -360,7 +360,7 @@ struct prdebugentry *aentry;
     code = pr_ReadEntry(tt, 0, apos, aentry);
     if (code) ABORT_WITH(tt,code);
 
-    if (!AccessOK (tt, cid, aentry, PRP_STATUS_MEM, PRP_STATUS_ANY))
+    if (!AccessOK (tt, cid, 0, PRP_STATUS_MEM, 0))
         ABORT_WITH(tt,PRPERM);
 
     /* Since prdebugentry is in the form of a prentry not a coentry, we will
@@ -524,7 +524,8 @@ afs_int32 idToName (call, aid, aname)
 
     /* leave this first for rpc stub */
     size = aid->idlist_len;
-    if (size <= 0) size = 0;
+    if (size == 0) return 0;
+    if (size <  0) return PRTOOMANY;
     aname->namelist_val = (prname *)malloc(size*PR_MAXNAMELEN);
     aname->namelist_len = 0;
     if (aname->namelist_val == 0) return PRNOMEM;
index 4957bace138d4d3d47b987b78b066d2935d28c24..3583588f00605c533c41e3b299e0d6ab87a7f10a 100644 (file)
@@ -10,7 +10,7 @@
 #include <afsconfig.h>
 #include <afs/param.h>
 
-RCSID("$Header: /tmp/cvstemp/openafs/src/ptserver/testpt.c,v 1.1.1.8 2001/10/14 18:06:14 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/ptserver/testpt.c,v 1.1.1.9 2002/09/26 19:07:29 hartmans Exp $");
 
 #include <ctype.h>
 #include <errno.h>
@@ -917,6 +917,9 @@ static int MyBeforeProc (as, arock)
            memcpy(&cellinfo.hostAddr[i].sin_addr, th->h_addr, sizeof(afs_int32));
            cellinfo.hostAddr[i].sin_family = AF_INET;
            cellinfo.hostAddr[i].sin_port = 0;
+#ifdef STRUCT_SOCKADDR_HAS_SA_LEN
+           cellinfo.hostAddr[i].sin_len = sizeof(struct sockaddr_in);
+#endif
        }
        cellinfo.numServers = i;
        strcpy (cellinfo.name, lcell);
index 530b3ceba86c0854308eb46c35d0b488ce2a8214..a7700733c7938ca94f80421b67b74de102364edc 100644 (file)
  */
 #define CV_INIT(cv,a,b,c)
 #define CV_DESTROY(cv)
+#ifdef AFS_DARWIN14_ENV
+#define CV_WAIT(cv, lck)    { \
+                               int isGlockOwner = ISAFS_GLOCK(); \
+                               if (isGlockOwner) AFS_GUNLOCK();  \
+                               MUTEX_EXIT(lck);        \
+                               sleep(cv, PVFS);                \
+                               if (isGlockOwner) AFS_GLOCK();  \
+                               MUTEX_ENTER(lck); \
+                           }
+
+#define CV_TIMEDWAIT(cv,lck,t)  { \
+                               int isGlockOwner = ISAFS_GLOCK(); \
+                               if (isGlockOwner) AFS_GUNLOCK();  \
+                               MUTEX_EXIT(lck);        \
+                               tsleep(cv,PVFS, "afs_CV_TIMEDWAIT",t);  \
+                               if (isGlockOwner) AFS_GLOCK();  \
+                               MUTEX_ENTER(lck);       \
+                            }
+
+#define CV_SIGNAL(cv)           wakeup_one(cv)
+#define CV_BROADCAST(cv)        wakeup(cv)
+#else
 #define CV_WAIT(cv, lck)    { \
                                int isGlockOwner = ISAFS_GLOCK(); \
                                if (isGlockOwner) AFS_GUNLOCK();  \
@@ -57,6 +79,7 @@
 
 #define CV_SIGNAL(cv)           thread_wakeup_one((event_t)(cv))
 #define CV_BROADCAST(cv)        thread_wakeup((event_t)(cv))
+#endif
 
 typedef struct {
     struct lock__bsd__ lock;
index 924d8c216adb300fe09440edaa653975380cab82..005e41b350903b33ec5f0877931eb7ee0b96252a 100644 (file)
@@ -1,18 +1,24 @@
-/* Copyright Transarc Corporation 1998 - All Rights Reserved
- *
+/*
+ * Copyright 2000, International Business Machines Corporation and others.
+ * All Rights Reserved.
+ * 
+ * This software has been released under the terms of the IBM Public
+ * License.  For details, see the LICENSE file in the top-level source
+ * directory or online at http://www.openafs.org/dl/license10.html
+ */
+
+/*
  * rx_kmutex.h - mutex and condition variable macros for kernel environment.
  *
- * DUX implementation.
+ * FBSD implementation.
  */
 
 #ifndef _RX_KMUTEX_H_
 #define _RX_KMUTEX_H_
 
-#ifdef AFS_FBSD40_ENV
-
+#include <sys/systm.h>
+#include <sys/proc.h>
 #include <sys/lock.h>
-/* #include <kern/sched_prim.h> */
-/* #include <sys/unix_defs.h> */
 
 #define RX_ENABLE_LOCKS                1
 #define AFS_GLOBAL_RXLOCK_KERNEL
 #define CV_WAIT(cv, lck)    { \
                                int isGlockOwner = ISAFS_GLOCK(); \
                                if (isGlockOwner) AFS_GUNLOCK();  \
-                               assert_wait((vm_offset_t)(cv), 0);      \
                                MUTEX_EXIT(lck);        \
-                               thread_block();         \
+                               tsleep(cv, PSOCK, "afs_rx_cv_wait", 0);  \
                                if (isGlockOwner) AFS_GLOCK();  \
                                MUTEX_ENTER(lck); \
                            }
 
-#define CV_TIMEDWAIT(cv,lck,t) { \
-                               int isGlockOwner = ISAFS_GLOCK(); \
-                               if (isGlockOwner) AFS_GUNLOCK();  \
-                               assert_wait((vm_offset_t)(cv), 0);      \
-                               thread_set_timeout(t);  \
-                               MUTEX_EXIT(lck);        \
-                               thread_block();         \
-                               if (isGlockOwner) AFS_GLOCK();  \
-                               MUTEX_ENTER(lck);       \
+#define CV_TIMEDWAIT(cv,lck,t)  { \
+                               int isGlockOwner = ISAFS_GLOCK(); \
+                               if (isGlockOwner) AFS_GUNLOCK();  \
+                               MUTEX_EXIT(lck);        \
+                               tsleep(cv, PSOCK, "afs_rx_cv_timedwait", t); \
+                               if (isGlockOwner) AFS_GLOCK();  \
+                               MUTEX_ENTER(lck);       \
 
-#define CV_SIGNAL(cv)          thread_wakeup_one((vm_offset_t)(cv))
-#define CV_BROADCAST(cv)       thread_wakeup((vm_offset_t)(cv))
+#define CV_SIGNAL(cv)           wakeup_one(cv)
+#define CV_BROADCAST(cv)        wakeup(cv)
 
+#define osi_rxWakeup(cv)        wakeup(cv)
+typedef int afs_kcondvar_t;
+
+#define HEAVY_LOCKS
+#ifdef NULL_LOCKS
 typedef struct {
-    struct simplelock lock;
+    struct proc *owner;
 } afs_kmutex_t;
-typedef int afs_kcondvar_t;
 
-#define osi_rxWakeup(cv)       thread_wakeup((vm_offset_t)(cv))
+#define MUTEX_INIT(a,b,c,d) \
+    do { \
+       (a)->owner = 0; \
+    } while(0);
+#define MUTEX_DESTROY(a) \
+    do { \
+       (a)->owner = (struct proc *)-1; \
+    } while(0);
+#define MUTEX_ENTER(a) \
+    do { \
+       osi_Assert((a)->owner == 0); \
+       (a)->owner = curproc; \
+    } while(0);
+#define MUTEX_TRYENTER(a) \
+    ( osi_Assert((a)->owner == 0), (a)->owner = curproc, 1)
+#define MUTEX_EXIT(a) \
+    do { \
+       osi_Assert((a)->owner == curproc); \
+       (a)->owner = 0; \
+    } while(0);
 
-#define LOCK_INIT(a,b) \
+#undef MUTEX_ISMINE
+#define MUTEX_ISMINE(a) (((afs_kmutex_t *)(a))->owner == curproc)
+
+#else
+#ifdef HEAVY_LOCKS
+typedef struct {
+    struct lock lock;
+    struct proc *owner;
+} afs_kmutex_t;
+
+
+#define MUTEX_INIT(a,b,c,d) \
+    do { \
+       lockinit(&(a)->lock,PSOCK, "afs rx mutex", 0, 0); \
+       (a)->owner = 0; \
+    } while(0);
+#define MUTEX_DESTROY(a) \
     do { \
-       usimple_lock_init(&(a)->lock); \
+       (a)->owner = (struct proc *)-1; \
     } while(0);
+#define MUTEX_ENTER(a) \
+    do { \
+       lockmgr(&(a)->lock, LK_EXCLUSIVE, 0, curproc); \
+       osi_Assert((a)->owner == 0); \
+       (a)->owner = curproc; \
+    } while(0);
+#define MUTEX_TRYENTER(a) \
+    ( lockmgr(&(a)->lock, LK_EXCLUSIVE|LK_NOWAIT, 0, curproc) ? 0 : ((a)->owner = curproc, 1) )
+#define xMUTEX_TRYENTER(a) \
+    ( osi_Assert((a)->owner == 0), (a)->owner = curproc, 1)
+#define MUTEX_EXIT(a) \
+    do { \
+       osi_Assert((a)->owner == curproc); \
+       (a)->owner = 0; \
+       lockmgr(&(a)->lock, LK_RELEASE, 0, curproc); \
+    } while(0);
+
+#undef MUTEX_ISMINE
+#define MUTEX_ISMINE(a) (((afs_kmutex_t *)(a))->owner == curproc)
+#else
+typedef struct {
+    struct simplelock lock;
+    struct proc *owner;
+} afs_kmutex_t;
+
+
 #define MUTEX_INIT(a,b,c,d) \
     do { \
-       usimple_lock_init(&(a)->lock); \
+       simple_lock_init(&(a)->lock); \
+       (a)->owner = 0; \
     } while(0);
 #define MUTEX_DESTROY(a) \
     do { \
-       usimple_lock_terminate(&(a)->lock); \
+       (a)->owner = (struct proc *)-1; \
     } while(0);
 #define MUTEX_ENTER(a) \
     do { \
-       usimple_lock(&(a)->lock); \
+       simple_lock(&(a)->lock); \
+       osi_Assert((a)->owner == 0); \
+       (a)->owner = curproc; \
     } while(0);
 #define MUTEX_TRYENTER(a) \
-   usimple_lock(&(a)->lock)
+    ( simple_lock_try(&(a)->lock) ? 0 : ((a)->owner = curproc, 1) )
 #define MUTEX_EXIT(a) \
     do { \
-       usimple_unlock(&(a)->lock); \
+       osi_Assert((a)->owner == curproc); \
+       (a)->owner = 0; \
+       simple_unlock(&(a)->lock); \
     } while(0);
 
 #undef MUTEX_ISMINE
-#define MUTEX_ISMINE(a) 1
-/* 
-  #define MUTEX_ISMINE(a) 
-  (((afs_kmutex_t *)(a))->owner == current_thread())
-*/ 
+#define MUTEX_ISMINE(a) (((afs_kmutex_t *)(a))->owner == curproc)
+#endif
+#endif
+
 
 #undef osirx_AssertMine
 extern void osirx_AssertMine(afs_kmutex_t *lockaddr, char *msg);
 
-#endif /* FBSD40 */
-
-
 #endif /* _RX_KMUTEX_H_ */
-
index 5136de96555fe66abdc6782f5c4059010d24c257..4ed5f43b8da39c97dbc4bc0aad86ad06444998f6 100644 (file)
 #include <afsconfig.h>
 #include "../afs/param.h"
 
-RCSID("$Header: /tmp/cvstemp/openafs/src/rx/FBSD/rx_knet.c,v 1.1.1.4 2001/09/11 14:34:30 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/rx/FBSD/rx_knet.c,v 1.1.1.5 2002/09/26 19:07:44 hartmans Exp $");
 
 #ifdef AFS_FBSD40_ENV
 #include "../rx/rx_kcommon.h"
 
 
+#ifdef RXK_LISTENER_ENV
+int osi_NetReceive(osi_socket so, struct sockaddr_in *addr, struct iovec *dvec,         
+        int nvecs, int *alength)
+{   
+    struct socket *asocket = (struct socket *)so;
+    struct uio u;
+    int i;
+    struct iovec iov[RX_MAXIOVECS];
+    struct sockaddr *sa;
+    int code;
+
+    int haveGlock = ISAFS_GLOCK();
+    /*AFS_STATCNT(osi_NetReceive);*/
+
+    if (nvecs > RX_MAXIOVECS) {
+        osi_Panic("osi_NetReceive: %d: Too many iovecs.\n", nvecs);
+    }
+
+    for (i = 0 ; i < nvecs ; i++) {
+        iov[i].iov_base = dvec[i].iov_base;
+        iov[i].iov_len = dvec[i].iov_len;
+    }
+
+    u.uio_iov=&iov[0];
+    u.uio_iovcnt=nvecs;
+    u.uio_offset=0;
+    u.uio_resid=*alength;
+    u.uio_segflg=UIO_SYSSPACE; 
+    u.uio_rw=UIO_READ;
+    u.uio_procp=NULL;  
+
+    if (haveGlock) { 
+        AFS_GUNLOCK();
+    }
+    code = soreceive(asocket, &sa, &u, NULL, NULL, NULL);
+#if KNET_DEBUG
+    if (code) {
+        if (code == EINVAL)
+          Debugger("afs NetReceive busted");
+        else
+          printf("y");
+    }
+#endif
+    if (haveGlock) {
+        AFS_GLOCK();
+    }
+    *alength=*alength-u.uio_resid;
+    if (sa) {
+       if (sa->sa_family == AF_INET) {
+          if (addr) *addr=*(struct sockaddr_in *)sa;
+       } else {
+          printf("Unknown socket family %d in NetReceive\n", sa->sa_family);
+       }
+    }
+    return code;
+}
+
+extern int rxk_ListenerPid;
+void osi_StopListener(void)
+{
+   struct proc *p;
+
+   soclose(rx_socket);
+   p=pfind(rxk_ListenerPid); 
+   if (p)
+       psignal(p, SIGUSR1);
+}
+
+int 
+osi_NetSend(asocket, addr, dvec, nvecs, alength, istack)
+     register struct socket *asocket;
+     struct iovec *dvec;
+     int nvecs;
+     register afs_int32 alength;
+     struct sockaddr_in *addr;
+     int istack;
+{
+    register afs_int32 code;
+    int s;
+    int len;
+    int i;
+    struct iovec iov[RX_MAXIOVECS];
+    char *tdata;
+    struct uio u;
+    int haveGlock = ISAFS_GLOCK();
+
+    AFS_STATCNT(osi_NetSend);
+    if (nvecs > RX_MAXIOVECS) {
+        osi_Panic("osi_NetSend: %d: Too many iovecs.\n", nvecs);
+    } 
+
+    for (i = 0 ; i < nvecs ; i++) {
+        iov[i].iov_base = dvec[i].iov_base; 
+        iov[i].iov_len = dvec[i].iov_len; 
+    } 
+
+    u.uio_iov=&iov[0];
+    u.uio_iovcnt=nvecs;
+    u.uio_offset=0;
+    u.uio_resid=alength;
+    u.uio_segflg=UIO_SYSSPACE;
+    u.uio_rw=UIO_WRITE;
+    u.uio_procp=NULL;
+
+    addr->sin_len=sizeof(struct sockaddr_in);
+
+    if (haveGlock) {
+        AFS_GUNLOCK();
+    }
+#if KNET_DEBUG
+    printf("+");
+#endif
+    code = sosend(asocket, addr, &u, NULL, NULL, 0, curproc);
+#if KNET_DEBUG
+    if (code) {
+        if (code == EINVAL)
+          Debugger("afs NetSend busted");
+        else
+          printf("z");
+    }
+#endif
+    if (haveGlock) {
+        AFS_GLOCK();
+    }
+    return code;
+}
+#else
+/* This code *almost* works :( */
 static struct protosw parent_proto;    /* udp proto switch */
 static void rxk_input (struct mbuf *am, int iphlen);
 static void rxk_fasttimo (void);
@@ -41,9 +169,11 @@ rxk_init() {
     last = inetdomain.dom_protoswNPROTOSW;
     for (tpro = inetdomain.dom_protosw; tpro < last; tpro++)
       if (tpro->pr_protocol == IPPROTO_UDP) {
+#if 0 /* not exported */
        /* force UDP checksumming on for AFS    */
         extern int udpcksum;
         udpcksum = 1;  
+#endif
           memcpy(&parent_proto, tpro, sizeof(parent_proto));
           tpro->pr_input = rxk_input;
           tpro->pr_fasttimo = rxk_fasttimo;
@@ -190,7 +320,6 @@ static void rxk_fasttimo (void)
     if (tproc = parent_proto.pr_fasttimo) (*tproc)();
 }
 
-
 /* rx_NetSend - send asize bytes at adata from asocket to host at addr.
  *
  * Now, why do we allocate a new buffer when we could theoretically use the one
@@ -219,6 +348,8 @@ register struct sockbuf *sb; {
     return 0;
 }
 
+/* We only have to do all the mbuf management ourselves if we can be called at
+   interrupt time. in RXK_LISTENER_ENV, we can just call sosend() */
 int 
 osi_NetSend(asocket, addr, dvec, nvec, asize, istack)
      register struct socket *asocket;
@@ -239,15 +370,20 @@ osi_NetSend(asocket, addr, dvec, nvec, asize, istack)
     int i,tl,rlen;
     int mlen;
     int haveGlock;
+#if KNET_DEBUG
+    static int before=0;
+#endif
 
     AFS_STATCNT(osi_NetSend);
-
 /* Actually, the Ultrix way is as good as any for us, so we don't bother with
  * special mbufs any more.  Used to think we could get away with not copying
  * the data to the interface, but there's no way to tell the caller not to
  * reuse the buffers after sending, so we lost out on that trick anyway */
-
     s = splnet();
+    if (trysblock(&asocket->so_snd)) {
+        splx(s);
+        return 1;
+    }
     mp = &top;
     i = 0;
     tdata = dvec[i].iov_base;
@@ -257,6 +393,7 @@ osi_NetSend(asocket, addr, dvec, nvec, asize, istack)
         if (top == 0) {
             MGETHDR(m, M_DONTWAIT, MT_DATA);
             if (!m) {
+                sbunlock(&asocket->so_snd);
                 splx(s);
                 return 1;
             }
@@ -282,8 +419,6 @@ osi_NetSend(asocket, addr, dvec, nvec, asize, istack)
         * to ourself).
         */
        if (asize >= 4 * MLEN) {        /* try to get cluster mbuf */
-           register struct mbuf *p;
-
            /* different algorithms for getting cluster mbuf */
             MCLGET(m, M_DONTWAIT);
             if ((m->m_flags & M_EXT) == 0)
@@ -334,32 +469,42 @@ nopages:
     um = m_get(M_DONTWAIT, MT_SONAME);
     if (!um) {
        if (top) m_freem(top);  /* free mbuf chain */
-       /* if this were vfs40, we'd do sbunlock(asocket, &asocket->so_snd), but
-          we don't do the locking at all for vfs40 systems */
+        sbunlock(&asocket->so_snd);
        splx(s);
        return 1;
     }
     memcpy(mtod(um, caddr_t), addr, sizeof(*addr));
-    um->m_len = sizeof(*addr);
+    addr->sin_len = um->m_len = sizeof(*addr);
     /* note that udp_usrreq frees funny mbuf.  We hold onto data, but mbuf
-     * around it is gone.  we free address ourselves.  */
+     * around it is gone. */
     /*    haveGlock = ISAFS_GLOCK();
     if (haveGlock) {
        AFS_GUNLOCK();
        }  */
     /* SOCKET_LOCK(asocket); */
     /* code = (*asocket->so_proto->pr_usrreq)(asocket, PRU_SEND, tm, um, 0); */
+#if KNET_DEBUG
+    if (before) Debugger("afs NetSend before");
+#endif
     code = (*asocket->so_proto->pr_usrreqs->pru_send)(asocket, 0, tm, 
                                                      (struct sockaddr *) addr,
-                                                     um, curproc);
+                                                     um, &proc0);
     /* SOCKET_UNLOCK(asocket); */
     /* if (haveGlock) {
        AFS_GLOCK();
        } */
+    sbunlock(&asocket->so_snd);
     splx(s);
-    m_free(um);
-
+#if KNET_DEBUG
+    if (code) {
+        if (code == EINVAL)
+          Debugger("afs NetSend busted");
+        else
+          printf("z");
+    }
+#endif
     return code;
 }
+#endif
 
 #endif /* AFS_FBSD40_ENV */
index 783280f662279d1ce92de37202eaad00cd9a3326..22d52086566123d6ce348e661ce8d8cfd0570208 100644 (file)
@@ -39,6 +39,10 @@ typedef struct afs_kmutex {
     int owner;
 } afs_kmutex_t;
 
+#ifndef set_current_state
+#define set_current_state(X) current->state=X
+#endif
+
 #if defined(AFS_LINUX24_ENV)
 typedef wait_queue_head_t afs_kcondvar_t;
 #else
index 7770be71c6ac92c6298ec50583a4d254197de53b..8cadf0b7c63a5f704cca52e1eacd3f0a501b3246 100644 (file)
@@ -204,6 +204,9 @@ int ntoh_syserr_conv(int error);
 /* Set the connection dead time for any connections created for this service (server only) */
 #define rx_SetServiceDeadTime(service, seconds) ((service)->secondsUntilDead = (seconds))
 
+/* Enable or disable asymmetric client checking for a service */
+#define rx_SetCheckReach(service, x) ((service)->checkReach = (x))
+
 /* Set connection dead time, for a specific client or server connection */
 extern void rx_SetConnDeadTime();
 
@@ -346,6 +349,7 @@ struct rx_service {
     u_short minProcs;              /* Minimum # of requests guaranteed executable simultaneously */
     u_short connDeadTime;                  /* Seconds until a client of this service will be declared dead, if it is not responding */
     u_short idleDeadTime;                  /* Time a server will wait for I/O to start up again */
+    u_char checkReach;             /* Check for asymmetric clients? */
 };
 
 #endif /* KDUMP_RX_LOCK */
@@ -452,6 +456,7 @@ struct rx_peer {
     afs_hyper_t bytesSent;      /* Number of bytes sent to this peer */
     afs_hyper_t bytesReceived;  /* Number of bytes received from this peer */
     struct rx_queue rpcStats;  /* rpc statistic list */
+    int lastReachTime;         /* Last time we verified reachability */
 };
 
 /* A connection is an authenticated communication path, allowing 
@@ -486,6 +491,7 @@ struct rx_connection {
          /* peer process could be restarted on us. Includes RX Header.       */
     struct rxevent *challengeEvent; /* Scheduled when the server is challenging a     */
     struct rxevent *delayedAbortEvent; /* Scheduled to throttle looping client */
+    struct rxevent *checkReachEvent; /* Scheduled when checking reachability */
     int                abortCount;         /* count of abort messages sent */
                                     /* client-- to retransmit the challenge */
     struct rx_service *service;            /* used by servers only */
@@ -519,6 +525,7 @@ struct rx_connection {
 #define RX_CONN_KNOW_WINDOW         8   /* window size negotiation works */
 #define RX_CONN_RESET             16   /* connection is reset, remove */
 #define RX_CONN_BUSY               32   /* connection is busy; don't delete */
+#define RX_CONN_ATTACHWAIT        64   /* attach waiting for peer->lastReach */
 
 /* Type of connection, client or server */
 #define        RX_CLIENT_CONNECTION    0
@@ -740,6 +747,8 @@ struct rx_ackPacket {
 
 #define        RX_CHALLENGE_TIMEOUT    2   /* Number of seconds before another authentication request packet is generated */
 #define RX_CHALLENGE_MAXTRIES  50  /* Max # of times we resend challenge */
+#define        RX_CHECKREACH_TIMEOUT   2   /* Number of seconds before another ping is generated */
+#define        RX_CHECKREACH_TTL       60  /* Re-check reachability this often */
 
 /* RX error codes.  RX uses error codes from -1 to -64.  Rxgen may use other error codes < -64; user programs are expected to return positive error codes */
 
index cc6e73d4e414cbfe9e426279f84c27f53cec0bd0..6c40a2820b85c7b91543be5a3c701abc5946ff97 100644 (file)
@@ -14,7 +14,7 @@
 #include <afsconfig.h>
 #include "../afs/param.h"
 
-RCSID("$Header: /tmp/cvstemp/openafs/src/rx/rx_kcommon.c,v 1.1.1.12 2002/06/10 11:47:11 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/rx/rx_kcommon.c,v 1.1.1.13 2002/09/26 19:07:36 hartmans Exp $");
 
 #include "../rx/rx_kcommon.h"
 
@@ -368,7 +368,11 @@ register struct rx_peer *pp;
       pp->ifMTU = RX_REMOTE_PACKET_SIZE;
     }
 #else /* AFS_USERSPACE_IP_ADDR */
+#ifdef AFS_DARWIN60_ENV
+    struct ifaddr *ifad = (struct ifaddr *) 0;
+#else
     struct in_ifaddr *ifad = (struct in_ifaddr *) 0;
+#endif
     struct ifnet *ifn;
 
     /* At some time we need to iterate through rxi_FindIfnet() to find the
@@ -645,7 +649,25 @@ int rxi_GetIFInfo()
     }
    return different;
 }
+#ifdef AFS_DARWIN60_ENV
+/* Returns ifnet which best matches address */
+struct ifnet *
+rxi_FindIfnet(addr, pifad) 
+     afs_uint32 addr;
+     struct ifaddr **pifad;
+{
+  struct sockaddr_in s;
+
+  if (numMyNetAddrs == 0)
+    (void) rxi_GetIFInfo();
 
+  s.sin_family=AF_INET;
+  s.sin_addr.s_addr=addr;
+  *pifad=ifa_ifwithnet((struct sockaddr *)&s);
+ done:
+  return (*pifad ?  (*pifad)->ifa_ifp : NULL );
+}
+#else
 /* Returns ifnet which best matches address */
 struct ifnet *
 rxi_FindIfnet(addr, pifad) 
@@ -710,6 +732,7 @@ rxi_FindIfnet(addr, pifad)
  done:
   return (*pifad ?  (*pifad)->ia_ifp : NULL );
 }
+#endif
 #endif /* else AFS_USERSPACE_IP_ADDR */
 #endif /* !SUN5 && !SGI62 */
 
@@ -766,6 +789,9 @@ struct osi_socket *rxk_NewSocket(short aport)
     myaddr.sin_family = AF_INET;
     myaddr.sin_port = aport;
     myaddr.sin_addr.s_addr = 0;
+#ifdef STRUCT_SOCKADDR_HAS_SA_LEN
+    myaddr.sin_len = sizeof(myaddr);
+#endif
 
 #ifdef AFS_HPUX110_ENV
     bindnam = allocb_wait((addrsize+SO_MSGOFFSET+1), BPRI_MED);
@@ -792,7 +818,6 @@ struct osi_socket *rxk_NewSocket(short aport)
            osi_Panic("osi_NewSocket: last attempt to reserve 32K failed!\n");
     }
 #if defined(AFS_DARWIN_ENV) || defined(AFS_XBSD_ENV)
-    myaddr.sin_len = sizeof(myaddr);
 #if defined(AFS_XBSD_ENV)
     code = sobind(newSocket, (struct sockaddr *)&myaddr, curproc);
 #else
@@ -1025,7 +1050,10 @@ void rxk_Listener(void)
 #ifdef AFS_SUN5_ENV
     rxk_ListenerPid = ttoproc(curthread)->p_pidp->pid_id;
 #endif /* AFS_SUN5_ENV */
-#if defined(AFS_DARWIN_ENV) || defined(AFS_XBSD_ENV)
+#ifdef AFS_FBSD_ENV
+    rxk_ListenerPid = curproc->p_pid;
+#endif /* AFS_FBSD_ENV */
+#if defined(AFS_DARWIN_ENV)
     rxk_ListenerPid = current_proc()->p_pid;
 #endif
 #if defined(RX_ENABLE_LOCKS) && !defined(AFS_SUN5_ENV)
index 23d48adf1b85e0b76e64db3637a8539cf6ab0bfd..271d1058d8831719d6cf475a014450ef902e6b3a 100644 (file)
@@ -53,19 +53,24 @@ typedef unsigned short                  etap_event_t;
 #ifdef AFS_SGI62_ENV
 #include "../h/hashing.h"
 #endif
+#ifdef AFS_FBSD_ENV
+#include "../h/sysctl.h"
+#endif
 #include "../netinet/in.h"
 #include "../net/route.h"
 #include "../netinet/in_systm.h"
 #include "../netinet/ip.h"
-#if !defined(AFS_HPUX110_ENV) && !defined(AFS_LINUX22_ENV)
+#if !defined(AFS_HPUX110_ENV) && !defined(AFS_LINUX22_ENV) && !defined(AFS_DARWIN60_ENV)
 #include "../netinet/in_pcb.h"
 #endif /* ! AFS_HPUX110_ENV && ! AFS_LINUX22_ENV */
 #ifndef AFS_LINUX22_ENV
+#if !defined(AFS_DARWIN60_ENV)
 #include "../netinet/ip_var.h"
+#endif
 #include "../netinet/ip_icmp.h"
 #endif /* AFS_LINUX22_ENV */
 #include "../netinet/udp.h"
-#if !defined(AFS_SGI62_ENV) && !defined(AFS_LINUX22_ENV)
+#if !defined(AFS_SGI62_ENV) && !defined(AFS_LINUX22_ENV) && !defined(AFS_DARWIN60_ENV)
 #include "../netinet/udp_var.h"
 #endif
 #if defined(AFS_HPUX102_ENV) || (defined(AFS_SGI62_ENV) && !defined(AFS_SGI64_ENV))
@@ -81,7 +86,7 @@ struct coda_inode_info {};
 #include "../h/file.h"
 #endif
 #include "../net/if.h"
-#if !defined(AFS_HPUX110_ENV) && !defined(AFS_LINUX22_ENV)
+#if !defined(AFS_HPUX110_ENV) && !defined(AFS_LINUX22_ENV) && !defined(AFS_DARWIN60_ENV)
 #include "../netinet/in_var.h"
 #endif /* ! AFS_HPUX110_ENV && ! AFS_LINUX22_ENV */
 #ifndef AFS_LINUX22_ENV
index 850c3b04eabda28ccea557bc8b6082ae0819dc41..575175d1851c04cfded4fe4059f88084d16cf1ee 100644 (file)
@@ -57,8 +57,9 @@ typedef pthread_cond_t afs_kcondvar_t;
 #ifndef MUTEX_ISMINE
 /* Only used for debugging. */
 #ifdef AFS_SUN5_ENV
+/* synch.h says mutex_t and pthread_mutex_t are always the same */
 #include <synch.h>
-#define MUTEX_ISMINE(l) MUTEX_HELD(l)
+#define MUTEX_ISMINE(l) MUTEX_HELD((mutex_t *) l)
 #else /* AFS_SUN5_ENV */
 #define MUTEX_ISMINE(l) (1)
 #endif /* AFS_SUN5_ENV */
@@ -71,17 +72,17 @@ extern void osirx_AssertMine(afs_kmutex_t *lockaddr, char *msg);
 #ifdef MUTEX_INIT
 #undef MUTEX_INIT
 #endif
-#define MUTEX_INIT(a, b, c, d) pthread_mutex_init(a, NULL)
+#define MUTEX_INIT(a, b, c, d) osi_Assert(pthread_mutex_init(a, NULL) == 0)
 
 #ifdef MUTEX_DESTROY
 #undef MUTEX_DESTROY
 #endif
-#define MUTEX_DESTROY(l) pthread_mutex_destroy(l)
+#define MUTEX_DESTROY(l) osi_Assert(pthread_mutex_destroy(l) == 0)
 
 #ifdef MUTEX_ENTER
 #undef MUTEX_ENTER
 #endif
-#define MUTEX_ENTER(l) pthread_mutex_lock(l)
+#define MUTEX_ENTER(l) osi_Assert(pthread_mutex_lock(l) == 0)
 
 #ifdef MUTEX_TRYENTER
 #undef MUTEX_TRYENTER
@@ -91,7 +92,7 @@ extern void osirx_AssertMine(afs_kmutex_t *lockaddr, char *msg);
 #ifdef MUTEX_EXIT
 #undef MUTEX_EXIT
 #endif
-#define MUTEX_EXIT(l) pthread_mutex_unlock(l)
+#define MUTEX_EXIT(l) osi_Assert(pthread_mutex_unlock(l) == 0)
 
 #ifdef RXObtainWriteLock
 #undef RXObtainWriteLock
@@ -106,27 +107,27 @@ extern void osirx_AssertMine(afs_kmutex_t *lockaddr, char *msg);
 #ifdef CV_INIT
 #undef CV_INIT
 #endif
-#define CV_INIT(cv, a, b, c) pthread_cond_init(cv, NULL)
+#define CV_INIT(cv, a, b, c) osi_Assert(pthread_cond_init(cv, NULL) == 0)
 
 #ifdef CV_DESTROY
 #undef CV_DESTROY
 #endif
-#define CV_DESTROY(cv) pthread_cond_destroy(cv)
+#define CV_DESTROY(cv) osi_Assert(pthread_cond_destroy(cv) == 0)
 
 #ifdef CV_WAIT
 #undef CV_WAIT
 #endif
-#define CV_WAIT(cv, l) pthread_cond_wait(cv, l)
+#define CV_WAIT(cv, l) osi_Assert(pthread_cond_wait(cv, l) == 0)
 
 #ifdef CV_SIGNAL
 #undef CV_SIGNAL
 #endif
-#define CV_SIGNAL(cv) pthread_cond_signal(cv)
+#define CV_SIGNAL(cv) osi_Assert(pthread_cond_signal(cv) == 0)
 
 #ifdef CV_BROADCAST
 #undef CV_BROADCAST
 #endif
-#define CV_BROADCAST(cv) pthread_cond_broadcast(cv)
+#define CV_BROADCAST(cv) osi_Assert(pthread_cond_broadcast(cv) == 0)
 
 #endif /* AFS_PTHREAD_ENV */
 
index e1b92b7e68f2d62e102e5f733a81a31ec09b5370..a0f3b060167c68ba1f20ab95d4deea6d4151b7e9 100644 (file)
@@ -12,7 +12,7 @@
 #include <afsconfig.h>
 #include <afs/param.h>
 
-RCSID("$Header: /tmp/cvstemp/openafs/src/rx/rx_user.c,v 1.1.1.6 2001/09/11 14:34:25 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/rx/rx_user.c,v 1.1.1.7 2002/09/26 19:07:39 hartmans Exp $");
 
 # include <sys/types.h>
 # include <errno.h>
@@ -120,6 +120,9 @@ osi_socket rxi_GetUDPSocket(u_short port)
     taddr.sin_addr.s_addr = 0;
     taddr.sin_family = AF_INET;
     taddr.sin_port = (u_short)port;
+#ifdef STRUCT_SOCKADDR_HAS_SA_LEN
+    taddr.sin_len = sizeof(struct sockaddr_in);
+#endif
 #define MAX_RX_BINDS 10
     for (binds=0; binds<MAX_RX_BINDS; binds++) {
       if (binds) rxi_Delay (10);
index 89732c81046d1ed5793079a5d7a325f4b00082da..f08c6148e3e497c5248d8d6f3542b568fa9525d6 100644 (file)
@@ -73,12 +73,6 @@ extern void osi_Panic();
 extern void osi_AssertFailU(const char *expr, const char *file, int line);
 #define osi_Assert(e) (void)((e) || (osi_AssertFailU(#e, __FILE__, __LINE__), 0))
 
-#if  !defined(_ANSI_C_SOURCE) || defined(AFS_SUN_ENV)
-#if defined(AFS_SUN_ENV) && !defined(AFS_SUN5_ENV)
-extern int fprintf();
-#endif
-#endif /* ANSI_C_SOURCE */
-
 #define        osi_Msg                     fprintf)(stderr,
 
 #endif /* RX_USER_INCLUDE */
index 92166ac6693ed6f01cd2d82f0a4438fb0af7e1f7..fdc188e2db8b20ad21efaf66c7672612194e522a 100644 (file)
@@ -10,7 +10,7 @@
 #include <afsconfig.h>
 #include <afs/param.h>
 
-RCSID("$Header: /tmp/cvstemp/openafs/src/rx/rxdebug.c,v 1.1.1.7 2001/09/11 14:34:25 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/rx/rxdebug.c,v 1.1.1.8 2002/09/26 19:07:40 hartmans Exp $");
 
 #include <sys/types.h>
 #include <errno.h>
@@ -207,6 +207,9 @@ struct cmd_syndesc *as;
     taddr.sin_family = AF_INET;
     taddr.sin_port = 0;
     taddr.sin_addr.s_addr = 0;
+#ifdef STRUCT_SOCKADDR_HAS_SA_LEN
+    taddr.sin_len = sizeof(struct sockaddr_in);
+#endif 
     code = bind(s, (struct sockaddr *) &taddr, sizeof(struct sockaddr_in));
     if (code) {
        perror("bind");
index 97108ccc6ee5861f11d67ddf4f00450f7cebc5d3..b823818fdc5e9f11729106e8338f5d6f9509ffa6 100644 (file)
@@ -10,7 +10,7 @@
 #include <afsconfig.h>
 #include <afs/param.h>
 
-RCSID("$Header: /tmp/cvstemp/openafs/src/rxdebug/rxdebug.c,v 1.1.1.2 2001/10/14 18:06:32 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/rxdebug/rxdebug.c,v 1.1.1.3 2002/09/26 19:07:53 hartmans Exp $");
 
 #include <sys/types.h>
 #include <errno.h>
@@ -209,6 +209,9 @@ struct cmd_syndesc *as;
     taddr.sin_family = AF_INET;
     taddr.sin_port = 0;
     taddr.sin_addr.s_addr = 0;
+#ifdef STRUCT_SOCKADDR_HAS_SA_LEN
+    taddr.sin_len = sizeof(struct sockaddr_in);
+#endif
     code = bind(s, (struct sockaddr *) &taddr, sizeof(struct sockaddr_in));
     if (code) {
        perror("bind");
index d88b03581fec0621af75b732f10206f958d332e3..8e4ae6eec0c0ceab31f56594a6267f109851eae7 100644 (file)
@@ -36,7 +36,7 @@
 #include <afsconfig.h>
 #include <afs/param.h>
 
-RCSID("$Header: /tmp/cvstemp/openafs/src/rxgen/rpc_main.c,v 1.1.1.10 2002/06/10 11:47:26 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/rxgen/rpc_main.c,v 1.1.1.11 2002/09/26 19:07:55 hartmans Exp $");
 
 #include <limits.h>
 #include <stdio.h>
@@ -95,7 +95,7 @@ int debug = 0;
 static char *cmdname;
 #ifdef AFS_SUN5_ENV
 static char CPP[] = "/usr/ccs/lib/cpp";
-#elif defined(AFS_XBSD_ENV)
+#elif defined(AFS_XBSD_ENV) || defined(AFS_DARWIN60_ENV)
 static char CPP[] = "/usr/bin/cpp";
 #elif defined(AFS_NT40_ENV)
 static char CPP[MAXCMDLINE];
index 23a926a6d33c41da72d5681f02e07d120859dca2..561054494f9c4a0be422eff6015de36e93d34fdc 100644 (file)
@@ -18,7 +18,7 @@
 #include <afs/param.h>
 #endif
 
-RCSID("$Header: /tmp/cvstemp/openafs/src/rxkad/rxkad_client.c,v 1.1.1.8 2002/06/10 11:47:28 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/rxkad/rxkad_client.c,v 1.1.1.9 2002/09/26 19:07:58 hartmans Exp $");
 
 #ifdef KERNEL
 #include "../afs/stds.h"
@@ -196,6 +196,7 @@ rxkad_NewClientSecurityObject(level, sessionkey, kvno, ticketLen, ticket)
     memcpy((void *)tcp->ivec, (void *)sessionkey, sizeof(tcp->ivec));
     tcp->kvno = kvno;                  /* key version number */
     tcp->ticketLen = ticketLen;                /* length of ticket */
+    if (tcp->ticketLen > MAXKTCTICKETLEN) return 0; /* bad key */
     memcpy(tcp->ticket, ticket, ticketLen);
 
     LOCK_RXKAD_STATS
index 774608df0c5340243240333e1994974b110ab384..ea6e8956b289a9c9c0f3cbe5b05fd39795948904 100644 (file)
@@ -20,7 +20,7 @@
 #include <sys/time_impl.h>
 #endif
 
-RCSID("$Header: /tmp/cvstemp/openafs/src/rxkad/rxkad_common.c,v 1.1.1.10 2002/08/02 04:36:36 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/rxkad/rxkad_common.c,v 1.1.1.11 2002/09/26 19:07:58 hartmans Exp $");
 
 #ifdef KERNEL
 #ifndef UKERNEL
@@ -29,6 +29,9 @@ RCSID("$Header: /tmp/cvstemp/openafs/src/rxkad/rxkad_common.c,v 1.1.1.10 2002/08
 #ifdef AFS_AIX_ENV
 #include "../h/systm.h"
 #endif
+#ifdef AFS_DARWIN60_ENV
+#include "../h/kernel.h"
+#endif
 #include "../h/types.h"
 #include "../h/time.h"
 #ifndef AFS_LINUX22_ENV
index 495ef8d155c3a3835c9bb6e14ff116aa6dbe633a..5db71fdc6fcd403c3e500b4cfcfb649a9f2a5b7e 100644 (file)
@@ -10,7 +10,7 @@
 #include <afsconfig.h>
 #include <afs/param.h>
 
-RCSID("$Header: /tmp/cvstemp/openafs/src/usd/usd_file.c,v 1.1.1.9 2001/10/14 18:06:52 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/usd/usd_file.c,v 1.1.1.10 2002/09/26 19:08:48 hartmans Exp $");
 
 #include <errno.h>
 #include <fcntl.h>
@@ -24,11 +24,11 @@ RCSID("$Header: /tmp/cvstemp/openafs/src/usd/usd_file.c,v 1.1.1.9 2001/10/14 18:
 #ifdef AFS_DARWIN_ENV
 #include <sys/ioccom.h>
 #endif
-#include <sys/mtio.h>
-#endif /* AFS_AIX_ENV */
-#if defined(AFS_DUX40_ENV) || defined(AFS_OBSD_ENV)
+#if defined(AFS_DUX40_ENV) || defined(AFS_OBSD_ENV) || defined(AFS_SUN4_ENV)
 #include <sys/ioctl.h>
 #endif
+#include <sys/mtio.h>
+#endif /* AFS_AIX_ENV */
 #include <afs/debug.h>
 #include "usd.h"
 
index 8eaf0b92446f261a122a47463f61d5f675b43d82..86270a4603e71e5aa71aa1d7cdd2168faaa0a0ba 100644 (file)
@@ -18,7 +18,7 @@
 #include <afsconfig.h>
 #include <afs/param.h>
 
-RCSID("$Header: /tmp/cvstemp/openafs/src/uss/uss_vol.c,v 1.1.1.5 2001/09/11 14:35:07 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/uss/uss_vol.c,v 1.1.1.6 2002/09/26 19:08:53 hartmans Exp $");
 
 #include "uss_vol.h"           /*Interface to this module*/
 #include "uss_common.h"                /*Common definitions*/
@@ -1114,7 +1114,7 @@ afs_int32 uss_vol_GetVolInfoFromMountPoint(a_mountpoint)
      */
     MapHostToNetwork(&vldbEntry);
     if (vldbEntry.volumeId[RWVOL] != volID) {
-       printf("s: Volume '%s' (ID %d) is not a read/write volume!!\n",
+       printf("%s: Volume '%s' (ID %d) is not a read/write volume!!\n",
               uss_whoami, uss_Volume, volID);
        return(-1);
     }
index 2404f7f248027b809393efea512378e59e37bcb5..1df7e63bcb7e3e55348b329dcfe884ee05074c60 100644 (file)
 #include <sys/time.h>
 #endif
 
-RCSID("$Header: /tmp/cvstemp/openafs/src/util/assert.c,v 1.1.1.5 2001/10/14 18:07:00 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/util/assert.c,v 1.1.1.6 2002/09/26 19:08:55 hartmans Exp $");
 
 #include <stdio.h>
+#include "afsutil.h"
 
 #ifdef AFS_NT40_ENV
 void afs_NTAbort(void)
@@ -33,8 +34,7 @@ void AssertionFailed(char *file, int line)
     time_t when;
 
     time(&when);
-    strcpy(tdate, ctime(&when));
-    tdate[24] = '0';
+    afs_ctime(&when, tdate, 25);
     fprintf(stderr, "%s: Assertion failed! file %s, line %d.\n",
        tdate, file, line);
     fflush(stderr);
index bacfc8bd21fb5d51f166b5e84d92879454a773a7..bf80ac5b7b3ff3156ea95abbe40888ad8402523f 100644 (file)
@@ -19,7 +19,7 @@
 #include <afs/param.h>
 #endif
 
-RCSID("$Header: /tmp/cvstemp/openafs/src/util/netutils.c,v 1.1.1.6 2001/09/11 14:35:15 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/util/netutils.c,v 1.1.1.7 2002/09/26 19:08:58 hartmans Exp $");
 
 #include <stdlib.h>
 #include <stdio.h>
@@ -256,40 +256,58 @@ const char *fileName;
   
   /* For each line in the NetInfo file */
   while ( fgets(line, MAX_NETFILE_LINE, fp) != NULL ) {
-    lineNo++;          /* input line number */
-    addr = extract_Addr(line, MAX_NETFILE_LINE);
+      int fake=0;
+
+      /* See if first char is an 'F' for fake */
+      /* Added to allow the fileserver to advertise fake IPS for use with
+       * the translation tables for NAT-like firewalls - defect 12462 */
+      for (fake=0; ((fake < strlen(line)) && isspace(line[fake])); fake++);
+      if ( (fake < strlen(line)) && ((line[fake]=='f') || (line[fake]=='F'))) {
+         fake++;
+      } else {
+         fake = 0;
+      }
+      lineNo++;                /* input line number */
+      addr = extract_Addr(&line[fake], strlen(&line[fake]));
     
-    if (addr == AFS_IPINVALID) { /* syntactically invalid */
-      fprintf(stderr,"afs:%s : line %d : parse error\n", fileName, lineNo);
-      continue;
-    }
-    if (addr == AFS_IPINVALIDIGNORE) { /* ignore error */
-      continue;
-    }
+      if (addr == AFS_IPINVALID) { /* syntactically invalid */
+         fprintf(stderr,"afs:%s : line %d : parse error\n", fileName, lineNo);
+         continue;
+      }
+      if (addr == AFS_IPINVALIDIGNORE) { /* ignore error */
+         continue;
+      }
     
-    /* See if it is an address that really exists */
-    for (i=0; i < existNu; i++) {
-      if (existingAddr[i] == addr) break;
-    }
-    if (i >= existNu) continue;    /* not found - ignore */
+      /* See if it is an address that really exists */
+      for (i=0; i < existNu; i++) {
+         if (existingAddr[i] == addr) break;
+      }
+      if ((i >= existNu) && (!fake)) continue;   /* not found/fake - ignore */
     
-    /* Check if it is a duplicate address we alread have */
-    for (l=0; l < count; l++) {
-      if ( final[l] == addr ) break;
-    }
-    if (l < count) {
-      fprintf(stderr,"afs:%x specified twice in NetInfo file\n", ntohl(addr));
-      continue; /* duplicate addr - ignore */
-    }
+      /* Check if it is a duplicate address we alread have */
+      for (l=0; l < count; l++) {
+         if ( final[l] == addr ) break;
+      }
+      if (l < count) {
+         fprintf(stderr,"afs:%x specified twice in NetInfo file\n", ntohl(addr));
+         continue; /* duplicate addr - ignore */
+      }
     
-    if ( count == max ) { /* no more space */
-      fprintf(stderr,"afs:Too many interfaces. The current kernel configuration supports a maximum of %d interfaces\n", max);
-    } else {
-      final[count] = existingAddr[i];
-      mask[count]  = existingMask[i];
-      mtu[count]   = existingMtu[i];
-      count++;
-    }
+      if ( count > max ) { /* no more space */
+         fprintf(stderr,"afs:Too many interfaces. The current kernel configuration supports a maximum of %d interfaces\n", max);
+      } else if (fake) {
+         fprintf(stderr, "Client (2) also has address %s\n", line);
+         final[count] = addr;
+         mask[count]  = 0xffffffff;
+         mtu[count]   = htonl(1500);
+         count++;
+      } else {
+         final[count] = existingAddr[i];
+         mask[count]  = existingMask[i];
+         mtu[count]   = existingMtu[i];
+         count++;
+      }
   } /* while */
   
   /* in case of any error, we use all the interfaces present */
index 368a3e74b0cba8acc74608bfa5600dd7df394f1d..75781bcf037b7d8e181f4a2e0b8b3dc0dd8ab788 100644 (file)
@@ -19,7 +19,7 @@
 #include <afsconfig.h>
 #include <afs/param.h>
 
-RCSID("$Header: /tmp/cvstemp/openafs/src/util/readdir_nt.c,v 1.1.1.4 2001/07/14 22:24:25 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/util/readdir_nt.c,v 1.1.1.5 2002/09/26 19:08:59 hartmans Exp $");
 
 #include <errno.h>
 #include <afs/errmap_nt.h>
@@ -32,7 +32,7 @@ RCSID("$Header: /tmp/cvstemp/openafs/src/util/readdir_nt.c,v 1.1.1.4 2001/07/14
 /* opendir() - The case insensitive version of opendir */
 DIR *opendir(const char *path)
 {
-    struct DIR *tDir;
+    DIR *tDir;
     HANDLE tH;
     char tPath[MAX_PATH];
     WIN32_FIND_DATA tData;
index 853f2c863f07800b7deb0b37aac0cf2e60ecfe65..5d74fc293852e94a82307d3d0e516cb49c2a502e 100644 (file)
@@ -3,16 +3,16 @@
 #include <afsconfig.h>
 #include <afs/param.h>
 
-RCSID("$Header: /tmp/cvstemp/openafs/src/util/snprintf.c,v 1.1.1.5 2001/07/14 22:24:27 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/util/snprintf.c,v 1.1.1.6 2002/09/26 19:09:00 hartmans Exp $");
 
-#if defined(AFS_OSF20_ENV) && !defined(AFS_DUX50_ENV) || defined(AFS_AIX32_ENV) || (defined(AFS_SUN55_ENV) && !defined(AFS_SUN56_ENV))
+#if defined(AFS_OSF20_ENV) && !defined(AFS_DUX50_ENV) || defined(AFS_AIX32_ENV) || (defined(AFS_SUN55_ENV) && !defined(AFS_SUN56_ENV)) || !defined(HAVE_SNPRINTF)
 #include <sys/types.h>
 #include <stdarg.h>
 #include <stdio.h>
 #include <ctype.h>
 #include <netinet/in.h>
 #include <netdb.h>
-#if defined(AFS_AIX32_ENV) || defined(AFS_SUN55_ENV)
+#if defined(AFS_AIX32_ENV) || defined(AFS_SUN_ENV)
 #include <sys/socket.h>
 #endif
 
index fcb13e4d2b36a9c1a25e9eb6203f85f0de83744f..e8654ef46a410fb8bfa833b0b34cd2b5f5cc5630 100644 (file)
@@ -7,6 +7,41 @@
  * directory or online at http://www.openafs.org/dl/license10.html
  */
 
+/* String conversion routines have the following copyright */
+
+/*
+ * Copyright (c) 2002 Kungliga Tekniska Högskolan
+ * (Royal Institute of Technology, Stockholm, Sweden).
+ * All rights reserved.
+ * 
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ * 
+ * 3. Neither the name of the Institute nor the names of its contributors
+ *    may be used to endorse or promote products derived from this software
+ *    without specific prior written permission.
+ * 
+ * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
 #include <afsconfig.h>
 #ifdef KERNEL
 #include "../afs/param.h"
@@ -14,7 +49,7 @@
 #include <afs/param.h>
 #endif
 
-RCSID("$Header: /tmp/cvstemp/openafs/src/util/uuid.c,v 1.1.1.8 2002/08/02 04:37:25 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/util/uuid.c,v 1.1.1.9 2002/09/26 19:09:00 hartmans Exp $");
 
 #ifdef KERNEL
 #include "../afs/sysincludes.h"
index 52e0e597dac8d0d08d161418dc7a4c1bb7ecdee7..6faf7923598a69cd434463edcce2f8cd72176da9 100644 (file)
@@ -19,7 +19,7 @@
  *             between user processes and Venus.
  */
 #include <afs/param.h>
-#ifdef AFS_SUN5_ENV
+#ifdef AFS_SUN_ENV
 #include <sys/ioccom.h>
 #endif
 
@@ -67,6 +67,8 @@ struct ViceIoctl {
 #define _VICEIOCTL(id)  ((unsigned int ) _IOW('V', id, struct ViceIoctl))
 #define _VICEIOCTL2(dev, id) ((unsigned int ) _IOW(dev, id, struct ViceIoctl))
 #endif
+#define _CVICEIOCTL(id) _VICEIOCTL2('C', id)
+#define _OVICEIOCTL(id) _VICEIOCTL2('O', id)
 
 /* Use this macro to define up to 256 vice ioctl's.  These ioctl's
    all potentially have in/out parameters--this depends upon the
index 599d35715d2e64de0346d59d60c0f77778e63493..60e1509d78bc6f4a5d9b60c85e108277b27ea2b4 100644 (file)
@@ -158,6 +158,8 @@ fstrace.o: fstrace.c AFS_component_version_number.c
        case ${SYS_NAME} in \
                sun4_411 | sun4c_411 | sun4m_412 ) \
                        ${CCXPG2} -g -I${TOP_SRCDIR}/config -I${TOP_INCDIR} -I${TOP_INCDIR} -c fstrace.c ;; \
+               sun*_4* ) \
+                       ${CC} -I/usr/xpg2include -I/usr/5include -g -I${TOP_SRCDIR}/config -I${TOP_INCDIR} -I${TOP_INCDIR} -c fstrace.c ;; \
                * ) \
                        ${CC} ${CFLAGS} -g -I${TOP_SRCDIR}/config -I${TOP_INCDIR} -I${TOP_INCDIR} -c fstrace.c ;; \
        esac
@@ -168,6 +170,8 @@ fstrace: fstrace.o
                        ${CC} ${CFLAGS} -o fstrace fstrace.o ${TOP_LIBDIR}/libsys.a ${TOP_LIBDIR}/libcmd.a ${TOP_LIBDIR}/util.a /usr/lib/libi.a ;; \
                sun4_411 | sun4c_411 | sun4m_412 ) \
                        ${CCXPG2} ${CFLAGS} -g -o fstrace fstrace.o ${TOP_LIBDIR}/libsys.a ${TOP_LIBDIR}/libcmd.a ${TOP_LIBDIR}/util.a ;; \
+               sun*_4* ) \
+                       ${CC} -L/usr/xpg2lib -L/usr/5lib ${CFLAGS} -g -o fstrace fstrace.o ${TOP_LIBDIR}/libsys.a ${TOP_LIBDIR}/libcmd.a ${TOP_LIBDIR}/util.a -lxpg ;; \
                hp700_ux100 | hp800_ux100 | hp?00_ux10? | hp_ux10? | hp_ux11?) \
                        ${CC} -I${TOP_SRCDIR}/config  -o fstrace fstrace.o ${TOP_LIBDIR}/libsys.a ${TOP_LIBDIR}/libcmd.a ${TOP_LIBDIR}/util.a ;; \
                * ) \
index 9d370ecff62df2c1ede9ff6f1b7f8c59a6103238..a8c2421e5719844ed01d70ae989c39860e3e5b65 100644 (file)
@@ -10,7 +10,7 @@
 #include <afsconfig.h>
 #include <afs/param.h>
 
-RCSID("$Header: /tmp/cvstemp/openafs/src/venus/fs.c,v 1.1.1.9 2002/01/22 19:54:57 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/venus/fs.c,v 1.1.1.10 2002/09/26 19:09:04 hartmans Exp $");
 
 #include <afs/afs_args.h>
 #include <rx/xdr.h>
@@ -1909,6 +1909,8 @@ static NewCellCmd(as)
      * MAXCELLHOSTS (8) servers. To determine which we are talking to,
      * do a GETCELL pioctl and pass it a magic number. If an array of
      * 8 comes back, its a 3.5 client. If not, its a 3.4 client.
+     * If we get back EDOM, there are no cells in the kernel yet,
+     * and we'll assume a 3.5 client.
      */
     tp = space;
     lp = (afs_int32 *)tp;
@@ -1919,13 +1921,17 @@ static NewCellCmd(as)
     blob.in       = space;
     blob.out      = space;
     code = pioctl(0, VIOCGETCELL, &blob, 1);
-    if (code < 0) {
+    if (code < 0 && errno != EDOM) {
        Die(errno, 0);
        return 1;
     }
-    tp = space;
-    cellname = tp + MAXCELLHOSTS*sizeof(afs_int32);
-    scount = ((cellname[0] != '\0') ? MAXCELLHOSTS : MAXHOSTS);
+    if (code < 1 && errno == EDOM) {
+       scount = MAXHOSTS;
+    } else {
+       tp = space;
+       cellname = tp + MAXCELLHOSTS*sizeof(afs_int32);
+       scount = ((cellname[0] != '\0') ? MAXCELLHOSTS : MAXHOSTS);
+    }
 
     /* Now setup and do the NEWCELL pioctl call */
     memset(space, 0, (scount+1) * sizeof(afs_int32));
index 0898c659efdc2dd6976d74861882ffb85bbdd2a0..246c5eedec67fa7d20073d14c8240564bf9b4e66 100644 (file)
@@ -82,7 +82,7 @@
 #include <afsconfig.h>
 #include <afs/param.h>
 
-RCSID("$Header: /tmp/cvstemp/openafs/src/viced/callback.c,v 1.1.1.8 2002/05/11 00:03:26 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/viced/callback.c,v 1.1.1.9 2002/09/26 19:09:13 hartmans Exp $");
 
 #include <stdio.h> 
 #include <stdlib.h>      /* for malloc() */
@@ -1391,16 +1391,16 @@ static int lih_r(host, held, hostp)
 
 } /*lih*/
 
-
 /* This could be upgraded to get more space each time */
 /* first pass: find the oldest host which isn't held by anyone */
 /* second pass: find the oldest host who isn't "me" */
 /* always called with hostp unlocked */
+extern struct host *hostList;
 static int GetSomeSpace_r(hostp, locked)
     struct host *hostp;
     int locked;
 {
-    register struct host *hp, *hp1 = (struct host *)0;
+    register struct host *hp, *hp1 = (struct host *)0, *hp2 = hostList;
     int i=0;
 
     cbstuff.GotSomeSpaces++;
@@ -1411,14 +1411,15 @@ static int GetSomeSpace_r(hostp, locked)
     }
     do {
        lih_host = 0;
-       h_Enumerate_r(lih_r, (char *)hp1);
+       h_Enumerate_r(lih_r, hp2, (char *)hp1);
        hp = lih_host;
        if (hp) {
            cbstuff.GSS4++;
            if ( ! ClearHostCallbacks_r(hp, 0 /* not locked or held */) )
                return;
-           hp1 = hp;
+           hp2 = hp->next;
        } else {
+           hp2 = hostList;
            hp1 = hostp;
            cbstuff.GSS1++;
            ViceLog(5,("GSS: Try harder for longest inactive host cnt= %d\n", i));
index b45d2869e9e23fa1f302925e6bab12abc409bb6a..5c46dbf9eebc45c51e0c5749ed68c7e97ce1c24e 100644 (file)
@@ -10,7 +10,7 @@
 #include <afsconfig.h>
 #include <afs/param.h>
 
-RCSID("$Header: /tmp/cvstemp/openafs/src/viced/fsprobe.c,v 1.1.1.5 2001/09/11 14:35:35 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/viced/fsprobe.c,v 1.1.1.6 2002/09/26 19:09:14 hartmans Exp $");
 
 #include <afs/stds.h>
 #include <afs/afsint.h>
@@ -101,6 +101,9 @@ main(argc, argv)
     memset((char *)&host, 0, sizeof(struct sockaddr_in));
     host.sin_family = AF_INET;
     host.sin_addr.s_addr = inet_addr(av[0]);
+#ifdef STRUCT_SOCKADDR_HAS_SA_LEN
+    host.sin_len = sizeof(struct sockaddr_in);
+#endif
     if (host.sin_addr.s_addr != -1) {
        strcpy(hnamebuf, av[0]);
        hostname = hnamebuf;
index 6133ae29b93bd77f85c8ed863382e2f811da90cd..610a516c1ff2cdd0e4ec19a74ab540597de9f576 100644 (file)
@@ -10,7 +10,7 @@
 #include <afsconfig.h>
 #include <afs/param.h>
 
-RCSID("$Header: /tmp/cvstemp/openafs/src/viced/host.c,v 1.1.1.10 2002/06/10 11:48:32 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/viced/host.c,v 1.1.1.11 2002/09/26 19:09:14 hartmans Exp $");
 
 #include <stdio.h>
 #include <errno.h>
@@ -914,16 +914,19 @@ h_Enumerate(proc, param)
     free((void *)held);
 } /*h_Enumerate*/
 
-/* h_Enumerate_r: Calls (*proc)(host, held, param) for at least each host in
- * the at the start of the enumeration (perhaps more).  Hosts may be deleted
- * (have delete flag set); ditto for clients.  (*proc) is always called with
+/* h_Enumerate_r (revised):
+ * Calls (*proc)(host, held, param) for each host in hostList, starting
+ * at enumstart
+ * Hosts may be deleted (have delete flag set); ditto for clients.
+ * (*proc) is always called with
  * host h_held() and the global host lock (H_LOCK) locked.The hold state of the
  * host with respect to this lwp is passed to (*proc) as the param held.
  * The proc should return 0 if the host should be released, 1 if it should
  * be held after enumeration.
  */
-h_Enumerate_r(proc, param)
+h_Enumerate_r(proc, enumstart, param)
     int (*proc)();
+    struct host* enumstart;
     char *param;
 
 {
@@ -933,15 +936,14 @@ h_Enumerate_r(proc, param)
     if (hostCount == 0) {
        return;
     }
-    for (host = hostList ; host ; host = host->next) {
+    for (host = enumstart ; host ; host = host->next) {
        if (!(held = h_Held_r(host)))
            h_Hold_r(host);
        held = (*proc)(host, held, param);
        if (!held)
            h_Release_r(host);/* this might free up the host */
     }
-} /*h_Enumerate*/
-
+} /*h_Enumerate_r*/
 
 /* Host is returned held */
 struct host *h_GetHost_r(tcon)
index 020b1e294f5deaea38ca074c5dc31fb8639327a8..6fe2ad434f9098e28cd7018d1d86aed198be3690 100644 (file)
@@ -19,7 +19,7 @@
 #include <afsconfig.h>
 #include <afs/param.h>
 
-RCSID("$Header: /tmp/cvstemp/openafs/src/viced/viced.c,v 1.1.1.8 2001/10/14 18:07:15 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/viced/viced.c,v 1.1.1.9 2002/09/26 19:09:16 hartmans Exp $");
 
 #include <stdio.h>
 #include <stdlib.h>
@@ -36,11 +36,11 @@ RCSID("$Header: /tmp/cvstemp/openafs/src/viced/viced.c,v 1.1.1.8 2001/10/14 18:0
 #include <sys/file.h>
 #include <netinet/in.h>
 #include <netdb.h>
-#include <sys/resource.h>
 #include <unistd.h>    /* sysconf() */
 #ifndef ITIMER_REAL
 #include <sys/time.h>
 #endif /* ITIMER_REAL */
+#include <sys/resource.h>
 #endif /* AFS_NT40_ENV */
 #include <afs/stds.h>
 #undef SHARED
@@ -488,6 +488,7 @@ main(argc, argv)
     rx_SetDestroyConnProc(tservice, (char (*)()) h_FreeConnection);
     rx_SetMinProcs(tservice, 3);
     rx_SetMaxProcs(tservice, lwps);
+    rx_SetCheckReach(tservice, 1);
 
     tservice = rx_NewService(0,  RX_STATS_SERVICE_ID, "rpcstats", sc, 4, RXSTATS_ExecuteRequest);
     if (!tservice) {
index 4dae14c77d6e0d5156fd97fc4619dd5e72554088..38704367e0bca64bea90419960a26edeeca592a0 100644 (file)
@@ -38,7 +38,7 @@ static int newVLDB = 1;
 #include <afsconfig.h>
 #include <afs/param.h>
 
-RCSID("$Header: /tmp/cvstemp/openafs/src/vol/fssync.c,v 1.1.1.6 2002/08/02 04:37:35 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/vol/fssync.c,v 1.1.1.7 2002/09/26 19:09:21 hartmans Exp $");
 
 #include <sys/types.h>
 #include <stdio.h>
@@ -236,9 +236,13 @@ static int getport(addr)
 
     memset(addr, 0, sizeof(*addr));
     assert((sd = socket(AF_INET, SOCK_STREAM, 0)) >= 0);
+#ifdef STRUCT_SOCKADDR_HAS_SA_LEN
+    addr->sin_len = sizeof(struct sockaddr_in);
+#endif
     addr->sin_addr.s_addr = htonl(0x7f000001);
     addr->sin_family = AF_INET; /* was localhost->h_addrtype */
     addr->sin_port = htons(2040);  /* XXXX htons not _really_ neccessary */
+
     return sd;
 }
 
index c3f3a2fad69e53fe246238b2a72251fa8e36e1db..6049afb74b24161e30765770efcb2832651c5768 100644 (file)
 #include <afsconfig.h>
 #include <afs/param.h>
 
-RCSID("$Header: /tmp/cvstemp/openafs/src/vol/listinodes.c,v 1.1.1.9 2001/10/14 18:07:22 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/vol/listinodes.c,v 1.1.1.10 2002/09/26 19:09:23 hartmans Exp $");
 
 #ifndef AFS_NAMEI_ENV
-#ifdef AFS_LINUX20_ENV
+#if defined(AFS_LINUX20_ENV) || defined(AFS_SUN4_ENV)
 /* ListViceInodes
  *
  * Return codes:
@@ -36,7 +36,7 @@ char *devname, *mountedOn, *resultFile, *wpath;
 int (*judgeInode)(); 
 int *forcep, forceR;
 {
-    Log("ListViceInodes not implemented for Linux\n");
+    Log("ListViceInodes not implemented for this platform!\n");
     return -1;
 }
 #else
index 1f08490c5cc2e9c73911c2e23657ee21a926c969..6c8dfd96f0704d444bcda68eaf1cd92018064ac8 100644 (file)
@@ -12,7 +12,7 @@
 #include <afsconfig.h>
 #include <afs/param.h>
 
-RCSID("$Header: /tmp/cvstemp/openafs/src/vol/namei_ops.c,v 1.1.1.7 2001/10/14 18:07:22 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/vol/namei_ops.c,v 1.1.1.8 2002/09/26 19:09:23 hartmans Exp $");
 
 #ifdef AFS_NAMEI_ENV
 #include <stdio.h>
@@ -317,8 +317,8 @@ delTree(char *root, char *tree, int *errp)
         */
        *cp = 0; 
       }
-      if (!errno)
-       closedir(ds);
+      /* if (!errno) -- closedir not implicit if we got an error */
+      closedir(ds);
     } 
     
     /* finally axe the current dir */
index aedefa44fa4bbaa64f6343006b36394dc2142f4d..a8e24f1c2854accf6cdeb6b658c0f82663a6d52c 100644 (file)
@@ -91,7 +91,7 @@ Vnodes with 0 inode pointers in RW volumes are now deleted.
 #include <afsconfig.h>
 #include <afs/param.h>
 
-RCSID("$Header: /tmp/cvstemp/openafs/src/vol/vol-salvage.c,v 1.1.1.10 2002/05/11 00:03:47 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/vol/vol-salvage.c,v 1.1.1.11 2002/09/26 19:09:26 hartmans Exp $");
 
 #include <stdlib.h>
 #include <stdio.h>
@@ -110,7 +110,7 @@ RCSID("$Header: /tmp/cvstemp/openafs/src/vol/vol-salvage.c,v 1.1.1.10 2002/05/11
 #include <sys/time.h>
 #endif /* ITIMER_REAL */
 #endif
-#if    defined(AFS_AIX_ENV)
+#if    defined(AFS_AIX_ENV) || defined(AFS_SUN4_ENV)
 #define WCOREDUMP(x)   (x & 0200)
 #endif
 #include <rx/xdr.h>
@@ -824,6 +824,7 @@ struct stat *status;
 #endif
 
 #ifdef AFS_AIX42_ENV
+#ifndef AFS_NAMEI_ENV
 /* We don't want to salvage big files filesystems, since we can't put volumes on
  * them.
  */
@@ -852,6 +853,7 @@ int CheckIfBigFilesFS(mountPoint, devName)
     return 0;
 }
 #endif
+#endif
 
 #ifdef AFS_NT40_ENV
 #define HDSTR "\\Device\\Harddisk"
index 521fc6a5afe4638e06a76b6c8359f7342cc214be..4787a11f6da2b5fedd6e03b977a4174e8cd65d6c 100644 (file)
@@ -19,7 +19,7 @@
 #include <afsconfig.h>
 #include <afs/param.h>
 
-RCSID("$Header: /tmp/cvstemp/openafs/src/vol/volume.c,v 1.1.1.11 2001/10/14 18:07:26 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/vol/volume.c,v 1.1.1.12 2002/09/26 19:09:28 hartmans Exp $");
 
 #include <rx/xdr.h>
 #include <afs/afsint.h>
@@ -130,9 +130,6 @@ RCSID("$Header: /tmp/cvstemp/openafs/src/vol/volume.c,v 1.1.1.11 2001/10/14 18:0
 #endif /* AFS_PTHREAD_ENV */
 #include "vutils.h"
 #include "fssync.h"
-#if !defined(AFS_NT40_ENV) && !defined(AFS_NAMEI_ENV)
-#include <afs/osi_inode.h>
-#endif
 #ifndef AFS_NT40_ENV
 #include <unistd.h>
 #endif
index 7be40ed73aa3cfdb5a6669d07148be4697185ede..2b0e8da1881e726fc56fc6c7a5ea4d9a835027c4 100644 (file)
@@ -10,7 +10,7 @@
 #include <afsconfig.h>
 #include <afs/param.h>
 
-RCSID("$Header: /tmp/cvstemp/openafs/src/volser/vos.c,v 1.1.1.10 2002/08/02 04:37:52 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/volser/vos.c,v 1.1.1.11 2002/09/26 19:09:35 hartmans Exp $");
 
 #include <sys/types.h>
 #ifdef AFS_NT40_ENV
@@ -3924,6 +3924,17 @@ register struct cmd_syndesc *as;
       printuuid=1;
   }
 
+  m_addrs.bulkaddrs_val = 0;
+  m_addrs.bulkaddrs_len = 0;
+
+  vcode = ubik_Call_New(VL_GetAddrs, cstruct, 0,
+                        0, 0, &m_unique, &nentries, &m_addrs);
+  if (vcode) {
+    fprintf(STDERR,"vos: could not list the server addresses\n");
+    PrintError("",vcode);
+    return( vcode );
+  }
+
   m_nentries            = 0;
   m_addrs.bulkaddrs_val = 0;
   m_addrs.bulkaddrs_len = 0;
@@ -3933,8 +3944,11 @@ register struct cmd_syndesc *as;
 
       vcode = ubik_Call_New(VL_GetAddrsU, cstruct, 0, &m_attrs, &m_uuid, 
                        &m_unique, &m_nentries, &m_addrs);
-      if(vcode == VL_NOENT)
-         break;
+      if(vcode == VL_NOENT) {
+         i++;
+          nentries++;
+          continue;
+      }
 
       if (vcode) {
          fprintf(STDERR,"vos: could not list the server addresses\n");
@@ -3945,7 +3959,7 @@ register struct cmd_syndesc *as;
       print_addrs(&m_addrs, &m_uuid, m_nentries, printuuid, noresolve);
       i++;
 
-      if ((as->parms[1].items)||(as->parms[0].items))
+      if ((as->parms[1].items)||(as->parms[0].items)||(i>nentries))
          break;
   }
     
index 29d5779e7d8b75f81f6c745a3e4ae48ba9b01c72..5f1c99eca3f823c19402e535c939edf342894887 100644 (file)
@@ -10,7 +10,7 @@
 #include <afsconfig.h>
 #include <afs/param.h>
 
-RCSID("$Header: /tmp/cvstemp/openafs/src/volser/vsprocs.c,v 1.1.1.8 2001/10/14 18:07:32 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/volser/vsprocs.c,v 1.1.1.9 2002/09/26 19:09:36 hartmans Exp $");
 
 #include <stdio.h>
 #include <sys/types.h>
@@ -3810,7 +3810,7 @@ static afs_int32 CheckVolume(volumeinfo, aserver, apart, modentry, maxvolid)
               if (entry.serverFlags[j] & ITSROVOL) {
                  /* Verify this volume exists and print message we are orphaning it */
                  if (pass == 1) {
-                    MapPartIdIntoName(apart, entry.serverPartition[j]);
+                    MapPartIdIntoName(apart, pname);
                     fprintf(STDERR,"*** Warning: Orphaned RO volume %u exists on %s %s\n",
                             entry.volumeId[ROVOL],
                             hostutil_GetNameByINet(entry.serverNumber[j]), pname);
@@ -4103,7 +4103,7 @@ UV_SyncVolume(aserver, apart, avolname, flags)
        if (modified && (code == VL_NOENT)) {
          fprintf(STDOUT,"\n**entry deleted**\n");
        } else if (modified) {
-         EnumerateEntry(vldbentry);
+         EnumerateEntry(&vldbentry);
        } else {
          fprintf(STDOUT,"\n**no change**\n");
        }