Index: openafs/src/WINNT/afsapplib/dialog.cpp
diff -c openafs/src/WINNT/afsapplib/dialog.cpp:1.2 openafs/src/WINNT/afsapplib/dialog.cpp:1.2.8.1
*** openafs/src/WINNT/afsapplib/dialog.cpp:1.2	Sat Nov  4 05:01:22 2000
--- openafs/src/WINNT/afsapplib/dialog.cpp	Tue Aug 27 23:28:16 2002
***************
*** 1835,1841 ****
        if ((wChild < 0) || (wChild >= 0xF000))
           continue;
  
!       wNext = max( wNext, wChild+1 );
        }
  
     return wNext;
--- 1835,1841 ----
        if ((wChild < 0) || (wChild >= 0xF000))
           continue;
  
!       wNext = max( wNext, (WORD) wChild+1 );
        }
  
     return wNext;
Index: openafs/src/afs/Makefile.in
diff -c openafs/src/afs/Makefile.in:1.4.2.2 openafs/src/afs/Makefile.in:1.4.2.3
*** openafs/src/afs/Makefile.in:1.4.2.2	Wed Jul 10 15:40:22 2002
--- openafs/src/afs/Makefile.in	Wed Aug 21 15:24:54 2002
***************
*** 48,53 ****
--- 48,55 ----
  	case ${SYS_NAME} in \
  		sgi_* ) \
  			gencat -m afszcm.cat afs_trace.msf ;; \
+ 		sun*_4* ) \
+ 			/usr/etc/gencat afszcm.cat afs_trace.msf ;; \
  		*_linux* ) \
  			gencat --new afszcm.cat afs_trace.msf ;; \
  		ppc_darwin* | i386_fbsd*) \
Index: openafs/src/afs/afs.h
diff -c openafs/src/afs/afs.h:1.9.2.8 openafs/src/afs/afs.h:1.9.2.10
*** openafs/src/afs/afs.h:1.9.2.8	Wed Jul 31 18:19:50 2002
--- openafs/src/afs/afs.h	Tue Sep 10 18:33:26 2002
***************
*** 497,504 ****
--- 497,508 ----
  #ifdef	AFS_OSF_ENV
  #define CWired		0x00000800	/* OSF hack only */
  #else
+ #ifdef AFS_DARWIN_ENV
+ #define CUBCinit        0x00000800
+ #else
  #define CWRITE_IGN	0x00000800	/* Next OS hack only */
  #endif
+ #endif
  #define CUnique		0x00001000	/* vc's uniquifier - latest unifiquier for fid */
  #define CForeign	0x00002000	/* this is a non-afs vcache */
  #define CHasPages	0x00004000
***************
*** 598,608 ****
       * Do not try to get the vcache lock when the vlock is held */
      afs_rwlock_t vlock;
  #endif /* defined(AFS_SUN5_ENV) */
- #if defined(AFS_SUN_ENV) || defined(AFS_ALPHA_ENV) || defined(AFS_DARWIN_ENV)
  #if	defined(AFS_SUN5_ENV)
      krwlock_t rwlock;
      struct cred *credp;
  #endif
      afs_bozoLock_t pvnLock;	/* see locks.x */
  #endif
  #ifdef	AFS_AIX32_ENV
--- 602,612 ----
       * Do not try to get the vcache lock when the vlock is held */
      afs_rwlock_t vlock;
  #endif /* defined(AFS_SUN5_ENV) */
  #if	defined(AFS_SUN5_ENV)
      krwlock_t rwlock;
      struct cred *credp;
  #endif
+ #if defined(AFS_SUN_ENV) || defined(AFS_ALPHA_ENV) || defined(AFS_DARWIN_ENV) || defined(AFS_FBSD_ENV)
      afs_bozoLock_t pvnLock;	/* see locks.x */
  #endif
  #ifdef	AFS_AIX32_ENV
***************
*** 617,622 ****
--- 621,629 ----
  #ifdef AFS_DARWIN_ENV
      struct lock__bsd__      rwlock;
  #endif
+ #ifdef AFS_FBSD_ENV
+     struct lock      rwlock;
+ #endif
      afs_int32 parentVnode;		/* Parent dir, if a file. */
      afs_int32 parentUnique;
      struct VenusFid *mvid;		/* Either parent dir (if root) or root (if mt pt) */
***************
*** 1036,1042 ****
  #else
  #ifdef AFS_DARWIN_ENV
  #define afs_VerifyVCache(avc, areq)  \
!   (((avc)->states & CStatd) ? (osi_VM_Setup(avc), 0) : \
     afs_VerifyVCache2((avc),areq))
  #else
  #define afs_VerifyVCache(avc, areq)  \
--- 1043,1049 ----
  #else
  #ifdef AFS_DARWIN_ENV
  #define afs_VerifyVCache(avc, areq)  \
!   (((avc)->states & CStatd) ? (osi_VM_Setup(avc, 0), 0) : \
     afs_VerifyVCache2((avc),areq))
  #else
  #define afs_VerifyVCache(avc, areq)  \
Index: openafs/src/afs/afs_analyze.c
diff -c openafs/src/afs/afs_analyze.c:1.6.4.2 openafs/src/afs/afs_analyze.c:1.6.4.3
*** openafs/src/afs/afs_analyze.c:1.6.4.2	Sat Oct 13 00:20:23 2001
--- openafs/src/afs/afs_analyze.c	Wed Aug 21 16:53:21 2002
***************
*** 13,19 ****
  #include <afsconfig.h>
  #include "../afs/param.h"
  
! RCSID("$Header: /data/cvs/openafs/src/afs/afs_analyze.c,v 1.6.4.2 2001/10/13 04:20:23 shadow Exp $");
  
  #include "../afs/stds.h"
  #include "../afs/sysincludes.h"	/* Standard vendor system headers */
--- 13,19 ----
  #include <afsconfig.h>
  #include "../afs/param.h"
  
! RCSID("$Header: /data/cvs/openafs/src/afs/afs_analyze.c,v 1.6.4.3 2002/08/21 20:53:21 shadow Exp $");
  
  #include "../afs/stds.h"
  #include "../afs/sysincludes.h"	/* Standard vendor system headers */
***************
*** 27,33 ****
  #ifdef AFS_SGI62_ENV
  #include "../h/hashing.h"
  #endif
! #if !defined(AFS_HPUX110_ENV) && !defined(AFS_LINUX20_ENV) && !defined(AFS_FBSD_ENV)
  #include <netinet/in_var.h>
  #endif
  #endif /* !UKERNEL */
--- 27,33 ----
  #ifdef AFS_SGI62_ENV
  #include "../h/hashing.h"
  #endif
! #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: openafs/src/afs/afs_buffer.c
diff -c openafs/src/afs/afs_buffer.c:1.5.2.1 openafs/src/afs/afs_buffer.c:1.5.2.2
*** openafs/src/afs/afs_buffer.c:1.5.2.1	Sat Oct 13 00:20:23 2001
--- openafs/src/afs/afs_buffer.c	Tue Sep 10 18:33:26 2002
***************
*** 10,16 ****
  #include <afsconfig.h>
  #include "../afs/param.h"
  
! RCSID("$Header: /data/cvs/openafs/src/afs/afs_buffer.c,v 1.5.2.1 2001/10/13 04:20:23 shadow Exp $");
  
  #include "../afs/sysincludes.h"
  #if !defined(UKERNEL)
--- 10,16 ----
  #include <afsconfig.h>
  #include "../afs/param.h"
  
! RCSID("$Header: /data/cvs/openafs/src/afs/afs_buffer.c,v 1.5.2.2 2002/09/10 22:33:26 zacheiss Exp $");
  
  #include "../afs/sysincludes.h"
  #if !defined(UKERNEL)
***************
*** 93,98 ****
--- 93,101 ----
  
  #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: openafs/src/afs/afs_call.c
diff -c openafs/src/afs/afs_call.c:1.14.2.10 openafs/src/afs/afs_call.c:1.14.2.14
*** openafs/src/afs/afs_call.c:1.14.2.10	Mon Jul 22 19:14:45 2002
--- openafs/src/afs/afs_call.c	Wed Sep 11 12:17:31 2002
***************
*** 10,16 ****
  #include <afsconfig.h>
  #include "../afs/param.h"
  
! RCSID("$Header: /data/cvs/openafs/src/afs/afs_call.c,v 1.14.2.10 2002/07/22 23:14:45 zacheiss Exp $");
  
  #include "../afs/sysincludes.h"	/* Standard vendor system headers */
  #include "../afs/afsincludes.h"	/* Afs-based standard headers */
--- 10,16 ----
  #include <afsconfig.h>
  #include "../afs/param.h"
  
! RCSID("$Header: /data/cvs/openafs/src/afs/afs_call.c,v 1.14.2.14 2002/09/11 16:17:31 shadow Exp $");
  
  #include "../afs/sysincludes.h"	/* Standard vendor system headers */
  #include "../afs/afsincludes.h"	/* Afs-based standard headers */
***************
*** 21,27 ****
  #ifdef AFS_SGI62_ENV
  #include "../h/hashing.h"
  #endif
! #if !defined(AFS_HPUX110_ENV)
  #include "netinet/in_var.h"
  #endif
  #endif /* !defined(UKERNEL) */
--- 21,27 ----
  #ifdef AFS_SGI62_ENV
  #include "../h/hashing.h"
  #endif
! #if !defined(AFS_HPUX110_ENV) && !defined(AFS_DARWIN60_ENV)
  #include "netinet/in_var.h"
  #endif
  #endif /* !defined(UKERNEL) */
***************
*** 61,69 ****
  #elif defined(AFS_DARWIN_ENV)
  struct lock__bsd__ afs_global_lock;
  #elif defined(AFS_FBSD_ENV)
! struct simplelock afs_global_lock;
  #endif
! #if defined(AFS_OSF_ENV) || defined(AFS_DARWIN_ENV) || defined(AFS_FBSD_ENV)
  thread_t afs_global_owner;
  #endif /* AFS_OSF_ENV */
  
--- 61,70 ----
  #elif defined(AFS_DARWIN_ENV)
  struct lock__bsd__ afs_global_lock;
  #elif defined(AFS_FBSD_ENV)
! struct lock afs_global_lock;
! struct proc *afs_global_owner;
  #endif
! #if defined(AFS_OSF_ENV) || defined(AFS_DARWIN_ENV)
  thread_t afs_global_owner;
  #endif /* AFS_OSF_ENV */
  
***************
*** 122,128 ****
--- 123,295 ----
  
      return code;
  }
+ #if defined(AFS_LINUX24_ENV) && defined(COMPLETION_H_EXISTS)
+ struct afsd_thread_info {
+     unsigned long parm;
+     struct completion *complete;
+ };
+ 
+ static int afsd_thread(void *rock) {
+      struct afsd_thread_info  *arg=rock;
+      unsigned long parm=arg->parm;
+ #ifdef SYS_SETPRIORITY_EXPORTED
+      int (*sys_setpriority)(int,int,int) = sys_call_table[__NR_setpriority];
+ #endif
+      daemonize(); /* doesn't do much, since we were forked from keventd, but
+                      does call mm_release, which wakes up our parent (since it
+                      used CLONE_VFORK) */
+      afs_osi_MaskSignals();
+      switch (parm) {
+      case AFSOP_START_RXCALLBACK:
+           sprintf(current->comm, "afs_cbstart");
+           AFS_GLOCK();
+           complete(arg->complete);
+           afs_CB_Running = 1;     
+           while (afs_RX_Running != 2)
+                afs_osi_Sleep(&afs_RX_Running);
+           sprintf(current->comm, "afs_callback");
+           afs_RXCallBackServer();
+           AFS_GUNLOCK();
+           complete_and_exit(0,0);
+           break;
+      case AFSOP_START_AFS:
+           sprintf(current->comm, "afs_afsstart");
+           AFS_GLOCK();
+           complete(arg->complete);
+           AFS_Running = 1;
+           while (afs_initState < AFSOP_START_AFS) 
+                afs_osi_Sleep(&afs_initState);
+           DInit(AFS_MINBUFFERS);          
+           afs_initState = AFSOP_START_BKG;
+           afs_osi_Wakeup(&afs_initState);
+           sprintf(current->comm, "afsd");
+           afs_Daemon();
+           AFS_GUNLOCK();
+           complete_and_exit(0,0);
+           break;
+      case AFSOP_START_BKG:
+           sprintf(current->comm, "afs_bkgstart");
+           AFS_GLOCK();
+           complete(arg->complete);
+           while (afs_initState < AFSOP_START_BKG) 
+                afs_osi_Sleep(&afs_initState);
+           if (afs_initState < AFSOP_GO) {
+                afs_initState = AFSOP_GO;
+                afs_osi_Wakeup(&afs_initState);
+           }
+           sprintf(current->comm, "afs_background");          
+           afs_BackgroundDaemon();
+           AFS_GUNLOCK();
+           complete_and_exit(0,0);
+           break;
+      case AFSOP_START_TRUNCDAEMON:
+           sprintf(current->comm, "afs_trimstart");
+           AFS_GLOCK();
+           complete(arg->complete);
+           while (afs_initState < AFSOP_GO) 
+                afs_osi_Sleep(&afs_initState);
+           sprintf(current->comm, "afs_cachetrim");
+           afs_CacheTruncateDaemon();
+           AFS_GUNLOCK();
+           complete_and_exit(0,0);
+           break;
+      case AFSOP_START_CS:
+           sprintf(current->comm, "afs_checkserver");
+           AFS_GLOCK();
+           complete(arg->complete);
+           afs_CheckServerDaemon();
+           AFS_GUNLOCK();
+           complete_and_exit(0,0);
+           break;
+      case AFSOP_RXEVENT_DAEMON:
+           sprintf(current->comm, "afs_evtstart");
+ #ifdef SYS_SETPRIORITY_EXPORTED
+         sys_setpriority(PRIO_PROCESS,0,-10);
+ #else
+ #ifdef CURRENT_INCLUDES_NICE
+         current->nice=-10;
+ #endif
+ #endif
+           AFS_GLOCK();
+           complete(arg->complete);
+           while (afs_initState < AFSOP_START_BKG) 
+                afs_osi_Sleep(&afs_initState);
+           sprintf(current->comm, "afs_rxevent");
+           afs_rxevent_daemon();
+           AFS_GUNLOCK();
+           complete_and_exit(0,0);
+           break;
+      case AFSOP_RXLISTENER_DAEMON:
+           sprintf(current->comm, "afs_lsnstart");
+ #ifdef SYS_SETPRIORITY_EXPORTED
+         sys_setpriority(PRIO_PROCESS,0,-10);
+ #else
+ #ifdef CURRENT_INCLUDES_NICE
+         current->nice=-10;
+ #endif
+ #endif
+           AFS_GLOCK();
+           complete(arg->complete);
+           afs_initState = AFSOP_START_AFS;
+           afs_osi_Wakeup(&afs_initState);
+           afs_RX_Running = 2;
+           afs_osi_Wakeup(&afs_RX_Running);
+           afs_osi_RxkRegister();
+           sprintf(current->comm, "afs_rxlistener");
+           rxk_Listener();
+           AFS_GUNLOCK();
+           complete_and_exit(0,0);
+           break;
+      default:
+           printf("Unknown op %d in StartDaemon()\n");
+           break;
+      }
+      return 0;
+ }
+ 
+ void afsd_launcher(void *rock) {
+      if (!kernel_thread(afsd_thread,rock, CLONE_VFORK|SIGCHLD))
+ 	printf("kernel_thread failed. afs startup will not complete\n");
+ }
  
+ void afs_DaemonOp(long parm, long parm2, long parm3, long parm4, long parm5, 
+              long parm6) 
+ {
+      int code;
+      DECLARE_COMPLETION(c);
+      struct tq_struct tq;
+      struct afsd_thread_info info;     
+      if (parm == AFSOP_START_RXCALLBACK) {
+           if (afs_CB_Running) return;
+      } else if (parm == AFSOP_RXLISTENER_DAEMON) {
+           if (afs_RX_Running) return;
+           afs_RX_Running=1;
+           code = afs_InitSetup(parm2);
+           if (parm3) {
+                rx_enablePeerRPCStats();
+           }
+           if (parm4) {
+                rx_enableProcessRPCStats();
+           }
+           if (code)
+                return;
+      } else if (parm == AFSOP_START_AFS) {
+           if (AFS_Running) return;
+      } /* other functions don't need setup in the parent */     
+      info.complete=&c;
+      info.parm=parm;
+      tq.sync=0;
+      INIT_LIST_HEAD(&tq.list);
+      tq.routine=afsd_launcher;
+      tq.data=&info;
+      schedule_task(&tq);
+      AFS_GUNLOCK();
+      /* we need to wait cause we passed stack pointers around.... */
+      wait_for_completion(&c);
+      AFS_GLOCK();
+ }
+ #endif
+ 
  afs_syscall_call(parm, parm2, parm3, parm4, parm5, parm6)
  long parm, parm2, parm3, parm4, parm5, parm6;
  {
***************
*** 151,156 ****
--- 318,329 ----
  #endif
      }
      AFS_GLOCK();
+ #if defined(AFS_LINUX24_ENV) && defined(COMPLETION_H_EXISTS) && !defined(UKERNEL)
+     if (parm < AFSOP_ADDCELL || parm == AFSOP_RXEVENT_DAEMON
+          || parm == AFSOP_RXLISTENER_DAEMON) {
+          afs_DaemonOp(parm,parm2,parm3,parm4,parm5,parm6);
+     }
+ #else
      if (parm == AFSOP_START_RXCALLBACK) {
  	if (afs_CB_Running) goto out;
  	afs_CB_Running = 1;
***************
*** 278,283 ****
--- 451,457 ----
  #endif
      }
  #endif	
+ #endif
      else if (parm == AFSOP_ADDCELL) {
  	/* add a cell.  Parameter 2 is 8 hosts (in net order),  parm 3 is the null-terminated
  	 name.  Parameter 4 is the length of the name, including the null.  Parm 5 is the
***************
*** 618,628 ****
--- 792,810 ----
        }
  #else /* AFS_USERSPACE_IP_ADDR */
        struct ifnet *tifnp;
+ #ifdef AFS_DARWIN60_ENV
+       struct ifaddr *tifadp = (struct ifaddr *) 0;
+ #else
        struct in_ifaddr *tifadp = (struct in_ifaddr *) 0;
+ #endif
        extern struct ifnet *rxi_FindIfnet();
        tifnp = rxi_FindIfnet(parm2, &tifadp);  /* make iterative */
        if (tifnp && tifadp) {
+ #ifdef AFS_DARWIN60_ENV
+ 	 mask = ((struct sockaddr_in *)tifadp->ifa_netmask)->sin_addr.s_addr;
+ #else
  	 mask = tifadp->ia_subnetmask;
+ #endif
        } else {
  	 code = -1;
        }
Index: openafs/src/afs/afs_cell.c
diff -c openafs/src/afs/afs_cell.c:1.7.2.6 openafs/src/afs/afs_cell.c:1.7.2.8
*** openafs/src/afs/afs_cell.c:1.7.2.6	Wed Jul 31 18:19:50 2002
--- openafs/src/afs/afs_cell.c	Wed Aug 21 16:53:21 2002
***************
*** 13,19 ****
  #include <afsconfig.h>
  #include "../afs/param.h"
  
! RCSID("$Header: /data/cvs/openafs/src/afs/afs_cell.c,v 1.7.2.6 2002/07/31 22:19:50 shadow Exp $");
  
  #include "../afs/stds.h"
  #include "../afs/sysincludes.h"	/* Standard vendor system headers */
--- 13,19 ----
  #include <afsconfig.h>
  #include "../afs/param.h"
  
! RCSID("$Header: /data/cvs/openafs/src/afs/afs_cell.c,v 1.7.2.8 2002/08/21 20:53:21 shadow Exp $");
  
  #include "../afs/stds.h"
  #include "../afs/sysincludes.h"	/* Standard vendor system headers */
***************
*** 25,31 ****
  #ifdef AFS_SGI62_ENV
  #include "../h/hashing.h"
  #endif
! #if !defined(AFS_HPUX110_ENV) && !defined(AFS_LINUX20_ENV)
  #include <netinet/in_var.h>
  #endif /* ! ASF_HPUX110_ENV */
  #endif /* !defined(UKERNEL) */
--- 25,31 ----
  #ifdef AFS_SGI62_ENV
  #include "../h/hashing.h"
  #endif
! #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,515 ****
  	tc->vlport = (vlport ? vlport : AFS_VLPORT);
  	afs_stats_cmperf.numCellsVisible++;
  	newc++;
! 	if (!aflags & CAlias) {
  	    tc->realcellIndex = afs_realcellindex++;
  	} else {
  	    tc->realcellIndex = -1;
--- 509,515 ----
  	tc->vlport = (vlport ? vlport : AFS_VLPORT);
  	afs_stats_cmperf.numCellsVisible++;
  	newc++;
! 	if (!(aflags & CAlias)) {
  	    tc->realcellIndex = afs_realcellindex++;
  	} else {
  	    tc->realcellIndex = -1;
***************
*** 543,549 ****
      tc->timeout = timeout;
  
      /* Allow converting an alias into a real cell */
!     if (!(aflags & CAlias)) {
  	tc->states &= ~CAlias;
  	tc->realcellIndex = afs_realcellindex++;
      }
--- 543,549 ----
      tc->timeout = timeout;
  
      /* Allow converting an alias into a real cell */
!     if ((!(aflags & CAlias)) && (tc->states & CAlias)) {
  	tc->states &= ~CAlias;
  	tc->realcellIndex = afs_realcellindex++;
      }
Index: openafs/src/afs/afs_conn.c
diff -c openafs/src/afs/afs_conn.c:1.7 openafs/src/afs/afs_conn.c:1.7.2.1
*** openafs/src/afs/afs_conn.c:1.7	Tue Aug  7 20:03:28 2001
--- openafs/src/afs/afs_conn.c	Wed Aug 21 16:53:21 2002
***************
*** 13,19 ****
  #include <afsconfig.h>
  #include "../afs/param.h"
  
! RCSID("$Header: /data/cvs/openafs/src/afs/afs_conn.c,v 1.7 2001/08/08 00:03:28 shadow Exp $");
  
  #include "../afs/stds.h"
  #include "../afs/sysincludes.h"	/* Standard vendor system headers */
--- 13,19 ----
  #include <afsconfig.h>
  #include "../afs/param.h"
  
! RCSID("$Header: /data/cvs/openafs/src/afs/afs_conn.c,v 1.7.2.1 2002/08/21 20:53:21 shadow Exp $");
  
  #include "../afs/stds.h"
  #include "../afs/sysincludes.h"	/* Standard vendor system headers */
***************
*** 25,31 ****
  #ifdef AFS_SGI62_ENV
  #include "../h/hashing.h"
  #endif
! #if !defined(AFS_HPUX110_ENV) && !defined(AFS_LINUX20_ENV)
  #include <netinet/in_var.h>
  #endif /* ! AFS_HPUX110_ENV */
  #endif /* !defined(UKERNEL) */
--- 25,31 ----
  #ifdef AFS_SGI62_ENV
  #include "../h/hashing.h"
  #endif
! #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: openafs/src/afs/afs_init.c
diff -c openafs/src/afs/afs_init.c:1.11 openafs/src/afs/afs_init.c:1.11.2.1
*** openafs/src/afs/afs_init.c:1.11	Tue Aug  7 20:03:28 2001
--- openafs/src/afs/afs_init.c	Tue Sep 10 18:33:27 2002
***************
*** 16,22 ****
  #include <afsconfig.h>
  #include "../afs/param.h"
  
! RCSID("$Header: /data/cvs/openafs/src/afs/afs_init.c,v 1.11 2001/08/08 00:03:28 shadow Exp $");
  
  #include "../afs/stds.h"
  #include "../afs/sysincludes.h"	/* Standard vendor system headers */
--- 16,22 ----
  #include <afsconfig.h>
  #include "../afs/param.h"
  
! RCSID("$Header: /data/cvs/openafs/src/afs/afs_init.c,v 1.11.2.1 2002/09/10 22:33:27 zacheiss Exp $");
  
  #include "../afs/stds.h"
  #include "../afs/sysincludes.h"	/* Standard vendor system headers */
***************
*** 102,108 ****
  /* 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)
  struct mount *afs_cacheVfsp=0;
  #elif defined(AFS_LINUX20_ENV)
  struct super_block *afs_cacheSBp = 0;
--- 102,108 ----
  /* 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) || defined(AFS_FBSD_ENV)
  struct mount *afs_cacheVfsp=0;
  #elif defined(AFS_LINUX20_ENV)
  struct super_block *afs_cacheSBp = 0;
***************
*** 439,449 ****
  	      TO_KERNEL_SPACE();
  	  }
  #else
! #if defined(AFS_DARWIN_ENV) || defined(AFS_FBSD_ENV)
          if (!VFS_STATFS(filevp->v_mount, &st, current_proc()))
  #else 
  	if (!VFS_STATFS(filevp->v_vfsp, &st))  
! #endif /* AFS_DARWIN_ENV || AFS_FBSD_ENV */
  #endif /* AFS_LINUX20_ENV */
  #endif /* AIX41 */
  #endif /* OSF */
--- 439,453 ----
  	      TO_KERNEL_SPACE();
  	  }
  #else
! #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_FBSD_ENV */
! #endif /* AFS_DARWIN_ENV */
  #endif /* AFS_LINUX20_ENV */
  #endif /* AIX41 */
  #endif /* OSF */
Index: openafs/src/afs/afs_mariner.c
diff -c openafs/src/afs/afs_mariner.c:1.4 openafs/src/afs/afs_mariner.c:1.4.4.1
*** openafs/src/afs/afs_mariner.c:1.4	Thu Jul 12 15:58:15 2001
--- openafs/src/afs/afs_mariner.c	Tue Sep 10 18:33:27 2002
***************
*** 16,22 ****
  #include <afsconfig.h>
  #include "../afs/param.h"
  
! RCSID("$Header: /data/cvs/openafs/src/afs/afs_mariner.c,v 1.4 2001/07/12 19:58:15 shadow Exp $");
  
  #include "../afs/sysincludes.h" /*Standard vendor system headers*/
  #include "../afs/afsincludes.h" /*AFS-based standard headers*/
--- 16,22 ----
  #include <afsconfig.h>
  #include "../afs/param.h"
  
! RCSID("$Header: /data/cvs/openafs/src/afs/afs_mariner.c,v 1.4.4.1 2002/09/10 22:33:27 zacheiss Exp $");
  
  #include "../afs/sysincludes.h" /*Standard vendor system headers*/
  #include "../afs/afsincludes.h" /*AFS-based standard headers*/
***************
*** 81,89 ****
      taddr.sin_family = AF_INET;
      taddr.sin_addr.s_addr = afs_marinerHost;
      taddr.sin_port = htons(2106);
! #ifdef  AFS_OSF_ENV
      taddr.sin_len = sizeof(taddr);
! #endif  /* AFS_OSF_ENV */
      tp = tp1 = (char *) osi_AllocSmallSpace(AFS_SMALLOCSIZ);
      strcpy(tp, "fetch$Fetching ");
      tp += 15; /* change it if string changes */
--- 81,89 ----
      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 = tp1 = (char *) osi_AllocSmallSpace(AFS_SMALLOCSIZ);
      strcpy(tp, "fetch$Fetching ");
      tp += 15; /* change it if string changes */
***************
*** 114,119 ****
--- 114,122 ----
      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: openafs/src/afs/afs_nfsclnt.c
diff -c openafs/src/afs/afs_nfsclnt.c:1.5 openafs/src/afs/afs_nfsclnt.c:1.5.2.1
*** openafs/src/afs/afs_nfsclnt.c:1.5	Tue Aug  7 20:03:28 2001
--- openafs/src/afs/afs_nfsclnt.c	Fri Sep 13 19:53:36 2002
***************
*** 10,16 ****
  #include <afsconfig.h>
  #include "../afs/param.h"
  
! RCSID("$Header: /data/cvs/openafs/src/afs/afs_nfsclnt.c,v 1.5 2001/08/08 00:03:28 shadow Exp $");
  
  #if !defined(AFS_NONFSTRANS) || defined(AFS_AIX_IAUTH_ENV)
  #ifndef	AFS_DEC_ENV
--- 10,16 ----
  #include <afsconfig.h>
  #include "../afs/param.h"
  
! RCSID("$Header: /data/cvs/openafs/src/afs/afs_nfsclnt.c,v 1.5.2.1 2002/09/13 23:53:36 shadow Exp $");
  
  #if !defined(AFS_NONFSTRANS) || defined(AFS_AIX_IAUTH_ENV)
  #ifndef	AFS_DEC_ENV
***************
*** 425,431 ****
--- 425,433 ----
  
  
  shutdown_nfsclnt() {
+ #if 0
      extern int afs_allnfsreqs, afs_nfscalls;
+ #endif
  
  #if defined(AFS_SGIMP_ENV)
      osi_Assert(ISAFS_GLOCK());
***************
*** 436,443 ****
--- 438,447 ----
  #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: openafs/src/afs/afs_osi.c
diff -c openafs/src/afs/afs_osi.c:1.8.2.8 openafs/src/afs/afs_osi.c:1.8.2.11
*** openafs/src/afs/afs_osi.c:1.8.2.8	Wed Jul 31 18:31:10 2002
--- openafs/src/afs/afs_osi.c	Tue Sep 10 18:33:27 2002
***************
*** 10,16 ****
  #include <afsconfig.h>
  #include "../afs/param.h"
  
! RCSID("$Header: /data/cvs/openafs/src/afs/afs_osi.c,v 1.8.2.8 2002/07/31 22:31:10 shadow Exp $");
  
  #include "../afs/sysincludes.h"	/* Standard vendor system headers */
  #include "../afs/afsincludes.h"	/* Afs-based standard headers */
--- 10,16 ----
  #include <afsconfig.h>
  #include "../afs/param.h"
  
! RCSID("$Header: /data/cvs/openafs/src/afs/afs_osi.c,v 1.8.2.11 2002/09/10 22:33:27 zacheiss Exp $");
  
  #include "../afs/sysincludes.h"	/* Standard vendor system headers */
  #include "../afs/afsincludes.h"	/* Afs-based standard headers */
***************
*** 56,62 ****
      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;
  #elif defined(AFS_AIX41_ENV)
      lock_alloc((void*)&afs_global_lock, LOCK_ALLOC_PIN, 1, 1);
      simple_lock_init((void *)&afs_global_lock);
--- 56,62 ----
      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 = 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,324 ****
  #if AFS_HPUX101_ENV
      set_system_proc(u.u_procp);
  #endif
! #if defined(AFS_DARWIN_ENV) || defined(AFS_FBSD_ENV)
      /* maybe call init_process instead? */
      current_proc()->p_flag |= P_SYSTEM;
  #endif
  #if defined(AFS_SGI_ENV)
      vrelvm();
  #endif /* AFS_SGI_ENV */
--- 315,327 ----
  #if AFS_HPUX101_ENV
      set_system_proc(u.u_procp);
  #endif
! #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,374 ****
      stime(&sta);
      AFS_GLOCK();
  #else
! #if defined(AFS_DARWIN_ENV) || defined(AFS_FBSD_ENV)
      AFS_GUNLOCK();
      setthetime(atv);
      AFS_GLOCK();
--- 371,397 ----
      stime(&sta);
      AFS_GLOCK();
  #else
! #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,402 ****
  #ifdef	AFS_AUX_ENV
      logtchg(atv->tv_sec);
  #endif
! #endif  /* AFS_DARWIN_ENV || AFS_FBSD_ENV */
  #endif	/* AFS_SGI_ENV */
  #endif /* AFS_SUN55_ENV */
  #endif /* AFS_SUN5_ENV */
--- 419,426 ----
  #ifdef	AFS_AUX_ENV
      logtchg(atv->tv_sec);
  #endif
! #endif  /* AFS_DARWIN_ENV */
! #endif  /* AFS_FBSD_ENV */
  #endif	/* AFS_SGI_ENV */
  #endif /* AFS_SUN55_ENV */
  #endif /* AFS_SUN5_ENV */
***************
*** 779,793 ****
  void afs_osi_TraverseProcTable()
  {   
      struct task_struct *p;
      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);
      }
  }   
  #endif
  
--- 803,820 ----
  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;
  	afs_GCPAGs_perproc_func(p);
      }
+ #ifdef EXPORTED_TASKLIST_LOCK
+     read_unlock(&tasklist_lock);
+ #endif
  }   
  #endif
  
***************
*** 986,998 ****
  	(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;
      }
      
      return rv;
--- 1013,1023 ----
  	(pr->state == TASK_INTERRUPTIBLE) ||
  	(pr->state == TASK_UNINTERRUPTIBLE) ||
  	(pr->state == TASK_STOPPED)) {
! 	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: openafs/src/afs/afs_pioctl.c
diff -c openafs/src/afs/afs_pioctl.c:1.22.2.9 openafs/src/afs/afs_pioctl.c:1.22.2.13
*** openafs/src/afs/afs_pioctl.c:1.22.2.9	Wed Jul 31 18:19:50 2002
--- openafs/src/afs/afs_pioctl.c	Thu Sep 12 22:53:19 2002
***************
*** 10,16 ****
  #include <afsconfig.h>
  #include "../afs/param.h"
  
! RCSID("$Header: /data/cvs/openafs/src/afs/afs_pioctl.c,v 1.22.2.9 2002/07/31 22:19:50 shadow Exp $");
  
  #include "../afs/sysincludes.h"	/* Standard vendor system headers */
  #include "../afs/afsincludes.h"	/* Afs-based standard headers */
--- 10,16 ----
  #include <afsconfig.h>
  #include "../afs/param.h"
  
! RCSID("$Header: /data/cvs/openafs/src/afs/afs_pioctl.c,v 1.22.2.13 2002/09/13 02:53:19 shadow Exp $");
  
  #include "../afs/sysincludes.h"	/* Standard vendor system headers */
  #include "../afs/afsincludes.h"	/* Afs-based standard headers */
***************
*** 430,446 ****
  #endif	/* AFS_SUN5_ENV */
  #endif
  #ifndef AFS_LINUX22_ENV
! #if	defined(AFS_AIX32_ENV) || defined(AFS_SUN5_ENV) || defined(AFS_OSF_ENV) || defined(AFS_DARWIN_ENV) || defined(AFS_FBSD_ENV)
        struct file *fd;
  #else
        register struct file *fd;
  #endif
  #endif
        register struct vcache *tvc;
        register int ioctlDone = 0, code = 0;
        
        AFS_STATCNT(afs_xioctl);
! #if defined(AFS_DARWIN_ENV) || defined(AFS_FBSD_ENV)
          if ((code=fdgetf(p, uap->fd, &fd)))
             return code;
  #else
--- 430,457 ----
  #endif	/* AFS_SUN5_ENV */
  #endif
  #ifndef AFS_LINUX22_ENV
! #if	defined(AFS_AIX32_ENV) || defined(AFS_SUN5_ENV) || defined(AFS_OSF_ENV) || defined(AFS_DARWIN_ENV)
        struct file *fd;
  #else
        register struct file *fd;
  #endif
  #endif
+ #if defined(AFS_FBSD_ENV)
+       register struct filedesc *fdp;
+ #endif
        register struct vcache *tvc;
        register int ioctlDone = 0, code = 0;
        
        AFS_STATCNT(afs_xioctl);
! #if defined(AFS_FBSD_ENV)
!         fdp=p->p_fd;
!         if ((u_int)uap->fd >= fdp->fd_nfiles ||
!             (fd = fdp->fd_ofiles[uap->fd]) == NULL)
!                 return EBADF;
!         if ((fd->f_flag & (FREAD | FWRITE)) == 0)
!                 return EBADF;
! #else
! #if defined(AFS_DARWIN_ENV)
          if ((code=fdgetf(p, uap->fd, &fd)))
             return code;
  #else
***************
*** 481,486 ****
--- 492,498 ----
  #endif
  #endif
  #endif
+ #endif
        
        /* first determine whether this is any sort of vnode */
  #ifdef AFS_LINUX22_ENV
***************
*** 589,595 ****
  #endif
            code = ioctl(uap, rvp);
  #else
! #if defined(AFS_DARWIN_ENV) || defined(AFS_FBSD_ENV)
          return ioctl(p, uap, retval);
  #else
  #ifdef  AFS_OSF_ENV
--- 601,610 ----
  #endif
            code = ioctl(uap, rvp);
  #else
! #if defined(AFS_FBSD_ENV)
!         return ioctl(p, uap);
! #else
! #if defined(AFS_DARWIN_ENV) 
          return ioctl(p, uap, retval);
  #else
  #ifdef  AFS_OSF_ENV
***************
*** 609,614 ****
--- 624,630 ----
  #endif
  #endif
  #endif
+ #endif
        }
  #ifdef	AFS_SUN5_ENV
        if (ioctlDone)
***************
*** 1072,1077 ****
--- 1088,1094 ----
      inData = osi_AllocLargeSpace(AFS_LRALLOCSIZ);
      if (inSize > 0) {
        AFS_COPYIN(ablob->in, inData, inSize, code);
+       inData[inSize]='\0';
      }
      else code = 0;
      if (code) {
***************
*** 1089,1096 ****
      if (code == 0 && ablob->out_size > 0) {
        if (outSize > ablob->out_size) outSize = ablob->out_size;
        if (outSize >= PIGGYSIZE) code = E2BIG;
!       else if	(outSize) 
  	AFS_COPYOUT(outData, ablob->out, outSize, code);
      }
      osi_FreeLargeSpace(outData);
      afs_PutFakeStat(&fakestate);
--- 1106,1115 ----
      if (code == 0 && ablob->out_size > 0) {
        if (outSize > ablob->out_size) outSize = ablob->out_size;
        if (outSize >= PIGGYSIZE) code = E2BIG;
!       else if	(outSize) {
! 	outData[outSize]='\0';
  	AFS_COPYOUT(outData, ablob->out, outSize, code);
+       }
      }
      osi_FreeLargeSpace(outData);
      afs_PutFakeStat(&fakestate);
***************
*** 1185,1195 ****
      else code = EPERM;
    }
  
!   if (avc && (sbr->sb_thisfile != -1))
      if (afs_AccessOK(avc, PRSFS_WRITE | PRSFS_ADMINISTER, 
  		      areq, DONT_CHECK_MODE_BITS))
        avc->asynchrony = sbr->sb_thisfile;
      else code = EACCES;
  
    *aoutSize = sizeof(struct sbstruct);
    sbr = (struct sbstruct *)aout;
--- 1204,1215 ----
      else code = EPERM;
    }
  
!   if (avc && (sbr->sb_thisfile != -1)) {
      if (afs_AccessOK(avc, PRSFS_WRITE | PRSFS_ADMINISTER, 
  		      areq, DONT_CHECK_MODE_BITS))
        avc->asynchrony = sbr->sb_thisfile;
      else code = EACCES;
+   }
  
    *aoutSize = sizeof(struct sbstruct);
    sbr = (struct sbstruct *)aout;
***************
*** 1412,1417 ****
--- 1432,1438 ----
      ain += sizeof(afs_int32);
      stp	= ain;	/* remember where the ticket is */
      if (i < 0 || i > 2000) return EINVAL;	/* malloc may fail */
+     if (i > MAXKTCTICKETLEN) return EINVAL;
      stLen = i;
      ain	+= i;	/* skip over ticket */
      memcpy((char *)&i, ain, sizeof(afs_int32));
***************
*** 1451,1457 ****
--- 1472,1482 ----
      if (set_parent_pag) {
  	int pag;
  #if defined(AFS_DARWIN_ENV) || defined(AFS_FBSD_ENV)
+ #if defined(AFS_DARWIN_ENV)
          struct proc *p=current_proc(); /* XXX */
+ #else
+         struct proc *p=curproc; /* XXX */
+ #endif
          uprintf("Process %d (%s) tried to change pags in PSetTokens\n",
                  p->p_pid, p->p_comm);
          if (!setpag(p, acred, -1, &pag, 1)) {
Index: openafs/src/afs/afs_server.c
diff -c openafs/src/afs/afs_server.c:1.11.2.4 openafs/src/afs/afs_server.c:1.11.2.5
*** openafs/src/afs/afs_server.c:1.11.2.4	Sun Apr 21 16:50:26 2002
--- openafs/src/afs/afs_server.c	Wed Aug 21 16:53:21 2002
***************
*** 32,38 ****
  #include <afsconfig.h>
  #include "../afs/param.h"
  
! RCSID("$Header: /data/cvs/openafs/src/afs/afs_server.c,v 1.11.2.4 2002/04/21 20:50:26 zacheiss Exp $");
  
  #include "../afs/stds.h"
  #include "../afs/sysincludes.h"	/* Standard vendor system headers */
--- 32,38 ----
  #include <afsconfig.h>
  #include "../afs/param.h"
  
! RCSID("$Header: /data/cvs/openafs/src/afs/afs_server.c,v 1.11.2.5 2002/08/21 20:53:21 shadow Exp $");
  
  #include "../afs/stds.h"
  #include "../afs/sysincludes.h"	/* Standard vendor system headers */
***************
*** 44,52 ****
  #ifdef AFS_SGI62_ENV
  #include "../h/hashing.h"
  #endif
! #if !defined(AFS_HPUX110_ENV) && !defined(AFS_LINUX20_ENV)
  #include <netinet/in_var.h>
  #endif /* AFS_HPUX110_ENV */
  #endif /* !defined(UKERNEL) */
  
  #include "../afs/afsincludes.h"	/* Afs-based standard headers */
--- 44,55 ----
  #ifdef AFS_SGI62_ENV
  #include "../h/hashing.h"
  #endif
! #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,1045 ****
     }
  }
  #else /* AFS_USERSPACE_IP_ADDR */
! #if (! defined(AFS_SUN5_ENV)) && defined(USEIFADDR)
  void
  afsi_SetServerIPRank(sa, ifa)
      struct srvAddr *sa;
--- 1042,1048 ----
     }
  }
  #else /* AFS_USERSPACE_IP_ADDR */
! #if (! defined(AFS_SUN5_ENV)) && !defined(AFS_DARWIN60_ENV) && defined(USEIFADDR)
  void
  afsi_SetServerIPRank(sa, ifa)
      struct srvAddr *sa;
***************
*** 1078,1083 ****
--- 1081,1145 ----
  #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,1240 ****
--- 1297,1312 ----
  #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: openafs/src/afs/afs_user.c
diff -c openafs/src/afs/afs_user.c:1.8 openafs/src/afs/afs_user.c:1.8.2.1
*** openafs/src/afs/afs_user.c:1.8	Tue Aug  7 20:03:28 2001
--- openafs/src/afs/afs_user.c	Wed Aug 21 16:53:22 2002
***************
*** 13,19 ****
  #include <afsconfig.h>
  #include "../afs/param.h"
  
! RCSID("$Header: /data/cvs/openafs/src/afs/afs_user.c,v 1.8 2001/08/08 00:03:28 shadow Exp $");
  
  #include "../afs/stds.h"
  #include "../afs/sysincludes.h"	/* Standard vendor system headers */
--- 13,19 ----
  #include <afsconfig.h>
  #include "../afs/param.h"
  
! RCSID("$Header: /data/cvs/openafs/src/afs/afs_user.c,v 1.8.2.1 2002/08/21 20:53:22 shadow Exp $");
  
  #include "../afs/stds.h"
  #include "../afs/sysincludes.h"	/* Standard vendor system headers */
***************
*** 25,31 ****
  #ifdef AFS_SGI62_ENV
  #include "../h/hashing.h"
  #endif
! #if !defined(AFS_HPUX110_ENV) && !defined(AFS_LINUX20_ENV)
  #include <netinet/in_var.h>
  #endif /* ! AFS_HPUX110_ENV */
  #endif /* !defined(UKERNEL) */
--- 25,31 ----
  #ifdef AFS_SGI62_ENV
  #include "../h/hashing.h"
  #endif
! #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: openafs/src/afs/afs_util.c
diff -c openafs/src/afs/afs_util.c:1.5.4.1 openafs/src/afs/afs_util.c:1.5.4.2
*** openafs/src/afs/afs_util.c:1.5.4.1	Sat Oct 13 00:20:24 2001
--- openafs/src/afs/afs_util.c	Wed Aug 21 16:53:22 2002
***************
*** 15,21 ****
  #include <afsconfig.h>
  #include "../afs/param.h"
  
! RCSID("$Header: /data/cvs/openafs/src/afs/afs_util.c,v 1.5.4.1 2001/10/13 04:20:24 shadow Exp $");
  
  #include "../afs/stds.h"
  #include "../afs/sysincludes.h"	/* Standard vendor system headers */
--- 15,21 ----
  #include <afsconfig.h>
  #include "../afs/param.h"
  
! RCSID("$Header: /data/cvs/openafs/src/afs/afs_util.c,v 1.5.4.2 2002/08/21 20:53:22 shadow Exp $");
  
  #include "../afs/stds.h"
  #include "../afs/sysincludes.h"	/* Standard vendor system headers */
***************
*** 27,33 ****
  #ifdef AFS_SGI62_ENV
  #include "../h/hashing.h"
  #endif
! #if !defined(AFS_HPUX110_ENV) && !defined(AFS_LINUX20_ENV)
  #include <netinet/in_var.h>
  #endif /* ! AFS_HPUX110_ENV */
  #endif /* !defined(UKERNEL) */
--- 27,33 ----
  #ifdef AFS_SGI62_ENV
  #include "../h/hashing.h"
  #endif
! #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: openafs/src/afs/afs_vcache.c
diff -c openafs/src/afs/afs_vcache.c:1.9.2.13 openafs/src/afs/afs_vcache.c:1.9.2.16
*** openafs/src/afs/afs_vcache.c:1.9.2.13	Mon Jul 22 19:14:45 2002
--- openafs/src/afs/afs_vcache.c	Tue Sep 10 18:33:27 2002
***************
*** 38,44 ****
  #include <afsconfig.h>
  #include "../afs/param.h"
  
! RCSID("$Header: /data/cvs/openafs/src/afs/afs_vcache.c,v 1.9.2.13 2002/07/22 23:14:45 zacheiss Exp $");
  
  #include "../afs/sysincludes.h" /*Standard vendor system headers*/
  #include "../afs/afsincludes.h" /*AFS-based standard headers*/
--- 38,44 ----
  #include <afsconfig.h>
  #include "../afs/param.h"
  
! RCSID("$Header: /data/cvs/openafs/src/afs/afs_vcache.c,v 1.9.2.16 2002/09/10 22:33:27 zacheiss Exp $");
  
  #include "../afs/sysincludes.h" /*Standard vendor system headers*/
  #include "../afs/afsincludes.h" /*AFS-based standard headers*/
***************
*** 70,76 ****
  #ifdef AFS_OSF_ENV
  extern struct mount *afs_globalVFS;
  extern struct vnodeops Afs_vnodeops;
! #elif defined(AFS_DARWIN_ENV)
  extern struct mount *afs_globalVFS;
  #else
  extern struct vfs *afs_globalVFS;
--- 70,76 ----
  #ifdef AFS_OSF_ENV
  extern struct mount *afs_globalVFS;
  extern struct vnodeops Afs_vnodeops;
! #elif defined(AFS_DARWIN_ENV) || defined(AFS_FBSD_ENV)
  extern struct mount *afs_globalVFS;
  #else
  extern struct vfs *afs_globalVFS;
***************
*** 490,495 ****
--- 490,496 ----
      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,533 ****
--- 529,535 ----
  		goto resume;
  	    }
  	}
+ #endif
  
  	if (!DCOUNT(dentry)) {
  	    AFS_GUNLOCK();
***************
*** 907,912 ****
--- 909,922 ----
      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,1534 ****
--- 1539,1547 ----
  #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,1676 ****
  #endif
  	ReleaseWriteLock(&tvc->lock);
  #ifdef AFS_DARWIN_ENV
!         osi_VM_Setup(tvc);
  #endif
  	return tvc;
      }
--- 1683,1689 ----
  #endif
  	ReleaseWriteLock(&tvc->lock);
  #ifdef AFS_DARWIN_ENV
!         osi_VM_Setup(tvc,0);
  #endif
  	return tvc;
      }
***************
*** 1735,1743 ****
      }
  
      ReleaseWriteLock(&tvc->lock);
- #ifdef AFS_DARWIN_ENV
-     osi_VM_Setup(avc);
- #endif
      return tvc;
  
  } /*afs_GetVCache*/
--- 1748,1753 ----
***************
*** 1893,1901 ****
      afs_ProcessFS(tvc, &OutStatus, areq);
  
      ReleaseWriteLock(&tvc->lock);
- #ifdef AFS_DARWIN_ENV
-     osi_VM_Setup(tvc);
- #endif
      return tvc;
  
  }
--- 1903,1908 ----
***************
*** 2465,2471 ****
  #endif
  #ifdef AFS_DARWIN_ENV
      if (tvc)
!         osi_VM_Setup(tvc);
  #endif
      return tvc;
  } /*afs_FindVCache*/
--- 2472,2478 ----
  #endif
  #ifdef AFS_DARWIN_ENV
      if (tvc)
!         osi_VM_Setup(tvc, 0);
  #endif
      return tvc;
  } /*afs_FindVCache*/
Index: openafs/src/afs/afs_volume.c
diff -c openafs/src/afs/afs_volume.c:1.6.2.4 openafs/src/afs/afs_volume.c:1.6.2.5
*** openafs/src/afs/afs_volume.c:1.6.2.4	Mon Apr  1 21:05:15 2002
--- openafs/src/afs/afs_volume.c	Wed Aug 21 16:53:22 2002
***************
*** 18,24 ****
  #include <afsconfig.h>
  #include "../afs/param.h"
  
! RCSID("$Header: /data/cvs/openafs/src/afs/afs_volume.c,v 1.6.2.4 2002/04/02 02:05:15 shadow Exp $");
  
  #include "../afs/stds.h"
  #include "../afs/sysincludes.h"	/* Standard vendor system headers */
--- 18,24 ----
  #include <afsconfig.h>
  #include "../afs/param.h"
  
! RCSID("$Header: /data/cvs/openafs/src/afs/afs_volume.c,v 1.6.2.5 2002/08/21 20:53:22 shadow Exp $");
  
  #include "../afs/stds.h"
  #include "../afs/sysincludes.h"	/* Standard vendor system headers */
***************
*** 30,36 ****
  #ifdef AFS_SGI62_ENV
  #include "../h/hashing.h"
  #endif
! #if !defined(AFS_HPUX110_ENV) && !defined(AFS_LINUX20_ENV)
  #include <netinet/in_var.h>
  #endif /* ! AFS_HPUX110_ENV */
  #endif /* !defined(UKERNEL) */
--- 30,36 ----
  #ifdef AFS_SGI62_ENV
  #include "../h/hashing.h"
  #endif
! #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: openafs/src/afs/lock.h
diff -c openafs/src/afs/lock.h:1.5.4.2 openafs/src/afs/lock.h:1.5.4.3
*** openafs/src/afs/lock.h:1.5.4.2	Sat Dec 29 18:15:19 2001
--- openafs/src/afs/lock.h	Tue Sep 10 18:33:27 2002
***************
*** 106,115 ****
  #ifdef AFS_LINUX20_ENV
  #define MyPidxx current->pid
  #else
! #if defined(AFS_DARWIN_ENV) || defined(AFS_FBSD_ENV)
  #define MyPidxx (current_proc()->p_pid )
  #else
  #define MyPidxx (u.u_procp->p_pid )
  #endif /* AFS_DARWIN_ENV */
  #endif /* AFS_LINUX20_ENV */
  #endif /* AFS_SGI64_ENV */
--- 106,119 ----
  #ifdef AFS_LINUX20_ENV
  #define MyPidxx current->pid
  #else
! #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: openafs/src/afs/sysincludes.h
diff -c openafs/src/afs/sysincludes.h:1.6.4.2 openafs/src/afs/sysincludes.h:1.6.4.3
*** openafs/src/afs/sysincludes.h:1.6.4.2	Sat Jun  8 00:47:34 2002
--- openafs/src/afs/sysincludes.h	Tue Sep 10 18:33:27 2002
***************
*** 74,80 ****
  #include <linux/errno.h>
  
  #else /* AFS_LINUX22_ENV */
! #if defined(AFS_DARWIN_ENV) || defined(AFS_FBSD_ENV)
  #define _MACH_ETAP_H_   
  typedef unsigned short                  etap_event_t; 
  #endif
--- 74,80 ----
  #include <linux/errno.h>
  
  #else /* AFS_LINUX22_ENV */
! #if defined(AFS_DARWIN_ENV)
  #define _MACH_ETAP_H_   
  typedef unsigned short                  etap_event_t; 
  #endif
***************
*** 180,186 ****
  #endif /* AFS_DEC_ENV */
  
  
! #ifndef AFS_SGI64_ENV
  #include "../h/user.h"
  #endif /* AFS_SGI64_ENV */
  #define	MACH_USER_API	1
--- 180,186 ----
  #endif /* AFS_DEC_ENV */
  
  
! #if !defined(AFS_SGI64_ENV) && !defined(AFS_FBSD_ENV)
  #include "../h/user.h"
  #endif /* AFS_SGI64_ENV */
  #define	MACH_USER_API	1
***************
*** 223,239 ****
--- 223,242 ----
  #  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: openafs/src/afs/DARWIN/osi_machdep.h
diff -c openafs/src/afs/DARWIN/osi_machdep.h:1.1 openafs/src/afs/DARWIN/osi_machdep.h:1.1.8.1
*** openafs/src/afs/DARWIN/osi_machdep.h:1.1	Tue Mar 27 02:33:05 2001
--- openafs/src/afs/DARWIN/osi_machdep.h	Wed Aug 21 16:53:22 2002
***************
*** 42,48 ****
--- 42,50 ----
  /* 
   * Time related macros
   */
+ #ifndef AFS_DARWIN60_ENV
  extern struct timeval time;
+ #endif
  #define osi_Time() (time.tv_sec)
  #define afs_hz      hz
  
Index: openafs/src/afs/DARWIN/osi_module.c
diff -c openafs/src/afs/DARWIN/osi_module.c:1.6.2.1 openafs/src/afs/DARWIN/osi_module.c:1.6.2.2
*** openafs/src/afs/DARWIN/osi_module.c:1.6.2.1	Sat Nov 10 18:22:52 2001
--- openafs/src/afs/DARWIN/osi_module.c	Wed Aug 21 16:53:22 2002
***************
*** 1,11 ****
  #include <afsconfig.h>
  #include "../afs/param.h"
  
! RCSID("$Header: /data/cvs/openafs/src/afs/DARWIN/osi_module.c,v 1.6.2.1 2001/11/10 23:22:52 shadow Exp $");
  
  #include "../afs/sysincludes.h"
  #include "../afs/afsincludes.h"
  #include "../sys/syscall.h"
  #include <mach/kmod.h>
  
  struct vfsconf afs_vfsconf;
--- 1,15 ----
  #include <afsconfig.h>
  #include "../afs/param.h"
  
! RCSID("$Header: /data/cvs/openafs/src/afs/DARWIN/osi_module.c,v 1.6.2.2 2002/08/21 20:53:22 shadow 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: openafs/src/afs/DARWIN/osi_prototypes.h
diff -c openafs/src/afs/DARWIN/osi_prototypes.h:1.1 openafs/src/afs/DARWIN/osi_prototypes.h:1.1.8.1
*** openafs/src/afs/DARWIN/osi_prototypes.h:1.1	Tue Mar 27 02:33:06 2001
--- openafs/src/afs/DARWIN/osi_prototypes.h	Wed Aug 21 16:53:22 2002
***************
*** 19,23 ****
  	                  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);
  #endif /* _OSI_PROTO_H_ */
--- 19,23 ----
  	                  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, int force);
  #endif /* _OSI_PROTO_H_ */
Index: openafs/src/afs/DARWIN/osi_vm.c
diff -c openafs/src/afs/DARWIN/osi_vm.c:1.3.4.3 openafs/src/afs/DARWIN/osi_vm.c:1.3.4.4
*** openafs/src/afs/DARWIN/osi_vm.c:1.3.4.3	Wed Jul 10 22:34:13 2002
--- openafs/src/afs/DARWIN/osi_vm.c	Wed Aug 21 16:53:22 2002
***************
*** 10,16 ****
  #include <afsconfig.h>
  #include "../afs/param.h"
  
! RCSID("$Header: /data/cvs/openafs/src/afs/DARWIN/osi_vm.c,v 1.3.4.3 2002/07/11 02:34:13 shadow Exp $");
  
  #include "../afs/sysincludes.h" /* Standard vendor system headers */
  #include "../afs/afsincludes.h" /* Afs-based standard headers */
--- 10,16 ----
  #include <afsconfig.h>
  #include "../afs/param.h"
  
! RCSID("$Header: /data/cvs/openafs/src/afs/DARWIN/osi_vm.c,v 1.3.4.4 2002/08/21 20:53:22 shadow Exp $");
  
  #include "../afs/sysincludes.h" /* Standard vendor system headers */
  #include "../afs/afsincludes.h" /* Afs-based standard headers */
***************
*** 320,335 ****
  #endif
  
  }
! int osi_VM_Setup(struct vcache *avc) {
     int error;
     struct vnode *vp=AFSTOV(avc);
  
!    if (UBCISVALID(vp) && (avc->states & CStatd)) {
        if (!UBCINFOEXISTS(vp) && !ISSET(vp->v_flag, VTERMINATE)) {
           osi_vnhold(avc,0);  
           AFS_GUNLOCK();
           if ((error=ubc_info_init(&avc->v)))  {
               AFS_GLOCK();
               AFS_RELE(avc);
               return error;
           }
--- 320,337 ----
  #endif
  
  }
! int osi_VM_Setup(struct vcache *avc, int force) {
     int error;
     struct vnode *vp=AFSTOV(avc);
  
!    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,350 ****
--- 347,353 ----
           simple_unlock(&avc->v.v_interlock);
  #endif
           AFS_GLOCK();
+          avc->states  &= ~CUBCinit;
           AFS_RELE(avc);
        }
        if (UBCINFOEXISTS(&avc->v))
Index: openafs/src/afs/DARWIN/osi_vnodeops.c
diff -c openafs/src/afs/DARWIN/osi_vnodeops.c:1.4.2.3 openafs/src/afs/DARWIN/osi_vnodeops.c:1.4.2.4
*** openafs/src/afs/DARWIN/osi_vnodeops.c:1.4.2.3	Thu Apr 25 17:22:30 2002
--- openafs/src/afs/DARWIN/osi_vnodeops.c	Wed Aug 21 16:53:22 2002
***************
*** 1,7 ****
  #include <afsconfig.h>
  #include <afs/param.h>
  
! RCSID("$Header: /data/cvs/openafs/src/afs/DARWIN/osi_vnodeops.c,v 1.4.2.3 2002/04/25 21:22:30 shadow Exp $");
  
  #include <afs/sysincludes.h>            /* Standard vendor system headers */
  #include <afs/afsincludes.h>            /* Afs-based standard headers */
--- 1,7 ----
  #include <afsconfig.h>
  #include <afs/param.h>
  
! RCSID("$Header: /data/cvs/openafs/src/afs/DARWIN/osi_vnodeops.c,v 1.4.2.4 2002/08/21 20:53:22 shadow Exp $");
  
  #include <afs/sysincludes.h>            /* Standard vendor system headers */
  #include <afs/afsincludes.h>            /* Afs-based standard headers */
***************
*** 309,314 ****
--- 309,325 ----
      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,1234 ****
      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",
  #ifdef AFS_DARWIN14_ENV
!                UBCINFOEXISTS(vp) ?
!                  sprintf(buf, "refs %d", vp->v_ubcinfo->ui_refcount),buf : "");
  #else
!                UBCINFOEXISTS(vp) ?
!                  sprintf(buf, "holdcnt %d", vp->v_ubcinfo->ui_holdcnt),buf : "");
  #endif
      printf("\n");
      return 0;
  }
--- 1225,1247 ----
      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" : "");
!     if (UBCISVALID(vp)) {
!         printf("\n  UBC: ");
!         if (UBCINFOEXISTS(vp)) {
!                printf("exists, ") ;
  #ifdef AFS_DARWIN14_ENV
!                  printf("refs %d%s%s", vp->v_ubcinfo->ui_refcount,
!                          ubc_issetflags(vp, UI_HASOBJREF) ? " HASOBJREF" : "",
!                          ubc_issetflags(vp, UI_WASMAPPED) ? " WASMAPPED" : "");
  #else
!                  printf("holdcnt %d", vp->v_ubcinfo->ui_holdcnt);
  #endif
+         } else printf("does not exist");
+     }
      printf("\n");
      return 0;
  }
Index: openafs/src/afs/DUX/osi_vnodeops.c
diff -c openafs/src/afs/DUX/osi_vnodeops.c:1.5.4.1 openafs/src/afs/DUX/osi_vnodeops.c:1.5.4.2
*** openafs/src/afs/DUX/osi_vnodeops.c:1.5.4.1	Tue Apr 23 21:41:25 2002
--- openafs/src/afs/DUX/osi_vnodeops.c	Tue Aug 27 23:54:49 2002
***************
*** 14,20 ****
  #include <afsconfig.h>
  #include "../afs/param.h"
  
! RCSID("$Header: /data/cvs/openafs/src/afs/DUX/osi_vnodeops.c,v 1.5.4.1 2002/04/24 01:41:25 zacheiss Exp $");
  
  
  #include "../afs/sysincludes.h"	/* Standard vendor system headers */
--- 14,20 ----
  #include <afsconfig.h>
  #include "../afs/param.h"
  
! RCSID("$Header: /data/cvs/openafs/src/afs/DUX/osi_vnodeops.c,v 1.5.4.2 2002/08/28 03:54:49 zacheiss Exp $");
  
  
  #include "../afs/sysincludes.h"	/* Standard vendor system headers */
***************
*** 450,456 ****
  	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)
--- 450,456 ----
  	return EISDIR;	/* can't read or write other things */
      }
      afs_BozonLock(&avc->pvnLock, avc);
!     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,724 ****
        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;
--- 718,724 ----
        return code;
      }
      afs_BozonLock(&avc->pvnLock, avc);
!     osi_FlushPages(avc, cred);	/* ensure old pages are gone */
      afs_BozonUnlock(&avc->pvnLock, avc);
      ObtainWriteLock(&avc->lock,166);
      avc->states |= CMAPPED;
Index: openafs/src/afs/FBSD/osi_file.c
diff -c openafs/src/afs/FBSD/osi_file.c:1.4 openafs/src/afs/FBSD/osi_file.c:1.4.2.1
*** openafs/src/afs/FBSD/osi_file.c:1.4	Tue Aug  7 20:03:29 2001
--- openafs/src/afs/FBSD/osi_file.c	Tue Sep 10 18:33:29 2002
***************
*** 10,16 ****
  #include <afsconfig.h>
  #include "../afs/param.h"
  
! RCSID("$Header: /data/cvs/openafs/src/afs/FBSD/osi_file.c,v 1.4 2001/08/08 00:03:29 shadow Exp $");
  
  #include "../afs/sysincludes.h"	/* Standard vendor system headers */
  #include "../afs/afsincludes.h"	/* Afs-based standard headers */
--- 10,16 ----
  #include <afsconfig.h>
  #include "../afs/param.h"
  
! RCSID("$Header: /data/cvs/openafs/src/afs/FBSD/osi_file.c,v 1.4.2.1 2002/09/10 22:33:29 zacheiss Exp $");
  
  #include "../afs/sysincludes.h"	/* Standard vendor system headers */
  #include "../afs/afsincludes.h"	/* Afs-based standard headers */
***************
*** 50,57 ****
  	osi_FreeSmallSpace(afile);
  	osi_Panic("UFSOpen: igetinode failed");
      }
-     IN_UNLOCK(ip);
      afile->vnode = ITOV(ip);
      afile->size = VTOI(afile->vnode)->i_size;
      afile->offset = 0;
      afile->proc = (int (*)()) 0;
--- 50,57 ----
  	osi_FreeSmallSpace(afile);
  	osi_Panic("UFSOpen: igetinode failed");
      }
      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,73 ****
      AFS_STATCNT(osi_Stat);
      MObtainWriteLock(&afs_xosi,320);
      AFS_GUNLOCK();
!     VOP_GETATTR(afile->vnode, &tvattr, &afs_osi_cred, code);
      AFS_GLOCK();
      if (code == 0) {
  	astat->size = tvattr.va_size;
--- 67,73 ----
      AFS_STATCNT(osi_Stat);
      MObtainWriteLock(&afs_xosi,320);
      AFS_GUNLOCK();
!     code=VOP_GETATTR(afile->vnode, &tvattr, &afs_osi_cred, curproc);
      AFS_GLOCK();
      if (code == 0) {
  	astat->size = tvattr.va_size;
***************
*** 94,100 ****
  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;
--- 94,99 ----
***************
*** 108,124 ****
      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);
      AFS_GLOCK();
-     curproc->p_cred->pc_ucred = oldCred;     /* restore */
      MReleaseWriteLock(&afs_xosi);
      return code;
  }
--- 107,116 ----
      if (code || tstat.size <= asize) return code;
      MObtainWriteLock(&afs_xosi,321);    
      VATTR_NULL(&tvattr);
      tvattr.va_size = asize;
      AFS_GUNLOCK();
!     code=VOP_SETATTR(afile->vnode, &tvattr, &afs_osi_cred, curproc);
      AFS_GLOCK();
      MReleaseWriteLock(&afs_xosi);
      return code;
  }
***************
*** 127,133 ****
  struct vnode *avp;
  {
     struct inode *ip = VTOI(avp);
!    ip->i_flag &= ~IACC;
  }
  
  
--- 119,125 ----
  struct vnode *avp;
  {
     struct inode *ip = VTOI(avp);
!    ip->i_flag &= ~IN_ACCESS;
  }
  
  
***************
*** 137,143 ****
      int offset;
      char *aptr;
      afs_int32 asize; {
-     struct AFS_UCRED *oldCred;
      unsigned int resid;
      register afs_int32 code;
      register afs_int32 cnt1=0;
--- 129,134 ----
***************
*** 178,184 ****
      char *aptr;
      afs_int32 offset;
      afs_int32 asize; {
-     struct AFS_UCRED *oldCred;
      unsigned int resid;
      register afs_int32 code;
      AFS_STATCNT(osi_Write);
--- 169,174 ----
***************
*** 186,198 ****
          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;
--- 176,185 ----
Index: openafs/src/afs/FBSD/osi_groups.c
diff -c openafs/src/afs/FBSD/osi_groups.c:1.3 openafs/src/afs/FBSD/osi_groups.c:1.3.4.1
*** openafs/src/afs/FBSD/osi_groups.c:1.3	Thu Jul 12 15:58:19 2001
--- openafs/src/afs/FBSD/osi_groups.c	Tue Sep 10 18:33:29 2002
***************
*** 6,12 ****
   * 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
   *
--- 6,11 ----
***************
*** 18,34 ****
  #include <afsconfig.h>
  #include "../afs/param.h"
  
! RCSID("$Header: /data/cvs/openafs/src/afs/FBSD/osi_groups.c,v 1.3 2001/07/12 19:58:19 shadow 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,
--- 17,28 ----
  #include <afsconfig.h>
  #include "../afs/param.h"
  
! RCSID("$Header: /data/cvs/openafs/src/afs/FBSD/osi_groups.c,v 1.3.4.1 2002/09/10 22:33:29 zacheiss Exp $");
  
  #include "../afs/sysincludes.h"
  #include "../afs/afsincludes.h"
  #include "../afs/afs_stats.h"  /* statistics */
  
  static int
  afs_getgroups(
      struct ucred *cred,
***************
*** 51,77 ****
  {
      int code = 0;
      struct vrequest treq;
  
      AFS_STATCNT(afs_xsetgroups);
      AFS_GLOCK();
! 
!     /*    code = afs_InitReq(&treq, u.u_cred); */
!     code = afs_InitReq(&treq, curproc->p_cred->pc_ucred);
      AFS_GUNLOCK();
!     if (code) return code;
  
      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) {
  	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);
  	    AFS_GUNLOCK();
  	}
      }
      return code;
  }
  
--- 45,77 ----
  {
      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, cr);
      AFS_GUNLOCK();
!     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.
       */
!     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, &cr );
  	    AFS_GUNLOCK();
  	}
      }
+     crfree(cr);
      return code;
  }
  
***************
*** 90,107 ****
  
      AFS_STATCNT(setpag);
      ngroups = afs_getgroups(*cred, NGROUPS, gidset);
!     if (afs_get_pag_from_groups(gidset[0], gidset[1]) == 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];
-  	}
  	ngroups += 2;
      }
      *newpag = (pagvalue == -1 ? genpag(): pagvalue);
!     afs_get_groups_from_pag(*newpag, &gidset[0], &gidset[1]);
      code = afs_setgroups(proc, cred, ngroups, gidset, change_parent);
      return code;
  }
--- 90,107 ----
  
      AFS_STATCNT(setpag);
      ngroups = afs_getgroups(*cred, NGROUPS, gidset);
!     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 >= 1; j--) {
+ 	    gidset[j+2] = gidset[j];
  	}
  	ngroups += 2;
      }
      *newpag = (pagvalue == -1 ? genpag(): pagvalue);
!     afs_get_groups_from_pag(*newpag, &gidset[1], &gidset[2]);
      code = afs_setgroups(proc, cred, ngroups, gidset, change_parent);
      return code;
  }
***************
*** 137,143 ****
      int ngrps;
      int i;
      gid_t *gp;
!     struct ucred *newcr, *cr;
  
      AFS_STATCNT(afs_setgroups);
      /*
--- 137,143 ----
      int ngrps;
      int i;
      gid_t *gp;
!     struct ucred *oldcr, *cr;
  
      AFS_STATCNT(afs_setgroups);
      /*
***************
*** 147,164 ****
      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;
      while (ngroups--)
  	*gp++ = *gidset++;
!     if (!change_parent) {
! 	substitute_real_creds(proc, NOUID, NOUID, NOGID, NOGID, newcr);
      }
!     *cred = newcr;
      return(0);
  }
--- 147,165 ----
      if (ngroups > NGROUPS)
  	return EINVAL;
      cr = *cred;
!     cr->cr_ngroups = ngroups;
!     gp = cr->cr_groups;
      while (ngroups--)
  	*gp++ = *gidset++;
!     if (change_parent) {
! 	crhold(cr);
! 	oldcr=proc->p_pptr->p_cred->pc_ucred;
! 	proc->p_pptr->p_cred->pc_ucred=cr;
! 	crfree(oldcr);
      }
!     crhold(cr);
!     oldcr=proc->p_cred->pc_ucred;
!     proc->p_cred->pc_ucred=cr;
!     crfree(oldcr);
      return(0);
  }
Index: openafs/src/afs/FBSD/osi_inode.c
diff -c openafs/src/afs/FBSD/osi_inode.c:1.3 openafs/src/afs/FBSD/osi_inode.c:1.3.4.1
*** openafs/src/afs/FBSD/osi_inode.c:1.3	Thu Jul 12 15:58:19 2001
--- openafs/src/afs/FBSD/osi_inode.c	Tue Sep 10 18:33:29 2002
***************
*** 16,22 ****
  #include <afsconfig.h>
  #include "../afs/param.h"
  
! RCSID("$Header: /data/cvs/openafs/src/afs/FBSD/osi_inode.c,v 1.3 2001/07/12 19:58:19 shadow Exp $");
  
  #include "../afs/sysincludes.h"	/* Standard vendor system headers */
  #include "../afs/afsincludes.h"	/* Afs-based standard headers */
--- 16,22 ----
  #include <afsconfig.h>
  #include "../afs/param.h"
  
! RCSID("$Header: /data/cvs/openafs/src/afs/FBSD/osi_inode.c,v 1.3.4.1 2002/09/10 22:33:29 zacheiss Exp $");
  
  #include "../afs/sysincludes.h"	/* Standard vendor system headers */
  #include "../afs/afsincludes.h"	/* Afs-based standard headers */
***************
*** 34,52 ****
       ino_t inode;
       int *perror;
  {
!     register struct vnode *vp;
!     char fake_vnode[FAKE_INODE_SIZE];
!     struct inode *ip;
      int code;
  
      *ipp = 0;
      *perror = 0;
      if (!fs) {
  	register struct ufsmount *ump;
- 	register struct vnode *vp;
  	register struct mount *mp;
  	
! 	MOUNTLIST_LOCK();
  	if (mp = TAILQ_FIRST(&mountlist)) do {
  	    /*
  	     * XXX Also do the test for MFS 
--- 34,49 ----
       ino_t inode;
       int *perror;
  {
!     struct vnode *vp;
      int code;
  
      *ipp = 0;
      *perror = 0;
      if (!fs) {
  	register struct ufsmount *ump;
  	register struct mount *mp;
  	
!         simple_lock(&mountlist_slock);
  	if (mp = TAILQ_FIRST(&mountlist)) do {
  	    /*
  	     * XXX Also do the test for MFS 
***************
*** 54,82 ****
  #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();
  	if (!fs)
  	    return(ENXIO);
      }
!     vp = (struct vnode *) fake_vnode;
!     fake_inode_init(vp, fs);
!     code = iget(VTOI(vp), inode, &ip, 0);
      if (code != 0) {
  	*perror = BAD_IGET;
          return code;
      } else {
! 	*ipp = ip;
          return(0);
      }
  }
--- 51,75 ----
  #undef m_data
  #undef m_next
  	    if (mp->mnt_stat.f_type == MOUNT_UFS) {	
  		ump = VFSTOUFS(mp);
  		if (ump->um_fs == NULL)
  		    break;
  		if (ump->um_dev == dev) {
  		    fs = ump->um_mountp;
  		}
  	    }
  	    mp = TAILQ_NEXT(mp, mnt_list);
  	} while (mp != TAILQ_FIRST(&mountlist));
!         simple_unlock(&mountlist_slock);
  	if (!fs)
  	    return(ENXIO);
      }
!     code = VFS_VGET(fs,inode, &vp);
      if (code != 0) {
  	*perror = BAD_IGET;
          return code;
      } else {
! 	*ipp = VTOI(vp);
          return(0);
      }
  }
***************
*** 102,113 ****
  
      if (ip->i_mode == 0) {
  	/* Not an allocated inode */
! 	iforget(ip);	    
  	return(ENOENT);
      }
  
      if (ip->i_nlink == 0 || (ip->i_mode&IFMT) != IFREG) {
! 	iput(ip);
  	return(ENOENT);
      }
  
--- 95,106 ----
  
      if (ip->i_mode == 0) {
  	/* Not an allocated inode */
! 	vput(ITOV(ip));	    
  	return(ENOENT);
      }
  
      if (ip->i_nlink == 0 || (ip->i_mode&IFMT) != IFREG) {
! 	vput(ITOV(ip));	    
  	return(ENOENT);
      }
  
***************
*** 115,137 ****
      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);
!     }
! }
! 
  /*
   * icreate system call -- create an inode
   */
--- 108,114 ----
      return(0);
  }
  
! #if 0
  /*
   * icreate system call -- create an inode
   */
***************
*** 281,283 ****
--- 258,280 ----
      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: openafs/src/afs/FBSD/osi_machdep.h
diff -c openafs/src/afs/FBSD/osi_machdep.h:1.1 openafs/src/afs/FBSD/osi_machdep.h:1.1.6.1
*** openafs/src/afs/FBSD/osi_machdep.h:1.1	Sat Apr 14 13:27:37 2001
--- openafs/src/afs/FBSD/osi_machdep.h	Tue Sep 10 18:33:29 2002
***************
*** 9,15 ****
  
  /*
   *
!  * DUX 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
--- 9,15 ----
  
  /*
   *
!  * 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,25 ****
--- 20,26 ----
  #define _OSI_MACHDEP_H_
  
  #include <sys/lock.h>
+ #include <sys/time.h>
  /* #include <kern/sched_prim.h> */
  /* #include <sys/unix_defs.h> */
  
***************
*** 29,36 ****
  /* 
   * Time related macros
   */
! extern struct timeval time;
! #define osi_Time() (time.tv_sec)
  #define	afs_hz	    hz
  
  #define PAGESIZE 8192
--- 30,36 ----
  /* 
   * Time related macros
   */
! #define osi_Time() time_second
  #define	afs_hz	    hz
  
  #define PAGESIZE 8192
***************
*** 40,91 ****
  
  #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	gop_rdwr(rw,gp,base,len,offset,segflg,unit,cred,aresid) \
    vn_rdwr((rw),(gp),(base),(len),(offset),(segflg),(unit),(cred),(aresid), curproc)
  
  #undef afs_suser
  
  #ifdef KERNEL
! extern struct simplelock afs_global_lock;
! #if 0
! extern thread_t afs_global_owner;
  #define AFS_GLOCK() \
      do { \
! 	usimple_lock(&afs_global_lock); \
!  	osi_Assert(afs_global_owner == (thread_t)0); \
!    	afs_global_owner = current_thread(); \
      } while (0)
  #define AFS_GUNLOCK() \
      do { \
!  	osi_Assert(afs_global_owner == current_thread()); \
!         afs_global_owner = (thread_t)0; \
! 	usimple_unlock(&afs_global_lock); \
      } 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 AFS_RXGLOCK()
  #define AFS_RXGUNLOCK()
  #define ISAFS_RXGLOCK() 1
  
  #undef SPLVAR
! #define SPLVAR
  #undef NETPRI
! #define NETPRI
  #undef USERPRI
! #define USERPRI
  #endif /* KERNEL */
  
  #endif /* _OSI_MACHDEP_H_ */
--- 40,82 ----
  
  #define afs_bufferpages bufpages
  
! #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 proc * afs_global_owner;
! extern struct lock afs_global_lock;
  #define AFS_GLOCK() \
      do { \
!         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(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 == curproc && curproc)
  #define AFS_RXGLOCK()
  #define AFS_RXGUNLOCK()
  #define ISAFS_RXGLOCK() 1
  
  #undef SPLVAR
! #define SPLVAR int splvar
  #undef NETPRI
! #define NETPRI splvar=splnet()
  #undef USERPRI
! #define USERPRI splx(splvar)
  #endif /* KERNEL */
  
  #endif /* _OSI_MACHDEP_H_ */
Index: openafs/src/afs/FBSD/osi_misc.c
diff -c openafs/src/afs/FBSD/osi_misc.c:1.3 openafs/src/afs/FBSD/osi_misc.c:1.3.4.1
*** openafs/src/afs/FBSD/osi_misc.c:1.3	Thu Jul 12 15:58:19 2001
--- openafs/src/afs/FBSD/osi_misc.c	Tue Sep 10 18:33:29 2002
***************
*** 17,27 ****
  #include <afsconfig.h>
  #include "../afs/param.h"
  
! RCSID("$Header: /data/cvs/openafs/src/afs/FBSD/osi_misc.c,v 1.3 2001/07/12 19:58:19 shadow Exp $");
  
  #include "../afs/sysincludes.h"	/* Standard vendor system headers */
  #include "../afs/afsincludes.h"	/* Afs-based standard headers */
! 
  /*
   * afs_suser() returns true if the caller is superuser, false otherwise.
   *
--- 17,27 ----
  #include <afsconfig.h>
  #include "../afs/param.h"
  
! RCSID("$Header: /data/cvs/openafs/src/afs/FBSD/osi_misc.c,v 1.3.4.1 2002/09/10 22:33:29 zacheiss 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.
   *
***************
*** 35,38 ****
--- 35,64 ----
  	return(1);
      }
      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: openafs/src/afs/FBSD/osi_module.c
diff -c /dev/null openafs/src/afs/FBSD/osi_module.c:1.1.8.1
*** /dev/null	Thu Sep 26 01:24:44 2002
--- openafs/src/afs/FBSD/osi_module.c	Tue Sep 17 18:32:54 2002
***************
*** 0 ****
--- 1,91 ----
+ 
+ 
+ #include <afs/param.h>
+ #include <afs/sysincludes.h>
+ #include <afs/afsincludes.h>
+ #include <sys/module.h>
+ #include <sys/sysproto.h>
+ #include <sys/syscall.h>
+ #include <sys/sysent.h>
+ 
+ extern struct vfsops afs_vfsops;
+ extern struct vnodeopv_desc afs_vnodeop_opv_desc;
+ extern struct mount *afs_globalVFS;
+ static struct vfsconf afs_vfsconf;
+ 
+ MALLOC_DEFINE(M_AFS, "afsmisc", "memory used by the AFS filesystem");
+ 
+ extern int afs3_syscall();
+ extern int Afs_xsetgroups();
+ extern int afs_xioctl();
+ 
+ int afs_module_handler(module_t mod, int what, void *arg) {
+    static sy_call_t *old_handler;
+    static int inited=0;
+    int error;
+    error=0;
+    switch (what) {
+         case MOD_LOAD:
+            if (inited) {
+                 printf ("afs cannot be MOD_LOAD'd more than once\n");
+                 error=-1;
+                 break;
+            }
+            if (sysent[AFS_SYSCALL].sy_call != nosys &&
+                sysent[AFS_SYSCALL].sy_call != lkmnosys) {
+                  printf("AFS_SYSCALL in use. aborting\n");
+                  error=-1;
+                  break;
+            }
+            memset(&afs_vfsconf, 0, sizeof(struct vfsconf));
+            strcpy(afs_vfsconf.vfc_name, "AFS");
+            afs_vfsconf.vfc_vfsops=&afs_vfsops;
+            afs_vfsconf.vfc_typenum=-1; /* set by vfs_register */
+            afs_vfsconf.vfc_flags=VFCF_NETWORK;
+            vfs_register(&afs_vfsconf); /* doesn't fail */
+            vfs_add_vnodeops(&afs_vnodeop_opv_desc);
+            osi_Init();
+            sysent[SYS_setgroups].sy_call=Afs_xsetgroups;
+            sysent[SYS_ioctl].sy_call=afs_xioctl;
+            old_handler=sysent[AFS_SYSCALL].sy_call;
+            sysent[AFS_SYSCALL].sy_call=afs3_syscall;
+            sysent[AFS_SYSCALL].sy_narg = 5;
+            inited=1;
+            break;
+         case MOD_UNLOAD:
+ #ifndef RXK_LISTENER_ENV
+            /* shutdown is incomplete unless RXK_LISTENER_ENV */
+            printf("afs: I can't be unloaded yet\n");
+            return -1;
+ #endif
+            if (! inited) {
+              error=0;
+              break; 
+            }
+            if (afs_globalVFS) {
+              error=-1;
+              break;
+            }
+            if (vfs_unregister(&afs_vfsconf)) {
+              error=-1;
+              break;
+            }
+            vfs_rm_vnodeops(&afs_vnodeop_opv_desc);
+            sysent[SYS_ioctl].sy_call = ioctl;
+            sysent[SYS_setgroups].sy_call = setgroups;
+            sysent[AFS_SYSCALL].sy_narg = 0;
+            sysent[AFS_SYSCALL].sy_call = old_handler;
+            break;
+    }
+ 
+    return (error);
+ }
+ 
+ 
+ static moduledata_t afs_mod = {
+        "afs",
+         afs_module_handler,
+         &afs_mod
+ };
+ DECLARE_MODULE(afs, afs_mod, SI_SUB_VFS, SI_ORDER_MIDDLE);
+ 
Index: openafs/src/afs/FBSD/osi_prototypes.h
diff -c /dev/null openafs/src/afs/FBSD/osi_prototypes.h:1.1.8.1
*** /dev/null	Thu Sep 26 01:24:44 2002
--- openafs/src/afs/FBSD/osi_prototypes.h	Fri Sep 13 01:06:11 2002
***************
*** 0 ****
--- 1,20 ----
+ /*
+  * 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_prototypes.h
+  *
+  * Exported macos support routines.
+  */
+ #ifndef _OSI_PROTO_H_
+ #define _OSI_PROTO_H_
+ 
+ /* osi_misc.c */
+ extern int osi_lookupname(char *aname, enum uio_seg seg, int followlink,
+ 	                  struct vnode **dirvpp, struct vnode **vpp);
+ #endif /* _OSI_PROTO_H_ */
Index: openafs/src/afs/FBSD/osi_sleep.c
diff -c openafs/src/afs/FBSD/osi_sleep.c:1.3 openafs/src/afs/FBSD/osi_sleep.c:1.3.4.1
*** openafs/src/afs/FBSD/osi_sleep.c:1.3	Thu Jul 12 15:58:19 2001
--- openafs/src/afs/FBSD/osi_sleep.c	Tue Sep 10 18:33:29 2002
***************
*** 11,17 ****
  #include <afsconfig.h>
  #include "../afs/param.h"
  
! RCSID("$Header: /data/cvs/openafs/src/afs/FBSD/osi_sleep.c,v 1.3 2001/07/12 19:58:19 shadow Exp $");
  
  #include "../afs/sysincludes.h"	/* Standard vendor system headers */
  #include "../afs/afsincludes.h"	/* Afs-based standard headers */
--- 11,17 ----
  #include <afsconfig.h>
  #include "../afs/param.h"
  
! RCSID("$Header: /data/cvs/openafs/src/afs/FBSD/osi_sleep.c,v 1.3.4.1 2002/09/10 22:33:29 zacheiss Exp $");
  
  #include "../afs/sysincludes.h"	/* Standard vendor system headers */
  #include "../afs/afsincludes.h"	/* Afs-based standard headers */
***************
*** 134,147 ****
      seq = evp->seq;
      while (seq == evp->seq) {
  	AFS_ASSERT_GLOCK();
- 	assert_wait((vm_offset_t)(&evp->cond), 0);
  	AFS_GUNLOCK();
! 	thread_block();
  	AFS_GLOCK();
      }
      relevent(evp);
  }
  
  /* osi_TimedSleep
   * 
   * Arguments:
--- 134,152 ----
      seq = evp->seq;
      while (seq == evp->seq) {
  	AFS_ASSERT_GLOCK();
  	AFS_GUNLOCK();
!         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,175 ****
      int code = 0;
      struct afs_event *evp;
      int ticks;
! 
      ticks = ( ams * afs_hz )/1000;
  
  
      evp = afs_getevent(event);
! 
!     assert_wait((vm_offset_t)(&evp->cond), aintok);
      AFS_GUNLOCK();
!     thread_set_timeout(ticks);
!     thread_block();
      AFS_GLOCK();
!     /*    if (current_thread()->wait_result != THREAD_AWAKENED)
! 	  code = EINTR; */
!     
      relevent(evp);
      return code;
  }
--- 161,182 ----
      int code = 0;
      struct afs_event *evp;
      int ticks;
!     int seq,prio;
!  
      ticks = ( ams * afs_hz )/1000;
  
  
      evp = afs_getevent(event);
!     seq=evp->seq;
      AFS_GUNLOCK();
!     if (aintok)
!        prio=PCATCH|PPAUSE;
!     else
!        prio=PVFS;
!     code=tsleep(event, prio, "afs_osi_TimedSleep", ticks);
      AFS_GLOCK();
!     if (seq == evp->seq)
!        code=EINTR;
      relevent(evp);
      return code;
  }
***************
*** 182,188 ****
      evp = afs_getevent(event);
      if (evp->refcount > 1) {
  	evp->seq++;    
! 	thread_wakeup((vm_offset_t)(&evp->cond));
      }
      relevent(evp);
  }
--- 189,195 ----
      evp = afs_getevent(event);
      if (evp->refcount > 1) {
  	evp->seq++;    
! 	wakeup(event);
      }
      relevent(evp);
  }
Index: openafs/src/afs/FBSD/osi_vfsops.c
diff -c openafs/src/afs/FBSD/osi_vfsops.c:1.4.2.1 openafs/src/afs/FBSD/osi_vfsops.c:1.4.2.2
*** openafs/src/afs/FBSD/osi_vfsops.c:1.4.2.1	Tue Apr 23 21:41:27 2002
--- openafs/src/afs/FBSD/osi_vfsops.c	Tue Sep 10 18:33:29 2002
***************
*** 1,53 ****
- /*
-  * 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"
  
! RCSID("$Header: /data/cvs/openafs/src/afs/FBSD/osi_vfsops.c,v 1.4.2.1 2002/04/24 01:41:27 zacheiss 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 <sys/conf.h>
! #include <machine/machlimits.h>
  
- 
  struct vcache *afs_globalVp = 0;
  struct mount *afs_globalVFS = 0;
  
! 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 mp_afs_mount(struct mount *afsp,char * path, caddr_t data,
! 		 struct nameidata *ndp)
  {
-     u_int size;
  
!     fsid_t tfsid;
!     struct mount *xmp, *getvfs();
!     int code;
  
      AFS_GLOCK();
      AFS_STATCNT(afs_mount);
  
--- 1,70 ----
  #include <afsconfig.h>
! #include <afs/param.h>
  
! RCSID("$Header: /data/cvs/openafs/src/afs/FBSD/osi_vfsops.c,v 1.4.2.2 2002/09/10 22:33:29 zacheiss 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 <sys/conf.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;
+ }
  
! int
! afs_fhtovp(mp, fhp, vpp)
! struct mount *mp;
! struct fid *fhp;
! struct vnode **vpp;
! {
  
+ 	return (EINVAL);
+ }
  
! int
! afs_vptofh(vp, fhp)
! struct vnode *vp;
! struct fid *fhp;
  {
  
! 	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);
  
***************
*** 55,185 ****
  	AFS_GUNLOCK();
  	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_GUNLOCK();
      return 0;
  }
- 
  
! int mp_afs_unmount (struct mount *afsp, int flag)
  {
      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);
  }
  
! int mp_afs_root (struct mount *afsp, struct vnode **avpp)
  {
!     register afs_int32 code = 0;
      struct vrequest treq;
      register struct vcache *tvp=0;
  
      AFS_GLOCK();
      AFS_STATCNT(afs_root);
      if (afs_globalVp && (afs_globalVp->states & CStatd)) {
  	tvp = afs_globalVp;
      } else {
! 	if (!(code = afs_InitReq(&treq, cred)) &&
! 	    !(code = afs_CheckInit())) {
  	    tvp = afs_GetVCache(&afs_rootFid, &treq, (afs_int32 *)0,
! 				(struct vcache*)0, WRITE_LOCK);
  	    /* we really want this to stay around */
  	    if (tvp) {
! 		afs_globalVp = tvp;
  	    } else
! 		code = 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);
      }
  
!     afs_Trace2(afs_iclSetp, CM_TRACE_VFSROOT, ICL_TYPE_POINTER, *avpp,
! 	       ICL_TYPE_INT32, code);
      AFS_GUNLOCK();
!     return code;
  }
  
! 
! mp_afs_quotactl(struct mount *mp, int cmd, uid_t uid, caddr_t arg)
  {
!     return EOPNOTSUPP;
  }
  
! int mp_afs_statfs(struct mount *afsp)
  {
-     struct nstatfs *abp = &afsp->m_stat;
- 
      AFS_GLOCK();
      AFS_STATCNT(afs_statfs);
  
      abp->f_type = MOUNT_AFS;
!     abp->f_bsize = afsp->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
--- 72,183 ----
  	AFS_GUNLOCK();
  	return (EBUSY);
      }
  
!     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
! 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
! afs_root(struct mount *mp,
! 	      struct vnode **vpp)
  {
!     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 (!(error = afs_InitReq(&treq, &cr)) &&
! 	    !(error = afs_CheckInit())) {
  	    tvp = afs_GetVCache(&afs_rootFid, &treq, (afs_int32 *)0,
! 	                        (struct vcache*)0, WRITE_LOCK);
  	    /* we really want this to stay around */
  	    if (tvp) {
! 	        afs_globalVp = tvp;
  	    } else
! 	        error = ENOENT;
  	}
      }
      if (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, *vpp,
! 	       ICL_TYPE_INT32, error);
      AFS_GUNLOCK();
!     return error;
  }
  
! int
! afs_vget(mp, lfl, vp)
! struct mount *mp;
! struct vnode *vp;
! int lfl;
  {
!     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 afs_statfs(struct mount *mp, struct statfs *abp, struct proc *p)
  {
      AFS_GLOCK();
      AFS_STATCNT(afs_statfs);
  
+ #if 0
      abp->f_type = MOUNT_AFS;
! #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,485 ****
       */
      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);
      }
  
-     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)
- {
-     AFS_GLOCK();
-     AFS_STATCNT(afs_mountroot);
-     afsmountroot++;
-     AFS_GUNLOCK();
-     return EINVAL;
- }
- 
- 
- /* 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;
- }
- 
- 
- 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;
- }
  
! 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 */
  };
- 
- 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;
- }
--- 185,232 ----
       */
      abp->f_blocks = abp->f_bfree = abp->f_bavail = abp->f_files =
  	abp->f_ffree  = 2000000;
  
!     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_GUNLOCK();
      return 0;
  }
  
! int afs_sync(mp, waitfor, cred, p) 
! struct mount *mp;
! int waitfor;
! struct ucred *cred;
! struct prioc *p;
  {
! return 0;
  }
  
! int afs_sysctl() {
!    return EOPNOTSUPP;
  }
  
  
! int afs_init(struct vfsconf *vfc) {
!    return 0;
  }
  
! 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
  };
Index: openafs/src/afs/FBSD/osi_vm.c
diff -c openafs/src/afs/FBSD/osi_vm.c:1.3.4.1 openafs/src/afs/FBSD/osi_vm.c:1.3.4.2
*** openafs/src/afs/FBSD/osi_vm.c:1.3.4.1	Tue Apr 23 21:41:28 2002
--- openafs/src/afs/FBSD/osi_vm.c	Tue Sep 10 18:33:29 2002
***************
*** 21,32 ****
  #include <afsconfig.h>
  #include "../afs/param.h"
  
! RCSID("$Header: /data/cvs/openafs/src/afs/FBSD/osi_vm.c,v 1.3.4.1 2002/04/24 01:41:28 zacheiss 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 <limits.h>
  #include <float.h>
  
--- 21,33 ----
  #include <afsconfig.h>
  #include "../afs/param.h"
  
! RCSID("$Header: /data/cvs/openafs/src/afs/FBSD/osi_vm.c,v 1.3.4.2 2002/09/10 22:33:29 zacheiss 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_object.h>
! #include <vm/vm_map.h>
  #include <limits.h>
  #include <float.h>
  
***************
*** 51,58 ****
      struct vcache *avc;
      int *slept;
  {
! #ifdef SECRETLY_OSF1
!     if (avc->vrefCount > 1)
  	return EBUSY;
  
      if (avc->opens)
--- 52,60 ----
      struct vcache *avc;
      int *slept;
  {
!     struct vm_object *obj;
!     struct vnode *vp;
!     if (VREFCOUNT(avc) > 1)
  	return EBUSY;
  
      if (avc->opens)
***************
*** 63,142 ****
  	return EBUSY;
  
      AFS_GUNLOCK();
!     ubc_invalidate(((struct vnode *)avc)->v_object, 0, 0, B_INVAL);
      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
--- 65,89 ----
  	return EBUSY;
  
      AFS_GUNLOCK();
!     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();
  
      return 0;
  }
  
  /* 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,158 ****
  osi_VM_StoreAllSegments(avc)
      struct vcache *avc;
  {
! #ifdef SECRETLY_OSF1
      ReleaseWriteLock(&avc->lock);
      AFS_GUNLOCK();
!     osi_ubc_flush_dirty_and_wait((struct vnode *)avc, 0);
      AFS_GLOCK();
      ObtainWriteLock(&avc->lock,94);
- #endif /* SECRETLY_OSF1 */
  }
  
  /* Try to invalidate pages, for "fs flush" or "fs flushv"; or
--- 93,124 ----
  osi_VM_StoreAllSegments(avc)
      struct vcache *avc;
  {
!     struct vnode *vp;
!     struct vm_object *obj;
!     int anyio,tries;
      ReleaseWriteLock(&avc->lock);
      AFS_GUNLOCK();
!     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);
  }
  
  /* Try to invalidate pages, for "fs flush" or "fs flushv"; or
***************
*** 170,183 ****
      struct AFS_UCRED *acred;
      int sync;
  {
! #ifdef SECRETLY_OSF1
      ReleaseWriteLock(&avc->lock);
      AFS_GUNLOCK();
!     osi_ubc_flush_dirty_and_wait(AFSTOV(avc), 0);
!     ubc_invalidate((AFSTOV(avc))->v_object, 0, 0, B_INVAL);
      AFS_GLOCK();
      ObtainWriteLock(&avc->lock,59);
- #endif /* SECRETLY_OSF1 */
  }
  
  /* Purge VM for a file when its callback is revoked.
--- 136,173 ----
      struct AFS_UCRED *acred;
      int sync;
  {
!     struct vnode *vp;
!     struct vm_object *obj;
!     int anyio, tries;
      ReleaseWriteLock(&avc->lock);
      AFS_GUNLOCK();
!     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);
  }
  
  /* Purge VM for a file when its callback is revoked.
***************
*** 189,198 ****
      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 */
  }
  
  /* Purge pages beyond end-of-file, when truncating a file.
--- 179,193 ----
      struct vcache *avc;
      struct AFS_UCRED *credp;
  {
!     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,214 ****
      int alen;
      struct AFS_UCRED *acred;
  {
! #ifdef SECRETLY_OSF1
!     ubc_invalidate((AFSTOV(avc))->v_object, alen,
!                         MAXINT - alen, B_INVAL);
! #endif /* SECRETLY_OSF1 */
  }
--- 202,206 ----
      int alen;
      struct AFS_UCRED *acred;
  {
!     vnode_pager_setsize(AFSTOV(avc), alen);
  }
Index: openafs/src/afs/FBSD/osi_vnodeops.c
diff -c openafs/src/afs/FBSD/osi_vnodeops.c:1.3 openafs/src/afs/FBSD/osi_vnodeops.c:1.3.4.1
*** openafs/src/afs/FBSD/osi_vnodeops.c:1.3	Thu Jul 12 15:58:19 2001
--- openafs/src/afs/FBSD/osi_vnodeops.c	Tue Sep 10 18:33:30 2002
***************
*** 1,1095 ****
- /*
-  * 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: /data/cvs/openafs/src/afs/FBSD/osi_vnodeops.c,v 1.3 2001/07/12 19:58:19 shadow 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.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();
  
! #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 code;
!     AFS_GLOCK();
!     code = afs_lookup(adp, ndp);
!     AFS_GUNLOCK();
!     return code;
! }
  
- mp_afs_create(ndp, attrs)
-     struct nameidata *ndp;
-     struct vattr *attrs;
- {
-     int code;
-     AFS_GLOCK();
-     code = afs_create(ndp, attrs);
-     AFS_GUNLOCK();
-     return code;
- }
  
! 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;
! }
  
! mp_afs_access(avc, amode, acred)
!     struct vcache *avc;
!     afs_int32 amode;
!     struct AFS_UCRED *acred;
! {
!     int code;
!     AFS_GLOCK();
!     code = afs_access(avc, amode, acred);
!     AFS_GUNLOCK();
!     return code;
! }
  
! mp_afs_close(avc, flags, cred)
!     struct vnode *avc;
!     int flags;
!     struct ucred *cred;
! {
!     int code;
!     AFS_GLOCK();
!     code = afs_close(avc, flags, cred);
      AFS_GUNLOCK();
!     return code;
! }
  
! 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;
! }
  
! 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;
  }
  
! mp_afs_fsync(avc, fflags, acred, waitfor)
!     struct vcache *avc;
!     int fflags;
!     struct AFS_UCRED *acred;
!     int waitfor;
  {
!     int code;
!     AFS_GLOCK();
!     code = afs_fsync(avc, fflags, acred, waitfor);
!     AFS_GUNLOCK();
!     return code;
  }
  
! mp_afs_remove(ndp)
!     struct nameidata *ndp;
  {
!     int code;
!     AFS_GLOCK();
!     code = afs_remove(ndp);
!     AFS_GUNLOCK();
!     return code;
! }
! 
! mp_afs_link(avc, ndp)
!     struct vcache *avc;
!     struct nameidata *ndp;
  {
!     int code;
!     AFS_GLOCK();
!     code = afs_link(avc, ndp);
!     AFS_GUNLOCK();
!     return code;
  }
  
! mp_afs_rename(fndp, tndp)
!     struct nameidata *fndp, *tndp;
  {
      int code;
      AFS_GLOCK();
!     code = afs_rename(fndp, tndp);
      AFS_GUNLOCK();
      return code;
  }
  
! mp_afs_mkdir(ndp, attrs)
!     struct nameidata *ndp;
!     struct vattr *attrs;
  {
      int code;
      AFS_GLOCK();
!     code = afs_mkdir(ndp, attrs);
      AFS_GUNLOCK();
      return code;
  }
! 
! mp_afs_rmdir(ndp)
!     struct nameidata *ndp;
  {
      int code;
      AFS_GLOCK();
!     code = afs_rmdir(ndp);
      AFS_GUNLOCK();
      return code;
  }
! 
! mp_afs_symlink(ndp, attrs, atargetName)
!     struct nameidata *ndp;
!     struct vattr *attrs;
!     register char *atargetName;
  {
      int code;
      AFS_GLOCK();
!     code = afs_symlink(ndp, attrs, atargetName);
      AFS_GUNLOCK();
      return code;
! }
! 
! mp_afs_readdir(avc, auio, acred, eofp)
!     struct vcache *avc;
!     struct uio *auio;
!     struct AFS_UCRED *acred;
!     int *eofp;
  {
      int code;
      AFS_GLOCK();
!     code = afs_readdir(avc, auio, acred, eofp);
      AFS_GUNLOCK();
      return code;
  }
! 
! mp_afs_readlink(avc, auio, acred)
!     struct vcache *avc;
!     struct uio *auio;
!     struct AFS_UCRED *acred;
  {
      int code;
!     AFS_GLOCK();
!     code = afs_readlink(avc, auio, acred);
!     AFS_GUNLOCK();
!     return code;
! }
  
! 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 code;
      AFS_GLOCK();
!     code = afs_lockctl(avc, af, flag, acred, clid, offset);
      AFS_GUNLOCK();
!     return code;
! }
  
! mp_afs_closex(afd)
!     struct file *afd;
  {
      int code;
      AFS_GLOCK();
!     code = afs_closex(afd);
      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);
! }
! 
! mp_afs_abortop(ndp)
!     struct nameidata *ndp;
! {
!     return(0);
! }
  
- mp_afs_inactive(avc, acred)
-     register struct vcache *avc;
-     struct AFS_UCRED *acred;
- {
      AFS_GLOCK();
!     afs_InactiveVCache(avc, acred);
      AFS_GUNLOCK();
! }
  
! 
! mp_afs_reclaim(avc)
!     struct vcache *avc;
! {
!     return(0);
  }
! 
! mp_afs_print(avc)
!     struct vcache *avc;
! {
!     return(0);
  }
  
! mp_afs_page_read(avc, uio, acred)
!     struct vcache *avc;
!     struct uio *uio;
!     struct ucred *acred;
  {
!     int error;
!     struct vrequest treq;
! 
!     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);
!     }
!     AFS_GUNLOCK();
!     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 error;
  
      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;
!     }
      AFS_GUNLOCK();
!     return(error);
  }
  
! 
! int DO_FLUSH=1;
! mp_afs_ubcrdwr(avc, uio, ioflag, cred)
!     struct vcache *avc;
!     struct uio *uio;
!     int ioflag;
!     struct ucred *cred;
! {
!     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;
      }
!     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 (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();
!     }
! 
!     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.
       */
!     if (code == EDQUOT || code == ENOSPC) {
! 	uio->uio_resid = save_resid;
! 	UpgradeSToWLock(&avc->lock, 410);
! 	osi_ReleaseVM(avc, cred);
! 	ConvertWToSLock(&avc->lock);
!     }
!     ReleaseSharedLock(&avc->lock);
! 
!     if (!code && (ioflag & IO_SYNC) && (uio->uio_rw == UIO_WRITE)
! 	&& !AFS_NFSXLATORREQ(cred)) {
! 	code = afs_fsync(avc, 0, cred, 0);
      }
! out:
!     code = afs_CheckCode(code, &treq, 36);
!     AFS_GUNLOCK();
!     return code;
! }
  
  
- /*
-  * 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;
-     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;
- }
- 
  
! 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;
! {
!     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 */
! 
!     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 */
!     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;
! 	    }
! 	}
!     }
! 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;
! }
! 
! 
! 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;
! {
!     register afs_int32 code=0;
!     struct vcache *avc = (struct vcache *)vop->vu_vp;
!     struct vnode *vp = (struct vnode *)avc;
!     int i;
! 
!     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);
-     AFS_GUNLOCK();
-     return code;
- }
- 
  
! int mp_afs_swap(avc, swapop, argp)
!     struct vcache *avc;
!     vp_swap_op_t swapop;
!     vm_offset_t argp;
! {
!     return EIO;
! }
! 
! 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;
! }
! 
! /* 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 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);
! 	}
! 
! 	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;
  }
  
! 
! mp_afs_brelse(vp, bp)
! struct vnode *vp;
! struct buf *bp;
  {
      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;
! 	}
      AFS_GUNLOCK();
  }
  
  
! mp_afs_bmap(avc, abn, anvp, anbn)
!     register struct vcache *avc;
!     afs_int32 abn, *anbn;
!     struct vcache **anvp;
  {
      AFS_GLOCK();
!     AFS_STATCNT(afs_bmap);
!     if (anvp)
! 	*anvp = avc;
!     if (anbn)
! 	*anbn =	abn * (8192 / DEV_BSIZE);   /* in 512 byte units */
      AFS_GUNLOCK();
      return 0;
  }
  
! 
! /* real strategy */
! mp_afs_strategy (abp)
!     register struct buf *abp;
  {
!     register afs_int32 code;
  
      AFS_GLOCK();
!     AFS_STATCNT(afs_strategy);
!     code = afs_osi_MapStrategy(afs_ustrategy, abp);
      AFS_GUNLOCK();
!     return code;
  }
  
  
- mp_afs_refer(vm_ubc_object_t vop)
- {
-         VREF(vop->vu_vp);
  }
- 
  
! mp_afs_release(vm_ubc_object_t vop)
  {
!         vrele(vop->vu_vp);
  }
! 
! 
! mp_afs_write_check(vm_ubc_object_t vop, vm_page_t pp)
  {
!         return TRUE;
  }
! 
! 
  
! 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 */
  
  /*
!  * 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.
   */
! 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 */
  {
-     /* 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);
  }
  
--- 1,1148 ----
  #include <afsconfig.h>
! #include <afs/param.h>
  
+ RCSID("$Header: /data/cvs/openafs/src/afs/FBSD/osi_vnodeops.c,v 1.3.4.1 2002/09/10 22:33:30 zacheiss 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'
  
! #define DROPNAME() FREE(name, M_TEMP)
! 	
  
  
! 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 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();
!     error = afs_lookup(VTOAFS(dvp), name, &vcp, cnp->cn_cred);
      AFS_GUNLOCK();
!     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;
  
!     if ((cnp->cn_nameiop == RENAME && wantparent && (flags & ISLASTCN)) ||
! 	 (cnp->cn_nameiop != LOOKUP && (flags & ISLASTCN)))
! 	cnp->cn_flags |= SAVENAME;
! 
!     DROPNAME();
!     return error;
! }
! 
! 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 error = 0;
!     struct vcache *vcp;
!     register struct vnode *dvp = ap->a_dvp;
!     struct proc *p;
!     GETNAME();
!     p=cnp->cn_proc;
! 
!     AFS_GLOCK();
!     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();
!     if (error) {
! 	DROPNAME();
! 	return(error);
!     }
  
!     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
! 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;
  {
!     return(ENODEV);
  }
  
! #if 0
! static int validate_vops(struct vnode *vp, int after) 
  {
!    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 error;
!     int bad;
!     struct vcache *vc = VTOAFS(ap->a_vp);
!     bad=0;
!     AFS_GLOCK();
!     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 error;
  }
  
! 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();
!     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;
  }
  
! 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_access(VTOAFS(ap->a_vp), ap->a_mode, ap->a_cred);
      AFS_GUNLOCK();
      return code;
  }
! 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_getattr(VTOAFS(ap->a_vp), ap->a_vap, ap->a_cred);
      AFS_GUNLOCK();
      return code;
  }
! 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_setattr(VTOAFS(ap->a_vp), ap->a_vap, ap->a_cred);
      AFS_GUNLOCK();
      return code;
! }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();
!     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;
  }
! 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();
!     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();
!     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;
! }
! 	
! 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();
!     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;
  }
  
! 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();
!     afs_BozonLock(&avc->pvnLock, avc);
!     code=afs_write(avc, &uio, sync, curproc->p_cred->pc_ucred,  0);
!     afs_BozonUnlock(&avc->pvnLock, avc);
      AFS_GUNLOCK();
!     pmap_qremove(kva, npages);
  
!     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];
  }
! 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();
! 	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);
!     }
  }
  
! /* 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;
  {
! 	/*
! 	 * We should really check to see if I/O is possible.
! 	 */
! 	return (1);
  }
! /*
!  * 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 (EINVAL);
! }
! 
! 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;
+     register struct vnode *vp = ap->a_vp;
  
      AFS_GLOCK();
!     /*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;
  }
  
! int
! afs_vop_remove(ap)
! 	struct vop_remove_args /* {
! 	        struct vnode *a_dvp;
! 	        struct vnode *a_vp;
! 	        struct componentname *a_cnp;
! 	} */ *ap;
! {
!     int error = 0;
!     register struct vnode *vp = ap->a_vp;
!     register struct vnode *dvp = ap->a_dvp;
! 
!     GETNAME();
!     AFS_GLOCK();
!     error =  afs_remove(VTOAFS(dvp), name, cnp->cn_cred);
!     AFS_GUNLOCK();
!     cache_purge(vp);
!     DROPNAME();
!     return error;
! }
! 
! int
! afs_vop_link(ap)
! 	struct vop_link_args /* {
! 	        struct vnode *a_vp;
! 	        struct vnode *a_tdvp;
! 	        struct componentname *a_cnp;
! 	} */ *ap;
! {
!     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 (vp->v_type == VDIR) {
! 	error = EISDIR;
! 	goto out;
      }
!     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;
! }
  
! 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 ((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);
      }
!     /*
!      * 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;
! 	}
! 
! 	/* 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);
      }
!     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';
  
  
      AFS_GLOCK();
!     /* XXX use "from" or "to" creds? NFS uses "to" creds */
!     error = afs_rename(VTOAFS(fdvp), fname, VTOAFS(tdvp), tname, tcnp->cn_cred);
      AFS_GUNLOCK();
  
!     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
! 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 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();
!     error = afs_mkdir(VTOAFS(dvp), name, vap, &vcp, cnp->cn_cred);
      AFS_GUNLOCK();
!     if (error) {
! 	vput(dvp);
! 	DROPNAME();
! 	return(error);
      }
!     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
! afs_vop_rmdir(ap)
! 	struct vop_rmdir_args /* {
! 	        struct vnode *a_dvp;
! 	        struct vnode *a_vp;
! 	        struct componentname *a_cnp;
! 	} */ *ap;
! {
!     int error = 0;
!     register struct vnode *vp = ap->a_vp;
!     register struct vnode *dvp = ap->a_dvp;
! 
!     GETNAME();
!     AFS_GLOCK();
!     error = afs_rmdir(VTOAFS(dvp), name, cnp->cn_cred);
!     AFS_GUNLOCK();
!     DROPNAME();
!     return error;
! }
! 
! 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;
! {
!     register struct vnode *dvp = ap->a_dvp;
!     int error = 0;
!     /* NFS ignores a_vpp; so do we. */
! 
!     GETNAME();
!     AFS_GLOCK();
!     error = afs_symlink(VTOAFS(dvp), name, ap->a_vap, ap->a_target,
! 	                cnp->cn_cred);
!     AFS_GUNLOCK();
!     DROPNAME();
!     return error;
! }
! 
! 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 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;
      }
  
!     return error;
  }
  
! 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();
!     error= afs_readlink(VTOAFS(ap->a_vp), ap->a_uio, ap->a_cred);
      AFS_GUNLOCK();
+     return error;
  }
  
+ extern int prtactive;
  
! 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_InactiveVCache(VTOAFS(vp), 0);   /* decrs ref counts */
      AFS_GUNLOCK();
+     VOP_UNLOCK(vp, 0, ap->a_p);
      return 0;
  }
  
! int
! afs_vop_reclaim(ap)
! 	struct vop_reclaim_args /* {
! 	        struct vnode *a_vp;
! 	} */ *ap;
  {
!     int error;
!     int sl;
!     register struct vnode *vp = ap->a_vp;
  
+     cache_purge(vp);                    /* just in case... */
+ 
+ #if 0 
      AFS_GLOCK();
!     error = afs_FlushVCache(VTOAFS(vp), &sl); /* tosses our stuff from vnode */
      AFS_GUNLOCK();
!     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
  }
  
+ int
+ afs_vop_lock(ap)
+ 	struct vop_lock_args /* {
+ 	        struct vnode *a_vp;
+ 	} */ *ap;
+ {
+ 	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));
+ }
+ 
+ int
+ afs_vop_unlock(ap)
+ 	struct vop_unlock_args /* {
+ 	        struct vnode *a_vp;
+ 	} */ *ap;
+ {
+     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));
  
  }
  
! 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;
  {
!     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;
! }
  
! 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);
! }
  
  /*
!  * Advisory record locking support (fcntl() POSIX style)
   */
! 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;
  {
      int 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: openafs/src/afs/FBSD/vnode_if.h
diff -c openafs/src/afs/FBSD/vnode_if.h:1.1 openafs/src/afs/FBSD/vnode_if.h:1.1.6.1
*** openafs/src/afs/FBSD/vnode_if.h:1.1	Sat Apr 14 13:27:38 2001
--- openafs/src/afs/FBSD/vnode_if.h	Tue Sep 10 18:33:30 2002
***************
*** 1,13 ****
  /*
-  * 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.
   *
--- 1,4 ----
***************
*** 467,472 ****
--- 458,484 ----
  	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;
***************
*** 1344,1348 ****
--- 1356,1423 ----
  	a.a_cred = cred;
  	a.a_p = 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: openafs/src/afs/LINUX/osi_misc.c
diff -c openafs/src/afs/LINUX/osi_misc.c:1.12.2.6 openafs/src/afs/LINUX/osi_misc.c:1.12.2.8
*** openafs/src/afs/LINUX/osi_misc.c:1.12.2.6	Mon Jul 22 18:05:50 2002
--- openafs/src/afs/LINUX/osi_misc.c	Thu Sep 19 18:33:43 2002
***************
*** 14,20 ****
  #include <afsconfig.h>
  #include "../afs/param.h"
  
! RCSID("$Header: /data/cvs/openafs/src/afs/LINUX/osi_misc.c,v 1.12.2.6 2002/07/22 22:05:50 zacheiss Exp $");
  
  #include "../afs/sysincludes.h"
  #include "../afs/afsincludes.h"
--- 14,20 ----
  #include <afsconfig.h>
  #include "../afs/param.h"
  
! RCSID("$Header: /data/cvs/openafs/src/afs/LINUX/osi_misc.c,v 1.12.2.8 2002/09/19 22:33:43 shadow Exp $");
  
  #include "../afs/sysincludes.h"
  #include "../afs/afsincludes.h"
***************
*** 91,97 ****
  
      cacheInode = dp->d_inode->i_ino;
      cacheDev.dev = dp->d_inode->i_dev;
!     afs_fsfragsize = dp->d_inode->i_sb->s_blocksize;
      afs_cacheSBp = dp->d_inode->i_sb;
  
      dput(dp);
--- 91,97 ----
  
      cacheInode = dp->d_inode->i_ino;
      cacheDev.dev = dp->d_inode->i_dev;
!     afs_fsfragsize = dp->d_inode->i_sb->s_blocksize - 1;
      afs_cacheSBp = dp->d_inode->i_sb;
  
      dput(dp);
***************
*** 114,119 ****
--- 114,120 ----
      KERNEL_SPACE_DECL;
      struct file *filp = &file->file;
      off_t offset = file->offset;
+     unsigned long savelim;
  
      /* Seek to the desired position. Return -1 on error. */
      if (filp->f_op->llseek) {
***************
*** 123,128 ****
--- 124,132 ----
      else
  	filp->f_pos = offset;
  
+     savelim = current->rlim[RLIMIT_FSIZE].rlim_cur;
+     current->rlim[RLIMIT_FSIZE].rlim_cur = RLIM_INFINITY;
+ 
      /* Read/Write the data. */
      TO_USER_SPACE();
      if (rw == UIO_READ)
***************
*** 133,138 ****
--- 137,144 ----
  	code = asize;
      TO_KERNEL_SPACE();
  
+     current->rlim[RLIMIT_FSIZE].rlim_cur = savelim;
+ 
      if (code >=0) {
  	*resid = asize - code;
  	return 0;
***************
*** 152,157 ****
--- 158,167 ----
      int code = 0;
      struct iovec *iov;
      int count;
+     unsigned long savelim;
+ 
+     savelim = current->rlim[RLIMIT_FSIZE].rlim_cur;
+     current->rlim[RLIMIT_FSIZE].rlim_cur = RLIM_INFINITY;
  
      if (uiop->uio_seg == AFS_UIOSYS)
  	TO_USER_SPACE();
***************
*** 165,171 ****
  	    uiop->uio_iovcnt--;
  	    continue;
  	}
! 	
  	if (rw == UIO_READ)
  	    code = FOP_READ(filp, iov->iov_base, count);
  	else
--- 175,181 ----
  	    uiop->uio_iovcnt--;
  	    continue;
  	}
! 
  	if (rw == UIO_READ)
  	    code = FOP_READ(filp, iov->iov_base, count);
  	else
***************
*** 185,190 ****
--- 195,202 ----
  
      if (uiop->uio_seg == AFS_UIOSYS)
  	TO_KERNEL_SPACE();
+ 
+     current->rlim[RLIMIT_FSIZE].rlim_cur = savelim;
  
      return code;
  }
Index: openafs/src/afs/SOLARIS/osi_file.c
diff -c openafs/src/afs/SOLARIS/osi_file.c:1.6.2.1 openafs/src/afs/SOLARIS/osi_file.c:1.6.2.2
*** openafs/src/afs/SOLARIS/osi_file.c:1.6.2.1	Sat Oct 13 00:20:26 2001
--- openafs/src/afs/SOLARIS/osi_file.c	Wed Aug 21 15:29:02 2002
***************
*** 10,16 ****
  #include <afsconfig.h>
  #include "../afs/param.h"
  
! RCSID("$Header: /data/cvs/openafs/src/afs/SOLARIS/osi_file.c,v 1.6.2.1 2001/10/13 04:20:26 shadow Exp $");
  
  #include "../afs/sysincludes.h"	/* Standard vendor system headers */
  #include "../afs/afsincludes.h"	/* Afs-based standard headers */
--- 10,16 ----
  #include <afsconfig.h>
  #include "../afs/param.h"
  
! RCSID("$Header: /data/cvs/openafs/src/afs/SOLARIS/osi_file.c,v 1.6.2.2 2002/08/21 19:29:02 shadow Exp $");
  
  #include "../afs/sysincludes.h"	/* Standard vendor system headers */
  #include "../afs/afsincludes.h"	/* Afs-based standard headers */
***************
*** 339,351 ****
          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
      AFS_GLOCK();
      if (code == 0) {
  	code = asize - resid;
--- 339,347 ----
          osi_Panic("afs_osi_Write called with null param");
      if (offset != -1) afile->offset = offset;
      AFS_GUNLOCK();
!     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: openafs/src/afs/SUNOS/osi_inode.h
diff -c /dev/null openafs/src/afs/SUNOS/osi_inode.h:1.1.2.1
*** /dev/null	Thu Sep 26 01:24:45 2002
--- openafs/src/afs/SUNOS/osi_inode.h	Wed Aug 21 15:24:54 2002
***************
*** 0 ****
--- 1 ----
+ #error kernel code not supported on SunOS 4 
Index: openafs/src/afs/VNOPS/afs_vnop_attrs.c
diff -c openafs/src/afs/VNOPS/afs_vnop_attrs.c:1.8.4.3 openafs/src/afs/VNOPS/afs_vnop_attrs.c:1.8.4.5
*** openafs/src/afs/VNOPS/afs_vnop_attrs.c:1.8.4.3	Mon Jul 22 19:14:54 2002
--- openafs/src/afs/VNOPS/afs_vnop_attrs.c	Tue Sep 10 18:33:33 2002
***************
*** 21,27 ****
  #include <afsconfig.h>
  #include "../afs/param.h"
  
! RCSID("$Header: /data/cvs/openafs/src/afs/VNOPS/afs_vnop_attrs.c,v 1.8.4.3 2002/07/22 23:14:54 zacheiss Exp $");
  
  #include "../afs/sysincludes.h"	/* Standard vendor system headers */
  #include "../afs/afsincludes.h"	/* Afs-based standard headers */
--- 21,27 ----
  #include <afsconfig.h>
  #include "../afs/param.h"
  
! RCSID("$Header: /data/cvs/openafs/src/afs/VNOPS/afs_vnop_attrs.c,v 1.8.4.5 2002/09/10 22:33:33 zacheiss Exp $");
  
  #include "../afs/sysincludes.h"	/* Standard vendor system headers */
  #include "../afs/afsincludes.h"	/* Afs-based standard headers */
***************
*** 105,111 ****
       * 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)
      attrs->va_atime.tv_nsec = attrs->va_mtime.tv_nsec =
  	attrs->va_ctime.tv_nsec =
  	    (hgetlo(avc->m.DataVersion) & 0x7ffff) * 1000;
--- 105,121 ----
       * anyway, so the difference between 512K and 1000000 shouldn't matter
       * much, and "&" is a lot faster than "%".
       */
! #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,125 ****
--- 130,136 ----
  	    (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,149 ****
       * 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)
  #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 */
  
  #if !defined(AFS_OSF_ENV) && !defined(AFS_DARWIN_ENV) && !defined(AFS_FBSD_ENV)
  #if !defined(AFS_HPUX_ENV)
--- 147,160 ----
       * 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)
  #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 */
  
  #if !defined(AFS_OSF_ENV) && !defined(AFS_DARWIN_ENV) && !defined(AFS_FBSD_ENV)
  #if !defined(AFS_HPUX_ENV)
***************
*** 215,220 ****
--- 226,237 ----
  
  #if defined(AFS_SUN5_ENV)
      if (flags & ATTR_HINT) {
+        code = afs_CopyOutAttrs(avc, attrs);
+        return code;
+     }
+ #endif
+ #if defined(AFS_DARWIN_ENV)
+     if (avc->states & CUBCinit) {
         code = afs_CopyOutAttrs(avc, attrs);
         return code;
      }
Index: openafs/src/afs/VNOPS/afs_vnop_flock.c
diff -c openafs/src/afs/VNOPS/afs_vnop_flock.c:1.10.4.3 openafs/src/afs/VNOPS/afs_vnop_flock.c:1.10.4.4
*** openafs/src/afs/VNOPS/afs_vnop_flock.c:1.10.4.3	Mon Jul 22 19:14:54 2002
--- openafs/src/afs/VNOPS/afs_vnop_flock.c	Tue Sep 10 18:33:34 2002
***************
*** 15,21 ****
  #include <afsconfig.h>
  #include "../afs/param.h"
  
! RCSID("$Header: /data/cvs/openafs/src/afs/VNOPS/afs_vnop_flock.c,v 1.10.4.3 2002/07/22 23:14:54 zacheiss Exp $");
  
  #include "../afs/sysincludes.h"	/* Standard vendor system headers */
  #include "../afs/afsincludes.h"	/* Afs-based standard headers */
--- 15,21 ----
  #include <afsconfig.h>
  #include "../afs/param.h"
  
! RCSID("$Header: /data/cvs/openafs/src/afs/VNOPS/afs_vnop_flock.c,v 1.10.4.4 2002/09/10 22:33:34 zacheiss Exp $");
  
  #include "../afs/sysincludes.h"	/* Standard vendor system headers */
  #include "../afs/afsincludes.h"	/* Afs-based standard headers */
***************
*** 37,43 ****
  static int GetFlockCount(struct vcache *avc, struct vrequest *areq);
  
  void lockIdSet(flock, slp, clid)
!    int clid;  /* non-zero on SGI, OSF, SunOS */
      struct SimpleLocks *slp;
      struct AFS_FLOCK *flock;
  {
--- 37,43 ----
  static int GetFlockCount(struct vcache *avc, struct vrequest *areq);
  
  void lockIdSet(flock, slp, clid)
!    int clid;  /* non-zero on SGI, OSF, SunOS, Darwin, xBSD *//* XXX ptr type */
      struct SimpleLocks *slp;
      struct AFS_FLOCK *flock;
  {
***************
*** 175,184 ****
        }
  #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)
  	  (!onlymine && (flock1->l_pid == getppid()))
  #else
! #if defined(AFS_SGI65_ENV)
  	  (!onlymine && (flock1->l_pid == clid))
  #else
  	  (!onlymine && (flock1->l_pid == procp->p_ppid))
--- 175,185 ----
        }
  #endif
        if ((flock1->l_pid == alp->pid) || 
! #if defined(AFS_AIX41_ENV) || defined(AFS_LINUX20_ENV) || defined(AFS_HPUX_ENV)
  	  (!onlymine && (flock1->l_pid == getppid()))
  #else
! #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,896 ****
      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) {
--- 887,893 ----
Index: openafs/src/afs/VNOPS/afs_vnop_lookup.c
diff -c openafs/src/afs/VNOPS/afs_vnop_lookup.c:1.14.2.5 openafs/src/afs/VNOPS/afs_vnop_lookup.c:1.14.2.8
*** openafs/src/afs/VNOPS/afs_vnop_lookup.c:1.14.2.5	Mon Jul 22 19:14:54 2002
--- openafs/src/afs/VNOPS/afs_vnop_lookup.c	Wed Sep 11 03:21:59 2002
***************
*** 22,28 ****
  #include <afsconfig.h>
  #include "../afs/param.h"
  
! RCSID("$Header: /data/cvs/openafs/src/afs/VNOPS/afs_vnop_lookup.c,v 1.14.2.5 2002/07/22 23:14:54 zacheiss Exp $");
  
  #include "../afs/sysincludes.h"	/* Standard vendor system headers */
  #include "../afs/afsincludes.h"	/* Afs-based standard headers */
--- 22,28 ----
  #include <afsconfig.h>
  #include "../afs/param.h"
  
! RCSID("$Header: /data/cvs/openafs/src/afs/VNOPS/afs_vnop_lookup.c,v 1.14.2.8 2002/09/11 07:21:59 shadow Exp $");
  
  #include "../afs/sysincludes.h"	/* Standard vendor system headers */
  #include "../afs/afsincludes.h"	/* Afs-based standard headers */
***************
*** 110,116 ****
      struct VenusFid tfid;
      struct cell *tcell;
      char   *cpos, *volnamep;
!     char   type, buf[128];
      afs_int32  prefetchRO;          /* 1=>No  2=>Yes */
      afs_int32  mtptCell, assocCell, hac=0;
      afs_int32  samecell, roname, len;
--- 110,116 ----
      struct VenusFid tfid;
      struct cell *tcell;
      char   *cpos, *volnamep;
!     char   type, *buf;
      afs_int32  prefetchRO;          /* 1=>No  2=>Yes */
      afs_int32  mtptCell, assocCell, hac=0;
      afs_int32  samecell, roname, len;
***************
*** 179,193 ****
       * Don't know why we do this. Would have still found it in above call - jpm.
       */
      if (!tvp && (prefetchRO == 2)) {
!        strcpy(buf, volnamep);
!        afs_strcat(buf, ".readonly");
  
!        tvp = afs_GetVolumeByName(buf, mtptCell, 1, areq, WRITE_LOCK);
  
!        /* Try the associated linked cell if failed */
!        if (!tvp && hac && areq->volumeError) {
! 	  tvp = afs_GetVolumeByName(buf, assocCell, 1, areq, WRITE_LOCK);
!        }
      }
    
      if (!tvp) return ENODEV;       /* Couldn't find the volume */
--- 179,196 ----
       * Don't know why we do this. Would have still found it in above call - jpm.
       */
      if (!tvp && (prefetchRO == 2)) {
! 	buf = (char *)osi_AllocSmallSpace(strlen(volnamep)+10);
  
! 	strcpy(buf, volnamep);
! 	afs_strcat(buf, ".readonly");
  
! 	tvp = afs_GetVolumeByName(buf, mtptCell, 1, areq, WRITE_LOCK);
!        
! 	/* Try the associated linked cell if failed */
! 	if (!tvp && hac && areq->volumeError) {
! 	    tvp = afs_GetVolumeByName(buf, assocCell, 1, areq, WRITE_LOCK);
! 	}
! 	osi_FreeSmallSpace(buf);
      }
    
      if (!tvp) return ENODEV;       /* Couldn't find the volume */
***************
*** 195,201 ****
      /* Don't cross mountpoint from a BK to a BK volume */
      if ((avc->states & CBackup) && (tvp->states & VBackup)) {
  	afs_PutVolume(tvp, WRITE_LOCK);
! 	return ELOOP;
      }
  
      /* If we want (prefetched) the RO and it exists, then drop the
--- 198,204 ----
      /* Don't cross mountpoint from a BK to a BK volume */
      if ((avc->states & CBackup) && (tvp->states & VBackup)) {
  	afs_PutVolume(tvp, WRITE_LOCK);
! 	return ENODEV;
      }
  
      /* If we want (prefetched) the RO and it exists, then drop the
***************
*** 1088,1093 ****
--- 1091,1097 ----
      struct sysname_info sysState;   /* used only for @sys checking */
      int dynrootRetry = 1;
      struct afs_fakestat_state fakestate;
+     int tryEvalOnly = 0;
  
      AFS_STATCNT(afs_lookup);
      afs_InitFakeStat(&fakestate);
***************
*** 1095,1108 ****
      if (code = afs_InitReq(&treq, acred))
  	goto done;
  
-     code = afs_EvalFakeStat(&adp, &fakestate, &treq);
-     if (code)
- 	goto done;
  #ifdef	AFS_OSF_ENV
      ndp->ni_dvp = AFSTOV(adp);
      memcpy(aname, ndp->ni_ptr, ndp->ni_namelen);
      aname[ndp->ni_namelen] = '\0';
  #endif	/* AFS_OSF_ENV */
  
      *avcp = (struct vcache *) 0;   /* Since some callers don't initialize it */
  
--- 1099,1130 ----
      if (code = afs_InitReq(&treq, acred))
  	goto done;
  
  #ifdef	AFS_OSF_ENV
      ndp->ni_dvp = AFSTOV(adp);
      memcpy(aname, ndp->ni_ptr, ndp->ni_namelen);
      aname[ndp->ni_namelen] = '\0';
  #endif	/* AFS_OSF_ENV */
+ 
+ #if defined(AFS_DARWIN_ENV)
+     /* Workaround for MacOSX Finder, which tries to look for
+      * .DS_Store and Contents under every directory.
+      */
+     if (afs_fakestat_enable && adp->mvstat == 1) {
+ 	if (strcmp(aname, ".DS_Store") == 0)
+ 	    tryEvalOnly = 1;
+ 	if (strcmp(aname, "Contents") == 0)
+ 	    tryEvalOnly = 1;
+     }
+ #endif
+ 
+     if (tryEvalOnly)
+ 	code = afs_TryEvalFakeStat(&adp, &fakestate, &treq);
+     else
+ 	code = afs_EvalFakeStat(&adp, &fakestate, &treq);
+     if (tryEvalOnly && adp->mvstat == 1)
+ 	code = ENOENT;
+     if (code)
+ 	goto done;
  
      *avcp = (struct vcache *) 0;   /* Since some callers don't initialize it */
  
Index: openafs/src/afs/VNOPS/afs_vnop_read.c
diff -c openafs/src/afs/VNOPS/afs_vnop_read.c:1.5.4.1 openafs/src/afs/VNOPS/afs_vnop_read.c:1.5.4.2
*** openafs/src/afs/VNOPS/afs_vnop_read.c:1.5.4.1	Wed Jul 10 16:04:36 2002
--- openafs/src/afs/VNOPS/afs_vnop_read.c	Tue Sep 10 18:33:34 2002
***************
*** 19,25 ****
  #include <afsconfig.h>
  #include "../afs/param.h"
  
! RCSID("$Header: /data/cvs/openafs/src/afs/VNOPS/afs_vnop_read.c,v 1.5.4.1 2002/07/10 20:04:36 shadow Exp $");
  
  #include "../afs/sysincludes.h"	/* Standard vendor system headers */
  #include "../afs/afsincludes.h"	/* Afs-based standard headers */
--- 19,25 ----
  #include <afsconfig.h>
  #include "../afs/param.h"
  
! RCSID("$Header: /data/cvs/openafs/src/afs/VNOPS/afs_vnop_read.c,v 1.5.4.2 2002/09/10 22:33:34 zacheiss Exp $");
  
  #include "../afs/sysincludes.h"	/* Standard vendor system headers */
  #include "../afs/afsincludes.h"	/* Afs-based standard headers */
***************
*** 431,436 ****
--- 431,443 ----
              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
  #endif
***************
*** 439,444 ****
--- 446,452 ----
  #endif
  #endif
  #endif
+ #endif
  	    auio->afsio_offset += avc->quick.minLoc;
  	    osi_UFSClose(tfile);
  	    /* Fix up LRU info */
***************
*** 768,775 ****
              code = VOP_READ(tfile->vnode, &tuio, 0, &afs_osi_cred);
              VOP_UNLOCK(tfile->vnode, 0, current_proc());
              AFS_GLOCK();
  #else
! 	    code = VOP_RDWR(tfile->vnode, &tuio, UIO_READ, 0, &afs_osi_cred);
  #endif
  #endif
  #endif
--- 776,791 ----
              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);
! #endif
  #endif
  #endif
  #endif
Index: openafs/src/afs/VNOPS/afs_vnop_readdir.c
diff -c openafs/src/afs/VNOPS/afs_vnop_readdir.c:1.8.4.1 openafs/src/afs/VNOPS/afs_vnop_readdir.c:1.8.4.2
*** openafs/src/afs/VNOPS/afs_vnop_readdir.c:1.8.4.1	Mon Jul 22 19:14:54 2002
--- openafs/src/afs/VNOPS/afs_vnop_readdir.c	Tue Sep 10 18:33:34 2002
***************
*** 22,28 ****
  #include <afsconfig.h>
  #include "../afs/param.h"
  
! RCSID("$Header: /data/cvs/openafs/src/afs/VNOPS/afs_vnop_readdir.c,v 1.8.4.1 2002/07/22 23:14:54 zacheiss Exp $");
  
  #include "../afs/sysincludes.h"	/* Standard vendor system headers */
  #include "../afs/afsincludes.h"	/* Afs-based standard headers */
--- 22,28 ----
  #include <afsconfig.h>
  #include "../afs/param.h"
  
! RCSID("$Header: /data/cvs/openafs/src/afs/VNOPS/afs_vnop_readdir.c,v 1.8.4.2 2002/09/10 22:33:34 zacheiss Exp $");
  
  #include "../afs/sysincludes.h"	/* Standard vendor system headers */
  #include "../afs/afsincludes.h"	/* Afs-based standard headers */
***************
*** 140,146 ****
  #else
  struct min_direct {	/* miniature direct structure */
  			/* If struct direct changes, this must too */
! #ifdef AFS_DARWIN_ENV
      afs_uint32  d_fileno;
      u_short     d_reclen;
      u_char      d_type;
--- 140,146 ----
  #else
  struct min_direct {	/* miniature direct structure */
  			/* If struct direct changes, this must too */
! #if defined(AFS_DARWIN_ENV) || defined(AFS_FBSD_ENV)
      afs_uint32  d_fileno;
      u_short     d_reclen;
      u_char      d_type;
***************
*** 226,231 ****
--- 226,270 ----
  #endif /* AFS_SUN56_ENV */
  #endif	/* AFS_HPUX100_ENV */
  
+ #if defined(AFS_DARWIN_ENV) || defined(AFS_FBSD_ENV)
+ int afs_readdir_type(avc, ade) 
+ struct DirEntry *	ade;
+ struct vcache *		avc;
+ {
+      struct VenusFid tfid;
+      struct vcache *tvc;
+      int vtype;
+      tfid.Cell=avc->fid.Cell;
+      tfid.Fid.Volume=avc->fid.Fid.Volume;
+      tfid.Fid.Vnode=ntohl(ade->fid.vnode);
+      tfid.Fid.Unique=ntohl(ade->fid.vunique);
+      if ((avc->states & CForeign) == 0 &&
+          (ntohl(ade->fid.vnode) & 1)) {
+           return DT_DIR;
+      } else if ((tvc=afs_FindVCache(&tfid,0,0,0,0))) {
+            if (tvc->mvstat) {
+                afs_PutVCache(tvc, WRITE_LOCK);
+                return DT_DIR;
+           } else if (((tvc->states) & (CStatd|CTruth))) {
+                /* CTruth will be set if the object has
+                 *ever* been statd */
+                vtype=vType(tvc);
+                afs_PutVCache(tvc, WRITE_LOCK);
+                if (vtype == VDIR)
+                     return DT_DIR;
+                else if (vtype == VREG)
+                     return DT_REG;
+                /* Don't do this until we're sure it can't be a mtpt */
+                /* else if (vtype == VLNK)
+                   type=DT_LNK; */
+                /* what other types does AFS support? */
+           } else
+                afs_PutVCache(tvc, WRITE_LOCK);
+     }
+     return DT_UNKNOWN;
+ }
+ #endif
+ 
  #ifdef AFS_AIX41_ENV
  #define AFS_MOVE_LOCK()   AFS_GLOCK()
  #define AFS_MOVE_UNLOCK() AFS_GUNLOCK()
***************
*** 233,239 ****
  #define AFS_MOVE_LOCK()
  #define AFS_MOVE_UNLOCK()
  #endif
- 
  char bufofzeros[64];	/* gotta fill with something */
  afs_readdir_move (de, vc, auio, slen, rlen, off) 
  struct DirEntry *	de;
--- 272,277 ----
***************
*** 348,355 ****
  #if defined(AFS_SUN_ENV) || defined(AFS_AIX32_ENV) || defined(AFS_SGI_ENV)
      sdirEntry.d_off = off;
  #endif
! #if defined(AFS_DARWIN_ENV)
!     sdirEntry.d_type=DT_UNKNOWN;
  #endif
  
  #if defined(AFS_SGI_ENV)
--- 386,393 ----
  #if defined(AFS_SUN_ENV) || defined(AFS_AIX32_ENV) || defined(AFS_SGI_ENV)
      sdirEntry.d_off = off;
  #endif
! #if defined(AFS_DARWIN_ENV) || defined(AFS_FBSD_ENV)
!     sdirEntry.d_type=afs_readdir_type(vc, de);
  #endif
  
  #if defined(AFS_SGI_ENV)
***************
*** 423,429 ****
   * It has to do with 'offset' (seek locations).
  */
  
! #if	defined(AFS_SUN5_ENV) || defined(AFS_SGI_ENV) || defined(AFS_OSF_ENV) || defined(AFS_DARWIN_ENV)
  afs_readdir(OSI_VC_ARG(avc), auio, acred, eofp)
      int *eofp;
  #else
--- 461,467 ----
   * It has to do with 'offset' (seek locations).
  */
  
! #if	defined(AFS_SUN5_ENV) || defined(AFS_SGI_ENV) || defined(AFS_OSF_ENV) || defined(AFS_DARWIN_ENV) || defined(AFS_FBSD_ENV)
  afs_readdir(OSI_VC_ARG(avc), auio, acred, eofp)
      int *eofp;
  #else
***************
*** 481,487 ****
  #endif /* AFS_SGI61_ENV */
  #endif /* defined(AFS_SGI53_ENV) */
  
! #if	defined(AFS_SUN5_ENV) || defined(AFS_SGI_ENV) || defined(AFS_OSF_ENV) || defined(AFS_DARWIN_ENV)
      /* Not really used by the callee so we ignore it for now */
      if (eofp) *eofp = 0;
  #endif
--- 519,525 ----
  #endif /* AFS_SGI61_ENV */
  #endif /* defined(AFS_SGI53_ENV) */
  
! #if	defined(AFS_SUN5_ENV) || defined(AFS_SGI_ENV) || defined(AFS_OSF_ENV) || defined(AFS_DARWIN_ENV) || defined(AFS_FBSD_ENV)
      /* Not really used by the callee so we ignore it for now */
      if (eofp) *eofp = 0;
  #endif
***************
*** 608,614 ****
  	    } else {
  		/* nothin to hand over */
  	    }
! #if	defined(AFS_SUN5_ENV) || defined(AFS_SGI_ENV) || defined(AFS_OSF_ENV)
  	if (eofp) *eofp = 1;	/* Set it properly */
  #endif
  	    if (ode) DRelease(ode, 0);
--- 646,652 ----
  	    } else {
  		/* nothin to hand over */
  	    }
! #if	defined(AFS_SUN5_ENV) || defined(AFS_SGI_ENV) || defined(AFS_OSF_ENV) || defined(AFS_DARWIN_ENV) || defined(AFS_FBSD_ENV)
  	if (eofp) *eofp = 1;	/* Set it properly */
  #endif
  	    if (ode) DRelease(ode, 0);
Index: openafs/src/afs/VNOPS/afs_vnop_strategy.c
diff -c openafs/src/afs/VNOPS/afs_vnop_strategy.c:1.7.2.2 openafs/src/afs/VNOPS/afs_vnop_strategy.c:1.7.2.3
*** openafs/src/afs/VNOPS/afs_vnop_strategy.c:1.7.2.2	Tue Apr 23 21:41:41 2002
--- openafs/src/afs/VNOPS/afs_vnop_strategy.c	Tue Sep 10 18:33:34 2002
***************
*** 15,21 ****
  #include <afsconfig.h>
  #include "../afs/param.h"
  
! RCSID("$Header: /data/cvs/openafs/src/afs/VNOPS/afs_vnop_strategy.c,v 1.7.2.2 2002/04/24 01:41:41 zacheiss Exp $");
  
  #if !defined(AFS_HPUX_ENV) && !defined(AFS_SGI_ENV) && !defined(AFS_LINUX20_ENV)
  
--- 15,21 ----
  #include <afsconfig.h>
  #include "../afs/param.h"
  
! RCSID("$Header: /data/cvs/openafs/src/afs/VNOPS/afs_vnop_strategy.c,v 1.7.2.3 2002/09/10 22:33:34 zacheiss Exp $");
  
  #if !defined(AFS_HPUX_ENV) && !defined(AFS_SGI_ENV) && !defined(AFS_LINUX20_ENV)
  
***************
*** 171,182 ****
  #endif
      }
  #if	!defined(AFS_AIX32_ENV) && !defined(AFS_SUN5_ENV)
! #ifdef AFS_DUX40_ENV
      if (code) {
  	abp->b_error = code;
  	abp->b_flags |= B_ERROR;
      }
      biodone(abp);
      if (code && !(abp->b_flags & B_READ)) {
  	/* prevent ubc from retrying writes */
  	AFS_GUNLOCK();
--- 171,183 ----
  #endif
      }
  #if	!defined(AFS_AIX32_ENV) && !defined(AFS_SUN5_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,193 ****
  		       PAGE_SIZE, B_INVAL);
  	AFS_GLOCK();
      }
! #else  /* AFS_DUX40_ENV */
      iodone(abp);
! #endif /* AFS_DUX40_ENV */
  #endif
  #ifdef	AFS_AIX32_ENV
      crfree(credp);
--- 186,195 ----
  		       PAGE_SIZE, B_INVAL);
  	AFS_GLOCK();
      }
! #endif
! #else  /* AFS_DUX40_ENV || AFS_FBSD_ENV */
      iodone(abp);
! #endif /* AFS_DUX40_ENV || AFS_FBSD_ENV */
  #endif
  #ifdef	AFS_AIX32_ENV
      crfree(credp);
Index: openafs/src/afs/VNOPS/afs_vnop_write.c
diff -c openafs/src/afs/VNOPS/afs_vnop_write.c:1.8.2.9 openafs/src/afs/VNOPS/afs_vnop_write.c:1.8.2.10
*** openafs/src/afs/VNOPS/afs_vnop_write.c:1.8.2.9	Thu Aug  1 15:12:03 2002
--- openafs/src/afs/VNOPS/afs_vnop_write.c	Tue Sep 10 18:33:34 2002
***************
*** 20,26 ****
  #include <afsconfig.h>
  #include "../afs/param.h"
  
! RCSID("$Header: /data/cvs/openafs/src/afs/VNOPS/afs_vnop_write.c,v 1.8.2.9 2002/08/01 19:12:03 shadow Exp $");
  
  #include "../afs/sysincludes.h"	/* Standard vendor system headers */
  #include "../afs/afsincludes.h"	/* Afs-based standard headers */
--- 20,26 ----
  #include <afsconfig.h>
  #include "../afs/param.h"
  
! RCSID("$Header: /data/cvs/openafs/src/afs/VNOPS/afs_vnop_write.c,v 1.8.2.10 2002/09/10 22:33:34 zacheiss Exp $");
  
  #include "../afs/sysincludes.h"	/* Standard vendor system headers */
  #include "../afs/afsincludes.h"	/* Afs-based standard headers */
***************
*** 536,550 ****
  	code = osi_file_uio_rdwr(tfile, &tuio, UIO_WRITE);
  	AFS_GLOCK();
  #else
! #if defined(AFS_DARWIN_ENV) || defined(AFS_FBSD_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
  	code = VOP_RDWR(tfile->vnode, &tuio, UIO_WRITE, 0, &afs_osi_cred);
! #endif /* AFS_DARWIN_ENV || AFS_FBSD_ENV */
  #endif /* AFS_LINUX20_ENV */
  #endif /* AFS_HPUX100_ENV */
  #endif /* AFS_OSF_ENV */
--- 536,558 ----
  	code = osi_file_uio_rdwr(tfile, &tuio, UIO_WRITE);
  	AFS_GLOCK();
  #else
! #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_FBSD_ENV */
! #endif /* AFS_DARWIN_ENV */
  #endif /* AFS_LINUX20_ENV */
  #endif /* AFS_HPUX100_ENV */
  #endif /* AFS_OSF_ENV */
Index: openafs/src/afsd/afs.rc.darwin
diff -c openafs/src/afsd/afs.rc.darwin:1.2 openafs/src/afsd/afs.rc.darwin:1.2.2.1
*** openafs/src/afsd/afs.rc.darwin:1.2	Fri Sep  7 14:59:03 2001
--- openafs/src/afsd/afs.rc.darwin	Wed Aug 21 16:53:23 2002
***************
*** 30,41 ****
  if [ -f $AFSDOPT ]; then
      OPTIONS=`cat $AFSDOPT`
  else
!     OPTIONS=$MEDIUM
  fi
  
  # Need the commands ps, awk, kill, sleep
  PATH=${PATH}${PATH:+:}/sbin:/bin:/usr/bin
! if kmodstat | grep -q openafs ; then
  :
  else
  if [ -d $VICEETC/afs.kext ]; then
--- 30,49 ----
  if [ -f $AFSDOPT ]; then
      OPTIONS=`cat $AFSDOPT`
  else
!     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
  :
  else
  if [ -d $VICEETC/afs.kext ]; then
***************
*** 46,52 ****
  	exit 1
  fi
  fi
! if kmodstat | grep -q openafs ; then
  :
  else
  	echo "AFS kernel extensions failed to initialize. Skipping AFS startup."
--- 54,60 ----
  	exit 1
  fi
  fi
! if $KMODSTAT | grep -q openafs ; then
  :
  else
  	echo "AFS kernel extensions failed to initialize. Skipping AFS startup."
Index: openafs/src/afsd/afs.rc.fbsd
diff -c openafs/src/afsd/afs.rc.fbsd:1.1 openafs/src/afsd/afs.rc.fbsd:1.1.6.1
*** openafs/src/afsd/afs.rc.fbsd:1.1	Sat Apr 14 13:27:53 2001
--- openafs/src/afsd/afs.rc.fbsd	Tue Sep 17 19:11:04 2002
***************
*** 6,24 ****
  # 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
  CONFIG=$VICEETC/config
  AFSDOPT=$CONFIG/afsd.options
  PACKAGE=$CONFIG/package.options
--- 6,13 ----
  # License.  For details, see the LICENSE file in the top-level source
  # directory or online at http://www.openafs.org/dl/license10.html
  
! VICEETC=/usr/vice/etc
! AFSD=$VICEETC/afsd
  CONFIG=$VICEETC/config
  AFSDOPT=$CONFIG/afsd.options
  PACKAGE=$CONFIG/package.options
***************
*** 35,44 ****
  
  # Need the commands ps, awk, kill, sleep
  PATH=${PATH}${PATH:+:}/sbin:/bin:/usr/bin
! if kmodstat | grep -q openafs ; then
  :
  else
! if [ -d $VICEETC/afs.ko ]; then
  	echo "Loading AFS kernel extensions"
  	kldload $VICEETC/afs.ko
  else
--- 24,33 ----
  
  # Need the commands ps, awk, kill, sleep
  PATH=${PATH}${PATH:+:}/sbin:/bin:/usr/bin
! if kmodstat | grep -q afs.ko ; then
  :
  else
! if [ -f $VICEETC/afs.ko ]; then
  	echo "Loading AFS kernel extensions"
  	kldload $VICEETC/afs.ko
  else
***************
*** 46,55 ****
  	exit 1
  fi
  fi
! if kldstat | grep -q openafs ; then
  :
  else
  	echo "AFS kernel extensions failed to initialize. Skipping AFS startup."
  fi
  
  #
--- 35,45 ----
  	exit 1
  fi
  fi
! if kldstat | grep -q afs.ko ; then
  :
  else
  	echo "AFS kernel extensions failed to initialize. Skipping AFS startup."
+ 	exit
  fi
  
  #
Index: openafs/src/afsd/afsd.c
diff -c openafs/src/afsd/afsd.c:1.13.2.9 openafs/src/afsd/afsd.c:1.13.2.10
*** openafs/src/afsd/afsd.c:1.13.2.9	Mon Jul 22 19:53:40 2002
--- openafs/src/afsd/afsd.c	Wed Aug 21 15:24:55 2002
***************
*** 55,61 ****
  #include <afsconfig.h>
  #include <afs/param.h>
  
! RCSID("$Header: /data/cvs/openafs/src/afsd/afsd.c,v 1.13.2.9 2002/07/22 23:53:40 zacheiss Exp $");
  
  #define VFS 1
  
--- 55,61 ----
  #include <afsconfig.h>
  #include <afs/param.h>
  
! RCSID("$Header: /data/cvs/openafs/src/afsd/afsd.c,v 1.13.2.10 2002/08/21 19:24:55 shadow Exp $");
  
  #define VFS 1
  
***************
*** 154,161 ****
--- 154,165 ----
  #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
  
Index: openafs/src/afsmonitor/afsmonitor.c
diff -c openafs/src/afsmonitor/afsmonitor.c:1.9 openafs/src/afsmonitor/afsmonitor.c:1.9.2.1
*** openafs/src/afsmonitor/afsmonitor.c:1.9	Tue Aug  7 22:05:55 2001
--- openafs/src/afsmonitor/afsmonitor.c	Tue Sep 10 18:33:36 2002
***************
*** 16,22 ****
  #include <afsconfig.h>
  #include <afs/param.h>
  
! RCSID("$Header: /data/cvs/openafs/src/afsmonitor/afsmonitor.c,v 1.9 2001/08/08 02:05:55 shadow Exp $");
  
  #include <stdio.h>
  #include <math.h>
--- 16,22 ----
  #include <afsconfig.h>
  #include <afs/param.h>
  
! RCSID("$Header: /data/cvs/openafs/src/afsmonitor/afsmonitor.c,v 1.9.2.1 2002/09/10 22:33:36 zacheiss Exp $");
  
  #include <stdio.h>
  #include <math.h>
***************
*** 274,279 ****
--- 274,280 ----
  
  
  
+ #ifndef AFS_FBSD_ENV
  /*	
          strcasestr(): Return first occurence of pattern s2 in s1, case 
  	insensitive. 
***************
*** 305,311 ****
          }
          return ((char *)NULL);
  }
! 
  
  struct hostent *GetHostByName(name)
  char *name;
--- 306,312 ----
          }
          return ((char *)NULL);
  }
! #endif
  
  struct hostent *GetHostByName(name)
  char *name;
***************
*** 3491,3496 ****
--- 3492,3500 ----
  	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,3567 ****
--- 3566,3574 ----
  	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: openafs/src/auth/cellconfig.c
diff -c openafs/src/auth/cellconfig.c:1.14.2.5 openafs/src/auth/cellconfig.c:1.14.2.7
*** openafs/src/auth/cellconfig.c:1.14.2.5	Sun Jan 20 03:33:45 2002
--- openafs/src/auth/cellconfig.c	Tue Sep 10 18:33:39 2002
***************
*** 10,16 ****
  #include <afsconfig.h>
  #include <afs/param.h>
  
! RCSID("$Header: /data/cvs/openafs/src/auth/cellconfig.c,v 1.14.2.5 2002/01/20 08:33:45 shadow Exp $");
  
  #include <afs/stds.h>
  #include <afs/pthread_glock.h>
--- 10,16 ----
  #include <afsconfig.h>
  #include <afs/param.h>
  
! RCSID("$Header: /data/cvs/openafs/src/auth/cellconfig.c,v 1.14.2.7 2002/09/10 22:33:39 zacheiss Exp $");
  
  #include <afs/stds.h>
  #include <afs/pthread_glock.h>
***************
*** 61,66 ****
--- 61,70 ----
  #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,544 ****
--- 543,551 ----
      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: openafs/src/bozo/bnode.c
diff -c openafs/src/bozo/bnode.c:1.7.2.3 openafs/src/bozo/bnode.c:1.7.2.4
*** openafs/src/bozo/bnode.c:1.7.2.3	Wed Dec 26 15:47:02 2001
--- openafs/src/bozo/bnode.c	Wed Aug 21 15:24:56 2002
***************
*** 10,16 ****
  #include <afsconfig.h>
  #include <afs/param.h>
  
! RCSID("$Header: /data/cvs/openafs/src/bozo/bnode.c,v 1.7.2.3 2001/12/26 20:47:02 shadow Exp $");
  
  #include <stddef.h>
  #include <stdlib.h>
--- 10,16 ----
  #include <afsconfig.h>
  #include <afs/param.h>
  
! RCSID("$Header: /data/cvs/openafs/src/bozo/bnode.c,v 1.7.2.4 2002/08/21 19:24:56 shadow Exp $");
  
  #include <stddef.h>
  #include <stdlib.h>
***************
*** 34,40 ****
  #include <afs/fileutil.h>
  #include "bnode.h"
  
! #ifdef AFS_AIX_ENV
  /* All known versions of AIX lack WCOREDUMP but this works */
  #define WCOREDUMP(x) ((x) & 0x80)
  #endif
--- 34,40 ----
  #include <afs/fileutil.h>
  #include "bnode.h"
  
! #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: openafs/src/bozo/bos.c
diff -c openafs/src/bozo/bos.c:1.10.2.3 openafs/src/bozo/bos.c:1.10.2.4
*** openafs/src/bozo/bos.c:1.10.2.3	Sat Oct 13 00:21:04 2001
--- openafs/src/bozo/bos.c	Wed Aug 21 11:45:13 2002
***************
*** 10,16 ****
  #include <afsconfig.h>
  #include <afs/param.h>
  
! RCSID("$Header: /data/cvs/openafs/src/bozo/bos.c,v 1.10.2.3 2001/10/13 04:21:04 shadow Exp $");
  
  #include <afs/stds.h>
  #include <stdlib.h>
--- 10,16 ----
  #include <afsconfig.h>
  #include <afs/param.h>
  
! RCSID("$Header: /data/cvs/openafs/src/bozo/bos.c,v 1.10.2.4 2002/08/21 15:45:13 shadow Exp $");
  
  #include <afs/stds.h>
  #include <stdlib.h>
***************
*** 1828,1834 ****
      cmd_AddParm(ts, "-instance", CMD_LIST, CMD_OPTIONAL, "instances");
      add_std_args (ts);
  
!     ts = cmd_CreateSyntax("restart", Restart, 0, "restart all 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");
--- 1828,1834 ----
      cmd_AddParm(ts, "-instance", CMD_LIST, CMD_OPTIONAL, "instances");
      add_std_args (ts);
  
!     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: openafs/src/bozo/bosoprocs.c
diff -c openafs/src/bozo/bosoprocs.c:1.6.2.6 openafs/src/bozo/bosoprocs.c:1.6.2.7
*** openafs/src/bozo/bosoprocs.c:1.6.2.6	Thu Apr 18 22:22:02 2002
--- openafs/src/bozo/bosoprocs.c	Wed Aug 21 15:33:45 2002
***************
*** 10,16 ****
  #include <afsconfig.h>
  #include <afs/param.h>
  
! RCSID("$Header: /data/cvs/openafs/src/bozo/bosoprocs.c,v 1.6.2.6 2002/04/19 02:22:02 zacheiss Exp $");
  
  #include <afs/stds.h>
  #include <sys/types.h>
--- 10,16 ----
  #include <afsconfig.h>
  #include <afs/param.h>
  
! RCSID("$Header: /data/cvs/openafs/src/bozo/bosoprocs.c,v 1.6.2.7 2002/08/21 19:33:45 shadow Exp $");
  
  #include <afs/stds.h>
  #include <sys/types.h>
***************
*** 1260,1265 ****
--- 1260,1272 ----
      for (i=0; i<bozo_nbosEntryStats; i++) {
  	struct bozo_bosEntryStats *e = &bozo_bosEntryStats[i];
  	if (!StatEachEntry (e)) {
+ 	    bozo_Log("unhappy with %s which is a %s that should "
+ 		     "have at least rights %o, at most rights %o %s\n",
+ 		     e->path, 
+ 		     e->dir ? "dir" : "file", 
+ 		     e->reqPerm, 
+ 		     e->proPerm, 
+ 		     e->rootOwner ? ", owned by root" : "");
  	    result = 0;
  	    break;
  	}
Index: openafs/src/bozo/bosserver.c
diff -c openafs/src/bozo/bosserver.c:1.12.2.4 openafs/src/bozo/bosserver.c:1.12.2.5
*** openafs/src/bozo/bosserver.c:1.12.2.4	Sun Apr 21 00:14:50 2002
--- openafs/src/bozo/bosserver.c	Tue Aug 27 23:47:43 2002
***************
*** 10,16 ****
  #include <afsconfig.h>
  #include <afs/param.h>
  
! RCSID("$Header: /data/cvs/openafs/src/bozo/bosserver.c,v 1.12.2.4 2002/04/21 04:14:50 zacheiss Exp $");
  
  #include <afs/stds.h>
  #include <sys/types.h>
--- 10,16 ----
  #include <afsconfig.h>
  #include <afs/param.h>
  
! RCSID("$Header: /data/cvs/openafs/src/bozo/bosserver.c,v 1.12.2.5 2002/08/28 03:47:43 zacheiss Exp $");
  
  #include <afs/stds.h>
  #include <sys/types.h>
***************
*** 180,194 ****
  /* create all the bozo dirs */
  static CreateDirs() {
      
!     MakeDir(AFSDIR_USR_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);
      MakeDir(AFSDIR_CLIENT_ETC_DIRPATH);
  
      symlink(AFSDIR_SERVER_THISCELL_FILEPATH, AFSDIR_CLIENT_THISCELL_FILEPATH); 
--- 180,205 ----
  /* create all the bozo dirs */
  static CreateDirs() {
      
!     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
!     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: openafs/src/bucoord/commands.c
diff -c openafs/src/bucoord/commands.c:1.6 openafs/src/bucoord/commands.c:1.6.2.1
*** openafs/src/bucoord/commands.c:1.6	Tue Aug  7 20:03:39 2001
--- openafs/src/bucoord/commands.c	Tue Sep 10 18:33:40 2002
***************
*** 10,16 ****
  #include <afsconfig.h>
  #include <afs/param.h>
  
! RCSID("$Header: /data/cvs/openafs/src/bucoord/commands.c,v 1.6 2001/08/08 00:03:39 shadow Exp $");
  
  #include <afs/stds.h>
  #include <sys/types.h>
--- 10,16 ----
  #include <afsconfig.h>
  #include <afs/param.h>
  
! RCSID("$Header: /data/cvs/openafs/src/bucoord/commands.c,v 1.6.2.1 2002/09/10 22:33:40 zacheiss Exp $");
  
  #include <afs/stds.h>
  #include <sys/types.h>
***************
*** 325,330 ****
--- 325,333 ----
  	      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: openafs/src/bucoord/config.c
diff -c openafs/src/bucoord/config.c:1.5 openafs/src/bucoord/config.c:1.5.2.1
*** openafs/src/bucoord/config.c:1.5	Tue Aug  7 20:03:39 2001
--- openafs/src/bucoord/config.c	Tue Sep 10 18:33:41 2002
***************
*** 10,16 ****
  #include <afsconfig.h>
  #include <afs/param.h>
  
! RCSID("$Header: /data/cvs/openafs/src/bucoord/config.c,v 1.5 2001/08/08 00:03:39 shadow Exp $");
  
  #include <sys/types.h>
  #ifdef AFS_NT40_ENV
--- 10,16 ----
  #include <afsconfig.h>
  #include <afs/param.h>
  
! RCSID("$Header: /data/cvs/openafs/src/bucoord/config.c,v 1.5.2.1 2002/09/10 22:33:41 zacheiss Exp $");
  
  #include <sys/types.h>
  #ifdef AFS_NT40_ENV
***************
*** 116,121 ****
--- 116,124 ----
      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: openafs/src/bucoord/dsvs.c
diff -c openafs/src/bucoord/dsvs.c:1.5 openafs/src/bucoord/dsvs.c:1.5.2.1
*** openafs/src/bucoord/dsvs.c:1.5	Tue Aug  7 20:03:39 2001
--- openafs/src/bucoord/dsvs.c	Tue Sep 10 18:33:41 2002
***************
*** 18,24 ****
  #include <afsconfig.h>
  #include <afs/param.h>
  
! RCSID("$Header: /data/cvs/openafs/src/bucoord/dsvs.c,v 1.5 2001/08/08 00:03:39 shadow Exp $");
  
  #include <sys/types.h>
  #include <afs/cmd.h>
--- 18,24 ----
  #include <afsconfig.h>
  #include <afs/param.h>
  
! RCSID("$Header: /data/cvs/openafs/src/bucoord/dsvs.c,v 1.5.2.1 2002/09/10 22:33:41 zacheiss Exp $");
  
  #include <sys/types.h>
  #include <afs/cmd.h>
***************
*** 151,156 ****
--- 151,159 ----
  	/*
  	 * 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,185 ****
--- 183,191 ----
      /*
       * 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: openafs/src/bucoord/tape_hosts.c
diff -c openafs/src/bucoord/tape_hosts.c:1.5 openafs/src/bucoord/tape_hosts.c:1.5.2.1
*** openafs/src/bucoord/tape_hosts.c:1.5	Tue Aug  7 20:03:39 2001
--- openafs/src/bucoord/tape_hosts.c	Tue Sep 10 18:33:41 2002
***************
*** 10,16 ****
  #include <afsconfig.h>
  #include <afs/param.h>
  
! RCSID("$Header: /data/cvs/openafs/src/bucoord/tape_hosts.c,v 1.5 2001/08/08 00:03:39 shadow Exp $");
  
  #include <afs/stds.h>
  #include <sys/types.h>
--- 10,16 ----
  #include <afsconfig.h>
  #include <afs/param.h>
  
! RCSID("$Header: /data/cvs/openafs/src/bucoord/tape_hosts.c,v 1.5.2.1 2002/09/10 22:33:41 zacheiss Exp $");
  
  #include <afs/stds.h>
  #include <sys/types.h>
***************
*** 285,290 ****
--- 285,293 ----
  	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: openafs/src/butc/dump.c
diff -c openafs/src/butc/dump.c:1.6 openafs/src/butc/dump.c:1.6.2.3
*** openafs/src/butc/dump.c:1.6	Tue Aug  7 20:03:40 2001
--- openafs/src/butc/dump.c	Tue Sep 10 18:33:42 2002
***************
*** 10,16 ****
  #include <afsconfig.h>
  #include <afs/param.h>
  
! RCSID("$Header: /data/cvs/openafs/src/butc/dump.c,v 1.6 2001/08/08 00:03:40 shadow Exp $");
  
  #include <sys/types.h>
  #ifdef AFS_NT40_ENV
--- 10,16 ----
  #include <afsconfig.h>
  #include <afs/param.h>
  
! RCSID("$Header: /data/cvs/openafs/src/butc/dump.c,v 1.6.2.3 2002/09/10 22:33:42 zacheiss Exp $");
  
  #include <sys/types.h>
  #ifdef AFS_NT40_ENV
***************
*** 101,107 ****
     else \
       sprintf(dumpname, "%s (DumpId %u)", name, dbDumpId);
  
! #if defined(AFS_NT40_ENV) || defined(AFS_DARWIN_ENV)
  localtime_r(t, tm)
     time_t *t;
     struct tm *tm;
--- 101,107 ----
     else \
       sprintf(dumpname, "%s (DumpId %u)", name, dbDumpId);
  
! #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,919 ****
--- 914,922 ----
  	    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: openafs/src/cf/linux-test4.m4
diff -c openafs/src/cf/linux-test4.m4:1.6.2.2 openafs/src/cf/linux-test4.m4:1.6.2.4
*** openafs/src/cf/linux-test4.m4:1.6.2.2	Wed Dec 26 15:15:05 2001
--- openafs/src/cf/linux-test4.m4	Wed Sep 11 03:02:51 2002
***************
*** 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: openafs/src/config/Makefile.alpha_dux40.in
diff -c openafs/src/config/Makefile.alpha_dux40.in:1.5 openafs/src/config/Makefile.alpha_dux40.in:1.5.2.2
*** openafs/src/config/Makefile.alpha_dux40.in:1.5	Fri Sep  7 19:34:53 2001
--- openafs/src/config/Makefile.alpha_dux40.in	Thu Sep 12 23:53:50 2002
***************
*** 12,17 ****
--- 12,18 ----
  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,28 ****
--- 24,30 ----
  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: openafs/src/config/Makefile.alpha_dux50.in
diff -c openafs/src/config/Makefile.alpha_dux50.in:1.4 openafs/src/config/Makefile.alpha_dux50.in:1.4.2.2
*** openafs/src/config/Makefile.alpha_dux50.in:1.4	Fri Sep  7 19:34:53 2001
--- openafs/src/config/Makefile.alpha_dux50.in	Thu Sep 12 23:53:50 2002
***************
*** 12,17 ****
--- 12,18 ----
  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,25 ****
--- 21,27 ----
  OPTMZ=-O2
  DBG=-g3
  CP=cp
+ RM=rm
  CSTATIC=-non_shared
  RANLIB=/bin/true
  INSTALL=${TOP_SRCDIR}/pinstall/pinstall
Index: openafs/src/config/Makefile.alpha_linux_22.in
diff -c openafs/src/config/Makefile.alpha_linux_22.in:1.5 openafs/src/config/Makefile.alpha_linux_22.in:1.5.2.2
*** openafs/src/config/Makefile.alpha_linux_22.in:1.5	Fri Sep  7 19:34:53 2001
--- openafs/src/config/Makefile.alpha_linux_22.in	Tue Sep 10 01:41:58 2002
***************
*** 18,28 ****
  # 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
  SHLIB_SUFFIX=so
  SHLIB_CFLAGS=
! #
  # libraries
  MTLIBS=-lpthread
  TXLIBS= /usr/lib/libncurses.so
--- 18,28 ----
  # Put -O2 here to _ensure_ all Makefiles pick it up.
  XCFLAGS= -O2
  MT_CFLAGS=-DAFS_PTHREAD_ENV -pthread -D_REENTRANT ${XCFLAGS}
! 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: openafs/src/config/Makefile.alpha_linux_24.in
diff -c openafs/src/config/Makefile.alpha_linux_24.in:1.1.2.1 openafs/src/config/Makefile.alpha_linux_24.in:1.1.2.3
*** openafs/src/config/Makefile.alpha_linux_24.in:1.1.2.1	Sat Oct 13 00:36:14 2001
--- openafs/src/config/Makefile.alpha_linux_24.in	Tue Sep 10 01:41:58 2002
***************
*** 19,27 ****
  XCFLAGS= -O2
  MT_CFLAGS=-DAFS_PTHREAD_ENV -pthread -D_REENTRANT ${XCFLAGS}
  XLDFLAGS=
! SHARE_LDFLAGS = -shared -Xlinker -x
  SHLIB_SUFFIX=so
  SHLIB_CFLAGS=
  #
  # libraries
  MTLIBS=-lpthread
--- 19,28 ----
  XCFLAGS= -O2
  MT_CFLAGS=-DAFS_PTHREAD_ENV -pthread -D_REENTRANT ${XCFLAGS}
  XLDFLAGS=
! SHLIB_LDFLAGS = -shared -Xlinker -x
  SHLIB_SUFFIX=so
  SHLIB_CFLAGS=
+ SHLIB_LINKER=${MT_CC} -shared
  #
  # libraries
  MTLIBS=-lpthread
Index: openafs/src/config/Makefile.hp_ux102.in
diff -c openafs/src/config/Makefile.hp_ux102.in:1.4 openafs/src/config/Makefile.hp_ux102.in:1.4.2.1
*** openafs/src/config/Makefile.hp_ux102.in:1.4	Fri Sep  7 19:34:53 2001
--- openafs/src/config/Makefile.hp_ux102.in	Tue Sep 10 01:03:38 2002
***************
*** 31,36 ****
  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
--- 31,36 ----
  LEX=/opt/langtools/bin/lex
  DBM=/lib/libndbm.a
  PAM_CFLAGS=+DA1.0 +z -Wl,+k
! SHLIB_LDFLAGS=-b -Bsymbolic
  PAMLIBS=/usr/lib/libpam.1
  YACC=/opt/langtools/bin/yacc
Index: openafs/src/config/Makefile.hp_ux110.in
diff -c openafs/src/config/Makefile.hp_ux110.in:1.5 openafs/src/config/Makefile.hp_ux110.in:1.5.2.2
*** openafs/src/config/Makefile.hp_ux110.in:1.5	Fri Sep  7 19:34:53 2001
--- openafs/src/config/Makefile.hp_ux110.in	Tue Sep 10 01:41:58 2002
***************
*** 17,22 ****
--- 17,24 ----
  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,36 ****
  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
--- 33,37 ----
Index: openafs/src/config/Makefile.i386_djgpp
diff -c openafs/src/config/Makefile.i386_djgpp:1.5.2.1 openafs/src/config/Makefile.i386_djgpp:1.5.2.2
*** openafs/src/config/Makefile.i386_djgpp:1.5.2.1	Sat Oct 13 00:21:18 2001
--- openafs/src/config/Makefile.i386_djgpp	Tue Sep 10 01:03:38 2002
***************
*** 18,24 ****
  XCFLAGS= ${DBG} -Dfds_bits=fd_bits -DAFS_AFSDB_ENV -DAFS_FREELANCE_CLIENT
  MT_CFLAGS=${XCFLAGS}
  XLDFLAGS=
! SHARE_LDFLAGS = -shared -Xlinker -x
  SHLIB_SUFFIX=so
  SHLIB_CFLAGS=
  #
--- 18,24 ----
  XCFLAGS= ${DBG} -Dfds_bits=fd_bits -DAFS_AFSDB_ENV -DAFS_FREELANCE_CLIENT
  MT_CFLAGS=${XCFLAGS}
  XLDFLAGS=
! SHLIB_LDFLAGS = -shared -Xlinker -x
  SHLIB_SUFFIX=so
  SHLIB_CFLAGS=
  #
Index: openafs/src/config/Makefile.i386_fbsd_42.in
diff -c openafs/src/config/Makefile.i386_fbsd_42.in:1.5 openafs/src/config/Makefile.i386_fbsd_42.in:1.5.2.2
*** openafs/src/config/Makefile.i386_fbsd_42.in:1.5	Fri Sep  7 19:34:53 2001
--- openafs/src/config/Makefile.i386_fbsd_42.in	Tue Sep 17 18:32:55 2002
***************
*** 4,15 ****
  #
  # 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
--- 4,9 ----
***************
*** 20,26 ****
  XCFLAGS= -O2 -pipe
  MT_CFLAGS=-DAFS_PTHREAD_ENV -pthread -D_REENTRANT ${XCFLAGS}
  XLDFLAGS=
! SHARE_LDFLAGS = -shared -Xlinker -x
  SHLIB_SUFFIX=so
  SHLIB_CFLAGS=
  #
--- 14,20 ----
  XCFLAGS= -O2 -pipe
  MT_CFLAGS=-DAFS_PTHREAD_ENV -pthread -D_REENTRANT ${XCFLAGS}
  XLDFLAGS=
! SHLIB_LDFLAGS = -shared -Xlinker -x
  SHLIB_SUFFIX=so
  SHLIB_CFLAGS=
  #
Index: openafs/src/config/Makefile.i386_fbsd_43.in
diff -c /dev/null openafs/src/config/Makefile.i386_fbsd_43.in:1.1.2.1
*** /dev/null	Thu Sep 26 01:24:46 2002
--- openafs/src/config/Makefile.i386_fbsd_43.in	Tue Sep 17 18:32:56 2002
***************
*** 0 ****
--- 1,41 ----
+ # Copyright 1998 Transarc Corporation 
+ #
+ # Keep macros within each section in sorted order for clean diff displays.
+ #
+ # AFS_OSTYPE used to indicate suffixes and os specific subdirectories.
+ AFS_OSTYPE = FBSD
+ 
+ #
+ # compilation and link editor flags
+ DBG=-g
+ OPTMZ=-O2
+ PAM_CFLAGS = -O2 -pipe -fPIC
+ # Put -O2 here to _ensure_ all Makefiles pick it up.
+ XCFLAGS= -O2 -pipe
+ MT_CFLAGS=-DAFS_PTHREAD_ENV -pthread -D_REENTRANT ${XCFLAGS}
+ XLDFLAGS=
+ SHLIB_LDFLAGS = -shared -Xlinker -x
+ SHLIB_SUFFIX=so
+ SHLIB_CFLAGS=
+ #
+ # libraries
+ MTLIBS=-pthread
+ TXLIBS= /usr/lib/libncurses.so
+ XLIBS=@LIB_AFSDB@ -lcompat
+ 
+ #
+ # programs
+ AR=ar
+ AS=as
+ CP=cp
+ INSTALL=${TOP_SRCDIR}/pinstall/pinstall
+ LD=ld   
+ MT_CC=cc
+ MV=mv
+ RANLIB=ranlib
+ RM=rm
+ #
+ # Other OS specific requirements
+ #
+ YACC = bison -y
+ LEX = flex -l
Index: openafs/src/config/Makefile.i386_fbsd_44.in
diff -c /dev/null openafs/src/config/Makefile.i386_fbsd_44.in:1.1.2.1
*** /dev/null	Thu Sep 26 01:24:46 2002
--- openafs/src/config/Makefile.i386_fbsd_44.in	Tue Sep 17 18:32:56 2002
***************
*** 0 ****
--- 1,41 ----
+ # Copyright 1998 Transarc Corporation 
+ #
+ # Keep macros within each section in sorted order for clean diff displays.
+ #
+ # AFS_OSTYPE used to indicate suffixes and os specific subdirectories.
+ AFS_OSTYPE = FBSD
+ 
+ #
+ # compilation and link editor flags
+ DBG=-g
+ OPTMZ=-O2
+ PAM_CFLAGS = -O2 -pipe -fPIC
+ # Put -O2 here to _ensure_ all Makefiles pick it up.
+ XCFLAGS= -O2 -pipe
+ MT_CFLAGS=-DAFS_PTHREAD_ENV -pthread -D_REENTRANT ${XCFLAGS}
+ XLDFLAGS=
+ SHLIB_LDFLAGS = -shared -Xlinker -x
+ SHLIB_SUFFIX=so
+ SHLIB_CFLAGS=
+ #
+ # libraries
+ MTLIBS=-pthread
+ TXLIBS= /usr/lib/libncurses.so
+ XLIBS=@LIB_AFSDB@ -lcompat
+ 
+ #
+ # programs
+ AR=ar
+ AS=as
+ CP=cp
+ INSTALL=${TOP_SRCDIR}/pinstall/pinstall
+ LD=ld   
+ MT_CC=cc
+ MV=mv
+ RANLIB=ranlib
+ RM=rm
+ #
+ # Other OS specific requirements
+ #
+ YACC = bison -y
+ LEX = flex -l
Index: openafs/src/config/Makefile.i386_fbsd_45.in
diff -c /dev/null openafs/src/config/Makefile.i386_fbsd_45.in:1.1.2.1
*** /dev/null	Thu Sep 26 01:24:46 2002
--- openafs/src/config/Makefile.i386_fbsd_45.in	Tue Sep 17 18:32:56 2002
***************
*** 0 ****
--- 1,41 ----
+ # Copyright 1998 Transarc Corporation 
+ #
+ # Keep macros within each section in sorted order for clean diff displays.
+ #
+ # AFS_OSTYPE used to indicate suffixes and os specific subdirectories.
+ AFS_OSTYPE = FBSD
+ 
+ #
+ # compilation and link editor flags
+ DBG=-g
+ OPTMZ=-O2
+ PAM_CFLAGS = -O2 -pipe -fPIC
+ # Put -O2 here to _ensure_ all Makefiles pick it up.
+ XCFLAGS= -O2 -pipe
+ MT_CFLAGS=-DAFS_PTHREAD_ENV -pthread -D_REENTRANT ${XCFLAGS}
+ XLDFLAGS=
+ SHLIB_LDFLAGS = -shared -Xlinker -x
+ SHLIB_SUFFIX=so
+ SHLIB_CFLAGS=
+ #
+ # libraries
+ MTLIBS=-pthread
+ TXLIBS= /usr/lib/libncurses.so
+ XLIBS=@LIB_AFSDB@ -lcompat
+ 
+ #
+ # programs
+ AR=ar
+ AS=as
+ CP=cp
+ INSTALL=${TOP_SRCDIR}/pinstall/pinstall
+ LD=ld   
+ MT_CC=cc
+ MV=mv
+ RANLIB=ranlib
+ RM=rm
+ #
+ # Other OS specific requirements
+ #
+ YACC = bison -y
+ LEX = flex -l
Index: openafs/src/config/Makefile.i386_fbsd_46.in
diff -c /dev/null openafs/src/config/Makefile.i386_fbsd_46.in:1.1.2.1
*** /dev/null	Thu Sep 26 01:24:46 2002
--- openafs/src/config/Makefile.i386_fbsd_46.in	Tue Sep 17 18:32:56 2002
***************
*** 0 ****
--- 1,41 ----
+ # Copyright 1998 Transarc Corporation 
+ #
+ # Keep macros within each section in sorted order for clean diff displays.
+ #
+ # AFS_OSTYPE used to indicate suffixes and os specific subdirectories.
+ AFS_OSTYPE = FBSD
+ 
+ #
+ # compilation and link editor flags
+ DBG=-g
+ OPTMZ=-O2
+ PAM_CFLAGS = -O2 -pipe -fPIC
+ # Put -O2 here to _ensure_ all Makefiles pick it up.
+ XCFLAGS= -O2 -pipe
+ MT_CFLAGS=-DAFS_PTHREAD_ENV -pthread -D_REENTRANT ${XCFLAGS}
+ XLDFLAGS=
+ SHLIB_LDFLAGS = -shared -Xlinker -x
+ SHLIB_SUFFIX=so
+ SHLIB_CFLAGS=
+ #
+ # libraries
+ MTLIBS=-pthread
+ TXLIBS= /usr/lib/libncurses.so
+ XLIBS=@LIB_AFSDB@ -lcompat
+ 
+ #
+ # programs
+ AR=ar
+ AS=as
+ CP=cp
+ INSTALL=${TOP_SRCDIR}/pinstall/pinstall
+ LD=ld   
+ MT_CC=cc
+ MV=mv
+ RANLIB=ranlib
+ RM=rm
+ #
+ # Other OS specific requirements
+ #
+ YACC = bison -y
+ LEX = flex -l
Index: openafs/src/config/Makefile.i386_linux22.in
diff -c openafs/src/config/Makefile.i386_linux22.in:1.7 openafs/src/config/Makefile.i386_linux22.in:1.7.2.2
*** openafs/src/config/Makefile.i386_linux22.in:1.7	Fri Sep  7 19:34:53 2001
--- openafs/src/config/Makefile.i386_linux22.in	Tue Sep 10 01:41:58 2002
***************
*** 25,33 ****
  XCFLAGS= -O2
  MT_CFLAGS=-DAFS_PTHREAD_ENV -pthread -D_REENTRANT ${XCFLAGS}
  XLDFLAGS=
! SHARE_LDFLAGS = -shared -Xlinker -x
  SHLIB_SUFFIX=so
  SHLIB_CFLAGS=
  #
  # libraries
  MTLIBS=-lpthread
--- 25,34 ----
  XCFLAGS= -O2
  MT_CFLAGS=-DAFS_PTHREAD_ENV -pthread -D_REENTRANT ${XCFLAGS}
  XLDFLAGS=
! SHLIB_LDFLAGS = -shared -Xlinker -x
  SHLIB_SUFFIX=so
  SHLIB_CFLAGS=
+ SHLIB_LINKER=${MT_CC} -shared
  #
  # libraries
  MTLIBS=-lpthread
Index: openafs/src/config/Makefile.i386_linux24.in
diff -c openafs/src/config/Makefile.i386_linux24.in:1.5 openafs/src/config/Makefile.i386_linux24.in:1.5.2.2
*** openafs/src/config/Makefile.i386_linux24.in:1.5	Fri Sep  7 19:34:53 2001
--- openafs/src/config/Makefile.i386_linux24.in	Tue Sep 10 01:41:58 2002
***************
*** 17,25 ****
  XCFLAGS= -O2
  MT_CFLAGS=-DAFS_PTHREAD_ENV -pthread -D_REENTRANT ${XCFLAGS}
  XLDFLAGS=
! SHARE_LDFLAGS = -shared -Xlinker -x
  SHLIB_SUFFIX=so
  SHLIB_CFLAGS=
  #
  # libraries
  MTLIBS=-lpthread
--- 17,26 ----
  XCFLAGS= -O2
  MT_CFLAGS=-DAFS_PTHREAD_ENV -pthread -D_REENTRANT ${XCFLAGS}
  XLDFLAGS=
! SHLIB_LDFLAGS = -shared -Xlinker -x
  SHLIB_SUFFIX=so
  SHLIB_CFLAGS=
+ SHLIB_LINKER=${MT_CC} -shared
  #
  # libraries
  MTLIBS=-lpthread
Index: openafs/src/config/Makefile.i386_obsd29.in
diff -c openafs/src/config/Makefile.i386_obsd29.in:1.2.2.1 openafs/src/config/Makefile.i386_obsd29.in:1.2.2.2
*** openafs/src/config/Makefile.i386_obsd29.in:1.2.2.1	Wed Sep 19 18:46:46 2001
--- openafs/src/config/Makefile.i386_obsd29.in	Tue Sep 10 01:03:38 2002
***************
*** 12,18 ****
  XCFLAGS= -O2
  MT_CFLAGS=-DAFS_PTHREAD_ENV -pthread -D_REENTRANT ${XCFLAGS}
  XLDFLAGS=
! SHARE_LDFLAGS = -shared -Xlinker -x
  SHLIB_SUFFIX=so
  SHLIB_CFLAGS= -fpic
  #
--- 12,18 ----
  XCFLAGS= -O2
  MT_CFLAGS=-DAFS_PTHREAD_ENV -pthread -D_REENTRANT ${XCFLAGS}
  XLDFLAGS=
! SHLIB_LDFLAGS = -shared -Xlinker -x
  SHLIB_SUFFIX=so
  SHLIB_CFLAGS= -fpic
  #
Index: openafs/src/config/Makefile.ia64_linux24.in
diff -c openafs/src/config/Makefile.ia64_linux24.in:1.1.2.2 openafs/src/config/Makefile.ia64_linux24.in:1.1.2.4
*** openafs/src/config/Makefile.ia64_linux24.in:1.1.2.2	Thu May  2 11:59:44 2002
--- openafs/src/config/Makefile.ia64_linux24.in	Tue Sep 10 01:41:58 2002
***************
*** 17,25 ****
  XCFLAGS= -O2 -G0
  MT_CFLAGS=-DAFS_PTHREAD_ENV -pthread -D_REENTRANT ${XCFLAGS}
  XLDFLAGS=
! SHARE_LDFLAGS = -shared -Xlinker -x
  SHLIB_SUFFIX=so
  SHLIB_CFLAGS=
  #
  # libraries
  MTLIBS=-lpthread
--- 17,26 ----
  XCFLAGS= -O2 -G0
  MT_CFLAGS=-DAFS_PTHREAD_ENV -pthread -D_REENTRANT ${XCFLAGS}
  XLDFLAGS=
! SHLIB_LDFLAGS = -shared -Xlinker -x
  SHLIB_SUFFIX=so
  SHLIB_CFLAGS=
+ SHLIB_LINKER=${MT_CC} -shared
  #
  # libraries
  MTLIBS=-lpthread
Index: openafs/src/config/Makefile.parisc_linux24.in
diff -c openafs/src/config/Makefile.parisc_linux24.in:1.1.2.1 openafs/src/config/Makefile.parisc_linux24.in:1.1.2.2
*** openafs/src/config/Makefile.parisc_linux24.in:1.1.2.1	Sat Oct 13 00:36:14 2001
--- openafs/src/config/Makefile.parisc_linux24.in	Tue Sep 10 01:03:38 2002
***************
*** 17,23 ****
  XCFLAGS= -O2
  MT_CFLAGS=-DAFS_PTHREAD_ENV -pthread -D_REENTRANT ${XCFLAGS}
  XLDFLAGS=
! SHARE_LDFLAGS = -shared -Xlinker -x
  SHLIB_SUFFIX=so
  SHLIB_CFLAGS=
  #
--- 17,23 ----
  XCFLAGS= -O2
  MT_CFLAGS=-DAFS_PTHREAD_ENV -pthread -D_REENTRANT ${XCFLAGS}
  XLDFLAGS=
! SHLIB_LDFLAGS = -shared -Xlinker -x
  SHLIB_SUFFIX=so
  SHLIB_CFLAGS=
  #
Index: openafs/src/config/Makefile.ppc_darwin_12.in
diff -c openafs/src/config/Makefile.ppc_darwin_12.in:1.4 openafs/src/config/Makefile.ppc_darwin_12.in:1.4.2.1
*** openafs/src/config/Makefile.ppc_darwin_12.in:1.4	Fri Sep  7 19:34:53 2001
--- openafs/src/config/Makefile.ppc_darwin_12.in	Tue Sep 10 01:03:38 2002
***************
*** 10,16 ****
  #MT_CC=cc
  KROOT=
  KINCLUDES=-I$(KROOT)/System/Library/Frameworks/Kernel.framework/Headers
- #SHARE_LDFLAGS =
  LWP_OPTMZ=-g
  OPTMZ=-g
  DBG=-g
--- 10,15 ----
Index: openafs/src/config/Makefile.ppc_darwin_13.in
diff -c openafs/src/config/Makefile.ppc_darwin_13.in:1.4.2.2 openafs/src/config/Makefile.ppc_darwin_13.in:1.4.2.3
*** openafs/src/config/Makefile.ppc_darwin_13.in:1.4.2.2	Sat Nov 10 18:22:55 2001
--- openafs/src/config/Makefile.ppc_darwin_13.in	Tue Sep 10 01:03:38 2002
***************
*** 10,16 ****
  #MT_CC=cc
  KROOT=
  KINCLUDES=-I$(KROOT)/System/Library/Frameworks/Kernel.framework/Headers
- #SHARE_LDFLAGS =
  LWP_OPTMZ=-O2
  OPTMZ=-O2
  DBG=-g
--- 10,15 ----
Index: openafs/src/config/Makefile.ppc_darwin_14.in
diff -c openafs/src/config/Makefile.ppc_darwin_14.in:1.1.2.1 openafs/src/config/Makefile.ppc_darwin_14.in:1.1.2.2
*** openafs/src/config/Makefile.ppc_darwin_14.in:1.1.2.1	Sat Nov 10 18:22:55 2001
--- openafs/src/config/Makefile.ppc_darwin_14.in	Tue Sep 10 01:03:38 2002
***************
*** 10,16 ****
  #MT_CC=cc
  KROOT=
  KINCLUDES=-I$(KROOT)/System/Library/Frameworks/Kernel.framework/Headers
- #SHARE_LDFLAGS =
  LWP_OPTMZ=-O2
  OPTMZ=-O2
  DBG=-g
--- 10,15 ----
Index: openafs/src/config/Makefile.ppc_darwin_60.in
diff -c /dev/null openafs/src/config/Makefile.ppc_darwin_60.in:1.1.2.2
*** /dev/null	Thu Sep 26 01:24:46 2002
--- openafs/src/config/Makefile.ppc_darwin_60.in	Tue Sep 10 01:03:38 2002
***************
*** 0 ****
--- 1,42 ----
+ # Keep macros within each section in sorted order for clean diff displays.
+ #
+ # AFS_OSTYPE used to indicate suffixes and os specific subdirectories.
+ AFS_OSTYPE = DARWIN
+ #
+ #
+ # compilation and link editor flags
+ XCFLAGS=-no-cpp-precomp
+ #MT_CFLAGS=-D_REENTRANT -DAFS_PTHREAD_ENV ${XCFLAGS}
+ #MT_CC=cc
+ KROOT=
+ KINCLUDES=-I$(KROOT)/System/Library/Frameworks/Kernel.framework/Headers
+ LWP_OPTMZ=-O2
+ OPTMZ=-O2
+ DBG=-g
+ REGEX_OBJ=regex.o
+ 
+ 
+ #
+ # libraries
+ XLIBS=@LIB_AFSDB@
+ TXLIBS=-lncurses
+ #MTLIBS=
+ #XLIBELFA=
+ #XLIBKVM=
+ #
+ SHLIB_SUFFIX=
+ SHLIB_CFLAGS=
+ #
+ # programs
+ AR=ar
+ AS=as
+ CC=cc
+ CP=cp
+ INSTALL=${TOP_SRCDIR}/pinstall/pinstall
+ LEX=lex -l
+ LD= ld
+ LORDER = lorder
+ MV=mv
+ RANLIB=ranlib
+ RM=rm
+ STRIP= strip
Index: openafs/src/config/Makefile.ppc_linux22.in
diff -c openafs/src/config/Makefile.ppc_linux22.in:1.3.2.1 openafs/src/config/Makefile.ppc_linux22.in:1.3.2.3
*** openafs/src/config/Makefile.ppc_linux22.in:1.3.2.1	Wed Sep 19 18:29:18 2001
--- openafs/src/config/Makefile.ppc_linux22.in	Tue Sep 10 01:41:58 2002
***************
*** 17,25 ****
  XCFLAGS= -O2
  MT_CFLAGS=-DAFS_PTHREAD_ENV -pthread -D_REENTRANT ${XCFLAGS}
  XLDFLAGS=
! SHARE_LDFLAGS = -shared -Xlinker -x
  SHLIB_SUFFIX=so
  SHLIB_CFLAGS=
  #
  # libraries
  MTLIBS=-lpthread
--- 17,26 ----
  XCFLAGS= -O2
  MT_CFLAGS=-DAFS_PTHREAD_ENV -pthread -D_REENTRANT ${XCFLAGS}
  XLDFLAGS=
! SHLIB_LDFLAGS = -shared -Xlinker -x
  SHLIB_SUFFIX=so
  SHLIB_CFLAGS=
+ SHLIB_LINKER=${MT_CC} -shared
  #
  # libraries
  MTLIBS=-lpthread
Index: openafs/src/config/Makefile.ppc_linux24.in
diff -c openafs/src/config/Makefile.ppc_linux24.in:1.5 openafs/src/config/Makefile.ppc_linux24.in:1.5.2.2
*** openafs/src/config/Makefile.ppc_linux24.in:1.5	Fri Sep  7 19:34:53 2001
--- openafs/src/config/Makefile.ppc_linux24.in	Tue Sep 10 01:41:58 2002
***************
*** 17,25 ****
  XCFLAGS= -O2
  MT_CFLAGS=-DAFS_PTHREAD_ENV -pthread -D_REENTRANT ${XCFLAGS}
  XLDFLAGS=
! SHARE_LDFLAGS = -shared -Xlinker -x
  SHLIB_SUFFIX=so
  SHLIB_CFLAGS=
  #
  # libraries
  MTLIBS=-lpthread
--- 17,26 ----
  XCFLAGS= -O2
  MT_CFLAGS=-DAFS_PTHREAD_ENV -pthread -D_REENTRANT ${XCFLAGS}
  XLDFLAGS=
! SHLIB_LDFLAGS = -shared -Xlinker -x
  SHLIB_SUFFIX=so
  SHLIB_CFLAGS=
+ SHLIB_LINKER=${MT_CC} -shared
  #
  # libraries
  MTLIBS=-lpthread
Index: openafs/src/config/Makefile.rs_aix42.in
diff -c openafs/src/config/Makefile.rs_aix42.in:1.4.2.1 openafs/src/config/Makefile.rs_aix42.in:1.4.2.2
*** openafs/src/config/Makefile.rs_aix42.in:1.4.2.1	Sat Oct 13 00:21:18 2001
--- openafs/src/config/Makefile.rs_aix42.in	Wed Sep 11 17:33:57 2002
***************
*** 18,23 ****
--- 18,24 ----
  MT_CFLAGS=-DAFS_PTHREAD_ENV ${XCFLAGS}
  SHLIB_SUFFIX=o
  SHLIB_CFLAGS=
+ SHLIB_LINKER=${MT_CC} -bM:SRE -berok
  #
  # libraries
  TXLIBS=-lcurses
Index: openafs/src/config/Makefile.s390_linux22.in
diff -c openafs/src/config/Makefile.s390_linux22.in:1.5 openafs/src/config/Makefile.s390_linux22.in:1.5.2.2
*** openafs/src/config/Makefile.s390_linux22.in:1.5	Fri Sep  7 19:34:53 2001
--- openafs/src/config/Makefile.s390_linux22.in	Tue Sep 10 01:41:58 2002
***************
*** 22,30 ****
  XCFLAGS= -O -g
  MT_CFLAGS=-DAFS_PTHREAD_ENV -pthread -D_REENTRANT ${XCFLAGS}
  XLDFLAGS=
! SHARE_LDFLAGS = -shared -Xlinker -x
  SHLIB_SUFFIX=so
  SHLIB_CFLAGS=
  #
  # libraries
  MTLIBS=-lpthread
--- 22,31 ----
  XCFLAGS= -O -g
  MT_CFLAGS=-DAFS_PTHREAD_ENV -pthread -D_REENTRANT ${XCFLAGS}
  XLDFLAGS=
! SHLIB_LDFLAGS = -shared -Xlinker -x
  SHLIB_SUFFIX=so
  SHLIB_CFLAGS=
+ SHLIB_LINKER=${MT_CC} -shared
  #
  # libraries
  MTLIBS=-lpthread
Index: openafs/src/config/Makefile.s390_linux24.in
diff -c openafs/src/config/Makefile.s390_linux24.in:1.5 openafs/src/config/Makefile.s390_linux24.in:1.5.2.2
*** openafs/src/config/Makefile.s390_linux24.in:1.5	Fri Sep  7 19:34:53 2001
--- openafs/src/config/Makefile.s390_linux24.in	Tue Sep 10 01:41:58 2002
***************
*** 22,30 ****
  XCFLAGS= -O -g
  MT_CFLAGS=-DAFS_PTHREAD_ENV -pthread -D_REENTRANT ${XCFLAGS}
  XLDFLAGS=
! SHARE_LDFLAGS = -shared -Xlinker -x
  SHLIB_SUFFIX=so
  SHLIB_CFLAGS=
  #
  # libraries
  MTLIBS=-lpthread
--- 22,31 ----
  XCFLAGS= -O -g
  MT_CFLAGS=-DAFS_PTHREAD_ENV -pthread -D_REENTRANT ${XCFLAGS}
  XLDFLAGS=
! SHLIB_LDFLAGS = -shared -Xlinker -x
  SHLIB_SUFFIX=so
  SHLIB_CFLAGS=
+ SHLIB_LINKER=${MT_CC} -shared
  #
  # libraries
  MTLIBS=-lpthread
Index: openafs/src/config/Makefile.sgi_62.in
diff -c openafs/src/config/Makefile.sgi_62.in:1.4 openafs/src/config/Makefile.sgi_62.in:1.4.2.1
*** openafs/src/config/Makefile.sgi_62.in:1.4	Fri Sep  7 19:34:53 2001
--- openafs/src/config/Makefile.sgi_62.in	Wed Sep 11 17:33:57 2002
***************
*** 27,32 ****
--- 27,33 ----
  XLIBS=@LIB_AFSDB@
  MTLIBS=-lpthread
  SHLIB_SUFFIX=so
+ SHLIB_LINKER=${CC} -shared
  #
  # programs
  AR=ar
Index: openafs/src/config/Makefile.sgi_63.in
diff -c openafs/src/config/Makefile.sgi_63.in:1.4 openafs/src/config/Makefile.sgi_63.in:1.4.2.1
*** openafs/src/config/Makefile.sgi_63.in:1.4	Fri Sep  7 19:34:53 2001
--- openafs/src/config/Makefile.sgi_63.in	Wed Sep 11 17:33:57 2002
***************
*** 27,32 ****
--- 27,33 ----
  XLIBS=@LIB_AFSDB@
  MTLIBS=-lpthread
  SHLIB_SUFFIX=so
+ SHLIB_LINKER=${CC} -shared
  #
  # programs
  AR=ar
Index: openafs/src/config/Makefile.sgi_64.in
diff -c openafs/src/config/Makefile.sgi_64.in:1.4 openafs/src/config/Makefile.sgi_64.in:1.4.2.1
*** openafs/src/config/Makefile.sgi_64.in:1.4	Fri Sep  7 19:34:53 2001
--- openafs/src/config/Makefile.sgi_64.in	Wed Sep 11 17:33:57 2002
***************
*** 28,33 ****
--- 28,34 ----
  MTLIBS=-lpthread
  SHLIB_SUFFIX=so
  SHLIB_CFLAGS=
+ SHLIB_LINKER=${CC} -shared
  #
  # programs
  AR=ar
Index: openafs/src/config/Makefile.sgi_65.in
diff -c openafs/src/config/Makefile.sgi_65.in:1.4 openafs/src/config/Makefile.sgi_65.in:1.4.2.1
*** openafs/src/config/Makefile.sgi_65.in:1.4	Fri Sep  7 19:34:53 2001
--- openafs/src/config/Makefile.sgi_65.in	Wed Sep 11 17:33:57 2002
***************
*** 28,33 ****
--- 28,34 ----
  MTLIBS=-lpthread
  SHLIB_SUFFIX=so
  SHLIB_CFLAGS=
+ SHLIB_LINKER=${CC} -shared
  #
  # programs
  AR=ar
Index: openafs/src/config/Makefile.sparc64_linux22.in
diff -c openafs/src/config/Makefile.sparc64_linux22.in:1.5 openafs/src/config/Makefile.sparc64_linux22.in:1.5.2.2
*** openafs/src/config/Makefile.sparc64_linux22.in:1.5	Fri Sep  7 19:34:53 2001
--- openafs/src/config/Makefile.sparc64_linux22.in	Tue Sep 10 01:41:58 2002
***************
*** 21,29 ****
  XCFLAGS= -O2
  MT_CFLAGS=-DAFS_PTHREAD_ENV -pthread -D_REENTRANT ${XCFLAGS}
  XLDFLAGS=
! SHARE_LDFLAGS = -shared -Xlinker -x
  SHLIB_SUFFIX=so
  SHLIB_CFLAGS=
  #
  # libraries
  MTLIBS=-lpthread
--- 21,30 ----
  XCFLAGS= -O2
  MT_CFLAGS=-DAFS_PTHREAD_ENV -pthread -D_REENTRANT ${XCFLAGS}
  XLDFLAGS=
! SHLIB_LDFLAGS = -shared -Xlinker -x
  SHLIB_SUFFIX=so
  SHLIB_CFLAGS=
+ SHLIB_LINKER=${MT_CC} -shared
  #
  # libraries
  MTLIBS=-lpthread
Index: openafs/src/config/Makefile.sparc64_linux24.in
diff -c openafs/src/config/Makefile.sparc64_linux24.in:1.5 openafs/src/config/Makefile.sparc64_linux24.in:1.5.2.2
*** openafs/src/config/Makefile.sparc64_linux24.in:1.5	Fri Sep  7 19:34:53 2001
--- openafs/src/config/Makefile.sparc64_linux24.in	Tue Sep 10 01:41:58 2002
***************
*** 21,29 ****
  XCFLAGS= -O2
  MT_CFLAGS=-DAFS_PTHREAD_ENV -pthread -D_REENTRANT ${XCFLAGS}
  XLDFLAGS=
! SHARE_LDFLAGS = -shared -Xlinker -x
  SHLIB_SUFFIX=so
  SHLIB_CFLAGS=
  #
  # libraries
  MTLIBS=-lpthread
--- 21,30 ----
  XCFLAGS= -O2
  MT_CFLAGS=-DAFS_PTHREAD_ENV -pthread -D_REENTRANT ${XCFLAGS}
  XLDFLAGS=
! SHLIB_LDFLAGS = -shared -Xlinker -x
  SHLIB_SUFFIX=so
  SHLIB_CFLAGS=
+ SHLIB_LINKER=${MT_CC} -shared
  #
  # libraries
  MTLIBS=-lpthread
Index: openafs/src/config/Makefile.sparc_linux22.in
diff -c openafs/src/config/Makefile.sparc_linux22.in:1.5 openafs/src/config/Makefile.sparc_linux22.in:1.5.2.2
*** openafs/src/config/Makefile.sparc_linux22.in:1.5	Fri Sep  7 19:34:53 2001
--- openafs/src/config/Makefile.sparc_linux22.in	Tue Sep 10 01:41:58 2002
***************
*** 21,29 ****
  XCFLAGS= -O2
  MT_CFLAGS=-DAFS_PTHREAD_ENV -pthread -D_REENTRANT ${XCFLAGS}
  XLDFLAGS=
! SHARE_LDFLAGS = -shared -Xlinker -x
  SHLIB_SUFFIX=so
  SHLIB_CFLAGS=
  #
  # libraries
  MTLIBS=-lpthread
--- 21,30 ----
  XCFLAGS= -O2
  MT_CFLAGS=-DAFS_PTHREAD_ENV -pthread -D_REENTRANT ${XCFLAGS}
  XLDFLAGS=
! SHLIB_LDFLAGS = -shared -Xlinker -x
  SHLIB_SUFFIX=so
  SHLIB_CFLAGS=
+ SHLIB_LINKER=${MT_CC} -shared
  #
  # libraries
  MTLIBS=-lpthread
Index: openafs/src/config/Makefile.sparc_linux24.in
diff -c openafs/src/config/Makefile.sparc_linux24.in:1.1.2.1 openafs/src/config/Makefile.sparc_linux24.in:1.1.2.3
*** openafs/src/config/Makefile.sparc_linux24.in:1.1.2.1	Sun Jan 20 03:49:33 2002
--- openafs/src/config/Makefile.sparc_linux24.in	Tue Sep 10 01:41:58 2002
***************
*** 21,29 ****
  XCFLAGS= -O2
  MT_CFLAGS=-DAFS_PTHREAD_ENV -pthread -D_REENTRANT ${XCFLAGS}
  XLDFLAGS=
! SHARE_LDFLAGS = -shared -Xlinker -x
  SHLIB_SUFFIX=so
  SHLIB_CFLAGS=
  #
  # libraries
  MTLIBS=-lpthread
--- 21,30 ----
  XCFLAGS= -O2
  MT_CFLAGS=-DAFS_PTHREAD_ENV -pthread -D_REENTRANT ${XCFLAGS}
  XLDFLAGS=
! SHLIB_LDFLAGS = -shared -Xlinker -x
  SHLIB_SUFFIX=so
  SHLIB_CFLAGS=
+ SHLIB_LINKER=${MT_CC} -shared
  #
  # libraries
  MTLIBS=-lpthread
Index: openafs/src/config/Makefile.sun4_413.in
diff -c /dev/null openafs/src/config/Makefile.sun4_413.in:1.1.2.1
*** /dev/null	Thu Sep 26 01:24:46 2002
--- openafs/src/config/Makefile.sun4_413.in	Wed Aug 21 15:24:57 2002
***************
*** 0 ****
--- 1,40 ----
+ # 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
+ 
+ # Keep macros within each section in sorted order for clean diff displays.
+ #
+ # AFS_OSTYPE used to indicate suffixes and os specific subdirectories.
+ AFS_OSTYPE = SUNOS
+ 
+ # compilation and link editor flags
+ XCFLAGS=
+ LWP_OPTMZ=-O
+ OPTMZ=-O
+ DBG=-g
+ #
+ # libraries
+ XLIBS=@LIB_AFSDB@
+ TXLIBS=-lcurses -ltermcap
+ XLIBELFA=-lelf
+ XLIBKVM=-lkvm
+ SHLIB_SUFFIX=so
+ SHLIB_CFLAGS=-PIC
+ #
+ # programs
+ AR=ar
+ AS=as
+ CC=gcc
+ MT_CC=gcc
+ CP=/bin/cp
+ LEX=lex
+ LD= ld
+ LORDER = lorder
+ MV=mv
+ RANLIB=ranlib
+ RM=rm
+ STRIP= strip
+ INSTALL=${TOP_SRCDIR}/pinstall/pinstall
Index: openafs/src/config/Makefile.sun4x_55.in
diff -c openafs/src/config/Makefile.sun4x_55.in:1.4 openafs/src/config/Makefile.sun4x_55.in:1.4.2.2
*** openafs/src/config/Makefile.sun4x_55.in:1.4	Fri Sep  7 19:34:53 2001
--- openafs/src/config/Makefile.sun4x_55.in	Tue Sep 10 01:41:58 2002
***************
*** 16,21 ****
--- 16,25 ----
  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: openafs/src/config/Makefile.sun4x_56.in
diff -c openafs/src/config/Makefile.sun4x_56.in:1.4.2.1 openafs/src/config/Makefile.sun4x_56.in:1.4.2.3
*** openafs/src/config/Makefile.sun4x_56.in:1.4.2.1	Sat Oct 13 00:21:18 2001
--- openafs/src/config/Makefile.sun4x_56.in	Tue Sep 10 01:41:58 2002
***************
*** 15,24 ****
  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
  #
  # libraries
  XLIBS=@LIB_AFSDB@ -lsocket -lnsl -lintl -ldl
--- 15,27 ----
  MT_CFLAGS=-mt -DAFS_PTHREAD_ENV ${XCFLAGS}
  PAM_CFLAGS = -KPIC
  PAMLIBS= -lc -lpam -lsocket -lnsl -lm
! 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: openafs/src/config/Makefile.sun4x_57.in
diff -c openafs/src/config/Makefile.sun4x_57.in:1.4.2.1 openafs/src/config/Makefile.sun4x_57.in:1.4.2.3
*** openafs/src/config/Makefile.sun4x_57.in:1.4.2.1	Sat Oct 13 00:21:18 2001
--- openafs/src/config/Makefile.sun4x_57.in	Tue Sep 10 01:41:58 2002
***************
*** 15,27 ****
  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
  
  ## Compilation flags for 64 bit Solaris
  XCFLAGS64 = ${XCFLAGS} -xarch=v9
  
  #
  # libraries
--- 15,30 ----
  MT_CFLAGS=-mt -DAFS_PTHREAD_ENV ${XCFLAGS}
  PAM_CFLAGS = -KPIC
  PAMLIBS= -lc -lpam -lsocket -lnsl -lm
! SHLIB_LDFLAGS = -G -Bsymbolic
  LWP_OPTMZ=-g
  OPTMZ=-O
  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
Index: openafs/src/config/Makefile.sun4x_58.in
diff -c openafs/src/config/Makefile.sun4x_58.in:1.4.2.1 openafs/src/config/Makefile.sun4x_58.in:1.4.2.3
*** openafs/src/config/Makefile.sun4x_58.in:1.4.2.1	Sat Oct 13 00:21:18 2001
--- openafs/src/config/Makefile.sun4x_58.in	Tue Sep 10 01:41:58 2002
***************
*** 8,14 ****
  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
--- 8,14 ----
  MT_CFLAGS=-mt -DAFS_PTHREAD_ENV ${XCFLAGS}
  PAM_CFLAGS = -KPIC
  PAMLIBS= -lc -lpam -lsocket -lnsl -lm
! SHLIB_LDFLAGS = -G -Bsymbolic
  LWP_OPTMZ=-g
  OPTMZ=-O
  DBG=-g
***************
*** 16,21 ****
--- 16,23 ----
  ## 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: openafs/src/config/Makefile.sun4x_59.in
diff -c openafs/src/config/Makefile.sun4x_59.in:1.2.2.1 openafs/src/config/Makefile.sun4x_59.in:1.2.2.3
*** openafs/src/config/Makefile.sun4x_59.in:1.2.2.1	Sat Oct 13 00:27:21 2001
--- openafs/src/config/Makefile.sun4x_59.in	Thu Sep 26 01:18:26 2002
***************
*** 8,14 ****
  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
--- 8,13 ----
***************
*** 24,31 ****
--- 23,32 ----
  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: openafs/src/config/Makefile.sunx86_54.in
diff -c openafs/src/config/Makefile.sunx86_54.in:1.4 openafs/src/config/Makefile.sunx86_54.in:1.4.2.2
*** openafs/src/config/Makefile.sunx86_54.in:1.4	Fri Sep  7 19:34:53 2001
--- openafs/src/config/Makefile.sunx86_54.in	Tue Sep 10 01:41:58 2002
***************
*** 9,14 ****
--- 9,17 ----
  # 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: openafs/src/config/Makefile.sunx86_57.in
diff -c openafs/src/config/Makefile.sunx86_57.in:1.1.4.1 openafs/src/config/Makefile.sunx86_57.in:1.1.4.3
*** openafs/src/config/Makefile.sunx86_57.in:1.1.4.1	Wed Jul 10 15:57:43 2002
--- openafs/src/config/Makefile.sunx86_57.in	Tue Sep 10 01:41:58 2002
***************
*** 8,14 ****
  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
--- 8,14 ----
  MT_CFLAGS=-mt -DAFS_PTHREAD_ENV ${XCFLAGS}
  PAM_CFLAGS = -KPIC
  PAMLIBS= -lc -lpam -lsocket -lnsl -lm
! SHLIB_LDFLAGS = -G -Bsymbolic
  LWP_OPTMZ=-g
  OPTMZ=-O
  DBG=-g
***************
*** 16,21 ****
--- 16,23 ----
  ## 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: openafs/src/config/afs_sysnames.h
diff -c openafs/src/config/afs_sysnames.h:1.14.2.3 openafs/src/config/afs_sysnames.h:1.14.2.5
*** openafs/src/config/afs_sysnames.h:1.14.2.3	Sun Jan 20 03:49:33 2002
--- openafs/src/config/afs_sysnames.h	Tue Sep 10 18:33:45 2002
***************
*** 50,55 ****
--- 50,56 ----
  #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
***************
*** 141,146 ****
--- 142,151 ----
  #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: openafs/src/config/param.i386_fbsd_42.h
diff -c openafs/src/config/param.i386_fbsd_42.h:1.3 openafs/src/config/param.i386_fbsd_42.h:1.3.4.1
*** openafs/src/config/param.i386_fbsd_42.h:1.3	Thu Jul  5 11:20:18 2001
--- openafs/src/config/param.i386_fbsd_42.h	Tue Sep 10 18:33:46 2002
***************
*** 16,22 ****
  #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
  
--- 16,21 ----
***************
*** 54,59 ****
--- 53,59 ----
  #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,80 ****
  #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	v_count		v_usecount
  #define v_vfsp		v_mount
  #define vfs_bsize	mnt_stat.f_bsize
--- 73,80 ----
  #define	AFS_UIOUSER	UIO_USERSPACE
  #define	AFS_CLBYTES	CLBYTES
  #define	osi_GetTime(x)	microtime(x)
! #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: openafs/src/config/param.i386_fbsd_42_usr.h
diff -c openafs/src/config/param.i386_fbsd_42_usr.h:1.3 openafs/src/config/param.i386_fbsd_42_usr.h:1.3.4.1
*** openafs/src/config/param.i386_fbsd_42_usr.h:1.3	Thu Jul  5 11:20:18 2001
--- openafs/src/config/param.i386_fbsd_42_usr.h	Tue Sep 10 18:33:46 2002
***************
*** 9,15 ****
  #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
  
--- 9,14 ----
Index: openafs/src/config/param.i386_fbsd_43.h
diff -c /dev/null openafs/src/config/param.i386_fbsd_43.h:1.2.6.1
*** /dev/null	Thu Sep 26 01:24:46 2002
--- openafs/src/config/param.i386_fbsd_43.h	Tue Sep 17 18:32:56 2002
***************
*** 0 ****
--- 1,117 ----
+ #ifndef	AFS_PARAM_H
+ #define	AFS_PARAM_H
+ 
+ #include <sys/param.h>
+ 
+ #define AFS_XBSD_ENV 1             /* {Free,Open,Net}BSD */
+ #define AFS_X86_XBSD_ENV 1
+ 
+ #define AFS_NAMEI_ENV     1   /* User space interface to file system */
+ #define AFS_64BIT_IOPS_ENV 1  /* Needed for NAMEI */
+ #define AFS_FBSD_ENV 1
+ #define AFS_FBSD40_ENV 1
+ #define AFS_FBSD42_ENV 1
+ #define AFS_FBSD43_ENV 1
+ #define AFS_X86_FBSD_ENV 1
+ #define AFS_X86_FBSD40_ENV 1
+ #define AFS_X86_FBSD42_ENV 1
+ #define AFS_X86_FBSD43_ENV 1
+ #define AFS_X86_ENV 1
+ #define AFS_NONFSTRANS 1
+ #define O_SYNC O_FSYNC
+ #define FTRUNC O_TRUNC
+ 
+ #define IUPD 0x0010
+ #define IACC 0x0020
+ #define ICHG 0x0040
+ #define IMOD 0x0080
+ 
+ #define IN_LOCK(ip)     lockmgr(&ip->i_lock, LK_EXCLUSIVE, \
+                                 NULL, curproc)
+ #define IN_UNLOCK(ip)   lockmgr(&ip->i_lock, LK_RELEASE, \
+                                 NULL, curproc)
+ 
+ #include <afs/afs_sysnames.h>
+ 
+ #define AFS_VM_RDWR_ENV	1
+ #define AFS_VFS_ENV	1
+ #define AFS_VFSINCL_ENV 1
+ #define AFS_GREEDY43_ENV	1
+ #define AFS_ENV  	1
+ 
+ #define AFS_SYSCALL	210
+ #define AFS_MOUNT_AFS	"afs"
+ 
+ #ifndef MOUNT_UFS
+ #define MOUNT_UFS "ufs"
+ #endif
+ 
+ #ifndef	MOUNT_AFS
+ #define	MOUNT_AFS AFS_MOUNT_AFS
+ #endif
+ #define SYS_NAME	"i386_fbsd_43"
+ #define SYS_NAME_ID	SYS_NAME_ID_i386_fbsd_43
+ 
+ #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 */
+ 
+ #define AFSLITTLE_ENDIAN 1
+ 
+ /* Extra kernel definitions (from kdefs file) */
+ #ifdef _KERNEL
+ #define AFS_GLOBAL_SUNLOCK        1
+ #define	AFS_VFS34	1	/* What is VFS34??? */
+ #define	AFS_SHORTGID	1	/* are group id's short? */
+ #define	afsio_iov	uio_iov
+ #define	afsio_iovcnt	uio_iovcnt
+ #define	afsio_offset	uio_offset
+ #define	afsio_seg	uio_segflg
+ #define	afsio_resid	uio_resid
+ #define	AFS_UIOSYS	UIO_SYSSPACE
+ #define	AFS_UIOUSER	UIO_USERSPACE
+ #define	AFS_CLBYTES	CLBYTES
+ #define	osi_GetTime(x)	microtime(x)
+ #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
+ #define vfs_fsid	mnt_stat.f_fsid
+ #define va_nodeid	va_fileid
+ #define vfs_vnodecovered mnt_vnodecovered
+ #define direct		dirent
+ #define vnode_t		struct vnode
+ 
+ #ifndef MUTEX_DEFAULT
+ #define MUTEX_DEFAULT   0
+ #endif /* MUTEX_DEFAULT */
+ 
+ #ifndef SSYS
+ #define SSYS            0x00002
+ #endif /* SSYS */
+ 
+ #define p_rcred         p_ucred
+ 
+ #define	VN_RELE(vp)	vrele(((struct vnode *)(vp)))
+ #define	VN_HOLD(vp)	VREF(((struct vnode *)(vp)))
+ 
+ #if	!defined(ASSEMBLER) && !defined(__LANGUAGE_ASSEMBLY__)
+ enum vcexcl {NONEXCL, EXCL};
+ 
+ #ifdef KERNEL
+ #ifndef MIN
+ #define MIN(A,B) ((A) < (B) ? (A) : (B))
+ #endif
+ #ifndef MAX
+ #define MAX(A,B) ((A) > (B) ? (A) : (B))
+ #endif
+ #endif /* KERNEL */
+ 
+ #endif	/* ! ASSEMBLER & ! __LANGUAGE_ASSEMBLY__ */
+ #endif /* _KERNEL */
+ 
+ #endif	/* AFS_PARAM_H */
Index: openafs/src/config/param.i386_fbsd_43_usr.h
diff -c /dev/null openafs/src/config/param.i386_fbsd_43_usr.h:1.1.8.1
*** /dev/null	Thu Sep 26 01:24:46 2002
--- openafs/src/config/param.i386_fbsd_43_usr.h	Tue Sep 17 18:32:56 2002
***************
*** 0 ****
--- 1,60 ----
+ #ifndef AFS_PARAM_H
+ #define AFS_PARAM_H
+ 
+ 
+ #define UKERNEL			1	/* user space kernel */
+ #define AFS_ENV			1
+ #define AFS_VFSINCL_ENV         1
+ #define AFS_USR_FBSD40_ENV	1
+ #define AFS_USR_FBSD42_ENV	1
+ #define AFS_USR_FBSD43_ENV	1
+ #define AFS_USR_FBSD_ENV	1
+ #define AFS_NONFSTRANS 1
+ 
+ #define O_SYNC O_FSYNC
+ 
+ #define AFS_MOUNT_AFS "afs"	/* The name of the filesystem type. */
+ #define AFS_SYSCALL 210
+ #define AFS_NAMEI_ENV         1   /* User space interface to file system */
+ #define AFS_64BIT_IOPS_ENV    1   /* Needed for NAMEI */
+ #include <afs/afs_sysnames.h>
+ 
+ #define AFS_USERSPACE_IP_ADDR 1
+ #define RXK_LISTENER_ENV      1
+ #define AFS_GCPAGS	      0       /* if nonzero, garbage collect PAGs */
+ 
+ /* Machine / Operating system information */
+ #define SYS_NAME	"i386_fbsd_43"
+ #define SYS_NAME_ID	SYS_NAME_ID_i386_fbsd_43
+ #define AFSLITTLE_ENDIAN    1
+ #define AFS_HAVE_FFS        1       /* Use system's ffs. */
+ #define AFS_HAVE_STATVFS    0	/* System doesn't support statvfs */
+ #define AFS_VM_RDWR_ENV	    1	/* read/write implemented via VM */
+ 
+ #define	afsio_iov	uio_iov
+ #define	afsio_iovcnt	uio_iovcnt
+ #define	afsio_offset	uio_offset
+ #define	afsio_seg	uio_segflg
+ #define	afsio_fmode	uio_fmode
+ #define	afsio_resid	uio_resid
+ #define	AFS_UIOSYS	1
+ #define	AFS_UIOUSER	UIO_USERSPACE
+ #define	AFS_CLBYTES	MCLBYTES
+ #define	AFS_MINCHANGE	2
+ #define	VATTR_NULL	usr_vattr_null
+ 
+ #define AFS_DIRENT
+ #ifndef CMSERVERPREF
+ #define CMSERVERPREF
+ #endif
+ 
+ #include <limits.h>
+ #include <sys/param.h>
+ #include <sys/types.h>
+ #include <sys/mount.h>
+ #include <sys/fcntl.h>
+ #include <netinet/in.h>
+ #include <sys/uio.h>
+ #include <sys/socket.h>
+ 
+ #endif /* AFS_PARAM_H */
Index: openafs/src/config/param.i386_fbsd_44.h
diff -c /dev/null openafs/src/config/param.i386_fbsd_44.h:1.2.6.1
*** /dev/null	Thu Sep 26 01:24:46 2002
--- openafs/src/config/param.i386_fbsd_44.h	Tue Sep 17 18:32:56 2002
***************
*** 0 ****
--- 1,119 ----
+ #ifndef	AFS_PARAM_H
+ #define	AFS_PARAM_H
+ 
+ #include <sys/param.h>
+ 
+ #define AFS_XBSD_ENV 1             /* {Free,Open,Net}BSD */
+ #define AFS_X86_XBSD_ENV 1
+ 
+ #define AFS_NAMEI_ENV     1   /* User space interface to file system */
+ #define AFS_64BIT_IOPS_ENV 1  /* Needed for NAMEI */
+ #define AFS_FBSD_ENV 1
+ #define AFS_FBSD40_ENV 1
+ #define AFS_FBSD42_ENV 1
+ #define AFS_FBSD43_ENV 1
+ #define AFS_FBSD44_ENV 1
+ #define AFS_X86_FBSD_ENV 1
+ #define AFS_X86_FBSD40_ENV 1
+ #define AFS_X86_FBSD42_ENV 1
+ #define AFS_X86_FBSD43_ENV 1
+ #define AFS_X86_FBSD44_ENV 1
+ #define AFS_X86_ENV 1
+ #define AFS_NONFSTRANS 1
+ #define O_SYNC O_FSYNC
+ #define FTRUNC O_TRUNC
+ 
+ #define IUPD 0x0010
+ #define IACC 0x0020
+ #define ICHG 0x0040
+ #define IMOD 0x0080
+ 
+ #define IN_LOCK(ip)     lockmgr(&ip->i_lock, LK_EXCLUSIVE, \
+                                 NULL, curproc)
+ #define IN_UNLOCK(ip)   lockmgr(&ip->i_lock, LK_RELEASE, \
+                                 NULL, curproc)
+ 
+ #include <afs/afs_sysnames.h>
+ 
+ #define AFS_VM_RDWR_ENV	1
+ #define AFS_VFS_ENV	1
+ #define AFS_VFSINCL_ENV 1
+ #define AFS_GREEDY43_ENV	1
+ #define AFS_ENV  	1
+ 
+ #define AFS_SYSCALL	210
+ #define AFS_MOUNT_AFS	"afs"
+ 
+ #ifndef MOUNT_UFS
+ #define MOUNT_UFS "ufs"
+ #endif
+ 
+ #ifndef	MOUNT_AFS
+ #define	MOUNT_AFS AFS_MOUNT_AFS
+ #endif
+ #define SYS_NAME	"i386_fbsd_44"
+ #define SYS_NAME_ID	SYS_NAME_ID_i386_fbsd_44
+ 
+ #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 */
+ 
+ #define AFSLITTLE_ENDIAN 1
+ 
+ /* Extra kernel definitions (from kdefs file) */
+ #ifdef _KERNEL
+ #define AFS_GLOBAL_SUNLOCK        1
+ #define	AFS_VFS34	1	/* What is VFS34??? */
+ #define	AFS_SHORTGID	1	/* are group id's short? */
+ #define	afsio_iov	uio_iov
+ #define	afsio_iovcnt	uio_iovcnt
+ #define	afsio_offset	uio_offset
+ #define	afsio_seg	uio_segflg
+ #define	afsio_resid	uio_resid
+ #define	AFS_UIOSYS	UIO_SYSSPACE
+ #define	AFS_UIOUSER	UIO_USERSPACE
+ #define	AFS_CLBYTES	CLBYTES
+ #define	osi_GetTime(x)	microtime(x)
+ #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
+ #define vfs_fsid	mnt_stat.f_fsid
+ #define va_nodeid	va_fileid
+ #define vfs_vnodecovered mnt_vnodecovered
+ #define direct		dirent
+ #define vnode_t		struct vnode
+ 
+ #ifndef MUTEX_DEFAULT
+ #define MUTEX_DEFAULT   0
+ #endif /* MUTEX_DEFAULT */
+ 
+ #ifndef SSYS
+ #define SSYS            0x00002
+ #endif /* SSYS */
+ 
+ #define p_rcred         p_ucred
+ 
+ #define	VN_RELE(vp)	vrele(((struct vnode *)(vp)))
+ #define	VN_HOLD(vp)	VREF(((struct vnode *)(vp)))
+ 
+ #if	!defined(ASSEMBLER) && !defined(__LANGUAGE_ASSEMBLY__)
+ enum vcexcl {NONEXCL, EXCL};
+ 
+ #ifdef KERNEL
+ #ifndef MIN
+ #define MIN(A,B) ((A) < (B) ? (A) : (B))
+ #endif
+ #ifndef MAX
+ #define MAX(A,B) ((A) > (B) ? (A) : (B))
+ #endif
+ #endif /* KERNEL */
+ 
+ #endif	/* ! ASSEMBLER & ! __LANGUAGE_ASSEMBLY__ */
+ #endif /* _KERNEL */
+ 
+ #endif	/* AFS_PARAM_H */
Index: openafs/src/config/param.i386_fbsd_44_usr.h
diff -c /dev/null openafs/src/config/param.i386_fbsd_44_usr.h:1.1.8.1
*** /dev/null	Thu Sep 26 01:24:46 2002
--- openafs/src/config/param.i386_fbsd_44_usr.h	Tue Sep 17 18:32:56 2002
***************
*** 0 ****
--- 1,61 ----
+ #ifndef AFS_PARAM_H
+ #define AFS_PARAM_H
+ 
+ 
+ #define UKERNEL			1	/* user space kernel */
+ #define AFS_ENV			1
+ #define AFS_VFSINCL_ENV         1
+ #define AFS_USR_FBSD40_ENV	1
+ #define AFS_USR_FBSD42_ENV	1
+ #define AFS_USR_FBSD43_ENV	1
+ #define AFS_USR_FBSD44_ENV	1
+ #define AFS_USR_FBSD_ENV	1
+ #define AFS_NONFSTRANS 1
+ 
+ #define O_SYNC O_FSYNC
+ 
+ #define AFS_MOUNT_AFS "afs"	/* The name of the filesystem type. */
+ #define AFS_SYSCALL 210
+ #define AFS_NAMEI_ENV         1   /* User space interface to file system */
+ #define AFS_64BIT_IOPS_ENV    1   /* Needed for NAMEI */
+ #include <afs/afs_sysnames.h>
+ 
+ #define AFS_USERSPACE_IP_ADDR 1
+ #define RXK_LISTENER_ENV      1
+ #define AFS_GCPAGS	      0       /* if nonzero, garbage collect PAGs */
+ 
+ /* Machine / Operating system information */
+ #define SYS_NAME	"i386_fbsd_44"
+ #define SYS_NAME_ID	SYS_NAME_ID_i386_fbsd_44
+ #define AFSLITTLE_ENDIAN    1
+ #define AFS_HAVE_FFS        1       /* Use system's ffs. */
+ #define AFS_HAVE_STATVFS    0	/* System doesn't support statvfs */
+ #define AFS_VM_RDWR_ENV	    1	/* read/write implemented via VM */
+ 
+ #define	afsio_iov	uio_iov
+ #define	afsio_iovcnt	uio_iovcnt
+ #define	afsio_offset	uio_offset
+ #define	afsio_seg	uio_segflg
+ #define	afsio_fmode	uio_fmode
+ #define	afsio_resid	uio_resid
+ #define	AFS_UIOSYS	1
+ #define	AFS_UIOUSER	UIO_USERSPACE
+ #define	AFS_CLBYTES	MCLBYTES
+ #define	AFS_MINCHANGE	2
+ #define	VATTR_NULL	usr_vattr_null
+ 
+ #define AFS_DIRENT
+ #ifndef CMSERVERPREF
+ #define CMSERVERPREF
+ #endif
+ 
+ #include <limits.h>
+ #include <sys/param.h>
+ #include <sys/types.h>
+ #include <sys/mount.h>
+ #include <sys/fcntl.h>
+ #include <netinet/in.h>
+ #include <sys/uio.h>
+ #include <sys/socket.h>
+ 
+ #endif /* AFS_PARAM_H */
Index: openafs/src/config/param.i386_fbsd_45.h
diff -c /dev/null openafs/src/config/param.i386_fbsd_45.h:1.3.6.1
*** /dev/null	Thu Sep 26 01:24:46 2002
--- openafs/src/config/param.i386_fbsd_45.h	Tue Sep 17 18:32:56 2002
***************
*** 0 ****
--- 1,120 ----
+ #ifndef	AFS_PARAM_H
+ #define	AFS_PARAM_H
+ 
+ #include <sys/param.h>
+ 
+ #define AFS_XBSD_ENV 1             /* {Free,Open,Net}BSD */
+ #define AFS_X86_XBSD_ENV 1
+ 
+ #define AFS_NAMEI_ENV     1   /* User space interface to file system */
+ #define AFS_64BIT_IOPS_ENV 1  /* Needed for NAMEI */
+ #define AFS_FBSD_ENV 1
+ #define AFS_FBSD40_ENV 1
+ #define AFS_FBSD42_ENV 1
+ #define AFS_FBSD43_ENV 1
+ #define AFS_FBSD44_ENV 1
+ #define AFS_FBSD45_ENV 1
+ #define AFS_X86_FBSD_ENV 1
+ #define AFS_X86_FBSD40_ENV 1
+ #define AFS_X86_FBSD42_ENV 1
+ #define AFS_X86_FBSD43_ENV 1
+ #define AFS_X86_FBSD45_ENV 1
+ #define AFS_X86_ENV 1
+ #define AFS_NONFSTRANS 1
+ #define O_SYNC O_FSYNC
+ #define FTRUNC O_TRUNC
+ 
+ #define IUPD 0x0010
+ #define IACC 0x0020
+ #define ICHG 0x0040
+ #define IMOD 0x0080
+ 
+ #define IN_LOCK(ip)     lockmgr(&ip->i_lock, LK_EXCLUSIVE, \
+                                 NULL, curproc)
+ #define IN_UNLOCK(ip)   lockmgr(&ip->i_lock, LK_RELEASE, \
+                                 NULL, curproc)
+ 
+ #include <afs/afs_sysnames.h>
+ 
+ #define AFS_VM_RDWR_ENV	1
+ #define AFS_VFS_ENV	1
+ #define AFS_VFSINCL_ENV 1
+ #define AFS_GREEDY43_ENV	1
+ #define AFS_ENV  	1
+ 
+ #define AFS_SYSCALL	210
+ #define AFS_MOUNT_AFS	"afs"
+ 
+ #ifndef MOUNT_UFS
+ #define MOUNT_UFS "ufs"
+ #endif
+ 
+ #ifndef	MOUNT_AFS
+ #define	MOUNT_AFS AFS_MOUNT_AFS
+ #endif
+ #define SYS_NAME	"i386_fbsd_45"
+ #define SYS_NAME_ID	SYS_NAME_ID_i386_fbsd_45
+ 
+ #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 */
+ 
+ #define AFSLITTLE_ENDIAN 1
+ 
+ /* Extra kernel definitions (from kdefs file) */
+ #ifdef _KERNEL
+ #define AFS_GLOBAL_SUNLOCK        1
+ #define	AFS_VFS34	1	/* What is VFS34??? */
+ #define	AFS_SHORTGID	1	/* are group id's short? */
+ #define	afsio_iov	uio_iov
+ #define	afsio_iovcnt	uio_iovcnt
+ #define	afsio_offset	uio_offset
+ #define	afsio_seg	uio_segflg
+ #define	afsio_resid	uio_resid
+ #define	AFS_UIOSYS	UIO_SYSSPACE
+ #define	AFS_UIOUSER	UIO_USERSPACE
+ #define	AFS_CLBYTES	CLBYTES
+ #define	osi_GetTime(x)	microtime(x)
+ #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
+ #define vfs_fsid	mnt_stat.f_fsid
+ #define va_nodeid	va_fileid
+ #define vfs_vnodecovered mnt_vnodecovered
+ #define direct		dirent
+ #define vnode_t		struct vnode
+ 
+ #ifndef MUTEX_DEFAULT
+ #define MUTEX_DEFAULT   0
+ #endif /* MUTEX_DEFAULT */
+ 
+ #ifndef SSYS
+ #define SSYS            0x00002
+ #endif /* SSYS */
+ 
+ #define p_rcred         p_ucred
+ 
+ #define	VN_RELE(vp)	vrele(((struct vnode *)(vp)))
+ #define	VN_HOLD(vp)	VREF(((struct vnode *)(vp)))
+ 
+ #if	!defined(ASSEMBLER) && !defined(__LANGUAGE_ASSEMBLY__)
+ enum vcexcl {NONEXCL, EXCL};
+ 
+ #ifdef KERNEL
+ #ifndef MIN
+ #define MIN(A,B) ((A) < (B) ? (A) : (B))
+ #endif
+ #ifndef MAX
+ #define MAX(A,B) ((A) > (B) ? (A) : (B))
+ #endif
+ #endif /* KERNEL */
+ 
+ #endif	/* ! ASSEMBLER & ! __LANGUAGE_ASSEMBLY__ */
+ #endif /* _KERNEL */
+ 
+ #endif	/* AFS_PARAM_H */
Index: openafs/src/config/param.i386_fbsd_45_usr.h
diff -c /dev/null openafs/src/config/param.i386_fbsd_45_usr.h:1.1.8.1
*** /dev/null	Thu Sep 26 01:24:46 2002
--- openafs/src/config/param.i386_fbsd_45_usr.h	Tue Sep 17 18:32:56 2002
***************
*** 0 ****
--- 1,62 ----
+ #ifndef AFS_PARAM_H
+ #define AFS_PARAM_H
+ 
+ 
+ #define UKERNEL			1	/* user space kernel */
+ #define AFS_ENV			1
+ #define AFS_VFSINCL_ENV         1
+ #define AFS_USR_FBSD40_ENV	1
+ #define AFS_USR_FBSD42_ENV	1
+ #define AFS_USR_FBSD43_ENV	1
+ #define AFS_USR_FBSD44_ENV	1
+ #define AFS_USR_FBSD45_ENV	1
+ #define AFS_USR_FBSD_ENV	1
+ #define AFS_NONFSTRANS 1
+ 
+ #define O_SYNC O_FSYNC
+ 
+ #define AFS_MOUNT_AFS "afs"	/* The name of the filesystem type. */
+ #define AFS_SYSCALL 210
+ #define AFS_NAMEI_ENV         1   /* User space interface to file system */
+ #define AFS_64BIT_IOPS_ENV    1   /* Needed for NAMEI */
+ #include <afs/afs_sysnames.h>
+ 
+ #define AFS_USERSPACE_IP_ADDR 1
+ #define RXK_LISTENER_ENV      1
+ #define AFS_GCPAGS	      0       /* if nonzero, garbage collect PAGs */
+ 
+ /* Machine / Operating system information */
+ #define SYS_NAME	"i386_fbsd_45"
+ #define SYS_NAME_ID	SYS_NAME_ID_i386_fbsd_45
+ #define AFSLITTLE_ENDIAN    1
+ #define AFS_HAVE_FFS        1       /* Use system's ffs. */
+ #define AFS_HAVE_STATVFS    0	/* System doesn't support statvfs */
+ #define AFS_VM_RDWR_ENV	    1	/* read/write implemented via VM */
+ 
+ #define	afsio_iov	uio_iov
+ #define	afsio_iovcnt	uio_iovcnt
+ #define	afsio_offset	uio_offset
+ #define	afsio_seg	uio_segflg
+ #define	afsio_fmode	uio_fmode
+ #define	afsio_resid	uio_resid
+ #define	AFS_UIOSYS	1
+ #define	AFS_UIOUSER	UIO_USERSPACE
+ #define	AFS_CLBYTES	MCLBYTES
+ #define	AFS_MINCHANGE	2
+ #define	VATTR_NULL	usr_vattr_null
+ 
+ #define AFS_DIRENT
+ #ifndef CMSERVERPREF
+ #define CMSERVERPREF
+ #endif
+ 
+ #include <limits.h>
+ #include <sys/param.h>
+ #include <sys/types.h>
+ #include <sys/mount.h>
+ #include <sys/fcntl.h>
+ #include <netinet/in.h>
+ #include <sys/uio.h>
+ #include <sys/socket.h>
+ 
+ #endif /* AFS_PARAM_H */
Index: openafs/src/config/param.i386_fbsd_46.h
diff -c /dev/null openafs/src/config/param.i386_fbsd_46.h:1.2.6.1
*** /dev/null	Thu Sep 26 01:24:46 2002
--- openafs/src/config/param.i386_fbsd_46.h	Tue Sep 17 18:32:56 2002
***************
*** 0 ****
--- 1,121 ----
+ #ifndef	AFS_PARAM_H
+ #define	AFS_PARAM_H
+ 
+ #include <sys/param.h>
+ 
+ #define AFS_XBSD_ENV 1             /* {Free,Open,Net}BSD */
+ #define AFS_X86_XBSD_ENV 1
+ 
+ #define AFS_NAMEI_ENV     1   /* User space interface to file system */
+ #define AFS_64BIT_IOPS_ENV 1  /* Needed for NAMEI */
+ #define AFS_FBSD_ENV 1
+ #define AFS_FBSD40_ENV 1
+ #define AFS_FBSD42_ENV 1
+ #define AFS_FBSD43_ENV 1
+ #define AFS_FBSD44_ENV 1
+ #define AFS_FBSD45_ENV 1
+ #define AFS_FBSD46_ENV 1
+ #define AFS_X86_FBSD_ENV 1
+ #define AFS_X86_FBSD40_ENV 1
+ #define AFS_X86_FBSD42_ENV 1
+ #define AFS_X86_FBSD43_ENV 1
+ #define AFS_X86_FBSD46_ENV 1
+ #define AFS_X86_ENV 1
+ #define AFS_NONFSTRANS 1
+ #define O_SYNC O_FSYNC
+ #define FTRUNC O_TRUNC
+ 
+ #define IUPD 0x0010
+ #define IACC 0x0020
+ #define ICHG 0x0040
+ #define IMOD 0x0080
+ 
+ #define IN_LOCK(ip)     lockmgr(&ip->i_lock, LK_EXCLUSIVE, \
+                                 NULL, curproc)
+ #define IN_UNLOCK(ip)   lockmgr(&ip->i_lock, LK_RELEASE, \
+                                 NULL, curproc)
+ 
+ #include <afs/afs_sysnames.h>
+ 
+ #define AFS_VM_RDWR_ENV	1
+ #define AFS_VFS_ENV	1
+ #define AFS_VFSINCL_ENV 1
+ #define AFS_GREEDY43_ENV	1
+ #define AFS_ENV  	1
+ 
+ #define AFS_SYSCALL	210
+ #define AFS_MOUNT_AFS	"afs"
+ 
+ #ifndef MOUNT_UFS
+ #define MOUNT_UFS "ufs"
+ #endif
+ 
+ #ifndef	MOUNT_AFS
+ #define	MOUNT_AFS AFS_MOUNT_AFS
+ #endif
+ #define SYS_NAME	"i386_fbsd_46"
+ #define SYS_NAME_ID	SYS_NAME_ID_i386_fbsd_46
+ 
+ #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 */
+ 
+ #define AFSLITTLE_ENDIAN 1
+ 
+ /* Extra kernel definitions (from kdefs file) */
+ #ifdef _KERNEL
+ #define AFS_GLOBAL_SUNLOCK        1
+ #define	AFS_VFS34	1	/* What is VFS34??? */
+ #define	AFS_SHORTGID	1	/* are group id's short? */
+ #define	afsio_iov	uio_iov
+ #define	afsio_iovcnt	uio_iovcnt
+ #define	afsio_offset	uio_offset
+ #define	afsio_seg	uio_segflg
+ #define	afsio_resid	uio_resid
+ #define	AFS_UIOSYS	UIO_SYSSPACE
+ #define	AFS_UIOUSER	UIO_USERSPACE
+ #define	AFS_CLBYTES	CLBYTES
+ #define	osi_GetTime(x)	microtime(x)
+ #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
+ #define vfs_fsid	mnt_stat.f_fsid
+ #define va_nodeid	va_fileid
+ #define vfs_vnodecovered mnt_vnodecovered
+ #define direct		dirent
+ #define vnode_t		struct vnode
+ 
+ #ifndef MUTEX_DEFAULT
+ #define MUTEX_DEFAULT   0
+ #endif /* MUTEX_DEFAULT */
+ 
+ #ifndef SSYS
+ #define SSYS            0x00002
+ #endif /* SSYS */
+ 
+ #define p_rcred         p_ucred
+ 
+ #define	VN_RELE(vp)	vrele(((struct vnode *)(vp)))
+ #define	VN_HOLD(vp)	VREF(((struct vnode *)(vp)))
+ 
+ #if	!defined(ASSEMBLER) && !defined(__LANGUAGE_ASSEMBLY__)
+ enum vcexcl {NONEXCL, EXCL};
+ 
+ #ifdef KERNEL
+ #ifndef MIN
+ #define MIN(A,B) ((A) < (B) ? (A) : (B))
+ #endif
+ #ifndef MAX
+ #define MAX(A,B) ((A) > (B) ? (A) : (B))
+ #endif
+ #endif /* KERNEL */
+ 
+ #endif	/* ! ASSEMBLER & ! __LANGUAGE_ASSEMBLY__ */
+ #endif /* _KERNEL */
+ 
+ #endif	/* AFS_PARAM_H */
Index: openafs/src/config/param.i386_fbsd_46_usr.h
diff -c /dev/null openafs/src/config/param.i386_fbsd_46_usr.h:1.1.8.1
*** /dev/null	Thu Sep 26 01:24:46 2002
--- openafs/src/config/param.i386_fbsd_46_usr.h	Tue Sep 17 18:32:56 2002
***************
*** 0 ****
--- 1,63 ----
+ #ifndef AFS_PARAM_H
+ #define AFS_PARAM_H
+ 
+ 
+ #define UKERNEL			1	/* user space kernel */
+ #define AFS_ENV			1
+ #define AFS_VFSINCL_ENV         1
+ #define AFS_USR_FBSD40_ENV	1
+ #define AFS_USR_FBSD42_ENV	1
+ #define AFS_USR_FBSD43_ENV	1
+ #define AFS_USR_FBSD44_ENV	1
+ #define AFS_USR_FBSD45_ENV	1
+ #define AFS_USR_FBSD46_ENV	1
+ #define AFS_USR_FBSD_ENV	1
+ #define AFS_NONFSTRANS 1
+ 
+ #define O_SYNC O_FSYNC
+ 
+ #define AFS_MOUNT_AFS "afs"	/* The name of the filesystem type. */
+ #define AFS_SYSCALL 210
+ #define AFS_NAMEI_ENV         1   /* User space interface to file system */
+ #define AFS_64BIT_IOPS_ENV    1   /* Needed for NAMEI */
+ #include <afs/afs_sysnames.h>
+ 
+ #define AFS_USERSPACE_IP_ADDR 1
+ #define RXK_LISTENER_ENV      1
+ #define AFS_GCPAGS	      0       /* if nonzero, garbage collect PAGs */
+ 
+ /* Machine / Operating system information */
+ #define SYS_NAME	"i386_fbsd_46"
+ #define SYS_NAME_ID	SYS_NAME_ID_i386_fbsd_46
+ #define AFSLITTLE_ENDIAN    1
+ #define AFS_HAVE_FFS        1       /* Use system's ffs. */
+ #define AFS_HAVE_STATVFS    0	/* System doesn't support statvfs */
+ #define AFS_VM_RDWR_ENV	    1	/* read/write implemented via VM */
+ 
+ #define	afsio_iov	uio_iov
+ #define	afsio_iovcnt	uio_iovcnt
+ #define	afsio_offset	uio_offset
+ #define	afsio_seg	uio_segflg
+ #define	afsio_fmode	uio_fmode
+ #define	afsio_resid	uio_resid
+ #define	AFS_UIOSYS	1
+ #define	AFS_UIOUSER	UIO_USERSPACE
+ #define	AFS_CLBYTES	MCLBYTES
+ #define	AFS_MINCHANGE	2
+ #define	VATTR_NULL	usr_vattr_null
+ 
+ #define AFS_DIRENT
+ #ifndef CMSERVERPREF
+ #define CMSERVERPREF
+ #endif
+ 
+ #include <limits.h>
+ #include <sys/param.h>
+ #include <sys/types.h>
+ #include <sys/mount.h>
+ #include <sys/fcntl.h>
+ #include <netinet/in.h>
+ #include <sys/uio.h>
+ #include <sys/socket.h>
+ 
+ #endif /* AFS_PARAM_H */
Index: openafs/src/config/param.ia64_linux24.h
diff -c openafs/src/config/param.ia64_linux24.h:1.1.2.2 openafs/src/config/param.ia64_linux24.h:1.1.2.3
*** openafs/src/config/param.ia64_linux24.h:1.1.2.2	Wed Jul 10 16:42:34 2002
--- openafs/src/config/param.ia64_linux24.h	Mon Aug 26 00:34:08 2002
***************
*** 75,80 ****
  #endif
  #endif /* KERNEL */
  
! #define HAVE_UCONTEXT_H		/* should be in afsconfig.h */
  
  #endif /* _PARAM_IA64_LINUX20_H_ */
--- 75,80 ----
  #endif
  #endif /* KERNEL */
  
! #define USE_UCONTEXT		/* should be in afsconfig.h */
  
  #endif /* _PARAM_IA64_LINUX20_H_ */
Index: openafs/src/config/param.ia64_linux24_usr.h
diff -c openafs/src/config/param.ia64_linux24_usr.h:1.1 openafs/src/config/param.ia64_linux24_usr.h:1.1.2.1
*** openafs/src/config/param.ia64_linux24_usr.h:1.1	Mon Aug  6 20:05:00 2001
--- openafs/src/config/param.ia64_linux24_usr.h	Mon Aug 26 00:34:08 2002
***************
*** 54,59 ****
  #define CMSERVERPREF
  #endif
  
! #define HAVE_UCONTEXT_H		/* should be in afsconfig.h */
  
  #endif /* AFS_PARAM_H */
--- 54,59 ----
  #define CMSERVERPREF
  #endif
  
! #define USE_UCONTEXT		/* should be in afsconfig.h */
  
  #endif /* AFS_PARAM_H */
Index: openafs/src/config/param.ppc_darwin_60.h
diff -c /dev/null openafs/src/config/param.ppc_darwin_60.h:1.1.2.1
*** /dev/null	Thu Sep 26 01:24:46 2002
--- openafs/src/config/param.ppc_darwin_60.h	Wed Aug 21 18:08:54 2002
***************
*** 0 ****
--- 1,65 ----
+ #ifndef AFS_PARAM_H
+ #define AFS_PARAM_H
+ 
+ #define AFS_ENV                 1
+ #define AFS_64BIT_ENV           1       /* Defines afs_int32 as int, not long. */
+ #define AFS_PPC_ENV 1
+ #define AFS_VFSINCL_ENV 1
+ 
+ #include <afs/afs_sysnames.h>
+ 
+ #define AFS_DARWIN_ENV
+ #define AFS_DARWIN13_ENV
+ #define AFS_DARWIN14_ENV
+ #define AFS_DARWIN60_ENV
+ #define AFS_NONFSTRANS
+ #define AFS_SYSCALL             230
+ #define AFS_NAMEI_ENV 1
+ 
+ /* File system entry (used if mount.h doesn't define MOUNT_AFS */
+ #define AFS_MOUNT_AFS    "afs"
+ 
+ /* Machine / Operating system information */
+ #define sys_ppc_darwin_12   1
+ #define sys_ppc_darwin_13   1
+ #define sys_ppc_darwin_14   1
+ #define sys_ppc_darwin_60   1
+ #define SYS_NAME        "ppc_darwin_60"
+ #define SYS_NAME_ID     SYS_NAME_ID_ppc_darwin_60
+ #define AFSBIG_ENDIAN   1
+ #define AFS_HAVE_FFS    1       /* Use system's ffs. */
+ 
+ #define AFS_GCPAGS                1       /* if nonzero, garbage collect PAGs */
+ #define RXK_LISTENER_ENV         1
+ 
+ #ifdef KERNEL
+ #undef MACRO_BEGIN
+ #undef MACRO_END
+ #include <kern/macro_help.h>
+ #define AFS_GLOBAL_SUNLOCK        1
+ #define AFS_VFS34       1       /* What is VFS34??? */
+ #define afsio_iov       uio_iov
+ #define afsio_iovcnt    uio_iovcnt
+ #define afsio_offset    uio_offset
+ #define afsio_seg       uio_segflg
+ #define afsio_resid     uio_resid
+ #define AFS_UIOSYS      UIO_SYSSPACE
+ #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 v_count         v_usecount
+ #define v_vfsp          v_mount
+ #define vfs_bsize       mnt_stat.f_bsize
+ #define vfs_fsid        mnt_stat.f_fsid
+ #define va_nodeid       va_fileid
+ #define vfs_vnodecovered mnt_vnodecovered
+ #define direct          dirent
+ #define vnode_t         struct vnode
+ 
+ #define VN_RELE(vp)     vrele(((struct vnode *)(vp)))
+ #define VN_HOLD(vp)     VREF(((struct vnode *)(vp)))
+ 
+ #endif
+ #endif /* AFS_PARAM_H */
Index: openafs/src/config/param.ppc_darwin_60_usr.h
diff -c /dev/null openafs/src/config/param.ppc_darwin_60_usr.h:1.1.2.1
*** /dev/null	Thu Sep 26 01:24:46 2002
--- openafs/src/config/param.ppc_darwin_60_usr.h	Wed Aug 21 18:08:54 2002
***************
*** 0 ****
--- 1,52 ----
+ #ifndef AFS_PARAM_H
+ #define AFS_PARAM_H
+ 
+ #define AFS_VFSINCL_ENV 1       /* NOBODY uses this.... */
+ #define AFS_ENV                 1
+ #define AFS_64BIT_ENV           1       /* Defines afs_int32 as int, not long. */
+ #define AFS_PPC_ENV 1
+ 
+ #include <afs/afs_sysnames.h>
+ #define AFS_USERSPACE_ENV
+ #define AFS_USR_DARWIN_ENV
+ #define AFS_USR_DARWIN13_ENV
+ #define AFS_USR_DARWIN14_ENV
+ #define AFS_USR_DARWIN60_ENV
+ #define AFS_NONFSTRANS 
+ #define AFS_SYSCALL             230
+ 
+ /* File system entry (used if mount.h doesn't define MOUNT_AFS */
+ #define AFS_MOUNT_AFS    "afs"
+ 
+ /* Machine / Operating system information */
+ #define sys_ppc_darwin_12   1
+ #define sys_ppc_darwin_13   1
+ #define sys_ppc_darwin_14   1
+ #define sys_ppc_darwin_60   1
+ #define SYS_NAME        "ppc_darwin_60"
+ #define SYS_NAME_ID     SYS_NAME_ID_ppc_darwin_60
+ #define AFSBIG_ENDIAN   1
+ #define AFS_HAVE_FFS    1       /* Use system's ffs. */
+ 
+ #define AFS_UIOSYS      UIO_SYSSPACE
+ #define AFS_UIOUSER     UIO_USERSPACE
+ 
+ #define AFS_GCPAGS                0       /* if nonzero, garbage collect PAGs */
+ #define RXK_LISTENER_ENV          1
+ 
+ #define AFS_VFS34       1       /* What is VFS34??? */
+ #define afsio_iov       uio_iov
+ #define afsio_iovcnt    uio_iovcnt
+ #define afsio_offset    uio_offset
+ #define afsio_seg       uio_segflg
+ #define afsio_resid     uio_resid
+ #define AFS_UIOSYS      UIO_SYSSPACE
+ #define AFS_UIOUSER     UIO_USERSPACE
+ #define        VATTR_NULL      usr_vattr_null
+ 
+ #define AFS_DIRENT
+ #ifndef CMSERVERPREF
+ #define CMSERVERPREF
+ #endif
+ 
+ #endif /* AFS_PARAM_H */
Index: openafs/src/config/param.rs_aix42.h
diff -c openafs/src/config/param.rs_aix42.h:1.4 openafs/src/config/param.rs_aix42.h:1.4.4.1
*** openafs/src/config/param.rs_aix42.h:1.4	Thu Jul  5 11:20:18 2001
--- openafs/src/config/param.rs_aix42.h	Wed Sep 11 04:18:09 2002
***************
*** 15,20 ****
--- 15,24 ----
  #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: openafs/src/config/param.sun4_413.h
diff -c /dev/null openafs/src/config/param.sun4_413.h:1.1.2.1
*** /dev/null	Thu Sep 26 01:24:46 2002
--- openafs/src/config/param.sun4_413.h	Wed Aug 21 15:24:57 2002
***************
*** 0 ****
--- 1,67 ----
+ /*
+  * 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
+  */
+ 
+ #ifndef	AFS_PARAM_H
+ #define	AFS_PARAM_H
+ 
+ #define AFS_VFSINCL_ENV	1	/* NOBODY uses this.... */
+ #define AFS_ENV			1
+ #define AFS_SUN_ENV		1
+ #define AFS_SUN4_ENV		1
+ 
+ #include <afs/afs_sysnames.h>
+ 
+ #define AFS_GCPAGS		1       /* if nonzero, garbage collect PAGs */
+ #define AFS_GLOBAL_SUNLOCK	1	/* For global locking */
+ 
+ #define	AFS_3DISPARES		1	/* Utilize the 3 available disk inode 'spares' */
+ #define	AFS_SYSCALL		31
+ 
+ /* File system entry (used if mount.h doesn't define MOUNT_AFS */
+ #define AFS_MOUNT_AFS	 "afs"
+ 
+ /* Machine / Operating system information */
+ #define sys_sun4_413	1
+ #define SYS_NAME	"sun4_413"
+ #define SYS_NAME_ID	SYS_NAME_ID_sun4_411
+ #define AFSBIG_ENDIAN	1
+ #define AFS_HAVE_FFS    1       /* Use system's ffs. */
+ #define AFS_HAVE_STATVFS 0
+ #define AFS_VM_RDWR_ENV	1	/* read/write implemented via VM */
+ 
+ /* Extra kernel definitions (from kdefs file) */
+ #ifdef KERNEL
+ /* sun definitions here */
+ #define	AFS_UIOFMODE		1	/* Only in afs/afs_vnodeops.c (afs_ustrategy) */
+ #define	afsio_iov		uio_iov
+ #define	afsio_iovcnt	uio_iovcnt
+ #define	afsio_offset	uio_offset
+ #define	afsio_seg		uio_segflg
+ #define	afsio_fmode	uio_fmode
+ #define	afsio_resid	uio_resid
+ #define	AFS_UIOSYS	UIO_SYSSPACE
+ #define	AFS_UIOUSER	UIO_USERSPACE
+ #define	AFS_CLBYTES	MCLBYTES
+ #define	AFS_MINCHANGE	2
+ #define	osi_GetTime(x)	uniqtime(x)
+ #define	AFS_KALLOC(n)	kmem_alloc(n, KMEM_SLEEP)
+ #define	AFS_KALLOC_NOSLEEP(n)	kmem_alloc(n, KMEM_NOSLEEP)
+ #define	AFS_KFREE	kmem_free
+ #define	VATTR_NULL	vattr_null
+ #endif /* KERNEL */
+ #define memset(A, B, S) bzero(A, S)
+ #define memcpy(B, A, S) bcopy(A, B, S) 
+ #define memcmp(A, B, S) bcmp(A, B, S)
+ #define memmove(B, A, S) bcopy(A, B, S)
+ #define	AFS_DIRENT	
+ #ifndef CMSERVERPREF
+ #define CMSERVERPREF
+ #endif
+ 
+ #endif /* AFS_PARAM_H */
Index: openafs/src/config/param.sun4_413_usr.h
diff -c /dev/null openafs/src/config/param.sun4_413_usr.h:1.1.2.1
*** /dev/null	Thu Sep 26 01:24:46 2002
--- openafs/src/config/param.sun4_413_usr.h	Wed Aug 21 15:24:57 2002
***************
*** 0 ****
--- 1,58 ----
+ /*
+  * 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
+  */
+ 
+ #ifndef	AFS_PARAM_H
+ #define	AFS_PARAM_H
+ 
+ #define UKERNEL
+ #define AFS_ENV			1
+ /* define AFS_USR_XXX_ENV XXX */
+ 
+ #include <afs/afs_sysnames.h>
+ 
+ #define RXK_LISTENER_ENV        1
+ #define AFS_USERSPACE_IP_ADDR   1
+ #define AFS_GCPAGS		0       /* if nonzero, garbage collect PAGs */
+ 
+ #define	AFS_3DISPARES		1	/* Utilize the 3 available disk inode 'spares' */
+ #define	AFS_SYSCALL		31
+ 
+ /* File system entry (used if mount.h doesn't define MOUNT_AFS */
+ #define AFS_MOUNT_AFS	 1
+ 
+ /* Machine / Operating system information */
+ #define sys_sun4_413	1
+ #define SYS_NAME	"sun4_413"
+ #define SYS_NAME_ID	SYS_NAME_ID_sun4_411
+ #define AFSBIG_ENDIAN	1
+ #define AFS_HAVE_FFS    1       /* Use system's ffs. */
+ #define AFS_HAVE_STATVFS 0
+ 
+ /* Extra kernel definitions (from kdefs file) */
+ #ifdef KERNEL
+ /* sun definitions here */
+ #define	AFS_UIOFMODE		1	/* Only in afs/afs_vnodeops.c (afs_ustrategy) */
+ #define	afsio_iov		uio_iov
+ #define	afsio_iovcnt	uio_iovcnt
+ #define	afsio_offset	uio_offset
+ #define	afsio_seg		uio_segflg
+ #define	afsio_fmode	uio_fmode
+ #define	afsio_resid	uio_resid
+ #define	AFS_UIOSYS	1
+ #define	AFS_UIOUSER	UIO_USERSPACE
+ #define	AFS_CLBYTES	MCLBYTES
+ #define	AFS_MINCHANGE	2
+ #define	VATTR_NULL	usr_vattr_null
+ #endif /* KERNEL */
+ #define	AFS_DIRENT	
+ #ifndef CMSERVERPREF
+ #define CMSERVERPREF
+ #endif
+ 
+ #endif /* AFS_PARAM_H */
Index: openafs/src/config/stds.h
diff -c openafs/src/config/stds.h:1.7 openafs/src/config/stds.h:1.7.2.1
*** openafs/src/config/stds.h:1.7	Tue Aug  7 20:03:41 2001
--- openafs/src/config/stds.h	Wed Aug 21 16:59:04 2002
***************
*** 54,61 ****
  #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 NonZeroInt64(a)                (a)
  #define Int64ToInt32(a)    (a) & 0xFFFFFFFFL
  #define FillInt64(t,h,l) (t) = (h); (t) <<= 32; (t) |= (l);
--- 54,61 ----
  #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) = (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: openafs/src/config/venus.h
diff -c openafs/src/config/venus.h:1.6.4.1 openafs/src/config/venus.h:1.6.4.2
*** openafs/src/config/venus.h:1.6.4.1	Sun Jan 20 03:21:02 2002
--- openafs/src/config/venus.h	Wed Aug 21 15:24:57 2002
***************
*** 179,185 ****
  #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 */
  
  #endif /* AFS_VENUS_H */
--- 179,185 ----
  #define VIOC_STATISTICS         _VICEIOCTL(68)  /* arla: fetch statistics */
  
  /* Coordinated 'C' pioctl's */
! #define VIOC_NEWALIAS		_CVICEIOCTL(1)  /* create new cell alias */
! #define VIOC_GETALIAS		_CVICEIOCTL(2)  /* get alias info */
  
  #endif /* AFS_VENUS_H */
Index: openafs/src/dir/dir.c
diff -c openafs/src/dir/dir.c:1.5 openafs/src/dir/dir.c:1.5.4.1
*** openafs/src/dir/dir.c:1.5	Thu Jul 12 15:58:34 2001
--- openafs/src/dir/dir.c	Wed Aug 21 16:53:25 2002
***************
*** 10,16 ****
  #include <afsconfig.h>
  #include <afs/param.h>
  
! RCSID("$Header: /data/cvs/openafs/src/dir/dir.c,v 1.5 2001/07/12 19:58:34 shadow Exp $");
  
  #ifdef KERNEL
  #if !defined(UKERNEL)
--- 10,16 ----
  #include <afsconfig.h>
  #include <afs/param.h>
  
! RCSID("$Header: /data/cvs/openafs/src/dir/dir.c,v 1.5.4.1 2002/08/21 20:53:25 shadow Exp $");
  
  #ifdef KERNEL
  #if !defined(UKERNEL)
***************
*** 34,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"
--- 34,39 ----
***************
*** 42,47 ****
--- 41,47 ----
  #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: openafs/src/fsint/afsaux.c
diff -c openafs/src/fsint/afsaux.c:1.5.4.1 openafs/src/fsint/afsaux.c:1.5.4.2
*** openafs/src/fsint/afsaux.c:1.5.4.1	Sat Jun  8 00:47:42 2002
--- openafs/src/fsint/afsaux.c	Tue Sep 10 18:33:47 2002
***************
*** 14,20 ****
  #include <afs/param.h>
  #endif
  
! RCSID("$Header: /data/cvs/openafs/src/fsint/afsaux.c,v 1.5.4.1 2002/06/08 04:47:42 shadow Exp $");
  
  #ifdef KERNEL
  #if defined(UKERNEL)
--- 14,20 ----
  #include <afs/param.h>
  #endif
  
! RCSID("$Header: /data/cvs/openafs/src/fsint/afsaux.c,v 1.5.4.2 2002/09/10 22:33:47 zacheiss Exp $");
  
  #ifdef KERNEL
  #if defined(UKERNEL)
***************
*** 22,28 ****
  #include "../afs/afsincludes.h"
  #include "../rx/xdr.h"
  #else /* defined(UKERNEL) */
! #if defined(AFS_ALPHA_ENV) || defined(AFS_LINUX20_ENV) || defined(AFS_DARWIN_ENV)
  #include "../afs/sysincludes.h"
  #include "../afs/afsincludes.h"
  #else
--- 22,28 ----
  #include "../afs/afsincludes.h"
  #include "../rx/xdr.h"
  #else /* defined(UKERNEL) */
! #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,71 ****
  #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)
  /*
   * XDR chars; from user mode xdr package.
   */
--- 65,71 ----
  #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) && !defined(AFS_FBSD_ENV)
  /*
   * XDR chars; from user mode xdr package.
   */
Index: openafs/src/gtx/curseswindows.c
diff -c openafs/src/gtx/curseswindows.c:1.5 openafs/src/gtx/curseswindows.c:1.5.4.1
*** openafs/src/gtx/curseswindows.c:1.5	Thu Jul 12 15:58:39 2001
--- openafs/src/gtx/curseswindows.c	Wed Aug 21 16:53:25 2002
***************
*** 18,24 ****
  #include <afsconfig.h>
  #include <afs/param.h>
  
! RCSID("$Header: /data/cvs/openafs/src/gtx/curseswindows.c,v 1.5 2001/07/12 19:58:39 shadow Exp $");
  
  
  #if defined(AFS_HPUX110_ENV) && !defined(__HP_CURSES)
--- 18,24 ----
  #include <afsconfig.h>
  #include <afs/param.h>
  
! RCSID("$Header: /data/cvs/openafs/src/gtx/curseswindows.c,v 1.5.4.1 2002/08/21 20:53:25 shadow Exp $");
  
  
  #if defined(AFS_HPUX110_ENV) && !defined(__HP_CURSES)
***************
*** 758,764 ****
      struct gator_cursesgwin *cwp;	/*Curses-specific data*/
  
      cwp = (struct gator_cursesgwin *)(gwp->w_data);
! #ifdef AFS_DARWIN_ENV
      aparms->maxx = cwp->wp->maxx;
      aparms->maxy = cwp->wp->maxy;
  #else
--- 758,764 ----
      struct gator_cursesgwin *cwp;	/*Curses-specific data*/
  
      cwp = (struct gator_cursesgwin *)(gwp->w_data);
! #if defined(AFS_DARWIN_ENV) && !defined(AFS_DARWIN60_ENV)
      aparms->maxx = cwp->wp->maxx;
      aparms->maxy = cwp->wp->maxy;
  #else
Index: openafs/src/kauth/authclient.c
diff -c openafs/src/kauth/authclient.c:1.7.2.2 openafs/src/kauth/authclient.c:1.7.2.3
*** openafs/src/kauth/authclient.c:1.7.2.2	Sat Oct 13 00:21:33 2001
--- openafs/src/kauth/authclient.c	Tue Sep 10 18:33:49 2002
***************
*** 16,22 ****
  #include <afs/param.h>
  #endif
  
! RCSID("$Header: /data/cvs/openafs/src/kauth/authclient.c,v 1.7.2.2 2001/10/13 04:21:33 shadow Exp $");
  
  #if defined(UKERNEL)
  #include "../afs/sysincludes.h"
--- 16,22 ----
  #include <afs/param.h>
  #endif
  
! RCSID("$Header: /data/cvs/openafs/src/kauth/authclient.c,v 1.7.2.3 2002/09/10 22:33:49 zacheiss Exp $");
  
  #if defined(UKERNEL)
  #include "../afs/sysincludes.h"
***************
*** 91,96 ****
--- 91,100 ----
  	    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: openafs/src/kauth/krb_udp.c
diff -c openafs/src/kauth/krb_udp.c:1.14.2.4 openafs/src/kauth/krb_udp.c:1.14.2.5
*** openafs/src/kauth/krb_udp.c:1.14.2.4	Wed Jul 31 22:46:21 2002
--- openafs/src/kauth/krb_udp.c	Tue Sep 10 18:33:49 2002
***************
*** 15,21 ****
  #include <afsconfig.h>
  #include <afs/param.h>
  
! RCSID("$Header: /data/cvs/openafs/src/kauth/krb_udp.c,v 1.14.2.4 2002/08/01 02:46:21 zacheiss Exp $");
  
  #include <afs/stds.h>
  #include <sys/types.h>
--- 15,21 ----
  #include <afsconfig.h>
  #include <afs/param.h>
  
! RCSID("$Header: /data/cvs/openafs/src/kauth/krb_udp.c,v 1.14.2.5 2002/09/10 22:33:49 zacheiss Exp $");
  
  #include <afs/stds.h>
  #include <sys/types.h>
***************
*** 857,862 ****
--- 857,865 ----
      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: openafs/src/libafs/MakefileProto.DARWIN.in
diff -c openafs/src/libafs/MakefileProto.DARWIN.in:1.8.2.4 openafs/src/libafs/MakefileProto.DARWIN.in:1.8.2.5
*** openafs/src/libafs/MakefileProto.DARWIN.in:1.8.2.4	Sat Jun  8 00:47:42 2002
--- openafs/src/libafs/MakefileProto.DARWIN.in	Wed Aug 21 16:53:26 2002
***************
*** 1,5 ****
  #/* Copyright (C) 1995, 1989 Transarc Corporation - All rights reserved */
! # $Header: /data/cvs/openafs/src/libafs/MakefileProto.DARWIN.in,v 1.8.2.4 2002/06/08 04:47:42 shadow Exp $
  # 
  # MakefileProto for Digital Unix systems
  #
--- 1,5 ----
  #/* Copyright (C) 1995, 1989 Transarc Corporation - All rights reserved */
! # $Header: /data/cvs/openafs/src/libafs/MakefileProto.DARWIN.in,v 1.8.2.5 2002/08/21 20:53:26 shadow Exp $
  # 
  # MakefileProto for Digital Unix systems
  #
***************
*** 46,52 ****
--- 46,56 ----
  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: openafs/src/libafs/MakefileProto.FBSD.in
diff -c openafs/src/libafs/MakefileProto.FBSD.in:1.7.2.2 openafs/src/libafs/MakefileProto.FBSD.in:1.7.2.4
*** openafs/src/libafs/MakefileProto.FBSD.in:1.7.2.2	Sat Jun  8 00:47:42 2002
--- openafs/src/libafs/MakefileProto.FBSD.in	Fri Sep 13 00:10:19 2002
***************
*** 1,4 ****
- #/* Copyright (C) 1995, 1989 Transarc Corporation - All rights reserved */
  #
  # MakefileProto for FreeBSD systems
  #
--- 1,3 ----
***************
*** 20,26 ****
  afskerneldir=@afskerneldir@
  SYS_NAME=@AFS_SYSNAME@
  
! # include config/Makefile.${SYS_NAME}
  
  # OS specific object files:
  AFS_OS_OBJS = \
--- 19,25 ----
  afskerneldir=@afskerneldir@
  SYS_NAME=@AFS_SYSNAME@
  
! include config/Makefile.${SYS_NAME}
  
  # OS specific object files:
  AFS_OS_OBJS = \
***************
*** 30,36 ****
  	osi_misc.o \
  	osi_sleep.o \
  	osi_vm.o \
! 	osi_vnodeops.o
  
  AFS_OS_NFSOBJS = \
  	osi_vfsops_nfs.o
--- 29,36 ----
  	osi_misc.o \
  	osi_sleep.o \
  	osi_vm.o \
! 	osi_vnodeops.o \
! 	osi_module.o 
  
  AFS_OS_NFSOBJS = \
  	osi_vfsops_nfs.o
***************
*** 45,51 ****
  # 	-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
  DBUG = -O2
  DEFINES= -DAFSDEBUG -DKERNEL -DAFS -DVICE -DNFS -DUFS -DINET -DQUOTA -DGETMOUNT
  OPTF=${OPT} 
--- 45,51 ----
  # 	-DSWAPTYPE=1 -DUERF -DOSF -DCOMPAT_43 -DUFS \
  #	-DRT -DKERNEL -D_KERNEL
  KDEFS=-Wall -fformat-extensions -ansi -nostdinc -I/usr/include -D_KERNEL \
! 	-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,90 ****
  
  
  # Below this line are targets when in the COMMON directory:
! LIBAFS = libafs.o
! LIBAFSNONFS = libafs.nonfs.o
  
  INST_LIBAFS = ${DESTDIR}${afskerneldir}/${LIBAFS}
  INST_LIBAFSNONFS = ${DESTDIR}${afskerneldir}/${LIBAFSNONFS}
--- 83,90 ----
  
  
  # Below this line are targets when in the COMMON directory:
! LIBAFS = libafs.ko
! LIBAFSNONFS = libafs.nonfs.ko
  
  INST_LIBAFS = ${DESTDIR}${afskerneldir}/${LIBAFS}
  INST_LIBAFSNONFS = ${DESTDIR}${afskerneldir}/${LIBAFSNONFS}
***************
*** 92,114 ****
  DEST_LIBAFS = ${DEST}/root.client/bin/${LIBAFS}
  DEST_LIBAFSNONFS = ${DEST}/root.client/bin/${LIBAFSNONFS}
  
  
  # libafs:	$(LIBAFS) $(LIBAFSNONFS)
! # libafs:	$(LIBAFSNONFS)
  # install_libafs:	$(INST_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}
- 
- 
  $(INST_LIBAFS): $(LIBAFS)
  	$(INSTALL) -f $? $@
  
--- 92,108 ----
  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)
  # install_libafs:	$(INST_LIBAFS) $(INST_LIBAFSNONFS)
! install_libafs:	$(INST_LIBAFSNONFS)
  # dest_libafs:	$(DEST_LIBAFS) $(DEST_LIBAFSNONFS)
! dest_libafs:	$(DEST_LIBAFSNONFS)
  
  
  $(INST_LIBAFS): $(LIBAFS)
  	$(INSTALL) -f $? $@
  
***************
*** 122,131 ****
  	$(INSTALL) -f $? $@
  
  ${LIBAFS}: $(AFSAOBJS) $(AFSNFSOBJS)
! 	$(LD) -r -o ${LIBAFS} ${AFSAOBJS} ${AFSNFSOBJS}
  
  ${LIBAFSNONFS}:  $(AFSAOBJS) $(AFSNONFSOBJS)
! 	$(LD) -r -o ${LIBAFSNONFS} ${AFSAOBJS} ${AFSNONFSOBJS}
  
  
  # Object build rules:
--- 116,131 ----
  	$(INSTALL) -f $? $@
  
  ${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}.kld ${AFSAOBJS} ${AFSNONFSOBJS}
! 	gensetdefs ${LIBAFSNONFS}.kld
! 	$(MAKE) setdef0.o setdef1.o
! 	$(LD) -Bshareable -o ${LIBAFSNONFS} setdef0.o ${LIBAFSNONFS}.kld setdef1.o
  
  
  # Object build rules:
***************
*** 146,149 ****
--- 146,155 ----
  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: openafs/src/libafs/afs.ppc_darwin_60.plist.in
diff -c /dev/null openafs/src/libafs/afs.ppc_darwin_60.plist.in:1.1.2.1
*** /dev/null	Thu Sep 26 01:24:50 2002
--- openafs/src/libafs/afs.ppc_darwin_60.plist.in	Wed Aug 21 18:08:55 2002
***************
*** 0 ****
--- 1,31 ----
+ <?xml version="1.0" encoding="UTF-8"?>
+ <!DOCTYPE plist SYSTEM "file://localhost/System/Library/DTDs/PropertyList.dtd">
+ <plist version="0.9">
+ <dict>
+ 	<key>CFBundleDevelopmentRegion</key>
+ 	<string>English</string>
+ 	<key>CFBundleExecutable</key>
+ 	<string>afs</string>
+ 	<key>CFBundleIdentifier</key>
+ 	<string>org.openafs.filesystems.afs</string>
+ 	<key>CFBundleInfoDictionaryVersion</key>
+ 	<string>6.0</string>
+ 	<key>CFBundleName</key>
+ 	<string>afs</string>
+ 	<key>CFBundlePackageType</key>
+ 	<string>KEXT</string>
+ 	<key>CFBundleShortVersionString</key>
+ 	<string>@VERSION@</string>
+ 	<key>CFBundleSignature</key>
+ 	<string>????</string>
+ 	<key>CFBundleVersion</key>
+ 	<string>@VERSION@</string>
+ 	<key>OSBundleLibraries</key>
+ 	<dict>
+ 		<key>com.apple.kernel.bsd</key>
+ 		<string>6.0</string>
+ 		<key>com.apple.kernel.mach</key>
+ 		<string>6.0</string>
+ 	</dict>
+ </dict>
+ </plist>
Index: openafs/src/libafsrpc/Makefile.in
diff -c openafs/src/libafsrpc/Makefile.in:1.5.2.1 openafs/src/libafsrpc/Makefile.in:1.5.2.2
*** openafs/src/libafsrpc/Makefile.in:1.5.2.1	Wed Jul 10 15:57:44 2002
--- openafs/src/libafsrpc/Makefile.in	Tue Aug 27 23:56:05 2002
***************
*** 57,62 ****
--- 57,64 ----
  	com_err.o
  
  XDROBJS =\
+ 	xdr.o \
+ 	xdr_array.o \
  	xdr_arrayn.o \
  	xdr_rx.o \
  	xdr_int64.o \
***************
*** 256,262 ****
  #
  #   $ what /opt/langtools/bin/pxdb32
  #   /opt/langtools/bin/pxdb32:
! #           HP92453-02 A.10.0A HP-UX SYMBOLIC DEBUGGER (PXDB) $Revision: 1.5.2.1 $
  #
  # 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.
--- 258,264 ----
  #
  #   $ what /opt/langtools/bin/pxdb32
  #   /opt/langtools/bin/pxdb32:
! #           HP92453-02 A.10.0A HP-UX SYMBOLIC DEBUGGER (PXDB) $Revision: 1.5.2.2 $
  #
  # 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: openafs/src/libuafs/MakefileProto.FBSD.in
diff -c openafs/src/libuafs/MakefileProto.FBSD.in:1.3 openafs/src/libuafs/MakefileProto.FBSD.in:1.3.2.1
*** openafs/src/libuafs/MakefileProto.FBSD.in:1.3	Fri Sep  7 19:35:24 2001
--- openafs/src/libuafs/MakefileProto.FBSD.in	Tue Sep 17 19:00:43 2002
***************
*** 72,78 ****
  	$(MAKE) $(LIBUAFS) DESTDIR=${DESTDIR}
  
  AFSWEB/$(LIBAFSWEB): setup_nsafs
! cd AFSWEB; \
  	$(MAKE) $(LIBAFSWEB) DESTDIR=${DESTDIR}
  
  AFSWEB/$(LIBAFSWEBKRB): setup_nsafs
--- 72,78 ----
  	$(MAKE) $(LIBUAFS) DESTDIR=${DESTDIR}
  
  AFSWEB/$(LIBAFSWEB): setup_nsafs
! 	cd AFSWEB; \
  	$(MAKE) $(LIBAFSWEB) DESTDIR=${DESTDIR}
  
  AFSWEB/$(LIBAFSWEBKRB): setup_nsafs
Index: openafs/src/lwp/lwp.h
diff -c openafs/src/lwp/lwp.h:1.9 openafs/src/lwp/lwp.h:1.9.2.1
*** openafs/src/lwp/lwp.h:1.9	Mon Aug  6 20:05:03 2001
--- openafs/src/lwp/lwp.h	Mon Aug 26 00:34:10 2002
***************
*** 20,26 ****
  
  #if !defined(KERNEL) && !defined(_KMEMUSER) && !defined(AFS_PTHREAD_ENV)
  #include <afs/param.h>
! #ifdef HAVE_UCONTEXT_H
  #include <ucontext.h>
  #else
  #include <setjmp.h>
--- 20,26 ----
  
  #if !defined(KERNEL) && !defined(_KMEMUSER) && !defined(AFS_PTHREAD_ENV)
  #include <afs/param.h>
! #if defined(USE_UCONTEXT) && defined(HAVE_UCONTEXT_H)
  #include <ucontext.h>
  #else
  #include <setjmp.h>
***************
*** 195,201 ****
  #else
  struct lwp_context {	/* saved context for dispatcher */
      char *topstack;	/* ptr to top of process stack */
! #ifdef HAVE_UCONTEXT_H
      ucontext_t ucontext;
      int state;
  #else /* !HAVE_UCONTEXT_H */
--- 195,201 ----
  #else
  struct lwp_context {	/* saved context for dispatcher */
      char *topstack;	/* ptr to top of process stack */
! #if defined(USE_UCONTEXT) && defined(HAVE_UCONTEXT_H)
      ucontext_t ucontext;
      int state;
  #else /* !HAVE_UCONTEXT_H */
Index: openafs/src/lwp/preempt.c
diff -c openafs/src/lwp/preempt.c:1.10.2.2 openafs/src/lwp/preempt.c:1.10.2.4
*** openafs/src/lwp/preempt.c:1.10.2.2	Sat Oct 13 00:21:42 2001
--- openafs/src/lwp/preempt.c	Mon Aug 26 00:34:10 2002
***************
*** 16,22 ****
  #include <afsconfig.h>
  #include <afs/param.h>
  
! RCSID("$Header: /data/cvs/openafs/src/lwp/preempt.c,v 1.10.2.2 2001/10/13 04:21:42 shadow Exp $");
  
  
  #if defined(AFS_LINUX20_ENV) || defined(AFS_DARWIN_ENV) || defined(AFS_XBSD_ENV) || defined(AFS_DJGPP_ENV)
--- 16,22 ----
  #include <afsconfig.h>
  #include <afs/param.h>
  
! RCSID("$Header: /data/cvs/openafs/src/lwp/preempt.c,v 1.10.2.4 2002/08/26 04:34:10 shadow Exp $");
  
  
  #if defined(AFS_LINUX20_ENV) || defined(AFS_DARWIN_ENV) || defined(AFS_XBSD_ENV) || defined(AFS_DJGPP_ENV)
***************
*** 24,30 ****
--- 24,32 ----
  #else
  #include <sys/time.h>
  #include <signal.h>
+ #ifdef HAVE_UCONTEXT_H
  #include <ucontext.h>
+ #endif
  #include "lwp.h"
  #include "preempt.h"
  
***************
*** 34,48 ****
--- 36,60 ----
  char PRE_Block = 0;		/* used in lwp.c and process.s */
  #endif
  
+ #if HAVE_SIGACTION && defined(SA_SIGINFO)
  static void AlarmHandler(sig, st, scp)
      int sig;
      siginfo_t *st;
      ucontext_t *scp;
+ #else
+ static void AlarmHandler(sig, code, scp)
+     int sig, code;
+     struct sigcontext *scp;
+ #endif
      {
      if (PRE_Block == 0 && lwp_cpptr->level == 0)
  	{
  	PRE_BeginCritical();
+ #if HAVE_SIGACTION && defined(SA_SIGINFO)
  	sigprocmask(SIG_SETMASK, &scp->uc_sigmask, NULL);
+ #else
+ 	sigsetmask(scp->sc_mask);
+ #endif
  	LWP_DispatchProcess();
  	PRE_EndCritical();
  	}
***************
*** 53,59 ****
--- 65,75 ----
      struct timeval *slice;
      {
      struct itimerval itv;
+ #if HAVE_SIGACTION && defined(SA_SIGINFO)
      struct sigaction action;
+ #else
+     struct sigvec vec;
+ #endif
  
      if (lwp_cpptr == 0) return (LWP_EINIT);
      
***************
*** 67,72 ****
--- 83,89 ----
  	itv.it_interval = itv.it_value = *slice;
  	}
  
+ #if HAVE_SIGACTION && defined(SA_SIGINFO)
      memset((char *)&action, 0, sizeof(action));
      action.sa_sigaction = AlarmHandler;
      action.sa_flags = SA_SIGINFO;
***************
*** 74,98 ****
--- 91,138 ----
      if ((sigaction(SIGALRM, &action, (struct sigaction *)0) == -1) ||
  	(setitimer(ITIMER_REAL, &itv, (struct itimerval *) 0) == -1))
  	return(LWP_ESYSTEM);
+ #else
+     memset((char *)&vec, 0, sizeof(vec));
+     vec.sv_handler = AlarmHandler;
+     vec.sv_mask = vec.sv_onstack = 0;
  
+     if ((sigvec(SIGALRM, &vec, (struct sigvec *)0) == -1) ||
+ 	(setitimer(ITIMER_REAL, &itv, (struct itimerval *) 0) == -1))
+ 	return(LWP_ESYSTEM);
+ #endif
+ 
      return(LWP_SUCCESS);
      }
  
  int PRE_EndPreempt()
      {
      struct itimerval itv;
+ #if HAVE_SIGACTION && defined(SA_SIGINFO)
      struct sigaction action;
+ #else
+     struct sigvec vec;
+ #endif
  
      if (lwp_cpptr == 0) return (LWP_EINIT);
      
      itv.it_value.tv_sec = itv.it_value.tv_usec = 0;
  
+ #if HAVE_SIGACTION && defined(SA_SIGINFO)
      memset((char *)&action, 0, sizeof(action));
      action.sa_handler = SIG_DFL;
  
      if ((setitimer(ITIMER_REAL, &itv, (struct itimerval *) 0) == -1) ||
  	(sigaction(SIGALRM, &action, (struct sigaction *)0) == -1))
  	return(LWP_ESYSTEM);
+ #else
+     memset((char *)&vec, 0, sizeof(vec));
+     vec.sv_handler = SIG_DFL;
+     vec.sv_mask = vec.sv_onstack = 0;
+ 
+     if ((setitimer(ITIMER_REAL, &itv, (struct itimerval *) 0) == -1) ||
+ 	(sigvec(SIGALRM, &vec, (struct sigvec *)0) == -1))
+ 	return(LWP_ESYSTEM);
+ #endif
  
      return(LWP_SUCCESS);
      }
Index: openafs/src/lwp/process.c
diff -c openafs/src/lwp/process.c:1.12 openafs/src/lwp/process.c:1.12.2.1
*** openafs/src/lwp/process.c:1.12	Mon Aug  6 20:05:03 2001
--- openafs/src/lwp/process.c	Mon Aug 26 00:34:10 2002
***************
*** 12,18 ****
  #include <afsconfig.h>
  #include <afs/param.h>
  
! RCSID("$Header: /data/cvs/openafs/src/lwp/process.c,v 1.12 2001/08/07 00:05:03 shadow Exp $");
  
  #include <stdio.h>
  #include <assert.h>
--- 12,18 ----
  #include <afsconfig.h>
  #include <afs/param.h>
  
! RCSID("$Header: /data/cvs/openafs/src/lwp/process.c,v 1.12.2.1 2002/08/26 04:34:10 shadow Exp $");
  
  #include <stdio.h>
  #include <assert.h>
***************
*** 27,33 ****
  extern char PRE_Block;             /* used in lwp.c and process.s */
  #endif
  
! #ifdef HAVE_UCONTEXT_H
  
  afs_int32
  savecontext(ep, savearea, newsp)
--- 27,33 ----
  extern char PRE_Block;             /* used in lwp.c and process.s */
  #endif
  
! #if defined(USE_UCONTEXT) && defined(HAVE_UCONTEXT_H)
  
  afs_int32
  savecontext(ep, savearea, newsp)
Index: openafs/src/pam/Makefile.in
diff -c openafs/src/pam/Makefile.in:1.5.2.2 openafs/src/pam/Makefile.in:1.5.2.3
*** openafs/src/pam/Makefile.in:1.5.2.2	Tue Jun 11 20:16:52 2002
--- openafs/src/pam/Makefile.in	Tue Sep 10 01:03:42 2002
***************
*** 35,41 ****
            ${TOP_LIBDIR}/libcmd.a ${TOP_LIBDIR}/libcom_err.a \
  	  ${TOP_LIBDIR}/util.a
  
! LDFLAGS = ${SHARE_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 \
--- 35,41 ----
            ${TOP_LIBDIR}/libcmd.a ${TOP_LIBDIR}/libcom_err.a \
  	  ${TOP_LIBDIR}/util.a
  
! 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: openafs/src/pam/pam_afs.5
diff -c /dev/null openafs/src/pam/pam_afs.5:1.1.4.1
*** /dev/null	Thu Sep 26 01:24:51 2002
--- openafs/src/pam/pam_afs.5	Tue Aug  6 14:58:56 2002
***************
*** 0 ****
--- 1,158 ----
+ .TH pam_afs 5 "5 August 2002"
+ 
+ .SH NAME
+ pam_afs, pam_afs.so \- pluggable authentication modules for OpenAFS
+ 
+ .SH SYNOPSIS
+ .B pam_afs.so.1, pam_afs.krb.so.1
+ 
+ .SH DESCRIPTION
+ The OpenAFS pluggable authentication module provides module support
+ for authentication, session management, and password management, which
+ coorespond to the auth, session, and  password directives in a PAM 
+ configuration file, respectively.
+ 
+ The
+ .B pam_afs.krb.so
+ module additionally keeps users' Kerberos 4 TGT available for users
+ to use in other applications.  The 
+ .B pam_afs.so
+ module does not do this.
+ 
+ The
+ .B pam_afs.krb.so
+ module has nothing to do with Kerberos 5 authentication.  Users
+ with a Kerberos 5 integrated AFS environment should not use
+ either of these modules, but instead use
+ .B pam_krb5.so
+ directly.
+ 
+ .SH OPTIONS
+ The following arguments are supported.  In parenthesis next to
+ each option are the environments in which it works.
+ 
+ .IP "cell cell_name"
+ (auth) Specify a 
+ .I cell_name 
+ to authenticate to other than the local cell.
+ .IP debug
+ (all) Provide extra debugging information to syslog.
+ .IP dont_fork
+ (auth) Do not use a fork() when authenticating.  Forking is a good idea,
+ because sockets and memory used by the authentication function get
+ cleaned up automatically.  This option should only be used if a
+ PAM application fails when a fork() is issued.  This option cannot 
+ be used with 
+ .B use_klog.
+ .IP ignore_root
+ (auth, password) If user root is authenticating, simply return PAM_SUCCESS without
+ any AFS authentication attempt.  Presumably, authentication would fall through
+ to a secondary mechanism.
+ .IP "ignore_uid uid"
+ (auth) Similar to ignore_root but it allows you to specify a 
+ .I uid
+ such that any user authenticating with uid less than or equal to
+ .I uid
+ will not have AFS authentication performed.
+ .IP no_unlog
+ (session) Does not destroy a token during logout.  This is useful if
+ users have background jobs still running under their PAG that
+ need access to AFS after they log out.
+ .IP nowarn
+ (auth, password) Prevents warning from being written to syslog.
+ .IP refresh_token
+ (auth) Obtains a token without first obtaining a PAG.  This is useful for
+ screensavers to update the lifetime of a user's token.
+ .IP remain
+ (session) Causes AFS tokens to remain for 5 minutes after logout.
+ .IP "remainlifetime lifetime"
+ (session) Specify, in seconds, how long tokens should remain after
+ logout.
+ .IP set_token
+ (auth) If set_token is specified, the token obtained in the authentication
+ phase is not destroyed.  Ordinarily, tokens are obtained in the
+ setcred() phase of authentication.  For PAM applications which do not
+ call setcred(), the
+ .B set_token
+ directive should be used.
+ .IP setenv_password_expires
+ (auth) Sets the PASSWORD_EXPIRES environment variable to the time when your
+ AFS token will expire.
+ .IP try_first_pass
+ (auth, password) This will first try a password entered to a previous module and if it
+ fails, prompt for the user's AFS password.
+ If
+ .B pam_afs.so
+ is the first module called, it will generate a failed login attempt
+ with a NULL password for every user logging in.
+ .IP use_first_pass
+ (auth, password) This option is similar to
+ .B try_first_pass
+ except that it will not prompt for the user's AFS password if the first
+ password fails.  If this option is specified and 
+ .B pam_afs.so
+ is the first module listed in the PAM configuration, authentication
+ will fail.
+ .IP use_klog
+ (auth) This directs
+ .B pam_afs.so
+ to exec klog for authentication instead of calling the authentication
+ functions in the AFS libraries directly.
+ 
+ .SH FILES
+ .I /etc/pam.conf
+ .RS
+ This is the PAM configuration file on Solaris systems.
+ .RE
+ 
+ .I /etc/pam.d/*
+ .RS
+ These are the PAM configuration files on Linux systems.
+ .RE
+ 
+ .I /etc/pam.d/system-auth
+ .RS
+ This file controls all system authentication on many
+ Linux distributions.
+ .RE
+ .SH EXAMPLE
+ 
+ Standard 
+ .I auth
+ settings for
+ .I /etc/pam.d/system-auth
+ on Linux using OpenAFS:
+ .RS
+ auth required /lib/security/pam_env.so
+ .br
+ auth sufficient /lib/security/pam_afs.so.1 \\
+ .br
+      setenv_password_expires ignore_root
+ .br
+ auth sufficient /lib/security/pam_unix.so likeauth \\
+ .br
+      nullok try_first_pass
+ .br
+ auth required /lib/security/pam_deny.so
+ .RE
+ 
+ Suggested settings for
+ .I auth
+ in
+ .I /etc/pam.d/xscreensaver
+ .RS
+ auth sufficient /lib/security/pam_afs.so.1 \\
+ .br
+      refresh_token ignore_root
+ .br
+ auth required /lib/security/pam_stack.so \\
+ .br
+      service=system-auth
+ .RE
+ 
+ .SH AUTHOR
+ Charles Clancy <tcc@xauth.net>
+ .SH "SEE ALSO"
+ .BR klog (1),
+ .BR klog.krb (1),
+ .BR pagsh (1)
Index: openafs/src/pinstall/install.c
diff -c openafs/src/pinstall/install.c:1.9.2.2 openafs/src/pinstall/install.c:1.9.2.4
*** openafs/src/pinstall/install.c:1.9.2.2	Sat Oct 13 00:21:46 2001
--- openafs/src/pinstall/install.c	Wed Aug 21 16:53:27 2002
***************
*** 49,55 ****
  #include <afsconfig.h>
  #include <afs/param.h>
  
! RCSID("$Header: /data/cvs/openafs/src/pinstall/install.c,v 1.9.2.2 2001/10/13 04:21:46 shadow Exp $");
  
  #include <stdio.h>
  #include <pwd.h>
--- 49,55 ----
  #include <afsconfig.h>
  #include <afs/param.h>
  
! RCSID("$Header: /data/cvs/openafs/src/pinstall/install.c,v 1.9.2.4 2002/08/21 20:53:27 shadow Exp $");
  
  #include <stdio.h>
  #include <pwd.h>
***************
*** 86,92 ****
--- 86,94 ----
  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,485 ****
  #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;
--- 478,485 ----
Index: openafs/src/ptserver/ptprocs.c
diff -c openafs/src/ptserver/ptprocs.c:1.7.2.4 openafs/src/ptserver/ptprocs.c:1.7.2.6
*** openafs/src/ptserver/ptprocs.c:1.7.2.4	Sun Apr 21 00:01:51 2002
--- openafs/src/ptserver/ptprocs.c	Wed Sep 11 03:20:23 2002
***************
*** 10,16 ****
  #include <afsconfig.h>
  #include <afs/param.h>
  
! RCSID("$Header: /data/cvs/openafs/src/ptserver/ptprocs.c,v 1.7.2.4 2002/04/21 04:01:51 zacheiss Exp $");
  
  #include <afs/stds.h>
  #include <ctype.h>
--- 10,16 ----
  #include <afsconfig.h>
  #include <afs/param.h>
  
! RCSID("$Header: /data/cvs/openafs/src/ptserver/ptprocs.c,v 1.7.2.6 2002/09/11 07:20:23 shadow Exp $");
  
  #include <afs/stds.h>
  #include <ctype.h>
***************
*** 360,366 ****
      code = pr_ReadEntry(tt, 0, apos, aentry);
      if (code) ABORT_WITH(tt,code);
  
!     if (!AccessOK (tt, cid, aentry, PRP_STATUS_MEM, PRP_STATUS_ANY))
          ABORT_WITH(tt,PRPERM);
  
      /* Since prdebugentry is in the form of a prentry not a coentry, we will
--- 360,366 ----
      code = pr_ReadEntry(tt, 0, apos, aentry);
      if (code) ABORT_WITH(tt,code);
  
!     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,530 ****
  
      /* leave this first for rpc stub */
      size = aid->idlist_len;
!     if (size <= 0) size = 0;
      aname->namelist_val = (prname *)malloc(size*PR_MAXNAMELEN);
      aname->namelist_len = 0;
      if (aname->namelist_val == 0) return PRNOMEM;
--- 524,531 ----
  
      /* leave this first for rpc stub */
      size = aid->idlist_len;
!     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: openafs/src/ptserver/testpt.c
diff -c openafs/src/ptserver/testpt.c:1.6.2.2 openafs/src/ptserver/testpt.c:1.6.2.3
*** openafs/src/ptserver/testpt.c:1.6.2.2	Sat Oct 13 00:21:48 2001
--- openafs/src/ptserver/testpt.c	Tue Sep 10 18:33:53 2002
***************
*** 10,16 ****
  #include <afsconfig.h>
  #include <afs/param.h>
  
! RCSID("$Header: /data/cvs/openafs/src/ptserver/testpt.c,v 1.6.2.2 2001/10/13 04:21:48 shadow Exp $");
  
  #include <ctype.h>
  #include <errno.h>
--- 10,16 ----
  #include <afsconfig.h>
  #include <afs/param.h>
  
! RCSID("$Header: /data/cvs/openafs/src/ptserver/testpt.c,v 1.6.2.3 2002/09/10 22:33:53 zacheiss Exp $");
  
  #include <ctype.h>
  #include <errno.h>
***************
*** 917,922 ****
--- 917,925 ----
  	    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: openafs/src/rx/rx.c
diff -c openafs/src/rx/rx.c:1.22.2.7 openafs/src/rx/rx.c:1.22.2.13
*** openafs/src/rx/rx.c:1.22.2.7	Tue Jan 29 14:52:14 2002
--- openafs/src/rx/rx.c	Tue Sep 10 18:33:54 2002
***************
*** 16,22 ****
  #include <afs/param.h>
  #endif
  
! RCSID("$Header: /data/cvs/openafs/src/rx/rx.c,v 1.22.2.7 2002/01/29 19:52:14 shadow Exp $");
  
  #ifdef KERNEL
  #include "../afs/sysincludes.h"
--- 16,22 ----
  #include <afs/param.h>
  #endif
  
! RCSID("$Header: /data/cvs/openafs/src/rx/rx.c,v 1.22.2.13 2002/09/10 22:33:54 zacheiss Exp $");
  
  #ifdef KERNEL
  #include "../afs/sysincludes.h"
***************
*** 263,285 ****
  struct rx_connection *rxLastConn = 0; 
  
  #ifdef RX_ENABLE_LOCKS
! /* The locking hierarchy for rx fine grain locking is composed of five
   * tiers:
   * conn_call_lock - used to synchonize rx_EndCall and rx_NewCall
   * call->lock - locks call data fields.
!  * Most any other lock - these are all independent of each other.....
!  *	rx_freePktQ_lock
   *	rx_freeCallQueue_lock
-  *	freeSQEList_lock
-  *	rx_connHashTable_lock
-  *	rx_serverPool_lock
   *	rxi_keyCreate_lock
   * rx_peerHashTable_lock - locked under rx_connHashTable_lock
! 
   * lowest level:
!  *	peer_lock - locks peer data fields.
!  *	conn_data_lock - that more than one thread is not updating a conn data
!  *		field at the same time.
   * Do we need a lock to protect the peer field in the conn structure?
   *      conn->peer was previously a constant for all intents and so has no
   *      lock protecting this field. The multihomed client delta introduced
--- 263,293 ----
  struct rx_connection *rxLastConn = 0; 
  
  #ifdef RX_ENABLE_LOCKS
! /* The locking hierarchy for rx fine grain locking is composed of these
   * tiers:
+  *
+  * rx_connHashTable_lock - synchronizes conn creation, rx_connHashTable access
   * conn_call_lock - used to synchonize rx_EndCall and rx_NewCall
   * call->lock - locks call data fields.
!  * These are independent of each other:
   *	rx_freeCallQueue_lock
   *	rxi_keyCreate_lock
+  * rx_serverPool_lock
+  * freeSQEList_lock
+  *
+  * serverQueueEntry->lock
+  * rx_rpc_stats
   * rx_peerHashTable_lock - locked under rx_connHashTable_lock
!  * peer->lock - locks peer data fields.
!  * conn_data_lock - that more than one thread is not updating a conn data
!  *		    field at the same time.
!  * rx_freePktQ_lock
!  *
   * lowest level:
!  *	multi_handle->lock
!  *	rxevent_lock
!  *	rx_stats_mutex
!  *
   * Do we need a lock to protect the peer field in the conn structure?
   *      conn->peer was previously a constant for all intents and so has no
   *      lock protecting this field. The multihomed client delta introduced
***************
*** 404,412 ****
  #ifdef RX_LOCKS_DB
      rxdb_init();
  #endif /* RX_LOCKS_DB */
!     MUTEX_INIT(&rx_stats_mutex, "rx_stats_mutex",MUTEX_DEFAULT,0);    
!     MUTEX_INIT(&rx_rpc_stats, "rx_rpc_stats",MUTEX_DEFAULT,0);    
!     MUTEX_INIT(&rx_freePktQ_lock, "rx_freePktQ_lock",MUTEX_DEFAULT,0);    
      MUTEX_INIT(&freeSQEList_lock, "freeSQEList lock",MUTEX_DEFAULT,0);
      MUTEX_INIT(&rx_freeCallQueue_lock, "rx_freeCallQueue_lock",
  	       MUTEX_DEFAULT,0);
--- 412,420 ----
  #ifdef RX_LOCKS_DB
      rxdb_init();
  #endif /* RX_LOCKS_DB */
!     MUTEX_INIT(&rx_stats_mutex, "rx_stats_mutex",MUTEX_DEFAULT,0);
!     MUTEX_INIT(&rx_rpc_stats, "rx_rpc_stats",MUTEX_DEFAULT,0);
!     MUTEX_INIT(&rx_freePktQ_lock, "rx_freePktQ_lock",MUTEX_DEFAULT,0);
      MUTEX_INIT(&freeSQEList_lock, "freeSQEList lock",MUTEX_DEFAULT,0);
      MUTEX_INIT(&rx_freeCallQueue_lock, "rx_freeCallQueue_lock",
  	       MUTEX_DEFAULT,0);
***************
*** 957,965 ****
  
      /* Make sure the connection is completely reset before deleting it. */
      /* get rid of pending events that could zap us later */
!     if (conn->challengeEvent) {
  	rxevent_Cancel(conn->challengeEvent, (struct rx_call*)0, 0);
!     }
   
      /* Add the connection to the list of destroyed connections that
       * need to be cleaned up. This is necessary to avoid deadlocks
--- 965,974 ----
  
      /* Make sure the connection is completely reset before deleting it. */
      /* get rid of pending events that could zap us later */
!     if (conn->challengeEvent)
  	rxevent_Cancel(conn->challengeEvent, (struct rx_call*)0, 0);
!     if (conn->checkReachEvent)
! 	rxevent_Cancel(conn->checkReachEvent, (struct rx_call*)0, 0);
   
      /* Add the connection to the list of destroyed connections that
       * need to be cleaned up. This is necessary to avoid deadlocks
***************
*** 1247,1252 ****
--- 1256,1262 ----
  	    service->idleDeadTime = 60;
  	    service->connDeadTime = rx_connDeadTime;
  	    service->executeRequestProc = serviceProc;
+ 	    service->checkReach = 0;
  	    rx_services[i] = service;	/* not visible until now */
  	    AFS_RXGUNLOCK();
  	    USERPRI;
***************
*** 1423,1429 ****
      } else {    /* otherwise allocate a new one and return that */
  	MUTEX_EXIT(&freeSQEList_lock);
  	sq = (struct rx_serverQueueEntry *) rxi_Alloc(sizeof(struct rx_serverQueueEntry));
! 	MUTEX_INIT(&sq->lock, "server Queue lock",MUTEX_DEFAULT,0);	
  	CV_INIT(&sq->cv, "server Queue lock", CV_DEFAULT, 0);
      }
  
--- 1433,1439 ----
      } else {    /* otherwise allocate a new one and return that */
  	MUTEX_EXIT(&freeSQEList_lock);
  	sq = (struct rx_serverQueueEntry *) rxi_Alloc(sizeof(struct rx_serverQueueEntry));
! 	MUTEX_INIT(&sq->lock, "server Queue lock",MUTEX_DEFAULT,0);
  	CV_INIT(&sq->cv, "server Queue lock", CV_DEFAULT, 0);
      }
  
***************
*** 1581,1587 ****
      } else {    /* otherwise allocate a new one and return that */
  	MUTEX_EXIT(&freeSQEList_lock);
  	sq = (struct rx_serverQueueEntry *) rxi_Alloc(sizeof(struct rx_serverQueueEntry));
! 	MUTEX_INIT(&sq->lock, "server Queue lock",MUTEX_DEFAULT,0);	
  	CV_INIT(&sq->cv, "server Queue lock", CV_DEFAULT, 0);
      }
      MUTEX_ENTER(&sq->lock);
--- 1591,1597 ----
      } else {    /* otherwise allocate a new one and return that */
  	MUTEX_EXIT(&freeSQEList_lock);
  	sq = (struct rx_serverQueueEntry *) rxi_Alloc(sizeof(struct rx_serverQueueEntry));
! 	MUTEX_INIT(&sq->lock, "server Queue lock",MUTEX_DEFAULT,0);
  	CV_INIT(&sq->cv, "server Queue lock", CV_DEFAULT, 0);
      }
      MUTEX_ENTER(&sq->lock);
***************
*** 2408,2416 ****
  	addr.sin_family = AF_INET;
  	addr.sin_port = port;
  	addr.sin_addr.s_addr = host;
! #if  defined(AFS_OSF_ENV) && defined(_KERNEL)
          addr.sin_len = sizeof(addr);
! #endif  /* AFS_OSF_ENV */
  	drop = (*rx_justReceived) (np, &addr);
  	/* drop packet if return value is non-zero */
  	if (drop) return np;
--- 2418,2426 ----
  	addr.sin_family = AF_INET;
  	addr.sin_port = port;
  	addr.sin_addr.s_addr = host;
! #ifdef STRUCT_SOCKADDR_HAS_SA_LEN 
          addr.sin_len = sizeof(addr);
! #endif  /* STRUCT_SOCKADDR_HAS_SA_LEN */
  	drop = (*rx_justReceived) (np, &addr);
  	/* drop packet if return value is non-zero */
  	if (drop) return np;
***************
*** 2438,2444 ****
  
      MUTEX_ENTER(&conn->conn_data_lock);
      if (conn->maxSerial < np->header.serial)
!       conn->maxSerial = np->header.serial;
      MUTEX_EXIT(&conn->conn_data_lock);
  
      /* If the connection is in an error state, send an abort packet and ignore
--- 2448,2454 ----
  
      MUTEX_ENTER(&conn->conn_data_lock);
      if (conn->maxSerial < np->header.serial)
! 	conn->maxSerial = np->header.serial;
      MUTEX_EXIT(&conn->conn_data_lock);
  
      /* If the connection is in an error state, send an abort packet and ignore
***************
*** 2555,2561 ****
--- 2565,2573 ----
  	    return np;
  	}
  	if (!call) {
+ 	    MUTEX_ENTER(&conn->conn_call_lock);
  	    call = rxi_NewCall(conn, channel);
+ 	    MUTEX_EXIT(&conn->conn_call_lock);
  	    *call->callNumber = np->header.callNumber;
  	    call->state = RX_STATE_PRECALL;
  	    clock_GetTime(&call->queueTime);
***************
*** 2865,2884 ****
  }
  #endif /* KERNEL */
  
  /* try to attach call, if authentication is complete */
! static void TryAttach(acall, socket, tnop, newcallp)
! register struct rx_call *acall;
! register osi_socket socket;
! register int *tnop;
! register struct rx_call **newcallp; {
!     register struct rx_connection *conn;
!     conn = acall->conn;
!     if ((conn->type==RX_SERVER_CONNECTION) && (acall->state == RX_STATE_PRECALL)) {
  	/* Don't attach until we have any req'd. authentication. */
  	if (RXS_CheckAuthentication(conn->securityObject, conn) == 0) {
! 	    rxi_AttachServerProc(acall, socket, tnop, newcallp);
! 	    /* Note:  this does not necessarily succeed; there
! 	       may not any proc available */
  	}
  	else {
  	    rxi_ChallengeOn(acall->conn);
--- 2877,2986 ----
  }
  #endif /* KERNEL */
  
+ static void rxi_CheckReachEvent(event, conn, acall)
+     struct rxevent *event;
+     struct rx_connection *conn;
+     struct rx_call *acall;
+ {
+     struct rx_call *call = acall;
+     struct clock when;
+     int i, waiting;
+ 
+     MUTEX_ENTER(&conn->conn_data_lock);
+     conn->checkReachEvent = (struct rxevent *) 0;
+     waiting = conn->flags & RX_CONN_ATTACHWAIT;
+     if (event) conn->refCount--;
+     MUTEX_EXIT(&conn->conn_data_lock);
+ 
+     if (waiting) {
+ 	if (!call) {
+ 	    MUTEX_ENTER(&conn->conn_call_lock);
+ 	    MUTEX_ENTER(&conn->conn_data_lock);
+ 	    for (i=0; i<RX_MAXCALLS; i++) {
+ 		struct rx_call *tc = conn->call[i];
+ 		if (tc && tc->state == RX_STATE_PRECALL) {
+ 		    call = tc;
+ 		    break;
+ 		}
+ 	    }
+ 	    if (!call)
+ 		/* Indicate that rxi_CheckReachEvent is no longer running by
+ 		 * clearing the flag.  Must be atomic under conn_data_lock to
+ 		 * avoid a new call slipping by: rxi_CheckConnReach holds
+ 		 * conn_data_lock while checking RX_CONN_ATTACHWAIT.
+ 		 */
+ 		conn->flags &= ~RX_CONN_ATTACHWAIT;
+ 	    MUTEX_EXIT(&conn->conn_data_lock);
+ 	    MUTEX_EXIT(&conn->conn_call_lock);
+ 	}
+ 
+ 	if (call) {
+ 	    if (call != acall) MUTEX_ENTER(&call->lock);
+ 	    rxi_SendAck(call, NULL, 0, 0, 0, RX_ACK_PING, 0);
+ 	    if (call != acall) MUTEX_EXIT(&call->lock);
+ 
+ 	    clock_GetTime(&when);
+ 	    when.sec += RX_CHECKREACH_TIMEOUT;
+ 	    MUTEX_ENTER(&conn->conn_data_lock);
+ 	    if (!conn->checkReachEvent) {
+ 		conn->refCount++;
+ 		conn->checkReachEvent =
+ 		    rxevent_Post(&when, rxi_CheckReachEvent, conn, NULL);
+ 	    }
+ 	    MUTEX_EXIT(&conn->conn_data_lock);
+ 	}
+     }
+ }
+ 
+ static int rxi_CheckConnReach(conn, call)
+     struct rx_connection *conn;
+     struct rx_call *call;
+ {
+     struct rx_service *service = conn->service;
+     struct rx_peer *peer = conn->peer;
+     afs_uint32 now, lastReach;
+ 
+     if (service->checkReach == 0)
+ 	return 0;
+ 
+     now = clock_Sec();
+     MUTEX_ENTER(&peer->peer_lock);
+     lastReach = peer->lastReachTime;
+     MUTEX_EXIT(&peer->peer_lock);
+     if (now - lastReach < RX_CHECKREACH_TTL)
+ 	return 0;
+ 
+     MUTEX_ENTER(&conn->conn_data_lock);
+     if (conn->flags & RX_CONN_ATTACHWAIT) {
+ 	MUTEX_EXIT(&conn->conn_data_lock);
+ 	return 1;
+     }
+     conn->flags |= RX_CONN_ATTACHWAIT;
+     MUTEX_EXIT(&conn->conn_data_lock);
+     if (!conn->checkReachEvent)
+ 	rxi_CheckReachEvent((struct rxevent *)0, conn, call);
+ 
+     return 1;
+ }
+ 
  /* try to attach call, if authentication is complete */
! static void TryAttach(acall, socket, tnop, newcallp, reachOverride)
!     register struct rx_call *acall;
!     register osi_socket socket;
!     register int *tnop;
!     register struct rx_call **newcallp;
!     int reachOverride;
! {
!     struct rx_connection *conn = acall->conn;
! 
!     if (conn->type==RX_SERVER_CONNECTION && acall->state==RX_STATE_PRECALL) {
  	/* Don't attach until we have any req'd. authentication. */
  	if (RXS_CheckAuthentication(conn->securityObject, conn) == 0) {
! 	    if (reachOverride || rxi_CheckConnReach(conn, acall) == 0)
! 		rxi_AttachServerProc(acall, socket, tnop, newcallp);
! 		/* Note:  this does not necessarily succeed; there
! 		 * may not any proc available
! 		 */
  	}
  	else {
  	    rxi_ChallengeOn(acall->conn);
***************
*** 3053,3059 ****
  	     * server thread is available, this thread becomes a server
  	     * thread and the server thread becomes a listener thread. */
  	    if (isFirst) {
! 		TryAttach(call, socket, tnop, newcallp);
  	    }
  	}	
  	/* This is not the expected next packet. */
--- 3155,3161 ----
  	     * server thread is available, this thread becomes a server
  	     * thread and the server thread becomes a listener thread. */
  	    if (isFirst) {
! 		TryAttach(call, socket, tnop, newcallp, 0);
  	    }
  	}	
  	/* This is not the expected next packet. */
***************
*** 3241,3246 ****
--- 3343,3377 ----
  static void rxi_ComputeRate();
  #endif
  
+ static void rxi_UpdatePeerReach(conn, acall)
+     struct rx_connection *conn;
+     struct rx_call *acall;
+ {
+     struct rx_peer *peer = conn->peer;
+ 
+     MUTEX_ENTER(&peer->peer_lock);
+     peer->lastReachTime = clock_Sec();
+     MUTEX_EXIT(&peer->peer_lock);
+ 
+     MUTEX_ENTER(&conn->conn_data_lock);
+     if (conn->flags & RX_CONN_ATTACHWAIT) {
+ 	int i;
+ 
+ 	conn->flags &= ~RX_CONN_ATTACHWAIT;
+ 	MUTEX_EXIT(&conn->conn_data_lock);
+ 
+ 	for (i=0; i<RX_MAXCALLS; i++) {
+ 	    struct rx_call *call = conn->call[i];
+ 	    if (call) {
+ 		if (call != acall) MUTEX_ENTER(&call->lock);
+ 		TryAttach(call, -1, NULL, NULL, 1);
+ 		if (call != acall) MUTEX_EXIT(&call->lock);
+ 	    }
+ 	}
+     } else
+ 	MUTEX_EXIT(&conn->conn_data_lock);
+ }
+ 
  /* The real smarts of the whole thing.  */
  struct rx_packet *rxi_ReceiveAckPacket(call, np, istack)
      register struct rx_call *call;
***************
*** 3288,3293 ****
--- 3419,3427 ----
      if (np->header.flags & RX_SLOW_START_OK) {
  	call->flags |= RX_CALL_SLOW_START_OK;
      }
+ 
+     if (ap->reason == RX_ACK_PING_RESPONSE)
+ 	rxi_UpdatePeerReach(conn, call);
      
  #ifdef RXDEBUG
      if (rx_Log) {
***************
*** 3743,3750 ****
      }
      else {
  	/* If the response is valid, any calls waiting to attach
!          * servers can now do so */
  	int i;
  	for (i=0; i<RX_MAXCALLS; i++) {
  	    struct rx_call *call = conn->call[i];
  	    if (call) {
--- 3877,3885 ----
      }
      else {
  	/* If the response is valid, any calls waiting to attach
! 	 * servers can now do so */
  	int i;
+ 
  	for (i=0; i<RX_MAXCALLS; i++) {
  	    struct rx_call *call = conn->call[i];
  	    if (call) {
***************
*** 3754,3759 ****
--- 3889,3900 ----
  		MUTEX_EXIT(&call->lock);
  	    }
  	}
+ 
+ 	/* Update the peer reachability information, just in case
+ 	 * some calls went into attach-wait while we were waiting
+ 	 * for authentication..
+ 	 */
+ 	rxi_UpdatePeerReach(conn, NULL);
      }
      return np;
  }
***************
*** 3804,3813 ****
   * call so it eventually gets one */
  void 
  rxi_AttachServerProc(call, socket, tnop, newcallp)
! register struct rx_call *call;
! register osi_socket socket;
! register int *tnop;
! register struct rx_call **newcallp;
  {
      register struct rx_serverQueueEntry *sq;
      register struct rx_service *service = call->conn->service;
--- 3945,3954 ----
   * call so it eventually gets one */
  void 
  rxi_AttachServerProc(call, socket, tnop, newcallp)
!     register struct rx_call *call;
!     register osi_socket socket;
!     register int *tnop;
!     register struct rx_call **newcallp;
  {
      register struct rx_serverQueueEntry *sq;
      register struct rx_service *service = call->conn->service;
***************
*** 4159,4166 ****
--- 4300,4315 ----
  {
      if (error) {
  	register int i;
+ 	MUTEX_ENTER(&conn->conn_data_lock);
  	if (conn->challengeEvent)
  	    rxevent_Cancel(conn->challengeEvent, (struct rx_call*)0, 0);
+ 	if (conn->checkReachEvent) {
+ 	    rxevent_Cancel(conn->checkReachEvent, (struct rx_call*)0, 0);
+ 	    conn->checkReachEvent = 0;
+ 	    conn->flags &= ~RX_CONN_ATTACHWAIT;
+ 	    conn->refCount--;
+ 	}
+ 	MUTEX_EXIT(&conn->conn_data_lock);
  	for (i=0; i<RX_MAXCALLS; i++) {
  	    struct rx_call *call = conn->call[i];
  	    if (call) {
***************
*** 6032,6037 ****
--- 6181,6189 ----
      taddr.sin_family = AF_INET;
      taddr.sin_port = remotePort;
      taddr.sin_addr.s_addr = remoteAddr;
+ #ifdef STRUCT_SOCKADDR_HAS_SA_LEN
+     taddr.sin_len = sizeof(struct sockaddr_in);
+ #endif
      while(1) {
  	memset(&theader, 0, sizeof(theader));
  	theader.epoch = htonl(999);
Index: openafs/src/rx/rx.h
diff -c openafs/src/rx/rx.h:1.7.2.5 openafs/src/rx/rx.h:1.7.2.7
*** openafs/src/rx/rx.h:1.7.2.5	Fri Jan 25 22:41:45 2002
--- openafs/src/rx/rx.h	Wed Aug 21 21:47:45 2002
***************
*** 204,209 ****
--- 204,212 ----
  /* 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,351 ****
--- 349,355 ----
      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,457 ****
--- 456,462 ----
      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,491 ****
--- 491,497 ----
           /* 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,524 ****
--- 525,531 ----
  #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,745 ****
--- 747,754 ----
  
  #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: openafs/src/rx/rx_kcommon.c
diff -c openafs/src/rx/rx_kcommon.c:1.9.2.7 openafs/src/rx/rx_kcommon.c:1.9.2.9
*** openafs/src/rx/rx_kcommon.c:1.9.2.7	Sat Jun  8 20:46:47 2002
--- openafs/src/rx/rx_kcommon.c	Tue Sep 10 18:33:55 2002
***************
*** 14,20 ****
  #include <afsconfig.h>
  #include "../afs/param.h"
  
! RCSID("$Header: /data/cvs/openafs/src/rx/rx_kcommon.c,v 1.9.2.7 2002/06/09 00:46:47 shadow Exp $");
  
  #include "../rx/rx_kcommon.h"
  
--- 14,20 ----
  #include <afsconfig.h>
  #include "../afs/param.h"
  
! RCSID("$Header: /data/cvs/openafs/src/rx/rx_kcommon.c,v 1.9.2.9 2002/09/10 22:33:55 zacheiss Exp $");
  
  #include "../rx/rx_kcommon.h"
  
***************
*** 368,374 ****
--- 368,378 ----
        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,651 ****
--- 649,673 ----
      }
     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,715 ****
--- 732,738 ----
   done:
    return (*pifad ?  (*pifad)->ia_ifp : NULL );
  }
+ #endif
  #endif /* else AFS_USERSPACE_IP_ADDR */
  #endif /* !SUN5 && !SGI62 */
  
***************
*** 766,771 ****
--- 789,797 ----
      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,798 ****
  	    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
--- 818,823 ----
***************
*** 1025,1031 ****
  #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)
      rxk_ListenerPid = current_proc()->p_pid;
  #endif
  #if defined(RX_ENABLE_LOCKS) && !defined(AFS_SUN5_ENV)
--- 1050,1059 ----
  #ifdef AFS_SUN5_ENV
      rxk_ListenerPid = ttoproc(curthread)->p_pidp->pid_id;
  #endif /* AFS_SUN5_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: openafs/src/rx/rx_kcommon.h
diff -c openafs/src/rx/rx_kcommon.h:1.4.4.3 openafs/src/rx/rx_kcommon.h:1.4.4.5
*** openafs/src/rx/rx_kcommon.h:1.4.4.3	Sat Jun  8 00:47:43 2002
--- openafs/src/rx/rx_kcommon.h	Tue Sep 10 18:33:55 2002
***************
*** 53,71 ****
  #ifdef AFS_SGI62_ENV
  #include "../h/hashing.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)
  #include "../netinet/in_pcb.h"
  #endif /* ! AFS_HPUX110_ENV && ! AFS_LINUX22_ENV */
  #ifndef AFS_LINUX22_ENV
  #include "../netinet/ip_var.h"
  #include "../netinet/ip_icmp.h"
  #endif /* AFS_LINUX22_ENV */
  #include "../netinet/udp.h"
! #if !defined(AFS_SGI62_ENV) && !defined(AFS_LINUX22_ENV)
  #include "../netinet/udp_var.h"
  #endif
  #if defined(AFS_HPUX102_ENV) || (defined(AFS_SGI62_ENV) && !defined(AFS_SGI64_ENV))
--- 53,76 ----
  #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) && !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) && !defined(AFS_DARWIN60_ENV)
  #include "../netinet/udp_var.h"
  #endif
  #if defined(AFS_HPUX102_ENV) || (defined(AFS_SGI62_ENV) && !defined(AFS_SGI64_ENV))
***************
*** 81,87 ****
  #include "../h/file.h"
  #endif
  #include "../net/if.h"
! #if !defined(AFS_HPUX110_ENV) && !defined(AFS_LINUX22_ENV)
  #include "../netinet/in_var.h"
  #endif /* ! AFS_HPUX110_ENV && ! AFS_LINUX22_ENV */
  #ifndef AFS_LINUX22_ENV
--- 86,92 ----
  #include "../h/file.h"
  #endif
  #include "../net/if.h"
! #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: openafs/src/rx/rx_packet.c
diff -c openafs/src/rx/rx_packet.c:1.14.2.3 openafs/src/rx/rx_packet.c:1.14.2.4
*** openafs/src/rx/rx_packet.c:1.14.2.3	Sun Jan 20 00:43:48 2002
--- openafs/src/rx/rx_packet.c	Tue Sep 10 18:33:55 2002
***************
*** 14,20 ****
  #include <afs/param.h>
  #endif
  
! RCSID("$Header: /data/cvs/openafs/src/rx/rx_packet.c,v 1.14.2.3 2002/01/20 05:43:48 shadow Exp $");
  
  #ifdef KERNEL
  #if defined(UKERNEL)
--- 14,20 ----
  #include <afs/param.h>
  #endif
  
! RCSID("$Header: /data/cvs/openafs/src/rx/rx_packet.c,v 1.14.2.4 2002/09/10 22:33:55 zacheiss Exp $");
  
  #ifdef KERNEL
  #if defined(UKERNEL)
***************
*** 33,38 ****
--- 33,44 ----
  #include "../afs/sysincludes.h"
  #endif
  #include "../h/socket.h"
+ #if !defined(AFS_SUN5_ENV) &&  !defined(AFS_LINUX20_ENV)
+ #if	!defined(AFS_OSF_ENV) && !defined(AFS_AIX41_ENV)
+ #include "../sys/mount.h"   /* it gets pulled in by something later anyway */
+ #endif
+ #include "../h/mbuf.h"
+ #endif
  #include "../netinet/in.h"
  #include "../afs/afs_osi.h"
  #include "../rx/rx_kmutex.h"
***************
*** 42,53 ****
  #include <sys/sysmacros.h>
  #endif
  #include "../rx/rx_packet.h"
- #if !defined(AFS_SUN5_ENV) &&  !defined(AFS_LINUX20_ENV)
- #if	!defined(AFS_OSF_ENV) && !defined(AFS_AIX41_ENV)
- #include "../sys/mount.h"   /* it gets pulled in by something later anyway */
- #endif
- #include "../h/mbuf.h"
- #endif
  #endif /* defined(UKERNEL) */
  #include "../rx/rx_globals.h"
  #else /* KERNEL */
--- 48,53 ----
***************
*** 1437,1443 ****
      taddr.sin_family = AF_INET;
      taddr.sin_port = aport;
      taddr.sin_addr.s_addr = ahost;
! 
  
      /* We need to trim the niovecs. */
      nbytes = apacket->length;
--- 1437,1445 ----
      taddr.sin_family = AF_INET;
      taddr.sin_port = aport;
      taddr.sin_addr.s_addr = ahost;
! #ifdef STRUCT_SOCKADDR_HAS_SA_LEN
!     taddr.sin_len = sizeof(struct sockaddr_in);
! #endif
  
      /* We need to trim the niovecs. */
      nbytes = apacket->length;
Index: openafs/src/rx/rx_pthread.h
diff -c openafs/src/rx/rx_pthread.h:1.2 openafs/src/rx/rx_pthread.h:1.2.8.1
*** openafs/src/rx/rx_pthread.h:1.2	Sat Nov  4 05:05:34 2000
--- openafs/src/rx/rx_pthread.h	Wed Aug 21 22:02:09 2002
***************
*** 57,64 ****
  #ifndef MUTEX_ISMINE
  /* Only used for debugging. */
  #ifdef AFS_SUN5_ENV
  #include <synch.h>
! #define MUTEX_ISMINE(l) MUTEX_HELD(l)
  #else /* AFS_SUN5_ENV */
  #define MUTEX_ISMINE(l) (1)
  #endif /* AFS_SUN5_ENV */
--- 57,65 ----
  #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((mutex_t *) l)
  #else /* AFS_SUN5_ENV */
  #define MUTEX_ISMINE(l) (1)
  #endif /* AFS_SUN5_ENV */
***************
*** 71,87 ****
  #ifdef MUTEX_INIT
  #undef MUTEX_INIT
  #endif
! #define MUTEX_INIT(a, b, c, d) pthread_mutex_init(a, NULL)
  
  #ifdef MUTEX_DESTROY
  #undef MUTEX_DESTROY
  #endif
! #define MUTEX_DESTROY(l) pthread_mutex_destroy(l)
  
  #ifdef MUTEX_ENTER
  #undef MUTEX_ENTER
  #endif
! #define MUTEX_ENTER(l) pthread_mutex_lock(l)
  
  #ifdef MUTEX_TRYENTER
  #undef MUTEX_TRYENTER
--- 72,88 ----
  #ifdef MUTEX_INIT
  #undef MUTEX_INIT
  #endif
! #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) osi_Assert(pthread_mutex_destroy(l) == 0)
  
  #ifdef MUTEX_ENTER
  #undef MUTEX_ENTER
  #endif
! #define MUTEX_ENTER(l) osi_Assert(pthread_mutex_lock(l) == 0)
  
  #ifdef MUTEX_TRYENTER
  #undef MUTEX_TRYENTER
***************
*** 91,97 ****
  #ifdef MUTEX_EXIT
  #undef MUTEX_EXIT
  #endif
! #define MUTEX_EXIT(l) pthread_mutex_unlock(l)
  
  #ifdef RXObtainWriteLock
  #undef RXObtainWriteLock
--- 92,98 ----
  #ifdef MUTEX_EXIT
  #undef MUTEX_EXIT
  #endif
! #define MUTEX_EXIT(l) osi_Assert(pthread_mutex_unlock(l) == 0)
  
  #ifdef RXObtainWriteLock
  #undef RXObtainWriteLock
***************
*** 106,132 ****
  #ifdef CV_INIT
  #undef CV_INIT
  #endif
! #define CV_INIT(cv, a, b, c) pthread_cond_init(cv, NULL)
  
  #ifdef CV_DESTROY
  #undef CV_DESTROY
  #endif
! #define CV_DESTROY(cv) pthread_cond_destroy(cv)
  
  #ifdef CV_WAIT
  #undef CV_WAIT
  #endif
! #define CV_WAIT(cv, l) pthread_cond_wait(cv, l)
  
  #ifdef CV_SIGNAL
  #undef CV_SIGNAL
  #endif
! #define CV_SIGNAL(cv) pthread_cond_signal(cv)
  
  #ifdef CV_BROADCAST
  #undef CV_BROADCAST
  #endif
! #define CV_BROADCAST(cv) pthread_cond_broadcast(cv)
  
  #endif /* AFS_PTHREAD_ENV */
  
--- 107,133 ----
  #ifdef CV_INIT
  #undef CV_INIT
  #endif
! #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) osi_Assert(pthread_cond_destroy(cv) == 0)
  
  #ifdef CV_WAIT
  #undef CV_WAIT
  #endif
! #define CV_WAIT(cv, l) osi_Assert(pthread_cond_wait(cv, l) == 0)
  
  #ifdef CV_SIGNAL
  #undef CV_SIGNAL
  #endif
! #define CV_SIGNAL(cv) osi_Assert(pthread_cond_signal(cv) == 0)
  
  #ifdef CV_BROADCAST
  #undef CV_BROADCAST
  #endif
! #define CV_BROADCAST(cv) osi_Assert(pthread_cond_broadcast(cv) == 0)
  
  #endif /* AFS_PTHREAD_ENV */
  
Index: openafs/src/rx/rx_user.c
diff -c openafs/src/rx/rx_user.c:1.11 openafs/src/rx/rx_user.c:1.11.2.1
*** openafs/src/rx/rx_user.c:1.11	Tue Aug  7 20:03:57 2001
--- openafs/src/rx/rx_user.c	Tue Sep 10 18:33:55 2002
***************
*** 12,18 ****
  #include <afsconfig.h>
  #include <afs/param.h>
  
! RCSID("$Header: /data/cvs/openafs/src/rx/rx_user.c,v 1.11 2001/08/08 00:03:57 shadow Exp $");
  
  # include <sys/types.h>
  # include <errno.h>
--- 12,18 ----
  #include <afsconfig.h>
  #include <afs/param.h>
  
! RCSID("$Header: /data/cvs/openafs/src/rx/rx_user.c,v 1.11.2.1 2002/09/10 22:33:55 zacheiss Exp $");
  
  # include <sys/types.h>
  # include <errno.h>
***************
*** 120,125 ****
--- 120,128 ----
      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: openafs/src/rx/rx_user.h
diff -c openafs/src/rx/rx_user.h:1.2 openafs/src/rx/rx_user.h:1.2.8.1
*** openafs/src/rx/rx_user.h:1.2	Sat Nov  4 05:05:35 2000
--- openafs/src/rx/rx_user.h	Wed Aug 21 15:25:00 2002
***************
*** 73,84 ****
  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 */
--- 73,78 ----
Index: openafs/src/rx/rxdebug.c
diff -c openafs/src/rx/rxdebug.c:1.10 openafs/src/rx/rxdebug.c:1.10.2.1
*** openafs/src/rx/rxdebug.c:1.10	Tue Aug  7 20:03:57 2001
--- openafs/src/rx/rxdebug.c	Tue Sep 10 18:33:55 2002
***************
*** 10,16 ****
  #include <afsconfig.h>
  #include <afs/param.h>
  
! RCSID("$Header: /data/cvs/openafs/src/rx/rxdebug.c,v 1.10 2001/08/08 00:03:57 shadow Exp $");
  
  #include <sys/types.h>
  #include <errno.h>
--- 10,16 ----
  #include <afsconfig.h>
  #include <afs/param.h>
  
! RCSID("$Header: /data/cvs/openafs/src/rx/rxdebug.c,v 1.10.2.1 2002/09/10 22:33:55 zacheiss Exp $");
  
  #include <sys/types.h>
  #include <errno.h>
***************
*** 207,212 ****
--- 207,215 ----
      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: openafs/src/rx/DARWIN/rx_kmutex.h
diff -c openafs/src/rx/DARWIN/rx_kmutex.h:1.1 openafs/src/rx/DARWIN/rx_kmutex.h:1.1.8.1
*** openafs/src/rx/DARWIN/rx_kmutex.h:1.1	Tue Mar 27 02:33:49 2001
--- openafs/src/rx/DARWIN/rx_kmutex.h	Wed Aug 21 16:53:29 2002
***************
*** 35,43 ****
--- 35,65 ----
   */
  #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();  \
  	                        assert_wait((event_t)(cv), 0);  \
  	                        MUTEX_EXIT(lck);        \
  	                        thread_block(0);                \
***************
*** 57,62 ****
--- 79,85 ----
  
  #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: openafs/src/rx/FBSD/rx_kmutex.h
diff -c openafs/src/rx/FBSD/rx_kmutex.h:1.1 openafs/src/rx/FBSD/rx_kmutex.h:1.1.6.1
*** openafs/src/rx/FBSD/rx_kmutex.h:1.1	Sat Apr 14 13:28:46 2001
--- openafs/src/rx/FBSD/rx_kmutex.h	Tue Sep 10 18:33:57 2002
***************
*** 1,18 ****
! /* Copyright Transarc Corporation 1998 - All Rights Reserved
!  *
   * rx_kmutex.h - mutex and condition variable macros for kernel environment.
   *
!  * DUX implementation.
   */
  
  #ifndef _RX_KMUTEX_H_
  #define _RX_KMUTEX_H_
- 
- #ifdef AFS_FBSD40_ENV
  
  #include <sys/lock.h>
- /* #include <kern/sched_prim.h> */
- /* #include <sys/unix_defs.h> */
  
  #define RX_ENABLE_LOCKS		1
  #define AFS_GLOBAL_RXLOCK_KERNEL
--- 1,24 ----
! /*
!  * 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.
   *
!  * FBSD implementation.
   */
  
  #ifndef _RX_KMUTEX_H_
  #define _RX_KMUTEX_H_
  
+ #include <sys/systm.h>
+ #include <sys/proc.h>
  #include <sys/lock.h>
  
  #define RX_ENABLE_LOCKS		1
  #define AFS_GLOBAL_RXLOCK_KERNEL
***************
*** 29,96 ****
  #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();		\
  				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_SIGNAL(cv)		thread_wakeup_one((vm_offset_t)(cv))
! #define CV_BROADCAST(cv)	thread_wakeup((vm_offset_t)(cv))
  
  typedef struct {
!     struct simplelock lock;
  } afs_kmutex_t;
- typedef int afs_kcondvar_t;
  
! #define osi_rxWakeup(cv)	thread_wakeup((vm_offset_t)(cv))
  
! #define LOCK_INIT(a,b) \
      do { \
! 	usimple_lock_init(&(a)->lock); \
      } while(0);
  #define MUTEX_INIT(a,b,c,d) \
      do { \
! 	usimple_lock_init(&(a)->lock); \
      } while(0);
  #define MUTEX_DESTROY(a) \
      do { \
! 	usimple_lock_terminate(&(a)->lock); \
      } while(0);
  #define MUTEX_ENTER(a) \
      do { \
! 	usimple_lock(&(a)->lock); \
      } while(0);
  #define MUTEX_TRYENTER(a) \
!    usimple_lock(&(a)->lock)
  #define MUTEX_EXIT(a) \
      do { \
! 	usimple_unlock(&(a)->lock); \
      } while(0);
  
  #undef MUTEX_ISMINE
! #define MUTEX_ISMINE(a) 1
! /* 
!   #define MUTEX_ISMINE(a) 
!   (((afs_kmutex_t *)(a))->owner == current_thread())
! */ 
  
  #undef osirx_AssertMine
  extern void osirx_AssertMine(afs_kmutex_t *lockaddr, char *msg);
  
- #endif	/* FBSD40 */
- 
- 
  #endif /* _RX_KMUTEX_H_ */
- 
--- 35,164 ----
  #define CV_WAIT(cv, lck)    { \
  				int isGlockOwner = ISAFS_GLOCK(); \
  				if (isGlockOwner) AFS_GUNLOCK();  \
  				MUTEX_EXIT(lck);	\
! 	                        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();  \
! 	                        MUTEX_EXIT(lck);        \
! 	                        tsleep(cv, PSOCK, "afs_rx_cv_timedwait", t); \
! 	                        if (isGlockOwner) AFS_GLOCK();  \
! 	                        MUTEX_ENTER(lck);       \
  
! #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 proc *owner;
  } afs_kmutex_t;
  
! #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);
  
! #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 { \
! 	(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 { \
! 	simple_lock_init(&(a)->lock); \
! 	(a)->owner = 0; \
      } while(0);
  #define MUTEX_DESTROY(a) \
      do { \
! 	(a)->owner = (struct proc *)-1; \
      } while(0);
  #define MUTEX_ENTER(a) \
      do { \
! 	simple_lock(&(a)->lock); \
! 	osi_Assert((a)->owner == 0); \
! 	(a)->owner = curproc; \
      } while(0);
  #define MUTEX_TRYENTER(a) \
!     ( simple_lock_try(&(a)->lock) ? 0 : ((a)->owner = curproc, 1) )
  #define MUTEX_EXIT(a) \
      do { \
! 	osi_Assert((a)->owner == curproc); \
! 	(a)->owner = 0; \
! 	simple_unlock(&(a)->lock); \
      } while(0);
  
  #undef MUTEX_ISMINE
! #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 /* _RX_KMUTEX_H_ */
Index: openafs/src/rx/FBSD/rx_knet.c
diff -c openafs/src/rx/FBSD/rx_knet.c:1.5 openafs/src/rx/FBSD/rx_knet.c:1.5.2.1
*** openafs/src/rx/FBSD/rx_knet.c:1.5	Wed Aug  8 02:29:02 2001
--- openafs/src/rx/FBSD/rx_knet.c	Tue Sep 10 18:33:57 2002
***************
*** 23,34 ****
  #include <afsconfig.h>
  #include "../afs/param.h"
  
! RCSID("$Header: /data/cvs/openafs/src/rx/FBSD/rx_knet.c,v 1.5 2001/08/08 06:29:02 shadow Exp $");
  
  #ifdef AFS_FBSD40_ENV
  #include "../rx/rx_kcommon.h"
  
  
  static struct protosw parent_proto;	/* udp proto switch */
  static void rxk_input (struct mbuf *am, int iphlen);
  static void rxk_fasttimo (void);
--- 23,162 ----
  #include <afsconfig.h>
  #include "../afs/param.h"
  
! RCSID("$Header: /data/cvs/openafs/src/rx/FBSD/rx_knet.c,v 1.5.2.1 2002/09/10 22:33:57 zacheiss 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,49 ****
--- 169,179 ----
      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,196 ****
      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
--- 320,325 ----
***************
*** 219,224 ****
--- 348,355 ----
      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,253 ****
      int i,tl,rlen;
      int mlen;
      int haveGlock;
  
      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();
      mp = &top;
      i = 0;
      tdata = dvec[i].iov_base;
--- 370,389 ----
      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,262 ****
--- 393,399 ----
          if (top == 0) {
              MGETHDR(m, M_DONTWAIT, MT_DATA);
              if (!m) {
+                 sbunlock(&asocket->so_snd);
                  splx(s);
                  return 1;
              }
***************
*** 282,289 ****
  	 * 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)
--- 419,424 ----
***************
*** 334,365 ****
      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 */
  	splx(s);
  	return 1;
      }
      memcpy(mtod(um, caddr_t), addr, sizeof(*addr));
!     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.  */
      /*    haveGlock = ISAFS_GLOCK();
      if (haveGlock) {
  	AFS_GUNLOCK();
  	}  */
      /* SOCKET_LOCK(asocket); */
      /* code = (*asocket->so_proto->pr_usrreq)(asocket, PRU_SEND, tm, um, 0); */
      code = (*asocket->so_proto->pr_usrreqs->pru_send)(asocket, 0, tm, 
  						      (struct sockaddr *) addr,
! 						      um, curproc);
      /* SOCKET_UNLOCK(asocket); */
      /* if (haveGlock) {
  	AFS_GLOCK();
  	} */
      splx(s);
!     m_free(um);
! 
      return code;
  }
  
  #endif /* AFS_FBSD40_ENV */
--- 469,510 ----
      um = m_get(M_DONTWAIT, MT_SONAME);
      if (!um) {
  	if (top) m_freem(top);	/* free mbuf chain */
!         sbunlock(&asocket->so_snd);
  	splx(s);
  	return 1;
      }
      memcpy(mtod(um, caddr_t), addr, 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. */
      /*    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, &proc0);
      /* SOCKET_UNLOCK(asocket); */
      /* if (haveGlock) {
  	AFS_GLOCK();
  	} */
+     sbunlock(&asocket->so_snd);
      splx(s);
! #if KNET_DEBUG
!     if (code) {
!         if (code == EINVAL)
!           Debugger("afs NetSend busted");
!         else
!           printf("z");
!     }
! #endif
      return code;
  }
+ #endif
  
  #endif /* AFS_FBSD40_ENV */
Index: openafs/src/rx/LINUX/rx_kmutex.h
diff -c openafs/src/rx/LINUX/rx_kmutex.h:1.4.4.5 openafs/src/rx/LINUX/rx_kmutex.h:1.4.4.6
*** openafs/src/rx/LINUX/rx_kmutex.h:1.4.4.5	Wed Jul 31 18:00:04 2002
--- openafs/src/rx/LINUX/rx_kmutex.h	Wed Aug 21 15:58:02 2002
***************
*** 39,44 ****
--- 39,48 ----
      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: openafs/src/rx/SUNOS/rx_kmutex.h
diff -c /dev/null openafs/src/rx/SUNOS/rx_kmutex.h:1.1.2.1
*** /dev/null	Thu Sep 26 01:24:55 2002
--- openafs/src/rx/SUNOS/rx_kmutex.h	Wed Aug 21 15:25:02 2002
***************
*** 0 ****
--- 1 ----
+ #error kernel code not supported on SunOS 4
Index: openafs/src/rx/SUNOS/rx_knet.c
diff -c /dev/null openafs/src/rx/SUNOS/rx_knet.c:1.1.2.1
*** /dev/null	Thu Sep 26 01:24:55 2002
--- openafs/src/rx/SUNOS/rx_knet.c	Wed Aug 21 15:25:02 2002
***************
*** 0 ****
--- 1 ----
+ #error kernel code not supported on SunOS 4 
Index: openafs/src/rxdebug/rxdebug.c
diff -c openafs/src/rxdebug/rxdebug.c:1.1.2.1 openafs/src/rxdebug/rxdebug.c:1.1.2.2
*** openafs/src/rxdebug/rxdebug.c:1.1.2.1	Sat Oct 13 00:21:56 2001
--- openafs/src/rxdebug/rxdebug.c	Tue Sep 10 18:33:58 2002
***************
*** 10,16 ****
  #include <afsconfig.h>
  #include <afs/param.h>
  
! RCSID("$Header: /data/cvs/openafs/src/rxdebug/rxdebug.c,v 1.1.2.1 2001/10/13 04:21:56 shadow Exp $");
  
  #include <sys/types.h>
  #include <errno.h>
--- 10,16 ----
  #include <afsconfig.h>
  #include <afs/param.h>
  
! RCSID("$Header: /data/cvs/openafs/src/rxdebug/rxdebug.c,v 1.1.2.2 2002/09/10 22:33:58 zacheiss Exp $");
  
  #include <sys/types.h>
  #include <errno.h>
***************
*** 209,214 ****
--- 209,217 ----
      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: openafs/src/rxgen/rpc_main.c
diff -c openafs/src/rxgen/rpc_main.c:1.12.2.4 openafs/src/rxgen/rpc_main.c:1.12.2.5
*** openafs/src/rxgen/rpc_main.c:1.12.2.4	Sat Jun  8 00:47:44 2002
--- openafs/src/rxgen/rpc_main.c	Wed Aug 21 16:53:29 2002
***************
*** 36,42 ****
  #include <afsconfig.h>
  #include <afs/param.h>
  
! RCSID("$Header: /data/cvs/openafs/src/rxgen/rpc_main.c,v 1.12.2.4 2002/06/08 04:47:44 shadow Exp $");
  
  #include <limits.h>
  #include <stdio.h>
--- 36,42 ----
  #include <afsconfig.h>
  #include <afs/param.h>
  
! RCSID("$Header: /data/cvs/openafs/src/rxgen/rpc_main.c,v 1.12.2.5 2002/08/21 20:53:29 shadow Exp $");
  
  #include <limits.h>
  #include <stdio.h>
***************
*** 95,101 ****
  static char *cmdname;
  #ifdef	AFS_SUN5_ENV
  static char CPP[] = "/usr/ccs/lib/cpp";
! #elif defined(AFS_XBSD_ENV)
  static char CPP[] = "/usr/bin/cpp";
  #elif defined(AFS_NT40_ENV)
  static char CPP[MAXCMDLINE];
--- 95,101 ----
  static char *cmdname;
  #ifdef	AFS_SUN5_ENV
  static char CPP[] = "/usr/ccs/lib/cpp";
! #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: openafs/src/rxkad/rxkad_client.c
diff -c openafs/src/rxkad/rxkad_client.c:1.7.2.2 openafs/src/rxkad/rxkad_client.c:1.7.2.3
*** openafs/src/rxkad/rxkad_client.c:1.7.2.2	Sat Jun  8 00:47:45 2002
--- openafs/src/rxkad/rxkad_client.c	Thu Sep 12 22:53:21 2002
***************
*** 18,24 ****
  #include <afs/param.h>
  #endif
  
! RCSID("$Header: /data/cvs/openafs/src/rxkad/rxkad_client.c,v 1.7.2.2 2002/06/08 04:47:45 shadow Exp $");
  
  #ifdef KERNEL
  #include "../afs/stds.h"
--- 18,24 ----
  #include <afs/param.h>
  #endif
  
! RCSID("$Header: /data/cvs/openafs/src/rxkad/rxkad_client.c,v 1.7.2.3 2002/09/13 02:53:21 shadow Exp $");
  
  #ifdef KERNEL
  #include "../afs/stds.h"
***************
*** 196,201 ****
--- 196,202 ----
      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: openafs/src/rxkad/rxkad_common.c
diff -c openafs/src/rxkad/rxkad_common.c:1.8.2.4 openafs/src/rxkad/rxkad_common.c:1.8.2.5
*** openafs/src/rxkad/rxkad_common.c:1.8.2.4	Wed Jul 10 15:43:20 2002
--- openafs/src/rxkad/rxkad_common.c	Wed Aug 21 16:53:30 2002
***************
*** 20,26 ****
  #include <sys/time_impl.h>
  #endif
  
! RCSID("$Header: /data/cvs/openafs/src/rxkad/rxkad_common.c,v 1.8.2.4 2002/07/10 19:43:20 shadow Exp $");
  
  #ifdef KERNEL
  #ifndef UKERNEL
--- 20,26 ----
  #include <sys/time_impl.h>
  #endif
  
! RCSID("$Header: /data/cvs/openafs/src/rxkad/rxkad_common.c,v 1.8.2.5 2002/08/21 20:53:30 shadow Exp $");
  
  #ifdef KERNEL
  #ifndef UKERNEL
***************
*** 28,33 ****
--- 28,36 ----
  #include "../afs/afs_osi.h"
  #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"
Index: openafs/src/shlibafsauthent/Makefile.in
diff -c /dev/null openafs/src/shlibafsauthent/Makefile.in:1.8.2.4
*** /dev/null	Thu Sep 26 01:24:56 2002
--- openafs/src/shlibafsauthent/Makefile.in	Tue Sep 10 01:31:38 2002
***************
*** 0 ****
--- 1,291 ----
+ # API version. When something changes, increment as appropriate. 
+ # Ignore at your own risk.
+ LIBAFSAUTHENTMAJOR=1
+ LIBAFSAUTHENTMINOR=0
+ 
+ # 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 is a pthread safe library containing ubikclient, auth, kauth.
+ 
+ DEST=@DEST@
+ TOP_INCDIR=@TOP_INCDIR@
+ TOP_LIBDIR=@TOP_LIBDIR@
+ prefix=@prefix@
+ exec_prefix=@exec_prefix@
+ bindir=@bindir@
+ sbindir=@sbindir@
+ libexecdir=@libexecdir@
+ libdir=@libdir@
+ includedir=@includedir@
+ mandir=@mandir@
+ afssrvbindir=@afssrvbindir@
+ afssrvsbindir=@afssrvsbindir@
+ afssrvlibexecdir=@afssrvlibexecdir@
+ COMPILE_ET=${TOP_SRCDIR}/comerr/compile_et
+ RXGEN=${TOP_SRCDIR}/rxgen/rxgen
+ TOP_SRCDIR=@TOP_SRCDIR@
+ srcdir=@srcdir@
+ SYS_NAME=@AFS_SYSNAME@
+ include ../config/Makefile.${SYS_NAME}
+ 
+ 
+ CC=${MT_CC}
+ CFLAGS=-I. -I${srcdir} ${OPTMZ} ${DBG} -I${TOP_SRCDIR}/config -I${TOP_INCDIR} ${MT_CFLAGS} ${SHLIB_CFLAGS} \
+ 	-I../auth -I../kauth -I../ptserver -I../sys
+ CCRULE = ${CC} ${CFLAGS} -c $?
+ 
+ AUDIT= ../audit
+ AUTH = ../auth
+ KAUTH = ../kauth
+ UBIK = ../ubik
+ UTIL = ../util
+ RXKAD = ../rxkad
+ PTSERVER = ../ptserver
+ SYS = ../sys
+ 
+ AUDITOBJS = audit.o
+ 
+ AUTHOBJS = \
+ 	cellconfig.o \
+ 	ktc.o \
+ 	userok.o \
+ 	writeconfig.o \
+ 	authcon.o \
+ 	ktc_errors.o \
+ 	acfg_errors.o
+ 
+ KAUTHOBJS = \
+ 	kauth.xdr.o \
+ 	kauth.cs.o \
+ 	kaaux.o \
+ 	client.o \
+ 	authclient.o \
+ 	token.o \
+ 	kautils.o \
+ 	kalocalcell.o \
+ 	kaerrors.o \
+ 	user.o \
+ 	read_passwd.o
+ 
+ UBIKOBJS = \
+ 	ubikclient.o \
+ 	uerrors.o \
+ 	ubik_int.cs.o \
+ 	ubik_int.xdr.o
+ 
+ UTILOBJS = \
+ 	pthread_glock.o \
+ 	get_krbrlm.o \
+ 	dirpath.o \
+ 	fileutil.o \
+ 	casestrcpy.o
+ 
+ RXKADOBJS = \
+ 	rxkad_errs.o
+ 
+ SYSOBJS = \
+ 	rmtsysc.o \
+ 	rmtsys.xdr.o \
+ 	rmtsys.cs.o \
+ 	afssyscalls.o \
+ 	rmtsysnet.o
+ 
+ PTSERVEROBJS = \
+ 	ptclient.o \
+ 	ptint.cs.o \
+ 	ptint.xdr.o \
+ 	ptuser.o \
+ 	display.o \
+ 	pterror.o
+ 
+ LIBOBJS = \
+ 	${AUDITOBJS} \
+ 	${AUTHOBJS} \
+ 	${KAUTHOBJS} \
+ 	${UBIKOBJS} \
+ 	${UTILOBJS} \
+ 	${RXKADOBJS} \
+ 	${PTSERVEROBJS} \
+ 	${SYSOBJS}
+ 
+ LIBAFSAUTHENT = libafsauthent.${SHLIB_SUFFIX}.${LIBAFSAUTHENTMAJOR}.${LIBAFSAUTHENTMINOR}
+ 
+ ${DEST}/lib/${LIBAFSAUTHENT}: ${LIBAFSAUTHENT}
+ 	${INSTALL} ${LIBAFSAUTHENT} ${DEST}/lib/${LIBAFSAUTHENT}
+ 
+ ${DEST}/lib/libafsauthent.${SHLIB_SUFFIX}: ${DEST}/lib/${LIBAFSAUTHENT}
+ 	-ln -f -s ${LIBAFSAUTHENT} ${DEST}/lib/libafsauthent.${SHLIB_SUFFIX}
+ 
+ all: ${TOP_LIBDIR}/${LIBAFSAUTHENT} ${TOP_LIBDIR}/libafsauthent.${SHLIB_SUFFIX}
+ 
+ install: ${DESTDIR}${libdir}/${LIBAFSAUTHENT} ${DESTDIR}${libdir}/libafsauthent.${SHLIB_SUFFIX}
+ 
+ ${LIBAFSAUTHENT}: ${LIBOBJS}
+ 	case ${SYS_NAME} in \
+ 	rs_aix4*) \
+ 		${SHLIB_LINKER} -o ${LIBAFSAUTHENT} ${LIBOBJS} -L${TOP_LIBDIR} -bE:afsauthent.exp -lafsrpc ${MT_LIBS};; \
+ 	sun*_5*) \
+ 		${SHLIB_LINKER} -h ${LIBAFSAUTHENT} -o ${LIBAFSAUTHENT} ${LIBOBJS} -L${TOP_LIBDIR} -lafsrpc ${MT_LIBS};; \
+ 	*) \
+ 		${SHLIB_LINKER} -o ${LIBAFSAUTHENT} ${LIBOBJS} -L${TOP_LIBDIR} -lafsrpc ${MT_LIBS};; \
+ 	esac
+ 
+ audit.o: ${AUDIT}/audit.c
+ 	${CCRULE}
+ 
+ cellconfig.o: ${AUTH}/cellconfig.c
+ 	${CCRULE}
+ 
+ ktc.o: ${AUTH}/ktc.c
+ 	${CCRULE}
+ 
+ userok.o: ${AUTH}/userok.c
+ 	${CCRULE}
+ 
+ writeconfig.o: ${AUTH}/writeconfig.c
+ 	${CCRULE}
+ 
+ authcon.o: ${AUTH}/authcon.c
+ 	${CCRULE}
+ 
+ ktc_errors.o: ${AUTH}/ktc_errors.c
+ 	${CCRULE}
+ 
+ acfg_errors.o: ${AUTH}/acfg_errors.c
+ 	${CCRULE}
+ 
+ kauth.xdr.o: ${KAUTH}/kauth.xdr.c
+ 	${CCRULE}
+ 
+ kauth.cs.o: ${KAUTH}/kauth.cs.c
+ 	${CCRULE}
+ 
+ kaaux.o: ${KAUTH}/kaaux.c
+ 	${CCRULE}
+ 
+ client.o: ${KAUTH}/client.c
+ 	${CCRULE}
+ 
+ authclient.o: ${KAUTH}/authclient.c
+ 	${CCRULE}
+ 
+ token.o: ${KAUTH}/token.c
+ 	${CCRULE}
+ 
+ kautils.o: ${KAUTH}/kautils.c
+ 	${CCRULE}
+ 
+ kalocalcell.o: ${KAUTH}/kalocalcell.c
+ 	${CCRULE}
+ 
+ kaerrors.o: ${KAUTH}/kaerrors.c
+ 	${CCRULE}
+ 
+ user.o: ${KAUTH}/user.c
+ 	${CCRULE}
+ 
+ read_passwd.o: ${KAUTH}/read_passwd.c
+ 	${CCRULE}
+ 
+ ubikclient.o: ${UBIK}/ubikclient.c
+ 	${CCRULE}
+ 
+ uerrors.o: ${UBIK}/uerrors.c
+ 	${CCRULE}
+ 
+ ubik_int.cs.o: ${UBIK}/ubik_int.cs.c
+ 	${CCRULE}
+ 
+ ubik_int.xdr.o: ${UBIK}/ubik_int.xdr.c
+ 	${CCRULE}
+ 
+ get_krbrlm.o: ${UTIL}/get_krbrlm.c
+ 	${CCRULE}
+ 
+ dirpath.o: ${UTIL}/dirpath.c
+ 	${CCRULE}
+ 
+ fileutil.o: ${UTIL}/fileutil.c
+ 	${CCRULE}
+ 
+ casestrcpy.o: ${UTIL}/casestrcpy.c
+ 	${CCRULE}
+ 
+ pthread_glock.o: ${UTIL}/pthread_glock.c
+ 	${CCRULE}
+ 
+ rxkad_errs.o: ${RXKAD}/rxkad_errs.c
+ 	${CCRULE}
+ 
+ ptclient.o: ${PTSERVER}/ptclient.c
+ 	${CCRULE}
+ 
+ # The special treatment of this file for hp_ux110 is because of a bug
+ # in version A.11.01.00 of the HP C compiler.  This bug appears to be
+ # fixed in version A.11.01.02 of the HP C compiler, however this version
+ # of the compiler is not installed on all of our build machines.
+ # The symptom of the problem is an error when linking the pthread fileserver:
+ # /usr/ccs/bin/ld: TP override with DATA_ONE_SYM fixup for non thread local
+ # storage symbol pr_Initialize in file DEST/lib/libafsauthent.a(ptuser.o)
+ ptuser.o: ${PTSERVER}/ptuser.c
+ 	set -x; \
+ 	case ${SYS_NAME} in \
+ 	hp_ux11*) \
+ 		set X `echo ${CCRULE} | sed s/-g//`; shift; \
+ 		"$$@" \
+ 		;; \
+ 	*) \
+ 		${CCRULE} \
+ 		;; \
+ 	esac
+ 
+ display.o: ${PTSERVER}/display.c
+ 	${CCRULE}
+ 
+ ptint.cs.o: ${PTSERVER}/ptint.cs.c
+ 	${CCRULE}
+ 
+ ptint.xdr.o: ${PTSERVER}/ptint.xdr.c
+ 	${CCRULE}
+ 
+ pterror.o: ${PTSERVER}/pterror.c
+ 	${CCRULE}
+ 
+ rmtsysc.o: ${SYS}/rmtsysc.c
+ 	${CCRULE}
+ 
+ rmtsys.xdr.o: ${SYS}/rmtsys.xdr.c
+ 	${CCRULE}
+ 
+ rmtsys.cs.o: ${SYS}/rmtsys.cs.c
+ 	${CCRULE}
+ 
+ afssyscalls.o: ${SYS}/afssyscalls.c
+ 	${CCRULE}
+ 
+ rmtsysnet.o: ${SYS}/rmtsysnet.c
+ 	${CCRULE}
+ 
+ clean:
+ 	$(RM) -f *.o *.a libafsauthent*
+ 
+ ${DESTDIR}${libdir}/${LIBAFSAUTHENT}: ${LIBAFSAUTHENT}
+ 	${INSTALL} ${LIBAFSAUTHENT} ${DESTDIR}${libdir}/${LIBAFSAUTHENT}
+ 
+ ${DESTDIR}${libdir}/libafsauthent.${SHLIB_SUFFIX}: ${DESTDIR}${libdir}/${LIBAFSAUTHENT}
+ 	-ln -f -s ${LIBAFSAUTHENT} ${DESTDIR}${libdir}/libafsauthent.${SHLIB_SUFFIX}
+ 
+ ${TOP_LIBDIR}/${LIBAFSAUTHENT}: ${LIBAFSAUTHENT}
+ 	${INSTALL} ${LIBAFSAUTHENT} ${TOP_LIBDIR}/${LIBAFSAUTHENT}
+ 
+ ${TOP_LIBDIR}/libafsauthent.${SHLIB_SUFFIX}: ${TOP_LIBDIR}/${LIBAFSAUTHENT}
+ 	-ln -f -s ${LIBAFSAUTHENT} ${TOP_LIBDIR}/libafsauthent.${SHLIB_SUFFIX}
+ 
+ dest: ${DEST}/lib/${LIBAFSAUTHENT} ${DEST}/lib/libafsauthent.${SHLIB_SUFFIX}
+ 
+ 
Index: openafs/src/shlibafsauthent/NTMakefile
diff -c /dev/null openafs/src/shlibafsauthent/NTMakefile:1.1.2.1
*** /dev/null	Thu Sep 26 01:24:56 2002
--- openafs/src/shlibafsauthent/NTMakefile	Tue Sep 10 01:03:45 2002
***************
*** 0 ****
--- 1,235 ----
+ # 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 is a pthread safe library containing ubikclient, auth, kauth.
+ 
+ 
+ AFSDEV_AUXCDEFINES = -DAFS_PTHREAD_ENV
+ 
+ !include ..\config\NTMakefile.$(SYS_NAME)
+ !include ..\config\NTMakefile.version
+ 
+ AUDIT = ..\audit
+ AUTH = ..\auth
+ KAUTH = ..\kauth
+ UBIK = ..\ubik
+ UTIL = ..\util
+ RXKAD = ..\rxkad
+ PTSERVER = ..\ptserver
+ SYS = ..\sys
+ WINNTAFSD = ..\WINNT\afsd
+ 
+ LIBFILE = $(DESTDIR)\lib\afsauthent.dll
+ 
+ AUDITOBJS = audit.obj
+ 
+ AUTHOBJS = \
+ 	cellconfig.obj \
+ 	userok.obj \
+ 	writeconfig.obj \
+ 	authcon.obj \
+ 	ktc_errors.obj \
+ 	ktc_nt.obj \
+ 	acfg_errors.obj
+ 
+ KAUTHOBJS = \
+ 	kauth.xdr.obj \
+ 	kauth.cs.obj \
+ 	kaaux.obj \
+ 	client.obj \
+ 	authclient.obj \
+ 	token.obj \
+ 	kautils.obj \
+ 	kalocalcell.obj \
+ 	kaerrors.obj \
+ 	user_nt.obj
+ 
+ UBIKOBJS = \
+ 	ubikclient.obj \
+ 	uerrors.obj \
+ 	ubik_int.cs.obj \
+ 	ubik_int.xdr.obj
+ 
+ UTILOBJS = \
+ 	pthread_glock.obj \
+ 	get_krbrlm.obj \
+ 	casestrcpy.obj \
+ 	fileutil.obj \
+ 	dirpath.obj \
+ 	readdir_nt.obj
+ 
+ RXKADOBJS = \
+ 	rxkad_errs.obj
+ 
+ PTSERVEROBJS = \
+ 	ptclient.obj \
+ 	ptint.cs.obj \
+ 	ptint.xdr.obj \
+ 	ptuser.obj \
+ 	display.obj \
+ 	pterror.obj
+ 
+ SYSOBJS = \
+ 	pioctl_nt.obj
+ 
+ WINNTAFSDOBJS =\
+ 	cm_config.obj \
+ 	afsrpc_c.obj
+ 
+ DLLOBJS =\
+ 	$(AUTHOBJS) \
+ 	$(KAUTHOBJS) \
+ 	$(UBIKOBJS) \
+ 	$(UTILOBJS) \
+ 	$(RXKADOBJS) \
+ 	$(PTSERVEROBJS) \
+ 	$(SYSOBJS) \
+ 	$(WINNTAFSDOBJS) \
+ 	$(AUDITOBJS) \
+ 	$(DESTDIR)\lib\cm_dns.obj \
+ 	afsauthent.res
+ 
+ audit.obj: $(AUDIT)\audit.c
+ 	$(C2OBJ) $(AUDIT)\audit.c
+ 
+ cellconfig.obj: $(AUTH)\cellconfig.c
+ 	$(C2OBJ) $(AUTH)\cellconfig.c
+ 
+ userok.obj: $(AUTH)\userok.c
+ 	$(C2OBJ) $(AUTH)\userok.c
+ 
+ writeconfig.obj: $(AUTH)\writeconfig.c
+ 	$(C2OBJ) $(AUTH)\writeconfig.c
+ 
+ authcon.obj: $(AUTH)\authcon.c
+ 	$(C2OBJ) $(AUTH)\authcon.c
+ 
+ ktc_errors.obj: $(AUTH)\ktc_errors.c
+ 	$(C2OBJ) $(AUTH)\ktc_errors.c
+ 
+ acfg_errors.obj: $(AUTH)\acfg_errors.c
+ 	$(C2OBJ) $(AUTH)\acfg_errors.c
+ 
+ kauth.xdr.obj: $(KAUTH)\kauth.xdr.c
+ 	$(C2OBJ) $(KAUTH)\kauth.xdr.c
+ 
+ kauth.cs.obj: $(KAUTH)\kauth.cs.c
+ 	$(C2OBJ) $(KAUTH)\kauth.cs.c
+ 
+ kaaux.obj: $(KAUTH)\kaaux.c
+ 	$(C2OBJ) $(KAUTH)\kaaux.c
+ 
+ client.obj: $(KAUTH)\client.c
+ 	$(C2OBJ) $(KAUTH)\client.c
+ 
+ authclient.obj: $(KAUTH)\authclient.c
+ 	$(C2OBJ) $(KAUTH)\authclient.c
+ 
+ token.obj: $(KAUTH)\token.c
+ 	$(C2OBJ) $(KAUTH)\token.c
+ 
+ kautils.obj: $(KAUTH)\kautils.c
+ 	$(C2OBJ) $(KAUTH)\kautils.c
+ 
+ kalocalcell.obj: $(KAUTH)\kalocalcell.c
+ 	$(C2OBJ) $(KAUTH)\kalocalcell.c
+ 
+ kaerrors.obj: $(KAUTH)\kaerrors.c
+ 	$(C2OBJ) $(KAUTH)\kaerrors.c
+ 
+ ktc_nt.obj: $(AUTH)\ktc_nt.c
+ 	$(C2OBJ) $(AUTH)\ktc_nt.c
+ 
+ user_nt.obj: $(KAUTH)\user_nt.c
+ 	$(C2OBJ) $(KAUTH)\user_nt.c
+ 
+ ubikclient.obj: $(UBIK)\ubikclient.c
+ 	$(C2OBJ) $(UBIK)\ubikclient.c
+ 
+ uerrors.obj: $(UBIK)\uerrors.c
+ 	$(C2OBJ) $(UBIK)\uerrors.c
+ 
+ ubik_int.cs.obj: $(UBIK)\ubik_int.cs.c
+ 	$(C2OBJ) $(UBIK)\ubik_int.cs.c
+ 
+ ubik_int.xdr.obj: $(UBIK)\ubik_int.xdr.c
+ 	$(C2OBJ) $(UBIK)\ubik_int.xdr.c
+ 
+ get_krbrlm.obj: $(UTIL)\get_krbrlm.c
+ 	$(C2OBJ) $(UTIL)\get_krbrlm.c
+ 
+ dirpath.obj: $(UTIL)\dirpath.c
+ 	$(C2OBJ) $(UTIL)\dirpath.c
+ 
+ fileutil.obj: $(UTIL)\fileutil.c
+ 	$(C2OBJ) $(UTIL)\fileutil.c
+ 
+ readdir_nt.obj: $(UTIL)\readdir_nt.c
+ 	$(C2OBJ) $(UTIL)\readdir_nt.c
+ 
+ casestrcpy.obj: $(UTIL)\casestrcpy.c
+ 	$(C2OBJ) $(UTIL)\casestrcpy.c
+ 
+ pthread_glock.obj: $(UTIL)\pthread_glock.c
+ 	$(C2OBJ) $(UTIL)\pthread_glock.c
+ 
+ rxkad_errs.obj: $(RXKAD)\rxkad_errs.c
+ 	$(C2OBJ) $(RXKAD)\rxkad_errs.c
+ 
+ ptclient.obj: $(PTSERVER)\ptclient.c
+ 	$(C2OBJ) $(PTSERVER)\ptclient.c
+ 
+ ptuser.obj: $(PTSERVER)\ptuser.c
+ 	$(C2OBJ) $(PTSERVER)\ptuser.c
+ 
+ display.obj: $(PTSERVER)\display.c
+ 	$(C2OBJ) $(PTSERVER)\display.c
+ 
+ ptint.cs.obj: $(PTSERVER)\ptint.cs.c
+ 	$(C2OBJ) $(PTSERVER)\ptint.cs.c
+ 
+ ptint.xdr.obj: $(PTSERVER)\ptint.xdr.c
+ 	$(C2OBJ) $(PTSERVER)\ptint.xdr.c
+ 
+ pterror.obj: $(PTSERVER)\pterror.c
+ 	$(C2OBJ) $(PTSERVER)\pterror.c
+ 
+ pioctl_nt.obj: $(SYS)\pioctl_nt.c
+ 	$(C2OBJ) $(SYS)\pioctl_nt.c
+ 
+ afsrpc_c.obj: $(WINNTAFSD)\afsrpc_c.c
+ 	$(C2OBJ) $(WINNTAFSD)\afsrpc_c.c
+ 
+ cm_config.obj: $(WINNTAFSD)\cm_config.c
+ 	$(C2OBJ) $(WINNTAFSD)\cm_config.c
+ 
+ DLLLIBS =\
+ !IF (("$(SYS_NAME)"=="i386_win95" ) || ("$(SYS_NAME)"=="I386_WIN95" ))
+ 	$(DESTDIR)\lib\win95\afspthread.lib \
+ !ELSE
+ 	$(DESTDIR)\lib\afspthread.lib \
+ !ENDIF
+ 	$(DESTDIR)\lib\afsrpc.lib \
+ 	$(DESTDIR)\lib\afsdes.lib \
+ 	$(DESTDIR)\lib\afs\afsutil.lib \
+ 	$(DESTDIR)\lib\afs\afsreg.lib \
+ 	$(DESTDIR)\lib\afs\afseventlog.lib
+ 
+ $(LIBFILE): $(DLLOBJS) $(DLLLIBS)
+ 	$(DLLCONLINK) /DEF:afsauthent.def rpcrt4.lib
+ 	$(DLLPREP)
+ 
+ # Definitions for generating versioninfo resources
+ afsauthent.res: afsauthent.rc AFS_component_version_number.h
+ 	$(RC) $*.rc
+ 
+ install: $(LIBFILE)
+ 
+ install9x: install
+ 
+ clean ::
+ 	$(DEL) $(LIBFILE)
Index: openafs/src/shlibafsauthent/README
diff -c /dev/null openafs/src/shlibafsauthent/README:1.1.2.1
*** /dev/null	Thu Sep 26 01:24:56 2002
--- openafs/src/shlibafsauthent/README	Tue Sep 10 01:03:45 2002
***************
*** 0 ****
--- 1,24 ----
+ 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 library is to be used by multithreaded programs that need to access
+ the kauth and auth library interfaces.  The primary method used to obtain
+ thread safety in these libraries is to lock/unlock a recursive global
+ mutex at the entry point of every public function in the library.
+ 
+ However, not all public functions are made thread safe since not all 
+ functions are needed by the NT admin work.  In particular, there are
+ many public functions that make up decendants of the functions
+ we wish to use that weren't modified, since these functions will be 
+ protected by the locking at a higher level function.
+ 
+ To prevent people from using non-thread safe functions, platform 
+ specific methods are used to limit the functions exported by the 
+ library (using def files under NT and mapfiles under Solaris).  For 
+ most non-exported functions, it should be trivial to make the 
+ transformation to thread safe by simply locking/ unlocking the 
+ global mutex at the beginning/end of the function.
Index: openafs/src/shlibafsauthent/afsauthent.def
diff -c /dev/null openafs/src/shlibafsauthent/afsauthent.def:1.1.2.1
*** /dev/null	Thu Sep 26 01:24:56 2002
--- openafs/src/shlibafsauthent/afsauthent.def	Tue Sep 10 01:03:45 2002
***************
*** 0 ****
--- 1,86 ----
+ EXPORTS
+ 	afsconf_AddKey					@1
+ 	afsconf_AddUser					@2
+ 	afsconf_CellApply				@3
+ 	afsconf_CheckAuth				@4
+ 	afsconf_ClientAuth				@5
+ 	afsconf_ClientAuthSecure			@6
+ 	afsconf_Close					@7
+ 	afsconf_DeleteKey				@8
+ 	afsconf_DeleteUser				@9
+ 	afsconf_GetCellInfo				@10
+ 	afsconf_GetKey					@11
+ 	afsconf_GetKeys					@12
+ 	afsconf_GetLatestKey				@13
+ 	afsconf_GetLocalCell				@14
+ 	afsconf_GetNoAuthFlag				@15
+ 	afsconf_GetNthUser				@16
+ 	afsconf_IntGetKeys				@17
+ 	afsconf_Open					@18
+ 	afsconf_ServerAuth				@19
+ 	afsconf_SetCellInfo				@20
+ 	afsconf_SetNoAuthFlag				@21
+ 	afsconf_SuperUser				@22
+ 	ka_AuthServerConn				@23
+ 	ka_Authenticate					@24
+ 	ka_CellConfig					@25
+ 	ka_CellToRealm					@26
+ 	ka_ChangePassword				@27
+ 	ka_ExpandCell					@28
+ 	ka_ExplicitCell					@29
+ 	ka_GetAdminToken				@30
+ 	ka_GetAuthToken					@31
+ 	ka_GetSecurity					@32
+ 	ka_GetServerToken				@33
+ 	ka_GetServers					@34
+ 	ka_GetToken					@35
+ 	ka_Init						@36
+ 	ka_LocalCell					@37
+ 	ka_ParseLoginName				@38
+ 	ka_ReadPassword					@39
+ 	ka_SingleServerConn				@40
+ 	ka_StringToKey					@41
+ 	ka_UserAuthenticateGeneral			@42
+ 	ka_VerifyUserToken				@43
+ 	ubik_Call					@44
+ 	ubik_Call_New					@45
+ 	ubik_CallIter					@46
+ 	ubik_ClientDestroy				@47
+ 	ubik_ClientInit					@48
+ 	ubik_ParseClientList				@49
+ 	getDirPath					@50
+ 	ka_AuthSpecificServersConn			@51
+ 	pthread_recursive_mutex_lock			@52
+ 	pthread_recursive_mutex_unlock			@53
+ 	grmutex						@54 DATA
+ 	initAFSDirPath					@55
+ 	renamefile					@56
+ 	opendir						@57
+ 	readdir						@58
+ 	closedir					@59
+ 	nterr_nt2unix					@60
+         ka_KeyCheckSum                                  @61
+ 	pr_GetCPS					@62
+ 	pr_Initialize					@63
+ 	pr_GetHostCPS					@64
+ 	afs_krb_get_lrealm				@65
+ 	pr_NameToId					@66
+ 	pr_IdToName					@67
+ 	afs_gettimeofday				@68
+ 	int_to_base32					@69
+ 	base32_to_int					@70
+ 	ktc_ForgetAllTokens				@71
+ 	ktc_ForgetToken					@72
+ 	ktc_GetToken					@73
+ 	ktc_ListTokens					@74
+ 	ktc_SetToken					@75
+ 	ktc_OldPioctl					@76
+ 	pioctl						@77
+ 	rx_Init						@78
+ 	ka_UserAuthenticateGeneral2			@79
+ 
+ 
+ 
+ 
+ 	DISK_function_names				@83 DATA
+ 	VOTE_function_names				@84 DATA
Index: openafs/src/shlibafsauthent/afsauthent.exp
diff -c /dev/null openafs/src/shlibafsauthent/afsauthent.exp:1.1.2.1
*** /dev/null	Thu Sep 26 01:24:56 2002
--- openafs/src/shlibafsauthent/afsauthent.exp	Tue Sep 10 01:03:45 2002
***************
*** 0 ****
--- 1,55 ----
+ afsconf_AddKey
+ afsconf_AddUser
+ afsconf_CellApply
+ afsconf_CheckAuth
+ afsconf_ClientAuth
+ afsconf_ClientAuthSecure
+ afsconf_Close
+ afsconf_DeleteKey
+ afsconf_DeleteUser
+ afsconf_GetCellInfo
+ afsconf_GetKey
+ afsconf_GetKeys
+ afsconf_GetLatestKey
+ afsconf_GetLocalCell
+ afsconf_GetNoAuthFlag
+ afsconf_GetNthUser
+ afsconf_IntGetKeys
+ afsconf_Open
+ afsconf_ServerAuth
+ afsconf_SetCellInfo
+ afsconf_SetNoAuthFlag
+ afsconf_SuperUser
+ ka_AuthServerConn
+ ka_Authenticate
+ ka_CellConfig
+ ka_CellToRealm
+ ka_ChangePassword
+ ka_ExpandCell
+ ka_ExplicitCell
+ ka_GetAdminToken
+ ka_GetAuthToken
+ ka_GetSecurity
+ ka_GetServerToken
+ ka_GetServers
+ ka_GetToken
+ ka_Init
+ ka_LocalCell
+ ka_ParseLoginName
+ ka_ReadPassword
+ ka_SingleServerConn
+ ka_StringToKey
+ ka_UserAuthenticateGeneral
+ ka_VerifyUserToken
+ ktc_ForgetAllTokens
+ ktc_ForgetToken
+ ktc_GetToken
+ ktc_ListTokens
+ ktc_OldPioctl
+ ktc_SetToken
+ ubik_Call
+ ubik_Call_New
+ ubik_CallIter
+ ubik_ClientDestroy
+ ubik_ClientInit
+ ubik_ParseClientList
Index: openafs/src/shlibafsauthent/afsauthent.rc
diff -c /dev/null openafs/src/shlibafsauthent/afsauthent.rc:1.1.2.1
*** /dev/null	Thu Sep 26 01:24:56 2002
--- openafs/src/shlibafsauthent/afsauthent.rc	Tue Sep 10 01:03:45 2002
***************
*** 0 ****
--- 1,15 ----
+ /*
+  * 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
+  */
+ 
+ /* Define VERSIONINFO resource */
+ 
+ #define  AFS_VERINFO_FILE_DESCRIPTION "AFS Authentication Utilities DLL"
+ 
+ #include "AFS_component_version_number.h"
+ #include "..\config\NTVersioninfo.rc"
Index: openafs/src/shlibafsauthent/mapfile
diff -c /dev/null openafs/src/shlibafsauthent/mapfile:1.1.2.1
*** /dev/null	Thu Sep 26 01:24:56 2002
--- openafs/src/shlibafsauthent/mapfile	Tue Sep 10 01:03:45 2002
***************
*** 0 ****
--- 1,83 ----
+ # 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
+ 
+ {
+     global:
+ 	afsconf_AddKey;
+ 	afsconf_AddUser;
+ 	afsconf_CellApply;
+ 	afsconf_CheckAuth;
+ 	afsconf_ClientAuth;
+ 	afsconf_ClientAuthSecure;
+ 	afsconf_Close;
+ 	afsconf_DeleteKey;
+ 	afsconf_DeleteUser;
+ 	afsconf_GetCellInfo;
+ 	afsconf_GetKey;
+ 	afsconf_GetKeys;
+ 	afsconf_GetLatestKey;
+ 	afsconf_GetLocalCell;
+ 	afsconf_GetNoAuthFlag;
+ 	afsconf_GetNthUser;
+ 	afsconf_IntGetKeys;
+ 	afsconf_Open;
+ 	afsconf_ServerAuth;
+ 	afsconf_SetCellInfo;
+ 	afsconf_SetNoAuthFlag;
+ 	afsconf_SuperUser;
+ 	ka_AuthServerConn;
+ 	ka_Authenticate;
+ 	ka_CellConfig;
+ 	ka_CellToRealm;
+ 	ka_ChangePassword;
+ 	ka_ExpandCell;
+ 	ka_ExplicitCell;
+ 	ka_GetAdminToken;
+ 	ka_GetAuthToken;
+ 	ka_GetSecurity;
+ 	ka_GetServerToken;
+ 	ka_GetServers;
+ 	ka_GetToken;
+ 	ka_Init;
+ 	ka_LocalCell;
+ 	ka_ParseLoginName;
+ 	ka_ReadPassword;
+ 	ka_SingleServerConn;
+ 	ka_StringToKey;
+ 	ka_KeyCheckSum;
+ 	ka_UserAuthenticateGeneral;
+ 	ka_VerifyUserToken;
+ 	ktc_ForgetAllTokens;
+ 	ktc_ForgetToken;
+ 	ktc_GetToken;
+ 	ktc_ListTokens;
+ 	ktc_OldPioctl;
+ 	ktc_SetToken;
+ 	ubik_Call;
+ 	ubik_Call_New;
+ 	ubik_CallIter;
+ 	ubik_ClientDestroy;
+ 	ubik_ClientInit;
+ 	ubik_ParseClientList;
+ 	pioctl;
+ 	getDirPath;
+ 	ka_AuthSpecificServersConn;
+ 	pthread_recursive_mutex_lock;
+ 	pthread_recursive_mutex_unlock;
+ 	grmutex;
+ 	initAFSDirPath;
+ 	renamefile;
+ 	pr_GetCPS;
+ 	pr_Initialize;
+ 	pr_GetHostCPS;
+ 	afs_krb_get_lrealm;
+ 	pr_NameToId;
+ 	pr_IdToName;
+ 
+     local:
+ 	*;
+ };
Index: openafs/src/shlibafsrpc/Makefile.in
diff -c /dev/null openafs/src/shlibafsrpc/Makefile.in:1.7.2.5
*** /dev/null	Thu Sep 26 01:24:56 2002
--- openafs/src/shlibafsrpc/Makefile.in	Tue Sep 10 01:34:23 2002
***************
*** 0 ****
--- 1,407 ----
+ # API version. When something changes, increment as appropriate. 
+ # Ignore at your own risk.
+ LIBAFSRPCMAJOR=1
+ LIBAFSRPCMINOR=0
+ 
+ # 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 is a pthread safe library containing rx, rxkad and des.
+ 
+ DEST=@DEST@
+ TOP_INCDIR=@TOP_INCDIR@
+ TOP_LIBDIR=@TOP_LIBDIR@
+ prefix=@prefix@
+ exec_prefix=@exec_prefix@
+ bindir=@bindir@
+ sbindir=@sbindir@
+ libexecdir=@libexecdir@
+ libdir=@libdir@
+ includedir=@includedir@
+ mandir=@mandir@
+ afssrvbindir=@afssrvbindir@
+ afssrvsbindir=@afssrvsbindir@
+ afssrvlibexecdir=@afssrvlibexecdir@
+ COMPILE_ET=${TOP_SRCDIR}/comerr/compile_et
+ RXGEN=${TOP_SRCDIR}/rxgen/rxgen
+ TOP_SRCDIR=@TOP_SRCDIR@
+ srcdir=@srcdir@
+ SYS_NAME=@AFS_SYSNAME@
+ include ../config/Makefile.${SYS_NAME}
+ 
+ CC=${MT_CC}
+ INCLUDES=-I. -I${srcdir} -I${TOP_INCDIR} -I.. -I${srcdir}/../rx -I${srcdir}../des -I../des \
+ 	-I../rxkad -I${srcdir}/../rxkad -I../rxstat -I../fsint
+ CFLAGS = ${OPTMZ} ${DBG} ${INCLUDES} -DRXDEBUG ${MT_CFLAGS} -I${TOP_SRCDIR}/config ${SHLIB_CFLAGS}
+ SFLAGS=-P -I${TOP_INCDIR}
+ RX = ../rx
+ CCRULE = ${CC} ${CFLAGS} -c $?
+ RXKAD = ../rxkad
+ RXSTAT = ../rxstat
+ FSINT = ../fsint
+ DES = ../des
+ COMERR = ../comerr
+ UTIL = ../util
+ SYS = ${srcdir}/../sys
+ 
+ SYSOBJS =\
+ 	syscall.o
+ 
+ UTILOBJS =\
+ 	casestrcpy.o \
+ 	base64.o
+ 
+ COMERROBJS =\
+ 	error_msg.o \
+ 	et_name.o \
+ 	com_err.o
+ 
+ XDROBJS =\
+ 	xdr.o \
+ 	xdr_array.o \
+ 	xdr_arrayn.o \
+ 	xdr_rx.o \
+ 	xdr_int64.o \
+ 	xdr_afsuuid.o \
+ 	AFS_component_version_number.o
+ 
+ RXOBJS =\
+ 	rx_event.o \
+ 	rx_user.o \
+ 	rx_pthread.o \
+ 	rx.o \
+ 	rx_null.o \
+ 	rx_conncache.o \
+ 	rx_globals.o \
+ 	rx_getaddr.o \
+ 	rx_misc.o \
+ 	rx_packet.o \
+ 	rx_rdwr.o \
+ 	rx_trace.o \
+ 	rx_multi.o
+ 
+ RXSTATOBJS =\
+ 	rxstat.o \
+ 	rxstat.ss.o \
+ 	rxstat.xdr.o \
+ 	rxstat.cs.o
+ 
+ FSINTOBJS =\
+ 	afsint.cs.o \
+ 	afsint.xdr.o \
+ 	afscbint.cs.o \
+ 	afscbint.xdr.o \
+ 	afsaux.o
+ 
+ RXKADOBJS =\
+ 	rxkad_client.o \
+ 	rxkad_server.o \
+ 	rxkad_common.o \
+ 	ticket.o \
+ 	fcrypt.o \
+ 	crypt_conn.o
+ 
+ DESOBJS =\
+ 	des.o \
+ 	cbc_encrypt.o \
+ 	pcbc_encrypt.o \
+ 	cksum.o \
+ 	new_rnd_key.o \
+ 	key_sched.o \
+ 	debug_decl.o \
+ 	quad_cksum.o \
+ 	key_parity.o \
+ 	weak_key.o \
+ 	strng_to_key.o \
+ 	misc.o \
+ 	util.o
+ 
+ CRYPT_OBJ = crypt.o
+ 
+ LIBOBJS = \
+ 	${RXOBJS} \
+ 	${DESOBJS} \
+ 	${XDROBJS} \
+ 	${RXKADOBJS} \
+ 	${COMERROBJS} \
+ 	${UTILOBJS} \
+ 	${SYSOBJS} \
+ 	${CRYPT_OBJ} \
+ 	${RXSTATOBJS} \
+ 	${FSINTOBJS}
+ 
+ LIBAFSRPC = libafsrpc.${SHLIB_SUFFIX}.${LIBAFSRPCMAJOR}.${LIBAFSRPCMINOR}
+ 
+ all: ${TOP_LIBDIR}/${LIBAFSRPC} ${TOP_LIBDIR}/libafsrpc.${SHLIB_SUFFIX}
+ 
+ install: ${DESTDIR}${libdir}/${LIBAFSRPC} ${DESTDIR}${libdir}/libafsrpc.${SHLIB_SUFFIX}
+ 
+ ${DEST}/lib/${LIBAFSRPC}: ${LIBAFSRPC}
+ 	${INSTALL} ${LIBAFSRPC} ${DEST}/lib/${LIBAFSRPC}
+ 
+ ${DEST}/lib/libafsrpc.${SHLIB_SUFFIX}: ${DEST}/lib/${LIBAFSRPC}
+ 	-ln -f -s ${LIBAFSRPC} ${DEST}/lib/libafsrpc.${SHLIB_SUFFIX}
+ 
+ ${LIBAFSRPC}: ${LIBOBJS}
+ 	case ${SYS_NAME} in \
+ 	rs_aix4*) \
+ 		${SHLIB_LINKER} -o ${LIBAFSRPC} ${LIBOBJS} -bE:afsrpc.exp ${MT_LIBS};; \
+ 	sun*_5*) \
+ 		${SHLIB_LINKER} -h ${LIBAFSRPC} -o ${LIBAFSRPC} ${LIBOBJS} ${MT_LIBS};; \
+ 	*) \
+ 		${SHLIB_LINKER} -o ${LIBAFSRPC} ${LIBOBJS} ${MT_LIBS};; \
+ 	esac
+ 
+ rx_event.o: ${RX}/rx_event.c
+ 	${CCRULE}
+ 
+ rx_user.o: ${RX}/rx_user.c
+ 	${CCRULE}
+ 
+ rx_pthread.o: ${RX}/rx_pthread.c
+ 	${CCRULE}
+ 
+ rx.o: ${RX}/rx.c
+ 	${CCRULE}
+ 
+ rx_conncache.o: ${RX}/rx_conncache.c
+ 	${CCRULE}
+ 
+ rx_null.o: ${RX}/rx_null.c
+ 	${CCRULE}
+ 
+ rx_globals.o: ${RX}/rx_globals.c
+ 	${CCRULE}
+ 
+ rx_getaddr.o: ${RX}/rx_getaddr.c
+ 	${CCRULE}
+ 
+ rx_misc.o: ${RX}/rx_misc.c
+ 	${CCRULE}
+ 
+ rx_packet.o: ${RX}/rx_packet.c
+ 	${CCRULE}
+ 
+ rx_rdwr.o: ${RX}/rx_rdwr.c
+ 	${CCRULE}
+ 
+ rx_trace.o: ${RX}/rx_trace.c
+ 	${CCRULE}
+ 
+ rx_multi.o: ${RX}/rx_multi.c
+ 	${CCRULE}
+ 
+ rxkad_client.o: ${RXKAD}/rxkad_client.c
+ 	${CCRULE}
+ 
+ rxkad_server.o: ${RXKAD}/rxkad_server.c
+ 	${CCRULE}
+ 
+ rxkad_common.o: ${RXKAD}/rxkad_common.c
+ 	${CCRULE}
+ 
+ ticket.o: ${RXKAD}/ticket.c
+ 	${CCRULE}
+ 
+ fcrypt.o: ${RXKAD}/fcrypt.c
+ 	${CCRULE}
+ 
+ crypt_conn.o: ${RXKAD}/crypt_conn.c
+ 	${CCRULE}
+ 
+ AFS_component_version_number.o: ${RX}/AFS_component_version_number.c
+ 	${CCRULE}
+ 
+ xdr.o: ${RX}/xdr.c
+ 	${CCRULE}
+ 
+ xdr_int64.o: ${RX}/xdr_int64.c
+ 	${CCRULE}
+ 
+ xdr_array.o: ${RX}/xdr_array.c
+ 	${CCRULE}
+ 
+ xdr_arrayn.o: ${RX}/xdr_arrayn.c
+ 	${CCRULE}
+ 
+ xdr_float.o: ${RX}/xdr_float.c
+ 	${CCRULE}
+ 
+ xdr_mem.o: ${RX}/xdr_mem.c
+ 	${CCRULE}
+ 
+ xdr_rec.o: ${RX}/xdr_rec.c
+ 	${CCRULE}
+ 
+ xdr_refernce.o: ${RX}/xdr_refernce.c
+ 	${CCRULE}
+ 
+ xdr_rx.o: ${RX}/xdr_rx.c
+ 	${CCRULE}
+ 
+ xdr_update.o: ${RX}/xdr_update.c
+ 	${CCRULE}
+ 
+ xdr_afsuuid.o: ${RX}/xdr_afsuuid.c
+ 	${CCRULE}
+ 
+ # Note that the special case statement for compiling des.c is present
+ # simply to work around a compiler bug on HP-UX 11.0.  The symptom of
+ # the problem is that linking the pthread fileserver fails with messages
+ # such as
+ #
+ #   pxdb internal warning: cu[84]: SLT_SRCFILE[411] out of synch
+ #   Please contact your HP Support representative
+ #   pxdb internal warning: cu[84]: SLT_SRCFILE[442] out of synch
+ #   pxdb internal warning: cu[84]: SLT_SRCFILE[450] out of synch
+ #   pxdb internal warning: cu[84]: SLT_SRCFILE[529] out of synch
+ #   pxdb internal warning: cu[84]: SLT_SRCFILE[544] out of synch
+ #   ...
+ #   pxdb32: internal error. File won't be debuggable (still a valid executable)
+ #   *** Error exit code 10
+ #
+ # The problematic version of pxdb is:
+ #
+ #   $ what /opt/langtools/bin/pxdb32
+ #   /opt/langtools/bin/pxdb32:
+ #           HP92453-02 A.10.0A HP-UX SYMBOLIC DEBUGGER (PXDB) $Revision: 1.7.2.5 $
+ #
+ # 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.
+ # Since des.c is relatively stable I've chosen to eliminate -g rather
+ # than take any hit in performance.
+ 
+ des.o: ${DES}/des.c
+ 	set -x; \
+ 	case ${SYS_NAME} in \
+ 	hp_ux11*) \
+ 		set X `echo ${CCRULE} | sed s/-g//`; shift; \
+ 		"$$@" \
+ 		;; \
+ 	*) \
+ 		${CCRULE} \
+ 		;; \
+ 	esac
+ 
+ crypt.o: ${DES}/crypt.c
+ 	${CCRULE}
+ 
+ cbc_encrypt.o: ${DES}/cbc_encrypt.c
+ 	${CCRULE}
+ 
+ pcbc_encrypt.o: ${DES}/pcbc_encrypt.c
+ 	${CCRULE}
+ 
+ cksum.o: ${DES}/cksum.c
+ 	${CCRULE}
+ 
+ new_rnd_key.o: ${DES}/new_rnd_key.c
+ 	${CCRULE}
+ 
+ key_sched.o: ${DES}/key_sched.c
+ 	${CCRULE}
+ 
+ debug_decl.o: ${DES}/debug_decl.c
+ 	${CCRULE}
+ 
+ quad_cksum.o: ${DES}/quad_cksum.c
+ 	${CCRULE}
+ 
+ key_parity.o: ${DES}/key_parity.c
+ 	${CCRULE}
+ 
+ weak_key.o: ${DES}/weak_key.c
+ 	${CCRULE}
+ 
+ strng_to_key.o: ${DES}/strng_to_key.c
+ 	${CCRULE}
+ 
+ misc.o: ${DES}/misc.c
+ 	${CCRULE}
+ 
+ util.o: ${DES}/util.c
+ 	${CCRULE}
+ 
+ error_msg.o: ${COMERR}/error_msg.c
+ 	${CCRULE}
+ 
+ et_name.o: ${COMERR}/et_name.c
+ 	${CCRULE}
+ 
+ com_err.o: ${COMERR}/com_err.c
+ 	${CCRULE}
+ 
+ casestrcpy.o: ${UTIL}/casestrcpy.c
+ 	${CCRULE}
+ 
+ base64.o: ${UTIL}/base64.c
+ 	${CCRULE}
+ 
+ syscall.o: ${SYS}/syscall.s
+ 	case "$(SYS_NAME)" in \
+ 	     sun4x_5* | sunx86_5*) \
+ 		/usr/ccs/lib/cpp  ${SFLAGS} ${SYS}/syscall.s syscall.ss; \
+ 		as -o syscall.o syscall.ss;		\
+ 		$(RM) syscall.ss;;				\
+ 	 sgi_* | ppc_darwin* ) \
+                 ${CC} ${CFLAGS} -c ${SYS}/syscall.s;;          \
+ 	 alpha_dux?? ) \
+ 		${AS} -P ${CFLAGS} -D_NO_PROTO -DMACH -DOSF -nostdinc -traditional -DASSEMBLER ${SYS}/syscall.s; \
+ 		${AS} -o syscall.o syscall.i; \
+ 		$(RM) -f syscall.ss syscall.i;; \
+ 	 *fbsd* ) \
+ 		touch syscall.o ;; \
+ 	 *) \
+ 		/lib/cpp  ${SFLAGS} ${SYS}/syscall.s syscall.ss; \
+ 		as -o syscall.o syscall.ss;		\
+ 		$(RM) syscall.ss;;				\
+ 	esac
+ 
+ rxstat.o: ${RXSTAT}/rxstat.c
+ 	${CCRULE}
+ 
+ rxstat.cs.o: ${RXSTAT}/rxstat.cs.c
+ 	${CCRULE}
+ 
+ rxstat.ss.o: ${RXSTAT}/rxstat.ss.c
+ 	${CCRULE}
+ 
+ rxstat.xdr.o: ${RXSTAT}/rxstat.xdr.c
+ 	${CCRULE}
+ 
+ afsint.cs.o: ${FSINT}/afsint.cs.c
+ 	${CCRULE}
+ 
+ afsint.xdr.o: ${FSINT}/afsint.xdr.c
+ 	${CCRULE}
+ 
+ afscbint.cs.o: ${FSINT}/afscbint.cs.c
+ 	${CCRULE}
+ 
+ afscbint.xdr.o: ${FSINT}/afscbint.xdr.c
+ 	${CCRULE}
+ 
+ afsaux.o: ${FSINT}/afsaux.c
+ 	${CCRULE}
+ 
+ clean:
+ 	$(RM) -f *.o libafsrpc*
+ 
+ ${DESTDIR}${libdir}/${LIBAFSRPC}: ${LIBAFSRPC}
+ 	${INSTALL} ${LIBAFSRPC} ${DESTDIR}${libdir}/${LIBAFSRPC}
+ 
+ ${DESTDIR}${libdir}/libafsrpc.${SHLIB_SUFFIX}: ${DESTDIR}${libdir}/${LIBAFSRPC}
+ 	-ln -f -s ${LIBAFSRPC} ${DESTDIR}${libdir}/libafsrpc.${SHLIB_SUFFIX}
+ 
+ ${TOP_LIBDIR}/${LIBAFSRPC}: ${LIBAFSRPC}
+ 	${INSTALL} ${LIBAFSRPC} ${TOP_LIBDIR}/${LIBAFSRPC}
+ 
+ ${TOP_LIBDIR}/libafsrpc.${SHLIB_SUFFIX}: ${TOP_LIBDIR}/${LIBAFSRPC}
+ 	-ln -f -s ${LIBAFSRPC} ${TOP_LIBDIR}/libafsrpc.${SHLIB_SUFFIX}
+ 
+ dest: ${DEST}/lib/${LIBAFSRPC} ${DEST}/lib/libafsrpc.${SHLIB_SUFFIX}
+ 
Index: openafs/src/shlibafsrpc/NTMakefile
diff -c /dev/null openafs/src/shlibafsrpc/NTMakefile:1.1.2.1
*** /dev/null	Thu Sep 26 01:24:56 2002
--- openafs/src/shlibafsrpc/NTMakefile	Tue Sep 10 01:03:47 2002
***************
*** 0 ****
--- 1,303 ----
+ # 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
+ 
+ !include ..\config\NTMakefile.$(SYS_NAME)
+ !include ..\config\NTMakefile.version
+ 
+ RX = ..\rx
+ RXSTAT = ..\rxstat
+ RXKAD = ..\rxkad
+ DES = ..\des
+ UTIL = ..\util
+ FSINT = ..\fsint
+ COMERR = ..\comerr
+ 
+ # Additional debugging flag for RX.
+ AFSDEV_AUXCDEFINES = -DRXDEBUG -DAFS_PTHREAD_ENV
+ 
+ LIBFILE = $(DESTDIR)\lib\afsrpc.dll
+ 
+ # Object files by category.
+ MULTIOBJS = rx_multi.obj
+ 
+ XDROBJS = xdr.obj xdr_array.obj xdr_arrayn.obj xdr_float.obj xdr_mem.obj \
+ 	xdr_rec.obj  xdr_refernce.obj xdr_rx.obj xdr_update.obj \
+ 	xdr_afsuuid.obj xdr_int64.obj
+ 
+ RXOBJS = rx_event.obj rx_user.obj rx_pthread.obj rx.obj \
+ 	rx_null.obj rx_globals.obj rx_getaddr.obj rx_misc.obj rx_packet.obj \
+ 	rx_rdwr.obj rx_trace.obj rx_xmit_nt.obj rx_conncache.obj 
+ 
+ RXSTATOBJS = rxstat.obj rxstat.ss.obj rxstat.xdr.obj rxstat.cs.obj
+ 
+ LIBRXKAD_OBJS = rxkad_client.obj rxkad_server.obj rxkad_common.obj ticket.obj \
+ 	AFS_component_version_number.obj
+ 
+ LIBRXKAD_REGOBJS = fcrypt.obj crypt_conn.obj
+ 
+ DESOBJS = des.obj cbc_encrypt.obj pcbc_encrypt.obj cksum.obj new_rnd_key.obj \
+ 	key_sched.obj debug_decl.obj quad_cksum.obj key_parity.obj \
+ 	weak_key.obj strng_to_key.obj misc.obj util.obj
+ 
+ UTILOBJS = casestrcpy.obj winsock_nt.obj
+ 
+ COMERROBJS = error_msg.obj et_name.obj com_err.obj
+ 
+ FSINTOBJS = afsint.cs.obj afsint.xdr.obj afscbint.cs.obj afscbint.xdr.obj \
+ 	afsaux.obj
+ 
+ DLLOBJS = $(MULTIOBJS) $(RXOBJS) $(XDROBJS) $(RXSTATOBJS) $(LIBRXKAD_OBJS) \
+ 	$(DESOBJS) $(LIBRXKAD_REGOBJS) $(UTILOBJS) $(COMERROBJS) \
+ 	$(FSINTOBJS) afsrpc.res
+ 
+ rx_multi.obj: $(RX)\rx_multi.c
+ 	$(C2OBJ) $(RX)\rx_multi.c
+ 
+ xdr.obj: $(RX)\xdr.c
+ 	$(C2OBJ) $(RX)\xdr.c
+ 
+ xdr_array.obj: $(RX)\xdr_array.c
+ 	$(C2OBJ) $(RX)\xdr_array.c
+ 
+ xdr_arrayn.obj: $(RX)\xdr_arrayn.c
+ 	$(C2OBJ) $(RX)\xdr_arrayn.c
+ 
+ xdr_float.obj: $(RX)\xdr_float.c
+ 	$(C2OBJ) $(RX)\xdr_float.c
+ 
+ xdr_mem.obj: $(RX)\xdr_mem.c
+ 	$(C2OBJ) $(RX)\xdr_mem.c
+ 
+ xdr_rec.obj: $(RX)\xdr_rec.c
+ 	$(C2OBJ) $(RX)\xdr_rec.c
+ 
+ xdr_refernce.obj: $(RX)\xdr_refernce.c
+ 	$(C2OBJ) $(RX)\xdr_refernce.c
+ 
+ xdr_rx.obj: $(RX)\xdr_rx.c
+ 	$(C2OBJ) $(RX)\xdr_rx.c
+ 
+ xdr_update.obj: $(RX)\xdr_update.c
+ 	$(C2OBJ) $(RX)\xdr_update.c
+ 
+ xdr_afsuuid.obj: $(RX)\xdr_afsuuid.c
+ 	$(C2OBJ) $(RX)\xdr_afsuuid.c
+ 
+ xdr_int64.obj: $(RX)\xdr_int64.c
+ 	$(C2OBJ) $(RX)\xdr_int64.c
+ 
+ rx_event.obj: $(RX)\rx_event.c
+ 	$(C2OBJ) $(RX)\rx_event.c
+ 
+ rx_user.obj: $(RX)\rx_user.c
+ 	$(C2OBJ) $(RX)\rx_user.c
+ 
+ rx_pthread.obj: $(RX)\rx_pthread.c
+ 	$(C2OBJ) $(RX)\rx_pthread.c
+ 
+ rx.obj: $(RX)\rx.c
+ 	$(C2OBJ) $(RX)\rx.c
+ 
+ rx_null.obj: $(RX)\rx_null.c
+ 	$(C2OBJ) $(RX)\rx_null.c
+ 
+ rx_globals.obj: $(RX)\rx_globals.c
+ 	$(C2OBJ) $(RX)\rx_globals.c
+ 
+ rx_getaddr.obj: $(RX)\rx_getaddr.c
+ 	$(C2OBJ) $(RX)\rx_getaddr.c
+ 
+ rx_misc.obj: $(RX)\rx_misc.c
+ 	$(C2OBJ) $(RX)\rx_misc.c
+ 
+ rx_packet.obj: $(RX)\rx_packet.c
+ 	$(C2OBJ) $(RX)\rx_packet.c
+ 
+ rx_rdwr.obj: $(RX)\rx_rdwr.c
+ 	$(C2OBJ) $(RX)\rx_rdwr.c
+ 
+ rx_trace.obj: $(RX)\rx_trace.c
+ 	$(C2OBJ) $(RX)\rx_trace.c
+ 
+ rx_xmit_nt.obj: $(RX)\rx_xmit_nt.c
+ 	$(C2OBJ) $(RX)\rx_xmit_nt.c
+ 
+ rx_conncache.obj: $(RX)\rx_conncache.c
+ 	$(C2OBJ) $(RX)\rx_conncache.c
+ 
+ rxstat.cs.obj:$(RXSTAT)\rxstat.cs.c
+ 	$(C2OBJ) $(RXSTAT)\rxstat.cs.c
+ 
+ rxstat.ss.obj:$(RXSTAT)\rxstat.ss.c
+ 	$(C2OBJ) $(RXSTAT)\rxstat.ss.c
+ 
+ rxstat.xdr.obj:$(RXSTAT)\rxstat.xdr.c
+ 	$(C2OBJ) $(RXSTAT)\rxstat.xdr.c
+ 
+ rxstat.obj:$(RXSTAT)\rxstat.c
+ 	$(C2OBJ) $(RXSTAT)\rxstat.c
+ 
+ rxkad_client.obj:$(RXKAD)\rxkad_client.c
+ 	$(C2OBJ) $(RXKAD)\rxkad_client.c
+ 
+ rxkad_server.obj:$(RXKAD)\rxkad_server.c
+ 	$(C2OBJ) $(RXKAD)\rxkad_server.c
+ 
+ rxkad_common.obj:$(RXKAD)\rxkad_common.c
+ 	$(C2OBJ) $(RXKAD)\rxkad_common.c
+ 
+ ticket.obj:$(RXKAD)\ticket.c
+ 	$(C2OBJ) $(RXKAD)\ticket.c
+ 
+ fcrypt.obj:$(RXKAD)\fcrypt.c
+ 	$(C2OBJ) $(RXKAD)\fcrypt.c
+ 
+ crypt_conn.obj:$(RXKAD)\crypt_conn.c
+ 	$(C2OBJ) $(RXKAD)\crypt_conn.c
+ 
+ AFS_component_version_number.obj:$(RXKAD)\AFS_component_version_number.c
+ 	$(C2OBJ) $(RXKAD)\AFS_component_version_number.c
+ 
+ fcrypt_x.obj:$(RXKAD)\fcrypt.c
+ 	$(C2OBJ) $(RXKAD)\fcrypt.c /Fofcrypt_x.obj
+ 
+ crypt_conn_x.obj:$(RXKAD)\crypt_conn.c
+ 	$(C2OBJ) $(RXKAD)\crypt_conn.c /Focrypt_conn_x.obj
+ 
+ des.obj:$(DES)\des.c
+ 	$(C2OBJ) $(DES)\des.c
+ 
+ cbc_encrypt.obj:$(DES)\cbc_encrypt.c
+ 	$(C2OBJ) $(DES)\cbc_encrypt.c
+ 
+ pcbc_encrypt.obj:$(DES)\pcbc_encrypt.c
+ 	$(C2OBJ) $(DES)\pcbc_encrypt.c
+ 
+ cksum.obj:$(DES)\cksum.c
+ 	$(C2OBJ) $(DES)\cksum.c
+ 
+ new_rnd_key.obj:$(DES)\new_rnd_key.c
+ 	$(C2OBJ) $(DES)\new_rnd_key.c
+ 
+ key_sched.obj:$(DES)\key_sched.c
+ 	$(C2OBJ) $(DES)\key_sched.c
+ 
+ debug_decl.obj:$(DES)\debug_decl.c
+ 	$(C2OBJ) $(DES)\debug_decl.c
+ 
+ quad_cksum.obj:$(DES)\quad_cksum.c
+ 	$(C2OBJ) $(DES)\quad_cksum.c
+ 
+ key_parity.obj:$(DES)\key_parity.c
+ 	$(C2OBJ) $(DES)\key_parity.c
+ 
+ weak_key.obj:$(DES)\weak_key.c
+ 	$(C2OBJ) $(DES)\weak_key.c
+ 
+ strng_to_key.obj:$(DES)\strng_to_key.c
+ 	$(C2OBJ) $(DES)\strng_to_key.c
+ 
+ misc.obj:$(DES)\misc.c
+ 	$(C2OBJ) -DDONT_INCL_MAIN $(DES)\misc.c
+ 
+ util.obj:$(DES)\util.c
+ 	$(C2OBJ) $(DES)\util.c
+ 
+ des_x.obj:$(DES)\des.c
+ 	$(C2OBJ) $(DES)\des.c /Fodes_x.obj
+ 
+ cbc_crypt_x.obj:$(DES)\cbc_encrypt.c
+ 	$(C2OBJ) $(DES)\cbc_encrypt.c /Focbc_crypt_x.obj
+ 
+ pcbc_crypt_x.obj:$(DES)\pcbc_encrypt.c
+ 	$(C2OBJ) $(DES)\pcbc_encrypt.c /Fopcbc_crypt_x.obj
+ 
+ cksum_x.obj:$(DES)\cksum.c
+ 	$(C2OBJ) $(DES)\cksum.c /Focksum_x.obj
+ 
+ nrnd_key_x.obj:$(DES)\new_rnd_key.c
+ 	$(C2OBJ) $(DES)\new_rnd_key.c /Fonrnd_key_x.obj
+ 
+ error_msg.obj:$(COMERR)\error_msg.c
+ 	$(C2OBJ) $(COMERR)\error_msg.c
+ 
+ et_name.obj:$(COMERR)\et_name.c
+ 	$(C2OBJ) $(COMERR)\et_name.c
+ 
+ com_err.obj:$(COMERR)\com_err.c
+ 	$(C2OBJ) $(COMERR)\com_err.c
+ 
+ casestrcpy.obj:$(UTIL)\casestrcpy.c
+ 	$(C2OBJ) $(UTIL)\casestrcpy.c
+ 
+ winsock_nt.obj:$(UTIL)\winsock_nt.c
+ 	$(C2OBJ) $(UTIL)\winsock_nt.c
+ 
+ afsint.cs.obj:$(FSINT)\afsint.cs.c
+ 	$(C2OBJ) $(FSINT)\afsint.cs.c
+ 
+ afsint.xdr.obj:$(FSINT)\afsint.xdr.c
+ 	$(C2OBJ) $(FSINT)\afsint.xdr.c
+ 
+ afscbint.cs.obj:$(FSINT)\afscbint.cs.c
+ 	$(C2OBJ) $(FSINT)\afscbint.cs.c
+ 
+ afscbint.xdr.obj:$(FSINT)\afscbint.xdr.c
+ 	$(C2OBJ) $(FSINT)\afscbint.xdr.c
+ 
+ afsaux.obj:$(FSINT)\afsaux.c
+ 	$(C2OBJ) $(FSINT)\afsaux.c
+ 
+ NTMAKE = nmake /nologo /f ntmakefile
+ 
+ 
+ DLLLIBS =\
+ !IF (("$(SYS_NAME)"=="i386_win95" ) || ("$(SYS_NAME)"=="I386_WIN95" ))
+ 	$(DESTDIR)\lib\win95\afspthread.lib \
+ !ELSE
+ 	$(DESTDIR)\lib\afspthread.lib \
+ !ENDIF
+ 	$(DESTDIR)\lib\afs\afsutil.lib \
+ 	$(DESTDIR)\lib\afs\afsreg.lib
+ 
+ $(DESTDIR)\lib\afsrpc.dll: $(DLLOBJS) $(DLLLIBS)
+ 	$(DLLCONLINK) /DEF:afsrpc.def
+ 	$(DLLPREP)
+ 
+ # Definitions for generating versioninfo resources
+ afsrpc.res: afsrpc.rc AFS_component_version_number.h
+ 	$(RC) $*.rc
+ 
+ 
+ install:
+ !       IF (EXIST(..\..\src\des\NTMakefile))
+ 		$(NTMAKE) $(LIBFILE)
+ !	else
+ 		$(NTMAKE) libstub
+ !	endif
+ 
+ install9x: install
+ 
+ !IF (EXIST(..\..\src\des\NTMakefile))
+ !ELSE IF (EXIST(..\..\DESLIB))
+ DESPAR = ..\..\DESLIB\dest
+ !ELSE IF (EXIST(..\..\..\DESLIB))
+ DESPAR = ..\..\..\DESLIB\dest
+ !ELSE
+ !ERROR Must create DESLIB link in the same directory as PARENT link.
+ !ENDIF
+ 
+ libstub:
+ 	$(COPY) $(DESPAR)\lib\afsrpc.dll \
+ 		$(DESTDIR)\lib\afsrpc.dll
+ 	$(COPY) $(DESPAR)\lib\afsrpc.lib \
+ 		$(DESTDIR)\lib\afsrpc.lib
+ 	$(COPY) $(DESPAR)\lib\afsrpc.exp \
+ 		$(DESTDIR)\lib\afsrpc.exp
+ 
+ clean::
+ 	$(DEL) $(DESTDIR)\lib\afsrpc.dll $(DESTDIR)\lib\afsrpc.lib $(DESTDIR)\lib\afsrpc.exp
\ No newline at end of file
Index: openafs/src/shlibafsrpc/afsrpc.def
diff -c /dev/null openafs/src/shlibafsrpc/afsrpc.def:1.1.2.1
*** /dev/null	Thu Sep 26 01:24:56 2002
--- openafs/src/shlibafsrpc/afsrpc.def	Tue Sep 10 01:03:47 2002
***************
*** 0 ****
--- 1,200 ----
+ EXPORTS
+ 	des_check_key_parity			@2
+ 	des_fixup_key_parity			@5
+ 	des_init_random_number_generator	@6
+ 	des_is_weak_key				@7
+ 	des_key_sched				@8
+ 	des_random_key				@9
+ 	des_string_to_key			@10
+ 	ktohl					@11
+ 	life_to_time				@12
+ 	rx_DestroyConnection			@13
+ 	rx_EndCall				@14
+ 	rx_Finalize				@15
+ 	rx_GetCachedConnection			@16
+ 	rx_GetCall				@17
+ 	rx_GetIFInfo				@18
+ 	rx_Init					@19
+ 	rx_NewCall				@20
+ 	rx_NewConnection			@21
+ 	rx_NewService				@22
+ 	rx_PrintPeerStats			@23
+ 	rx_PrintStats				@24
+ 	rx_PrintTheseStats			@25
+ 	rx_ReadProc				@26
+ 	rx_ReleaseCachedConnection		@27
+ 	rx_ServerProc				@28
+ 	rx_StartServer				@29
+ 	rx_WriteProc				@30
+ 	rxevent_Init				@31
+ 	rxevent_Post				@32
+ 	rxkad_GetServerInfo			@33
+ 	rxkad_NewClientSecurityObject		@34
+ 	rxkad_NewServerSecurityObject		@35
+ 	rxnull_NewClientSecurityObject		@38
+ 	rxnull_NewServerSecurityObject		@39
+ 	rxs_Release				@40
+ 	time_to_life				@41
+ 	tkt_CheckTimes				@42
+ 	tkt_DecodeTicket			@43
+ 	tkt_MakeTicket				@44
+ 	xdr_array				@45
+ 	xdr_bool				@46
+ 	xdr_bytes				@47
+ 	xdr_char				@48
+ 	xdr_double				@49
+ 	xdr_enum				@50
+ 	xdr_float				@51
+ 	xdr_int					@52
+ 	xdr_long				@53
+ 	xdr_opaque				@54
+ 	xdr_pointer				@55
+ 	xdr_reference				@56
+ 	xdr_short				@57
+ 	xdr_string				@58
+ 	xdr_u_char				@59
+ 	xdr_u_int				@60
+ 	xdr_u_long				@61
+ 	xdr_u_short				@62
+ 	xdr_union				@63
+ 	xdr_vector				@64
+ 	xdr_void				@65
+ 	xdr_wrapstring				@66
+ 	xdrmem_create				@67
+ 	xdrrec_create				@68
+ 	xdrrec_endofrecord			@69
+ 	xdrrec_eof				@70
+ 	xdrrec_skiprecord			@71
+ 	xdrrx_create				@72
+ 	hton_syserr_conv			@73
+ 	rxkad_stats				@74 DATA
+ 	com_err					@75
+ 	error_message				@76
+ 	rx_socket				@77 DATA
+ 	AssertionFailed				@79
+ 	afs_winsockInit				@80
+ 	rxevent_debugFile			@81 DATA
+ 	rx_debugFile				@82 DATA
+ 	rx_connDeadTime				@83 DATA
+ 	rx_maxReceiveSize			@84 DATA
+ 	rx_UdpBufSize				@85 DATA
+ 	rx_extraQuota				@86 DATA
+ 	rx_extraPackets				@87 DATA
+ 	rx_tranquil				@88 DATA
+ 	rx_getAllAddr				@89
+ 	rx_nWaiting				@90 DATA
+ 	rx_stats				@91 DATA
+ 	rx_SetNoJumbo				@92
+ 	rx_SetConnDeadTime			@93
+ 	rx_FlushWrite				@94
+ 	rx_thread_id_key			@95 DATA
+ 	multi_Finalize				@96
+ 	multi_Select				@97
+ 	multi_Init				@98
+ 	multi_Finalize_Ignore			@99
+ 	add_to_error_table			@100
+ 	xdr_afsUUID				@101
+ 	rx_GetSpecific				@102
+ 	rx_SetSpecific				@103
+ 	rx_KeyCreate				@104
+ 	rx_BusyError				@105 DATA
+ 	rx_BusyThreshold			@106 DATA
+ 	rx_IncrementTimeAndCount		@107
+ 	rx_enable_stats				@108 DATA
+ 	rx_GetServerDebug			@109
+ 	rx_GetServerStats			@110
+ 	rx_GetServerVersion			@111
+ 	rx_GetServerConnections			@112
+ 	rx_stats_mutex				@113 DATA
+ 	rx_GetServerPeers			@114
+ 	rx_RetrieveProcessRPCStats		@115
+ 	rx_RetrievePeerRPCStats			@116
+ 	rx_FreeRPCStats				@117
+ 	rx_queryProcessRPCStats			@118
+ 	rx_queryPeerRPCStats			@119
+ 	rx_enableProcessRPCStats		@120
+ 	rx_enablePeerRPCStats			@121
+ 	rx_disableProcessRPCStats		@122
+ 	rx_disablePeerRPCStats			@123
+ 	RXSTATS_ExecuteRequest			@124
+ 	RXSTATS_RetrieveProcessRPCStats		@125
+ 	RXSTATS_RetrievePeerRPCStats		@126
+ 	RXSTATS_QueryProcessRPCStats		@127
+ 	RXSTATS_QueryPeerRPCStats		@128
+ 	RXSTATS_EnableProcessRPCStats		@129
+ 	RXSTATS_EnablePeerRPCStats		@130
+ 	RXSTATS_DisableProcessRPCStats		@131
+ 	RXSTATS_DisablePeerRPCStats		@132
+ 	RXSTATS_QueryRPCStatsVersion		@133
+ 	RXSTATS_ClearProcessRPCStats		@134
+ 	RXSTATS_ClearPeerRPCStats		@135
+ 
+ 
+ 	rxi_connAbortThreshhold			@138 DATA
+ 	rxi_connAbortDelay			@139 DATA
+ 	rxi_callAbortThreshhold			@140 DATA
+ 	rxi_callAbortDelay			@141 DATA
+ 	RXSTATS_function_names			@142 DATA
+ 	RXAFSCB_function_names			@143 DATA
+ 	RXAFSCB_CallBack			@144
+ 	StartRXAFSCB_CallBack			@145
+ 	EndRXAFSCB_CallBack			@146
+ 	RXAFSCB_InitCallBackState		@147
+ 	RXAFSCB_Probe				@148
+ 	StartRXAFSCB_Probe			@149
+ 	EndRXAFSCB_Probe			@150
+ 	RXAFSCB_GetLock				@151
+ 	RXAFSCB_GetCE				@152
+ 	RXAFSCB_XStatsVersion			@153
+ 	RXAFSCB_GetXStats			@154
+ 	RXAFSCB_InitCallBackState2		@155
+ 	RXAFSCB_WhoAreYou			@156
+ 	RXAFSCB_InitCallBackState3		@157
+ 	RXAFSCB_ProbeUuid			@158
+ 	StartRXAFSCB_ProbeUuid			@159
+ 	EndRXAFSCB_ProbeUuid			@160
+ 	RXAFSCB_GetServerPrefs			@161
+ 	RXAFSCB_GetCellServDB			@162
+ 	RXAFSCB_GetLocalCell			@163
+ 	RXAFSCB_GetCacheConfig			@164
+ 	StartRXAFS_FetchData			@165
+ 	EndRXAFS_FetchData			@166
+ 	RXAFS_FetchACL				@167
+ 	RXAFS_FetchStatus			@168
+ 	StartRXAFS_StoreData			@169
+ 	EndRXAFS_StoreData			@170
+ 	RXAFS_StoreACL				@171
+ 	RXAFS_StoreStatus			@172
+ 	RXAFS_RemoveFile			@173
+ 	RXAFS_CreateFile			@174
+ 	RXAFS_Rename				@175
+ 	RXAFS_Symlink				@176
+ 	RXAFS_Link				@177
+ 	RXAFS_MakeDir				@178
+ 	RXAFS_RemoveDir				@179
+ 	RXAFS_OldSetLock			@180
+ 	RXAFS_OldExtendLock			@181
+ 	RXAFS_OldReleaseLock			@182
+ 	RXAFS_GetStatistics			@183
+ 	RXAFS_GiveUpCallBacks			@184
+ 	RXAFS_GetVolumeInfo			@185
+ 	RXAFS_GetVolumeStatus			@186
+ 	RXAFS_SetVolumeStatus			@187
+ 	RXAFS_GetRootVolume			@188
+ 	RXAFS_CheckToken			@189
+ 	RXAFS_GetTime				@190
+ 	RXAFS_NGetVolumeInfo			@191
+ 	RXAFS_BulkStatus			@192
+ 	RXAFS_SetLock				@193
+ 	RXAFS_ExtendLock			@194
+ 	RXAFS_ReleaseLock			@195
+ 	RXAFS_XStatsVersion			@196
+ 	RXAFS_GetXStats				@197
+ 	RXAFS_Lookup				@198
+ 	RXAFS_FlushCPS				@199
+ 	RXAFS_DFSSymlink			@200
+ 	rx_SetRxStatUserOk			@201
+ 	rx_RxStatUserOk				@202
+ 	rx_enable_hot_thread			@203 DATA
+ 	xdr_int64				@204
+ 	xdr_uint64				@205
Index: openafs/src/shlibafsrpc/afsrpc.exp
diff -c /dev/null openafs/src/shlibafsrpc/afsrpc.exp:1.1.2.1
*** /dev/null	Thu Sep 26 01:24:56 2002
--- openafs/src/shlibafsrpc/afsrpc.exp	Tue Sep 10 01:03:47 2002
***************
*** 0 ****
--- 1,165 ----
+ des_cbc_cksum
+ des_cbc_encrypt
+ des_cbc_init
+ des_check_key_parity
+ des_cksum_init
+ des_des_init
+ des_ecb_encrypt
+ des_fixup_key_parity
+ des_generate_random_block
+ des_init_random_number_generator
+ des_is_weak_key
+ des_key_sched
+ des_pcbc_encrypt
+ des_random_key
+ des_string_to_key
+ ktohl
+ life_to_time
+ rx_DestroyConnection
+ rx_EndCall
+ rx_EventPost
+ rx_Finalize
+ rx_GetCachedConnection
+ rx_GetCall
+ rx_GetIFInfo
+ rx_Init
+ rx_NewCall
+ rx_NewConnection
+ rx_NewService
+ rx_PrintPeerStats
+ rx_PrintStats
+ rx_PrintTheseStats
+ rx_ReadProc
+ rx_ReleaseCachedConnection
+ rx_ServerProc
+ rx_StartServer
+ rx_WriteProc
+ rxevent_Init
+ rxevent_Post
+ rxkad_GetServerInfo
+ rxkad_NewClientSecurityObject
+ rxkad_NewServerSecurityObject
+ rxkad_client_init
+ rxkad_crypt_init
+ rxnull_NewClientSecurityObject
+ rxnull_NewServerSecurityObject
+ rxs_Release
+ time_to_life
+ tkt_CheckTimes
+ tkt_DecodeTicket
+ tkt_MakeTicket
+ xdr_array
+ xdr_bool
+ xdr_bytes
+ xdr_char
+ xdr_double
+ xdr_enum
+ xdr_float
+ xdr_int
+ xdr_long
+ xdr_opaque
+ xdr_pointer
+ xdr_reference
+ xdr_short
+ xdr_string
+ xdr_u_char
+ xdr_u_int
+ xdr_u_long
+ xdr_u_short
+ xdr_union
+ xdr_vector
+ xdr_void
+ xdr_wrapstring
+ xdrmem_create
+ xdrrec_create
+ xdrrec_endofrecord
+ xdrrec_eof
+ xdrrec_skiprecord
+ xdrrx_create
+ xdr_afsuuid
+ xdr_int64
+ hton_syserr_conv
+ rxkad_stats
+ _et_list
+ et_list_mutex
+ com_err
+ error_message
+ rx_socket
+ des_pcbc_init
+ rx_BusyError
+ rx_BusyThreshold
+ rxi_connAbortThreshhold
+ rxi_connAbortDelay
+ rxi_callAbortThreshhold
+ rxi_callAbortDelay
+ RXSTATS_ExecuteRequest
+ RXSTATS_RetrieveProcessRPCStats
+ RXSTATS_RetrievePeerRPCStats
+ RXSTATS_QueryProcessRPCStats
+ RXSTATS_QueryPeerRPCStats
+ RXSTATS_EnableProcessRPCStats
+ RXSTATS_EnablePeerRPCStats
+ RXSTATS_DisableProcessRPCStats
+ RXSTATS_DisablePeerRPCStats
+ RXSTATS_QueryRPCStatsVersion
+ RXSTATS_ClearProcessRPCStats
+ RXSTATS_ClearPeerRPCStats
+ RXSTATS_function_names
+ RXAFSCB_CallBack
+ StartRXAFSCB_CallBack
+ EndRXAFSCB_CallBack
+ RXAFSCB_InitCallBackState
+ RXAFSCB_Probe
+ StartRXAFSCB_Probe
+ EndRXAFSCB_Probe
+ RXAFSCB_GetLock
+ RXAFSCB_GetCE
+ RXAFSCB_XStatsVersion
+ RXAFSCB_GetXStats
+ RXAFSCB_InitCallBackState2
+ RXAFSCB_WhoAreYou
+ RXAFSCB_InitCallBackState3
+ RXAFSCB_ProbeUuid
+ StartRXAFSCB_ProbeUuid
+ EndRXAFSCB_ProbeUuid
+ RXAFSCB_GetServerPrefs
+ RXAFSCB_GetCellServDB
+ RXAFSCB_GetLocalCell
+ RXAFSCB_GetCacheConfig
+ StartRXAFS_FetchData
+ EndRXAFS_FetchData
+ RXAFS_FetchACL
+ RXAFS_FetchStatus
+ StartRXAFS_StoreData
+ EndRXAFS_StoreData
+ RXAFS_StoreACL
+ RXAFS_StoreStatus
+ RXAFS_RemoveFile
+ RXAFS_CreateFile
+ RXAFS_Rename
+ RXAFS_Symlink
+ RXAFS_Link
+ RXAFS_MakeDir
+ RXAFS_RemoveDir
+ RXAFS_OldSetLock
+ RXAFS_OldExtendLock
+ RXAFS_OldReleaseLock
+ RXAFS_GetStatistics
+ RXAFS_GiveUpCallBacks
+ RXAFS_GetVolumeInfo
+ RXAFS_GetVolumeStatus
+ RXAFS_SetVolumeStatus
+ RXAFS_GetRootVolume
+ RXAFS_CheckToken
+ RXAFS_GetTime
+ RXAFS_NGetVolumeInfo
+ RXAFS_BulkStatus
+ RXAFS_SetLock
+ RXAFS_ExtendLock
+ RXAFS_ReleaseLock
+ RXAFS_XStatsVersion
+ RXAFS_GetXStats
+ RXAFS_Lookup
+ RXAFS_FlushCPS
+ RXAFS_DFSSymlink
+ RXAFSCB_function_names
Index: openafs/src/shlibafsrpc/afsrpc.rc
diff -c /dev/null openafs/src/shlibafsrpc/afsrpc.rc:1.1.2.1
*** /dev/null	Thu Sep 26 01:24:56 2002
--- openafs/src/shlibafsrpc/afsrpc.rc	Tue Sep 10 01:03:47 2002
***************
*** 0 ****
--- 1,15 ----
+ /*
+  * 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
+  */
+ 
+ /* Define VERSIONINFO resource */
+ 
+ #define  AFS_VERINFO_FILE_DESCRIPTION "AFS Rx RPC DLL"
+ 
+ #include "AFS_component_version_number.h"
+ #include "..\config\NTVersioninfo.rc"
Index: openafs/src/shlibafsrpc/mapfile
diff -c /dev/null openafs/src/shlibafsrpc/mapfile:1.2.2.1
*** /dev/null	Thu Sep 26 01:24:56 2002
--- openafs/src/shlibafsrpc/mapfile	Tue Sep 10 01:03:47 2002
***************
*** 0 ****
--- 1,111 ----
+ # 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
+ 
+ {
+     global:
+ 	des_check_key_parity;
+ 	des_fixup_key_parity;
+ 	des_init_random_number_generator;
+ 	des_is_weak_key;
+ 	des_key_sched;
+ 	des_random_key;
+ 	des_string_to_key;
+ 	ktohl;
+ 	life_to_time;
+ 	rx_DestroyConnection;
+ 	rx_EndCall;
+ 	rx_Finalize;
+ 	rx_GetCachedConnection;
+ 	rx_GetCall;
+ 	rx_GetIFInfo;
+ 	rx_GetSpecific;
+ 	rx_Init;
+ 	rx_KeyCreate;
+ 	rx_NewCall;
+ 	rx_NewConnection;
+ 	rx_NewService;
+ 	rx_PrintPeerStats;
+ 	rx_PrintStats;
+ 	rx_PrintTheseStats;
+ 	rx_ReadProc;
+ 	rx_ReleaseCachedConnection;
+ 	rx_ServerProc;
+ 	rx_SetSpecific;
+ 	rx_StartServer;
+ 	rx_WriteProc;
+ 	rxevent_Init;
+ 	rxevent_Post;
+ 	rxkad_GetServerInfo;
+ 	rxkad_NewClientSecurityObject;
+ 	rxkad_NewServerSecurityObject;
+ 	rxnull_NewClientSecurityObject;
+ 	rxnull_NewServerSecurityObject;
+ 	rxs_Release;
+ 	time_to_life;
+ 	tkt_CheckTimes;
+ 	tkt_DecodeTicket;
+ 	tkt_MakeTicket;
+ 	xdrrx_create;
+ 	hton_syserr_conv;
+ 	rxkad_stats;
+ 	com_err;
+ 	error_message;
+ 	rx_socket;
+ 	rxevent_debugFile;
+ 	rx_debugFile;
+ 	rx_connDeadTime;
+ 	rx_maxReceiveSize;
+ 	rx_UdpBufSize;
+ 	rx_extraQuota;
+ 	rx_extraPackets;
+ 	rx_tranquil;
+ 	rx_getAllAddr;
+ 	rx_nWaiting;
+ 	rx_stats;
+ 	rx_SetNoJumbo;
+ 	rx_SetConnDeadTime;
+ 	rx_FlushWrite;
+ 	rx_thread_id_key;
+ 	multi_Finalize;
+ 	multi_Select;
+ 	multi_Init;
+ 	multi_Finalize_Ignore;
+ 	add_to_error_table;
+ 	xdr_afsUUID;
+ 	rx_IncrementTimeAndCount;
+ 	rx_enable_stats;
+ 	rx_GetServerDebug;
+ 	rx_GetServerStats;
+ 	rx_GetServerVersion;
+ 	rx_GetServerConnections;
+ 	rx_stats_mutex;
+ 	rx_GetServerPeers;
+ 	rx_RetrieveProcessRPCStats;
+ 	rx_RetrievePeerRPCStats;
+ 	rx_FreeRPCStats;
+ 	rx_queryProcessRPCStats;
+ 	rx_queryPeerRPCStats;
+ 	rx_enableProcessRPCStats;
+ 	rx_enablePeerRPCStats;
+ 	rx_disableProcessRPCStats;
+ 	rx_disablePeerRPCStats;
+ 	RXSTATS_ExecuteRequest;
+ 	RXSTATS_RetrieveProcessRPCStats;
+ 	RXSTATS_RetrievePeerRPCStats;
+ 	RXSTATS_QueryProcessRPCStats;
+ 	RXSTATS_QueryPeerRPCStats;
+ 	RXSTATS_EnableProcessRPCStats;
+ 	RXSTATS_EnablePeerRPCStats;
+ 	RXSTATS_DisableProcessRPCStats;
+ 	RXSTATS_DisablePeerRPCStats;
+ 	RXSTATS_QueryRPCStatsVersion;
+ 	RXSTATS_ClearProcessRPCStats;
+ 	RXSTATS_ClearPeerRPCStats;
+ 
+     local:
+ 	*;
+ };
Index: openafs/src/usd/usd_file.c
diff -c openafs/src/usd/usd_file.c:1.7.2.2 openafs/src/usd/usd_file.c:1.7.2.3
*** openafs/src/usd/usd_file.c:1.7.2.2	Sat Oct 13 00:21:56 2001
--- openafs/src/usd/usd_file.c	Wed Aug 21 15:25:03 2002
***************
*** 10,16 ****
  #include <afsconfig.h>
  #include <afs/param.h>
  
! RCSID("$Header: /data/cvs/openafs/src/usd/usd_file.c,v 1.7.2.2 2001/10/13 04:21:56 shadow Exp $");
  
  #include <errno.h>
  #include <fcntl.h>
--- 10,16 ----
  #include <afsconfig.h>
  #include <afs/param.h>
  
! RCSID("$Header: /data/cvs/openafs/src/usd/usd_file.c,v 1.7.2.3 2002/08/21 19:25:03 shadow Exp $");
  
  #include <errno.h>
  #include <fcntl.h>
***************
*** 24,34 ****
  #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)
  #include <sys/ioctl.h>
  #endif
  #include <afs/debug.h>
  #include "usd.h"
  
--- 24,34 ----
  #ifdef AFS_DARWIN_ENV
  #include <sys/ioccom.h>
  #endif
! #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: openafs/src/uss/uss_vol.c
diff -c openafs/src/uss/uss_vol.c:1.5 openafs/src/uss/uss_vol.c:1.5.2.1
*** openafs/src/uss/uss_vol.c:1.5	Tue Aug  7 20:04:15 2001
--- openafs/src/uss/uss_vol.c	Mon Sep  9 13:01:12 2002
***************
*** 18,24 ****
  #include <afsconfig.h>
  #include <afs/param.h>
  
! RCSID("$Header: /data/cvs/openafs/src/uss/uss_vol.c,v 1.5 2001/08/08 00:04:15 shadow Exp $");
  
  #include "uss_vol.h"		/*Interface to this module*/
  #include "uss_common.h"		/*Common definitions*/
--- 18,24 ----
  #include <afsconfig.h>
  #include <afs/param.h>
  
! RCSID("$Header: /data/cvs/openafs/src/uss/uss_vol.c,v 1.5.2.1 2002/09/09 17:01:12 shadow Exp $");
  
  #include "uss_vol.h"		/*Interface to this module*/
  #include "uss_common.h"		/*Common definitions*/
***************
*** 1114,1120 ****
       */
      MapHostToNetwork(&vldbEntry);
      if (vldbEntry.volumeId[RWVOL] != volID) {
! 	printf("s: Volume '%s' (ID %d) is not a read/write volume!!\n",
  	       uss_whoami, uss_Volume, volID);
  	return(-1);
      }
--- 1114,1120 ----
       */
      MapHostToNetwork(&vldbEntry);
      if (vldbEntry.volumeId[RWVOL] != volID) {
! 	printf("%s: Volume '%s' (ID %d) is not a read/write volume!!\n",
  	       uss_whoami, uss_Volume, volID);
  	return(-1);
      }
Index: openafs/src/util/assert.c
diff -c openafs/src/util/assert.c:1.4.4.1 openafs/src/util/assert.c:1.4.4.2
*** openafs/src/util/assert.c:1.4.4.1	Sat Oct 13 00:22:10 2001
--- openafs/src/util/assert.c	Tue Sep 10 18:34:00 2002
***************
*** 15,23 ****
  #include <sys/time.h>
  #endif
  
! RCSID("$Header: /data/cvs/openafs/src/util/assert.c,v 1.4.4.1 2001/10/13 04:22:10 shadow Exp $");
  
  #include <stdio.h>
  
  #ifdef AFS_NT40_ENV
  void afs_NTAbort(void)
--- 15,24 ----
  #include <sys/time.h>
  #endif
  
! RCSID("$Header: /data/cvs/openafs/src/util/assert.c,v 1.4.4.2 2002/09/10 22:34:00 zacheiss Exp $");
  
  #include <stdio.h>
+ #include "afsutil.h"
  
  #ifdef AFS_NT40_ENV
  void afs_NTAbort(void)
***************
*** 33,40 ****
      time_t when;
  
      time(&when);
!     strcpy(tdate, ctime(&when));
!     tdate[24] = '0';
      fprintf(stderr, "%s: Assertion failed! file %s, line %d.\n",
  	tdate, file, line);
      fflush(stderr);
--- 34,40 ----
      time_t when;
  
      time(&when);
!     afs_ctime(&when, tdate, 25);
      fprintf(stderr, "%s: Assertion failed! file %s, line %d.\n",
  	tdate, file, line);
      fflush(stderr);
Index: openafs/src/util/netutils.c
diff -c openafs/src/util/netutils.c:1.9 openafs/src/util/netutils.c:1.9.2.1
*** openafs/src/util/netutils.c:1.9	Mon Aug  6 19:50:13 2001
--- openafs/src/util/netutils.c	Tue Aug 27 23:32:18 2002
***************
*** 19,25 ****
  #include <afs/param.h>
  #endif
  
! RCSID("$Header: /data/cvs/openafs/src/util/netutils.c,v 1.9 2001/08/06 23:50:13 shadow Exp $");
  
  #include <stdlib.h>
  #include <stdio.h>
--- 19,25 ----
  #include <afs/param.h>
  #endif
  
! RCSID("$Header: /data/cvs/openafs/src/util/netutils.c,v 1.9.2.1 2002/08/28 03:32:18 shadow Exp $");
  
  #include <stdlib.h>
  #include <stdio.h>
***************
*** 256,295 ****
    
    /* 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);
      
!     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 */
      
!     /* 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++;
!     }
    } /* while */
    
    /* in case of any error, we use all the interfaces present */
--- 256,313 ----
    
    /* For each line in the NetInfo file */
    while ( fgets(line, MAX_NETFILE_LINE, fp) != NULL ) {
!       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;
!       }
      
!       /* 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 */
!       }
      
!       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: openafs/src/util/readdir_nt.c
diff -c openafs/src/util/readdir_nt.c:1.4 openafs/src/util/readdir_nt.c:1.4.4.1
*** openafs/src/util/readdir_nt.c:1.4	Thu Jul 12 15:59:23 2001
--- openafs/src/util/readdir_nt.c	Tue Aug 27 23:28:14 2002
***************
*** 19,25 ****
  #include <afsconfig.h>
  #include <afs/param.h>
  
! RCSID("$Header: /data/cvs/openafs/src/util/readdir_nt.c,v 1.4 2001/07/12 19:59:23 shadow Exp $");
  
  #include <errno.h>
  #include <afs/errmap_nt.h>
--- 19,25 ----
  #include <afsconfig.h>
  #include <afs/param.h>
  
! RCSID("$Header: /data/cvs/openafs/src/util/readdir_nt.c,v 1.4.4.1 2002/08/28 03:28:14 shadow Exp $");
  
  #include <errno.h>
  #include <afs/errmap_nt.h>
***************
*** 32,38 ****
  /* opendir() - The case insensitive version of opendir */
  DIR *opendir(const char *path)
  {
!     struct DIR *tDir;
      HANDLE tH;
      char tPath[MAX_PATH];
      WIN32_FIND_DATA tData;
--- 32,38 ----
  /* opendir() - The case insensitive version of opendir */
  DIR *opendir(const char *path)
  {
!     DIR *tDir;
      HANDLE tH;
      char tPath[MAX_PATH];
      WIN32_FIND_DATA tData;
Index: openafs/src/util/snprintf.c
diff -c openafs/src/util/snprintf.c:1.10 openafs/src/util/snprintf.c:1.10.4.1
*** openafs/src/util/snprintf.c:1.10	Thu Jul 12 15:59:23 2001
--- openafs/src/util/snprintf.c	Wed Aug 21 15:25:04 2002
***************
*** 3,18 ****
  #include <afsconfig.h>
  #include <afs/param.h>
  
! RCSID("$Header: /data/cvs/openafs/src/util/snprintf.c,v 1.10 2001/07/12 19:59:23 shadow Exp $");
  
! #if defined(AFS_OSF20_ENV) && !defined(AFS_DUX50_ENV) || defined(AFS_AIX32_ENV) || (defined(AFS_SUN55_ENV) && !defined(AFS_SUN56_ENV))
  #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)
  #include <sys/socket.h>
  #endif
  
--- 3,18 ----
  #include <afsconfig.h>
  #include <afs/param.h>
  
! RCSID("$Header: /data/cvs/openafs/src/util/snprintf.c,v 1.10.4.1 2002/08/21 19:25:04 shadow Exp $");
  
! #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_SUN_ENV)
  #include <sys/socket.h>
  #endif
  
Index: openafs/src/util/uuid.c
diff -c openafs/src/util/uuid.c:1.7.2.3 openafs/src/util/uuid.c:1.7.2.4
*** openafs/src/util/uuid.c:1.7.2.3	Thu Jul 11 18:12:50 2002
--- openafs/src/util/uuid.c	Tue Aug 27 23:39:37 2002
***************
*** 7,12 ****
--- 7,47 ----
   * 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,20 ****
  #include <afs/param.h>
  #endif
  
! RCSID("$Header: /data/cvs/openafs/src/util/uuid.c,v 1.7.2.3 2002/07/11 22:12:50 shadow Exp $");
  
  #ifdef KERNEL
  #include "../afs/sysincludes.h"
--- 49,55 ----
  #include <afs/param.h>
  #endif
  
! RCSID("$Header: /data/cvs/openafs/src/util/uuid.c,v 1.7.2.4 2002/08/28 03:39:37 zacheiss Exp $");
  
  #ifdef KERNEL
  #include "../afs/sysincludes.h"
Index: openafs/src/util/vice.h
diff -c openafs/src/util/vice.h:1.4.4.1 openafs/src/util/vice.h:1.4.4.2
*** openafs/src/util/vice.h:1.4.4.1	Sun Jan 20 03:21:04 2002
--- openafs/src/util/vice.h	Wed Aug 21 15:25:04 2002
***************
*** 19,25 ****
   *	    	between user processes and Venus.
   */
  #include <afs/param.h>
! #ifdef AFS_SUN5_ENV
  #include <sys/ioccom.h>
  #endif
  
--- 19,25 ----
   *	    	between user processes and Venus.
   */
  #include <afs/param.h>
! #ifdef AFS_SUN_ENV
  #include <sys/ioccom.h>
  #endif
  
***************
*** 67,72 ****
--- 67,74 ----
  #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: openafs/src/venus/Makefile.in
diff -c openafs/src/venus/Makefile.in:1.6.2.4 openafs/src/venus/Makefile.in:1.6.2.5
*** openafs/src/venus/Makefile.in:1.6.2.4	Wed Jul 10 15:57:45 2002
--- openafs/src/venus/Makefile.in	Wed Aug 21 15:25:05 2002
***************
*** 158,163 ****
--- 158,165 ----
  	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,173 ****
--- 170,177 ----
  			${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: openafs/src/venus/fs.c
diff -c openafs/src/venus/fs.c:1.12.2.1 openafs/src/venus/fs.c:1.12.2.2
*** openafs/src/venus/fs.c:1.12.2.1	Sun Jan 20 03:21:06 2002
--- openafs/src/venus/fs.c	Tue Aug 27 23:53:33 2002
***************
*** 10,16 ****
  #include <afsconfig.h>
  #include <afs/param.h>
  
! RCSID("$Header: /data/cvs/openafs/src/venus/fs.c,v 1.12.2.1 2002/01/20 08:21:06 shadow Exp $");
  
  #include <afs/afs_args.h>
  #include <rx/xdr.h>
--- 10,16 ----
  #include <afsconfig.h>
  #include <afs/param.h>
  
! RCSID("$Header: /data/cvs/openafs/src/venus/fs.c,v 1.12.2.2 2002/08/28 03:53:33 zacheiss Exp $");
  
  #include <afs/afs_args.h>
  #include <rx/xdr.h>
***************
*** 1909,1914 ****
--- 1909,1916 ----
       * 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,1931 ****
      blob.in       = space;
      blob.out      = space;
      code = pioctl(0, VIOCGETCELL, &blob, 1);
!     if (code < 0) {
         Die(errno, 0);
         return 1;
      }
!     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));
--- 1921,1937 ----
      blob.in       = space;
      blob.out      = space;
      code = pioctl(0, VIOCGETCELL, &blob, 1);
!     if (code < 0 && errno != EDOM) {
         Die(errno, 0);
         return 1;
      }
!     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: openafs/src/viced/afsfileprocs.c
diff -c openafs/src/viced/afsfileprocs.c:1.10.2.5 openafs/src/viced/afsfileprocs.c:1.10.2.6
*** openafs/src/viced/afsfileprocs.c:1.10.2.5	Fri Jun  7 20:16:09 2002
--- openafs/src/viced/afsfileprocs.c	Wed Aug 21 11:54:34 2002
***************
*** 28,34 ****
  #include <afsconfig.h>
  #include <afs/param.h>
  
! RCSID("$Header: /data/cvs/openafs/src/viced/afsfileprocs.c,v 1.10.2.5 2002/06/08 00:16:09 shadow Exp $");
  
  #include <stdio.h>
  #include <stdlib.h>
--- 28,34 ----
  #include <afsconfig.h>
  #include <afs/param.h>
  
! RCSID("$Header: /data/cvs/openafs/src/viced/afsfileprocs.c,v 1.10.2.6 2002/08/21 15:54:34 shadow Exp $");
  
  #include <stdio.h>
  #include <stdlib.h>
***************
*** 5530,5537 ****
  	    }
  	    else {	/* store data or status */
  	      /* watch for chowns and chgrps */
! 	      if (CHOWN(InStatus, targetptr) || CHGRP(InStatus, targetptr))
! 		return(EPERM);      /* Was EACCES */
  	      /* must be sysadmin to set suid/sgid bits */
  	      if ((InStatus->Mask & AFS_SETMODE) &&
  #ifdef AFS_NT40_ENV
--- 5530,5543 ----
  	    }
  	    else {	/* store data or status */
  	      /* watch for chowns and chgrps */
! 	      if (CHOWN(InStatus, targetptr) || CHGRP(InStatus, targetptr)) {
! 		if (VanillaUser (client)) 
! 		  return(EPERM);	/* Was EACCES */
! 		else
! 		  osi_audit(PrivilegeEvent, 0,
! 			    AUD_INT, (client ? client->ViceId : 0), 
! 			    AUD_INT, CallingRoutine, AUD_END);
! 	      }
  	      /* must be sysadmin to set suid/sgid bits */
  	      if ((InStatus->Mask & AFS_SETMODE) &&
  #ifdef AFS_NT40_ENV
Index: openafs/src/viced/callback.c
diff -c openafs/src/viced/callback.c:1.6.2.2 openafs/src/viced/callback.c:1.6.2.3
*** openafs/src/viced/callback.c:1.6.2.2	Thu Apr 18 23:50:32 2002
--- openafs/src/viced/callback.c	Wed Aug 21 17:01:55 2002
***************
*** 82,88 ****
  #include <afsconfig.h>
  #include <afs/param.h>
  
! RCSID("$Header: /data/cvs/openafs/src/viced/callback.c,v 1.6.2.2 2002/04/19 03:50:32 zacheiss Exp $");
  
  #include <stdio.h> 
  #include <stdlib.h>      /* for malloc() */
--- 82,88 ----
  #include <afsconfig.h>
  #include <afs/param.h>
  
! RCSID("$Header: /data/cvs/openafs/src/viced/callback.c,v 1.6.2.3 2002/08/21 21:01:55 shadow Exp $");
  
  #include <stdio.h> 
  #include <stdlib.h>      /* for malloc() */
***************
*** 1391,1406 ****
  
  } /*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 */
  static int GetSomeSpace_r(hostp, locked)
      struct host *hostp;
      int locked;
  {
!     register struct host *hp, *hp1 = (struct host *)0;
      int i=0;
  
      cbstuff.GotSomeSpaces++;
--- 1391,1406 ----
  
  } /*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, *hp2 = hostList;
      int i=0;
  
      cbstuff.GotSomeSpaces++;
***************
*** 1411,1424 ****
      }
      do {
  	lih_host = 0;
! 	h_Enumerate_r(lih_r, (char *)hp1);
  	hp = lih_host;
  	if (hp) {
  	    cbstuff.GSS4++;
  	    if ( ! ClearHostCallbacks_r(hp, 0 /* not locked or held */) )
  		return;
! 	    hp1 = hp;
  	} else {
  	    hp1 = hostp;
  	    cbstuff.GSS1++;
  	    ViceLog(5,("GSS: Try harder for longest inactive host cnt= %d\n", i));
--- 1411,1425 ----
      }
      do {
  	lih_host = 0;
! 	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;
! 	    hp2 = hp->next;
  	} else {
+ 	    hp2 = hostList;
  	    hp1 = hostp;
  	    cbstuff.GSS1++;
  	    ViceLog(5,("GSS: Try harder for longest inactive host cnt= %d\n", i));
Index: openafs/src/viced/fsprobe.c
diff -c openafs/src/viced/fsprobe.c:1.6 openafs/src/viced/fsprobe.c:1.6.2.1
*** openafs/src/viced/fsprobe.c:1.6	Tue Aug  7 20:04:21 2001
--- openafs/src/viced/fsprobe.c	Tue Sep 10 18:34:02 2002
***************
*** 10,16 ****
  #include <afsconfig.h>
  #include <afs/param.h>
  
! RCSID("$Header: /data/cvs/openafs/src/viced/fsprobe.c,v 1.6 2001/08/08 00:04:21 shadow Exp $");
  
  #include <afs/stds.h>
  #include <afs/afsint.h>
--- 10,16 ----
  #include <afsconfig.h>
  #include <afs/param.h>
  
! RCSID("$Header: /data/cvs/openafs/src/viced/fsprobe.c,v 1.6.2.1 2002/09/10 22:34:02 zacheiss Exp $");
  
  #include <afs/stds.h>
  #include <afs/afsint.h>
***************
*** 101,106 ****
--- 101,109 ----
      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: openafs/src/viced/host.c
diff -c openafs/src/viced/host.c:1.7.2.6 openafs/src/viced/host.c:1.7.2.7
*** openafs/src/viced/host.c:1.7.2.6	Fri Jun  7 20:17:31 2002
--- openafs/src/viced/host.c	Wed Aug 21 17:01:55 2002
***************
*** 10,16 ****
  #include <afsconfig.h>
  #include <afs/param.h>
  
! RCSID("$Header: /data/cvs/openafs/src/viced/host.c,v 1.7.2.6 2002/06/08 00:17:31 shadow Exp $");
  
  #include <stdio.h>
  #include <errno.h>
--- 10,16 ----
  #include <afsconfig.h>
  #include <afs/param.h>
  
! RCSID("$Header: /data/cvs/openafs/src/viced/host.c,v 1.7.2.7 2002/08/21 21:01:55 shadow Exp $");
  
  #include <stdio.h>
  #include <errno.h>
***************
*** 914,929 ****
      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
   * 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)
      int (*proc)();
      char *param;
  
  {
--- 914,932 ----
      free((void *)held);
  } /*h_Enumerate*/
  
! /* 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, enumstart, param)
      int (*proc)();
+     struct host* enumstart;
      char *param;
  
  {
***************
*** 933,947 ****
      if (hostCount == 0) {
  	return;
      }
!     for (host = hostList ; 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*/
! 
  
  /* Host is returned held */
  struct host *h_GetHost_r(tcon)
--- 936,949 ----
      if (hostCount == 0) {
  	return;
      }
!     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_r*/
  
  /* Host is returned held */
  struct host *h_GetHost_r(tcon)
Index: openafs/src/viced/viced.c
diff -c openafs/src/viced/viced.c:1.11.2.1 openafs/src/viced/viced.c:1.11.2.3
*** openafs/src/viced/viced.c:1.11.2.1	Sat Oct 13 00:22:10 2001
--- openafs/src/viced/viced.c	Wed Aug 21 21:48:21 2002
***************
*** 19,25 ****
  #include <afsconfig.h>
  #include <afs/param.h>
  
! RCSID("$Header: /data/cvs/openafs/src/viced/viced.c,v 1.11.2.1 2001/10/13 04:22:10 shadow Exp $");
  
  #include <stdio.h>
  #include <stdlib.h>
--- 19,25 ----
  #include <afsconfig.h>
  #include <afs/param.h>
  
! RCSID("$Header: /data/cvs/openafs/src/viced/viced.c,v 1.11.2.3 2002/08/22 01:48:21 zacheiss Exp $");
  
  #include <stdio.h>
  #include <stdlib.h>
***************
*** 36,46 ****
  #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 */
  #endif /* AFS_NT40_ENV */
  #include <afs/stds.h>
  #undef SHARED
--- 36,46 ----
  #include <sys/file.h>
  #include <netinet/in.h>
  #include <netdb.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,493 ****
--- 488,494 ----
      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: openafs/src/vol/fssync.c
diff -c openafs/src/vol/fssync.c:1.5.2.1 openafs/src/vol/fssync.c:1.5.2.2
*** openafs/src/vol/fssync.c:1.5.2.1	Thu Aug  1 23:11:14 2002
--- openafs/src/vol/fssync.c	Tue Sep 10 18:34:05 2002
***************
*** 38,44 ****
  #include <afsconfig.h>
  #include <afs/param.h>
  
! RCSID("$Header: /data/cvs/openafs/src/vol/fssync.c,v 1.5.2.1 2002/08/02 03:11:14 shadow Exp $");
  
  #include <sys/types.h>
  #include <stdio.h>
--- 38,44 ----
  #include <afsconfig.h>
  #include <afs/param.h>
  
! RCSID("$Header: /data/cvs/openafs/src/vol/fssync.c,v 1.5.2.2 2002/09/10 22:34:05 zacheiss Exp $");
  
  #include <sys/types.h>
  #include <stdio.h>
***************
*** 236,244 ****
--- 236,248 ----
  
      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: openafs/src/vol/listinodes.c
diff -c openafs/src/vol/listinodes.c:1.8.4.2 openafs/src/vol/listinodes.c:1.8.4.3
*** openafs/src/vol/listinodes.c:1.8.4.2	Sat Oct 13 00:22:11 2001
--- openafs/src/vol/listinodes.c	Wed Aug 21 15:25:07 2002
***************
*** 20,29 ****
  #include <afsconfig.h>
  #include <afs/param.h>
  
! RCSID("$Header: /data/cvs/openafs/src/vol/listinodes.c,v 1.8.4.2 2001/10/13 04:22:11 shadow Exp $");
  
  #ifndef AFS_NAMEI_ENV
! #ifdef AFS_LINUX20_ENV
  /* ListViceInodes
   *
   * Return codes:
--- 20,29 ----
  #include <afsconfig.h>
  #include <afs/param.h>
  
! RCSID("$Header: /data/cvs/openafs/src/vol/listinodes.c,v 1.8.4.3 2002/08/21 19:25:07 shadow Exp $");
  
  #ifndef AFS_NAMEI_ENV
! #if defined(AFS_LINUX20_ENV) || defined(AFS_SUN4_ENV)
  /* ListViceInodes
   *
   * Return codes:
***************
*** 36,42 ****
  int (*judgeInode)(); 
  int *forcep, forceR;
  {
!     Log("ListViceInodes not implemented for Linux\n");
      return -1;
  }
  #else
--- 36,42 ----
  int (*judgeInode)(); 
  int *forcep, forceR;
  {
!     Log("ListViceInodes not implemented for this platform!\n");
      return -1;
  }
  #else
Index: openafs/src/vol/namei_ops.c
diff -c openafs/src/vol/namei_ops.c:1.9.4.1 openafs/src/vol/namei_ops.c:1.9.4.2
*** openafs/src/vol/namei_ops.c:1.9.4.1	Sat Oct 13 00:22:11 2001
--- openafs/src/vol/namei_ops.c	Tue Aug 27 23:57:37 2002
***************
*** 12,18 ****
  #include <afsconfig.h>
  #include <afs/param.h>
  
! RCSID("$Header: /data/cvs/openafs/src/vol/namei_ops.c,v 1.9.4.1 2001/10/13 04:22:11 shadow Exp $");
  
  #ifdef AFS_NAMEI_ENV
  #include <stdio.h>
--- 12,18 ----
  #include <afsconfig.h>
  #include <afs/param.h>
  
! RCSID("$Header: /data/cvs/openafs/src/vol/namei_ops.c,v 1.9.4.2 2002/08/28 03:57:37 zacheiss Exp $");
  
  #ifdef AFS_NAMEI_ENV
  #include <stdio.h>
***************
*** 317,324 ****
  	 */
  	*cp = 0; 
        }
!       if (!errno)
! 	closedir(ds);
      } 
      
      /* finally axe the current dir */
--- 317,324 ----
  	 */
  	*cp = 0; 
        }
!       /* if (!errno) -- closedir not implicit if we got an error */
!       closedir(ds);
      } 
      
      /* finally axe the current dir */
Index: openafs/src/vol/partition.c
diff -c openafs/src/vol/partition.c:1.11.4.5 openafs/src/vol/partition.c:1.11.4.7
*** openafs/src/vol/partition.c:1.11.4.5	Wed Jul 10 16:41:45 2002
--- openafs/src/vol/partition.c	Wed Sep 11 04:18:12 2002
***************
*** 18,24 ****
  #include <afsconfig.h>
  #include <afs/param.h>
  
! RCSID("$Header: /data/cvs/openafs/src/vol/partition.c,v 1.11.4.5 2002/07/10 20:41:45 shadow Exp $");
  
  #include <ctype.h>
  #ifdef AFS_NT40_ENV
--- 18,24 ----
  #include <afsconfig.h>
  #include <afs/param.h>
  
! RCSID("$Header: /data/cvs/openafs/src/vol/partition.c,v 1.11.4.7 2002/09/11 08:18:12 shadow Exp $");
  
  #include <ctype.h>
  #ifdef AFS_NT40_ENV
***************
*** 75,80 ****
--- 75,83 ----
  #else
  #if	defined(AFS_SUN_ENV)
  #include <sys/vfs.h>
+ #ifndef AFS_SUN5_ENV
+ #include <mntent.h>
+ #endif
  #endif
  #ifdef AFS_SUN5_ENV
  #include <unistd.h>
***************
*** 503,508 ****
--- 506,512 ----
  	    continue; /* Ignore any "special" partitions */
  
  #ifdef AFS_AIX42_ENV
+ #ifndef AFS_NAMEI_ENV
  	{
  	    struct superblock fs;
  	    /* The Log statements are non-sequiters in the SalvageLog and don't
***************
*** 519,524 ****
--- 523,529 ----
  		continue;
  	    }
  	}
+ #endif
  #endif
  
  	/* If we're going to always attach this partition, do it later. */
Index: openafs/src/vol/vol-salvage.c
diff -c openafs/src/vol/vol-salvage.c:1.10.2.4 openafs/src/vol/vol-salvage.c:1.10.2.7
*** openafs/src/vol/vol-salvage.c:1.10.2.4	Fri Apr 19 00:39:22 2002
--- openafs/src/vol/vol-salvage.c	Wed Sep 11 04:18:12 2002
***************
*** 91,97 ****
  #include <afsconfig.h>
  #include <afs/param.h>
  
! RCSID("$Header: /data/cvs/openafs/src/vol/vol-salvage.c,v 1.10.2.4 2002/04/19 04:39:22 zacheiss Exp $");
  
  #include <stdlib.h>
  #include <stdio.h>
--- 91,97 ----
  #include <afsconfig.h>
  #include <afs/param.h>
  
! RCSID("$Header: /data/cvs/openafs/src/vol/vol-salvage.c,v 1.10.2.7 2002/09/11 08:18:12 shadow Exp $");
  
  #include <stdlib.h>
  #include <stdio.h>
***************
*** 110,116 ****
  #include <sys/time.h>
  #endif /* ITIMER_REAL */
  #endif
! #if	defined(AFS_AIX_ENV)
  #define WCOREDUMP(x)	(x & 0200)
  #endif
  #include <rx/xdr.h>
--- 110,116 ----
  #include <sys/time.h>
  #endif /* ITIMER_REAL */
  #endif
! #if	defined(AFS_AIX_ENV) || defined(AFS_SUN4_ENV)
  #define WCOREDUMP(x)	(x & 0200)
  #endif
  #include <rx/xdr.h>
***************
*** 824,829 ****
--- 824,830 ----
  #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.
   */
***************
*** 851,856 ****
--- 852,858 ----
      }
      return 0;
  }
+ #endif
  #endif
  
  #ifdef AFS_NT40_ENV
Index: openafs/src/vol/volume.c
diff -c openafs/src/vol/volume.c:1.12.2.2 openafs/src/vol/volume.c:1.12.2.3
*** openafs/src/vol/volume.c:1.12.2.2	Sat Oct 13 00:22:11 2001
--- openafs/src/vol/volume.c	Wed Aug 21 15:25:08 2002
***************
*** 19,25 ****
  #include <afsconfig.h>
  #include <afs/param.h>
  
! RCSID("$Header: /data/cvs/openafs/src/vol/volume.c,v 1.12.2.2 2001/10/13 04:22:11 shadow Exp $");
  
  #include <rx/xdr.h>
  #include <afs/afsint.h>
--- 19,25 ----
  #include <afsconfig.h>
  #include <afs/param.h>
  
! RCSID("$Header: /data/cvs/openafs/src/vol/volume.c,v 1.12.2.3 2002/08/21 19:25:08 shadow Exp $");
  
  #include <rx/xdr.h>
  #include <afs/afsint.h>
***************
*** 130,138 ****
  #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
--- 130,135 ----
Index: openafs/src/volser/vos.c
diff -c openafs/src/volser/vos.c:1.8.2.4 openafs/src/volser/vos.c:1.8.2.5
*** openafs/src/volser/vos.c:1.8.2.4	Wed Jul 10 16:00:01 2002
--- openafs/src/volser/vos.c	Mon Aug  5 18:08:02 2002
***************
*** 10,16 ****
  #include <afsconfig.h>
  #include <afs/param.h>
  
! RCSID("$Header: /data/cvs/openafs/src/volser/vos.c,v 1.8.2.4 2002/07/10 20:00:01 shadow Exp $");
  
  #include <sys/types.h>
  #ifdef AFS_NT40_ENV
--- 10,16 ----
  #include <afsconfig.h>
  #include <afs/param.h>
  
! RCSID("$Header: /data/cvs/openafs/src/volser/vos.c,v 1.8.2.5 2002/08/05 22:08:02 shadow Exp $");
  
  #include <sys/types.h>
  #ifdef AFS_NT40_ENV
***************
*** 3924,3929 ****
--- 3924,3940 ----
        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,3940 ****
  
        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) {
  	  fprintf(STDERR,"vos: could not list the server addresses\n");
--- 3944,3954 ----
  
        vcode = ubik_Call_New(VL_GetAddrsU, cstruct, 0, &m_attrs, &m_uuid, 
  			&m_unique, &m_nentries, &m_addrs);
!       if(vcode == VL_NOENT) {
! 	  i++;
!           nentries++;
!           continue;
!       }
  
        if (vcode) {
  	  fprintf(STDERR,"vos: could not list the server addresses\n");
***************
*** 3945,3951 ****
        print_addrs(&m_addrs, &m_uuid, m_nentries, printuuid, noresolve);
        i++;
  
!       if ((as->parms[1].items)||(as->parms[0].items))
  	  break;
    }
      
--- 3959,3965 ----
        print_addrs(&m_addrs, &m_uuid, m_nentries, printuuid, noresolve);
        i++;
  
!       if ((as->parms[1].items)||(as->parms[0].items)||(i>nentries))
  	  break;
    }
      
Index: openafs/src/volser/vsprocs.c
diff -c openafs/src/volser/vsprocs.c:1.6.2.3 openafs/src/volser/vsprocs.c:1.6.2.5
*** openafs/src/volser/vsprocs.c:1.6.2.3	Sat Oct 13 00:22:11 2001
--- openafs/src/volser/vsprocs.c	Thu Aug 22 13:54:46 2002
***************
*** 10,16 ****
  #include <afsconfig.h>
  #include <afs/param.h>
  
! RCSID("$Header: /data/cvs/openafs/src/volser/vsprocs.c,v 1.6.2.3 2001/10/13 04:22:11 shadow Exp $");
  
  #include <stdio.h>
  #include <sys/types.h>
--- 10,16 ----
  #include <afsconfig.h>
  #include <afs/param.h>
  
! RCSID("$Header: /data/cvs/openafs/src/volser/vsprocs.c,v 1.6.2.5 2002/08/22 17:54:46 shadow Exp $");
  
  #include <stdio.h>
  #include <sys/types.h>
***************
*** 3810,3816 ****
  	       if (entry.serverFlags[j] & ITSROVOL) {
  		  /* Verify this volume exists and print message we are orphaning it */
  		  if (pass == 1) {
! 		     MapPartIdIntoName(apart, entry.serverPartition[j]);
  		     fprintf(STDERR,"*** Warning: Orphaned RO volume %u exists on %s %s\n",
  			     entry.volumeId[ROVOL],
  			     hostutil_GetNameByINet(entry.serverNumber[j]), pname);
--- 3810,3816 ----
  	       if (entry.serverFlags[j] & ITSROVOL) {
  		  /* Verify this volume exists and print message we are orphaning it */
  		  if (pass == 1) {
! 		     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,4109 ****
         if (modified && (code == VL_NOENT)) {
  	  fprintf(STDOUT,"\n**entry deleted**\n");
         } else if (modified) {
! 	  EnumerateEntry(vldbentry);
         } else {
  	  fprintf(STDOUT,"\n**no change**\n");
         }
--- 4103,4109 ----
         if (modified && (code == VL_NOENT)) {
  	  fprintf(STDOUT,"\n**entry deleted**\n");
         } else if (modified) {
! 	  EnumerateEntry(&vldbentry);
         } else {
  	  fprintf(STDOUT,"\n**no change**\n");
         }
