Index: openafs/src/WINNT/afsd/afsd_init.c
diff -c openafs/src/WINNT/afsd/afsd_init.c:1.40.2.26 openafs/src/WINNT/afsd/afsd_init.c:1.40.2.27
*** openafs/src/WINNT/afsd/afsd_init.c:1.40.2.26	Mon Oct 17 15:33:04 2005
--- openafs/src/WINNT/afsd/afsd_init.c	Wed Dec 14 00:33:46 2005
***************
*** 573,581 ****
      code = osi_InitDebug(&debugID);
      afsi_log("osi_InitDebug code %d", code);
  
!     //	osi_LockTypeSetDefault("stat");	/* comment this out for speed *
      if (code != 0) {
!         *reasonP = "unknown error";
          return -1;
      }
  
--- 573,584 ----
      code = osi_InitDebug(&debugID);
      afsi_log("osi_InitDebug code %d", code);
  
!     //	osi_LockTypeSetDefault("stat");	/* comment this out for speed */
      if (code != 0) {
!         if (code == RPC_S_NO_PROTSEQS)
!             *reasonP = "No RPC Protocol Sequences registered.  Check HKLM\\SOFTWARE\\Microsoft\\RPC\\ClientProtocols";
!         else
!             *reasonP = "unknown error";
          return -1;
      }
  
Index: openafs/src/WINNT/afsd/cm_cell.c
diff -c openafs/src/WINNT/afsd/cm_cell.c:1.14.2.5 openafs/src/WINNT/afsd/cm_cell.c:1.14.2.6
*** openafs/src/WINNT/afsd/cm_cell.c:1.14.2.5	Wed Aug 31 20:07:41 2005
--- openafs/src/WINNT/afsd/cm_cell.c	Wed Dec 14 00:30:53 2005
***************
*** 321,334 ****
      int code;
  
      cp = tsp->cellp;	/* cell that this vlserver belongs to */
!     osi_assert(cp);
  
!     lock_ObtainMutex(&cp->mx);
!     code = cm_ChangeRankServer(&cp->vlServersp, tsp);
  
!     if ( !code ) 		/* if the server list was rearranged */
!         cm_RandomizeServer(&cp->vlServersp);
! 
!     lock_ReleaseMutex(&cp->mx);
  }       
  
--- 321,334 ----
      int code;
  
      cp = tsp->cellp;	/* cell that this vlserver belongs to */
!     if (cp) {
! 	lock_ObtainMutex(&cp->mx);
! 	code = cm_ChangeRankServer(&cp->vlServersp, tsp);
  
! 	if ( !code ) 		/* if the server list was rearranged */
! 	    cm_RandomizeServer(&cp->vlServersp);
  
! 	lock_ReleaseMutex(&cp->mx);
!     }
  }       
  
Index: openafs/src/WINNT/afsd/cm_conn.c
diff -c openafs/src/WINNT/afsd/cm_conn.c:1.25.2.17 openafs/src/WINNT/afsd/cm_conn.c:1.25.2.18
*** openafs/src/WINNT/afsd/cm_conn.c:1.25.2.17	Mon Nov 21 19:30:01 2005
--- openafs/src/WINNT/afsd/cm_conn.c	Wed Dec  7 07:02:41 2005
***************
*** 406,422 ****
  	    cm_scache_t * scp;
  	    osi_Log4(afsd_logp, "cm_Analyze passed VNOVNODE cell %u vol %u vn %u uniq %u.",
  		      fidp->cell, fidp->volume, fidp->vnode, fidp->unique);
- #ifdef VNOVNODE_FLUSH_VOLUME
- 	    cm_FlushVolume(userp, reqp, fidp->cell, fidp->volume);
- #else /* VNOVNODE_FLUSH_FILE */
  	    if (!cm_GetSCache(fidp, &scp, userp, reqp)) {
- 		cm_FlushFile(scp, userp, reqp);
- #ifdef VNOVNODE_FLUSH_PARENT
  		cm_FlushParent(scp, userp, reqp);
! #endif /* VNOVNODE_FLUSH_PARENT */
  		cm_ReleaseSCache(scp);
  	    }
- #endif /* VNODE_FLUSH_xxxx */
  	} else {
  	    osi_Log0(afsd_logp, "cm_Analyze passed VNOVNODE unknown fid.");
  	}
--- 406,416 ----
  	    cm_scache_t * scp;
  	    osi_Log4(afsd_logp, "cm_Analyze passed VNOVNODE cell %u vol %u vn %u uniq %u.",
  		      fidp->cell, fidp->volume, fidp->vnode, fidp->unique);
  	    if (!cm_GetSCache(fidp, &scp, userp, reqp)) {
  		cm_FlushParent(scp, userp, reqp);
! 		cm_FlushFile(scp, userp, reqp);
  		cm_ReleaseSCache(scp);
  	    }
  	} else {
  	    osi_Log0(afsd_logp, "cm_Analyze passed VNOVNODE unknown fid.");
  	}
Index: openafs/src/WINNT/afsd/cm_ioctl.c
diff -c openafs/src/WINNT/afsd/cm_ioctl.c:1.33.2.21 openafs/src/WINNT/afsd/cm_ioctl.c:1.33.2.22
*** openafs/src/WINNT/afsd/cm_ioctl.c:1.33.2.21	Mon Nov 21 19:30:01 2005
--- openafs/src/WINNT/afsd/cm_ioctl.c	Wed Dec  7 07:02:41 2005
***************
*** 82,88 ****
      lock_ReleaseMutex(&scp->mx);
  
      lock_ReleaseWrite(&scp->bufCreateLock);
!     afsi_log("cm_FlushFile scp 0x%x returns error: [%x]",scp, code);
      return code;
  }
  
--- 82,88 ----
      lock_ReleaseMutex(&scp->mx);
  
      lock_ReleaseWrite(&scp->bufCreateLock);
!     osi_Log2(afsd_logp,"cm_FlushFile scp 0x%x returns error: [%x]",scp, code);
      return code;
  }
  
***************
*** 101,107 ****
  
      for (i=0; i<cm_data.hashTableSize; i++) {
          for (scp = cm_data.hashTablep[i]; scp; scp = scp->nextp) {
!             if (cm_FidCmp(&scp->fid, &parent_fid)) {
                  cm_HoldSCacheNoLock(scp);
                  lock_ReleaseWrite(&cm_scacheLock);
  
--- 101,107 ----
  
      for (i=0; i<cm_data.hashTableSize; i++) {
          for (scp = cm_data.hashTablep[i]; scp; scp = scp->nextp) {
!             if (!cm_FidCmp(&scp->fid, &parent_fid)) {
                  cm_HoldSCacheNoLock(scp);
                  lock_ReleaseWrite(&cm_scacheLock);
  
Index: openafs/src/WINNT/install/wix/openafs.wxs
diff -c openafs/src/WINNT/install/wix/openafs.wxs:1.6.2.4 openafs/src/WINNT/install/wix/openafs.wxs:1.6.2.5
*** openafs/src/WINNT/install/wix/openafs.wxs:1.6.2.4	Wed Oct  5 11:32:34 2005
--- openafs/src/WINNT/install/wix/openafs.wxs	Fri Dec 30 17:41:49 2005
***************
*** 92,103 ****
--- 92,105 ----
           BinaryKey="BIN_afsLoopback"
           DllEntry="uninstallLoopbackMSI"
           Execute="deferred" 
+          Impersonate="no"
           />
          <CustomAction
           Id="RollbackLoopback"
           BinaryKey="BIN_afsLoopback"
           DllEntry="uninstallLoopbackMSI"
           Execute="deferred" 
+          Impersonate="no"
           />
  	<?endif?>
  	<?else?>
***************
*** 129,141 ****
           Id="InstallNetProvider" 
           BinaryKey="BIN_afsCustom" 
           DllEntry="InstallNetProvider"
!          Execute="oncePerProcess" />
  		<CustomAction 
  		 Id="RemoveNetProvider" 
  		 BinaryKey="BIN_afsCustom"
  		 DllEntry="UninstallNetProvider"
  		 Return="ignore"
! 		 Execute="oncePerProcess" />
  		<CustomAction 
  		 Id="RollbackNetProvider" 
  		 BinaryKey="BIN_afsCustom"
--- 131,147 ----
           Id="InstallNetProvider" 
           BinaryKey="BIN_afsCustom" 
           DllEntry="InstallNetProvider"
!          Execute="deferred" 
!          Impersonate="no"
!         />
  		<CustomAction 
  		 Id="RemoveNetProvider" 
  		 BinaryKey="BIN_afsCustom"
  		 DllEntry="UninstallNetProvider"
  		 Return="ignore"
! 		 Execute="deferred" 
!                  Impersonate="no"
!                 />
  		<CustomAction 
  		 Id="RollbackNetProvider" 
  		 BinaryKey="BIN_afsCustom"
Index: openafs/src/afs/afs_osi.h
diff -c openafs/src/afs/afs_osi.h:1.22.2.13 openafs/src/afs/afs_osi.h:1.22.2.14
*** openafs/src/afs/afs_osi.h:1.22.2.13	Thu Oct  6 19:38:14 2005
--- openafs/src/afs/afs_osi.h	Fri Dec 23 20:09:52 2005
***************
*** 188,199 ****
    * In 64 bit HP-UX the timeval structure has a 64 bit member.
    */
  
! 
! #if defined(AFS_HPUX_ENV) || (defined(AFS_SUN57_ENV) && !defined(AFS_SUN510_ENV)) || defined(AFS_LINUX_64BIT_KERNEL) || (defined(AFS_SGI61_ENV) && defined(KERNEL) && defined(_K64U64))
  typedef struct {
      afs_int32 tv_sec;
      afs_int32 tv_usec;
  } osi_timeval_t;
  #else
  typedef struct timeval osi_timeval_t;
  #endif /* AFS_SGI61_ENV */
--- 188,200 ----
    * In 64 bit HP-UX the timeval structure has a 64 bit member.
    */
  
! #if defined(AFS_HPUX_ENV) || defined(AFS_LINUX_64BIT_KERNEL) || (defined(AFS_SGI61_ENV) && defined(KERNEL) && defined(_K64U64))
  typedef struct {
      afs_int32 tv_sec;
      afs_int32 tv_usec;
  } osi_timeval_t;
+ #elif defined(AFS_SUN57_ENV)
+ typedef struct timeval32 osi_timeval_t;
  #else
  typedef struct timeval osi_timeval_t;
  #endif /* AFS_SGI61_ENV */
Index: openafs/src/afs/afs_osidnlc.c
diff -c openafs/src/afs/afs_osidnlc.c:1.8.2.1 openafs/src/afs/afs_osidnlc.c:1.8.2.3
*** openafs/src/afs/afs_osidnlc.c:1.8.2.1	Wed Oct  5 01:58:27 2005
--- openafs/src/afs/afs_osidnlc.c	Thu Jan  5 00:57:55 2006
***************
*** 11,17 ****
  #include "afs/param.h"
  
  RCSID
!     ("$Header: /cvs/openafs/src/afs/afs_osidnlc.c,v 1.8.2.1 2005/10/05 05:58:27 shadow Exp $");
  
  #include "afs/sysincludes.h"	/*Standard vendor system headers */
  #include "afsincludes.h"	/*AFS-based standard headers */
--- 11,17 ----
  #include "afs/param.h"
  
  RCSID
!     ("$Header: /cvs/openafs/src/afs/afs_osidnlc.c,v 1.8.2.3 2006/01/05 05:57:55 shadow Exp $");
  
  #include "afs/sysincludes.h"	/*Standard vendor system headers */
  #include "afsincludes.h"	/*AFS-based standard headers */
***************
*** 243,249 ****
  	VN_HOLD((vnode_t *) tvc);
  #else
  #ifdef AFS_DARWIN80_ENV
!         vnode_get(tvc->v);
  #endif
  	osi_vnhold(tvc, 0);
  #endif
--- 243,254 ----
  	VN_HOLD((vnode_t *) tvc);
  #else
  #ifdef AFS_DARWIN80_ENV
!         if (vnode_get(tvc->v)) {
! 	    ReleaseReadLock(&afs_xvcache);
! 	    dnlcstats.misses++;
!             osi_dnlc_remove(adp, aname, tvc);
!             return 0;
!         }
  #endif
  	osi_vnhold(tvc, 0);
  #endif
***************
*** 367,372 ****
--- 372,386 ----
      int i;
      int writelocked;
  
+ #ifdef AFS_DARWIN_ENV
+     if (!(adp->states & (CVInit | CVFlushed
+ #ifdef AFS_DARWIN80_ENV
+                         | CDeadVnode
+ #endif
+         )) && AFSTOV(adp))
+     cache_purge(AFSTOV(adp));
+ #endif
+ 
      if (!afs_usednlc)
  	return 0;
  
***************
*** 397,402 ****
--- 411,425 ----
      int i;
      int writelocked;
  
+ #ifdef AFS_DARWIN_ENV
+     if (!(avc->states & (CVInit | CVFlushed
+ #ifdef AFS_DARWIN80_ENV
+                         | CDeadVnode
+ #endif
+         )) && AFSTOV(avc))
+     cache_purge(AFSTOV(avc));
+ #endif
+ 
      if (!afs_usednlc)
  	return 0;
  
Index: openafs/src/afs/afs_pioctl.c
diff -c openafs/src/afs/afs_pioctl.c:1.81.2.21 openafs/src/afs/afs_pioctl.c:1.81.2.22
*** openafs/src/afs/afs_pioctl.c:1.81.2.21	Fri Oct 14 21:43:30 2005
--- openafs/src/afs/afs_pioctl.c	Thu Jan  5 00:57:55 2006
***************
*** 11,17 ****
  #include "afs/param.h"
  
  RCSID
!     ("$Header: /cvs/openafs/src/afs/afs_pioctl.c,v 1.81.2.21 2005/10/15 01:43:30 shadow Exp $");
  
  #include "afs/sysincludes.h"	/* Standard vendor system headers */
  #ifdef AFS_OBSD_ENV
--- 11,17 ----
  #include "afs/param.h"
  
  RCSID
!     ("$Header: /cvs/openafs/src/afs/afs_pioctl.c,v 1.81.2.22 2006/01/05 05:57:55 shadow Exp $");
  
  #include "afs/sysincludes.h"	/* Standard vendor system headers */
  #ifdef AFS_OBSD_ENV
***************
*** 2586,2591 ****
--- 2586,2595 ----
  		VN_HOLD(AFSTOV(tvc));
  #else
  #if defined(AFS_DARWIN_ENV) || defined(AFS_XBSD_ENV)
+ #ifdef AFS_DARWIN80_ENV
+                 if (vnode_get(AFSTOV(tvc)))
+                     continue;
+ #endif
  		osi_vnhold(tvc, 0);
  #else
  		VREFCOUNT_INC(tvc); /* AIX, apparently */
***************
*** 2610,2615 ****
--- 2614,2620 ----
  #endif
  #ifdef AFS_DARWIN80_ENV
  		/* our tvc ptr is still good until now */
+                 vnode_put(AFSTOV(tvc));
  		AFS_FAST_RELE(tvc);
  		ObtainReadLock(&afs_xvcache);
  #else
Index: openafs/src/afs/afs_vcache.c
diff -c openafs/src/afs/afs_vcache.c:1.65.2.32 openafs/src/afs/afs_vcache.c:1.65.2.34
*** openafs/src/afs/afs_vcache.c:1.65.2.32	Thu Dec  1 00:10:55 2005
--- openafs/src/afs/afs_vcache.c	Thu Jan  5 00:57:56 2006
***************
*** 39,45 ****
  #include "afs/param.h"
  
  RCSID
!     ("$Header: /cvs/openafs/src/afs/afs_vcache.c,v 1.65.2.32 2005/12/01 05:10:55 shadow Exp $");
  
  #include "afs/sysincludes.h"	/*Standard vendor system headers */
  #include "afsincludes.h"	/*AFS-based standard headers */
--- 39,45 ----
  #include "afs/param.h"
  
  RCSID
!     ("$Header: /cvs/openafs/src/afs/afs_vcache.c,v 1.65.2.34 2006/01/05 05:57:56 shadow Exp $");
  
  #include "afs/sysincludes.h"	/*Standard vendor system headers */
  #include "afsincludes.h"	/*AFS-based standard headers */
***************
*** 759,777 ****
                 && tvc->opens == 0 && (tvc->states & CUnlinkedDel) == 0) {
  #if defined (AFS_DARWIN_ENV) || defined(AFS_XBSD_ENV)
  #ifdef AFS_DARWIN80_ENV
!                 fv_slept=1;
!                 /* must release lock, since vnode_recycle will immediately
!                    reclaim if there are no other users */
!                 ReleaseWriteLock(&afs_xvcache);
!                 AFS_GUNLOCK();
!                 /* VREFCOUNT_GT only sees usecounts, not iocounts */
!                 /* so this may fail to actually recycle the vnode now */
!                 if (vnode_recycle(AFSTOV(tvc)))
!                    code=0;
!                 else
!                    code=EBUSY;
!                 AFS_GLOCK();
!                 ObtainWriteLock(&afs_xvcache, 336);
  #else
                  /*
                   * vgone() reclaims the vnode, which calls afs_FlushVCache(),
--- 759,786 ----
                 && tvc->opens == 0 && (tvc->states & CUnlinkedDel) == 0) {
  #if defined (AFS_DARWIN_ENV) || defined(AFS_XBSD_ENV)
  #ifdef AFS_DARWIN80_ENV
! 	        vnode_t tvp = AFSTOV(tvc);
! 		/* VREFCOUNT_GT only sees usecounts, not iocounts */
! 		/* so this may fail to actually recycle the vnode now */
! 		/* must call vnode_get to avoid races. */
! 		if (vnode_get(tvp) == 0) {
! 		    fv_slept=1;
! 		    /* must release lock, since vnode_put will immediately
! 		       reclaim if there are no other users */
! 		    ReleaseWriteLock(&afs_xvcache);
! 		    AFS_GUNLOCK();
! 		    vnode_recycle(tvp);
! 		    vnode_put(tvp);
! 		    AFS_GLOCK();
! 		    ObtainWriteLock(&afs_xvcache, 336);
! 		}
! 		/* we can't use the vnode_recycle return value to figure
! 		 * this out, since the iocount we have to hold makes it
! 		 * always "fail" */
! 		if (AFSTOV(tvc) == tvp)
! 		    code = EBUSY;
! 		else
! 		    code = 0;
  #else
                  /*
                   * vgone() reclaims the vnode, which calls afs_FlushVCache(),
***************
*** 2028,2033 ****
--- 2037,2045 ----
      struct AFSCallBack CallBack;
      struct AFSVolSync tsync;
      int origCBs = 0;
+ #ifdef	AFS_OSF_ENV
+     int vg;
+ #endif
  
      start = osi_Time();
  
***************
*** 2071,2077 ****
  	    /* for the present (95.05.25) everything on the hash table is
  	     * definitively NOT in the free list -- at least until afs_reclaim
  	     * can be safely implemented */
- 	    int vg;
  	    AFS_GUNLOCK();
  	    vg = vget(AFSTOV(tvc));	/* this bumps ref count */
  	    AFS_GLOCK();
--- 2083,2088 ----
***************
*** 2079,2094 ****
  		continue;
  #endif /* AFS_OSF_ENV */
  #ifdef AFS_DARWIN80_ENV
-             int vg;
              if (tvc->states & CDeadVnode) {
  		ReleaseSharedLock(&afs_xvcache);
  		afs_osi_Sleep(&tvc->states);
  		goto rootvc_loop;
              }
!             AFS_GUNLOCK();
!             vg = vnode_get(AFSTOV(tvc));        /* this bumps ref count */
!             AFS_GLOCK();
!             if (vg)
                  continue;
  #endif
  	    break;
--- 2090,2101 ----
  		continue;
  #endif /* AFS_OSF_ENV */
  #ifdef AFS_DARWIN80_ENV
              if (tvc->states & CDeadVnode) {
  		ReleaseSharedLock(&afs_xvcache);
  		afs_osi_Sleep(&tvc->states);
  		goto rootvc_loop;
              }
!             if (vnode_get(AFSTOV(tvc)))       /* this bumps ref count */
                  continue;
  #endif
  	    break;
***************
*** 2104,2111 ****
  	getNewFid = 1;
  	ReleaseSharedLock(&afs_xvcache);
  #ifdef AFS_DARWIN80_ENV
!         if (tvc)
              vnode_put(AFSTOV(tvc));
  #endif
          tvc = NULL;
  	goto newmtpt;
--- 2111,2121 ----
  	getNewFid = 1;
  	ReleaseSharedLock(&afs_xvcache);
  #ifdef AFS_DARWIN80_ENV
!         if (tvc) {
!             AFS_GUNLOCK();
              vnode_put(AFSTOV(tvc));
+             AFS_GLOCK();
+         }
  #endif
          tvc = NULL;
  	goto newmtpt;
***************
*** 2557,2562 ****
--- 2567,2575 ----
  
      register struct vcache *tvc;
      afs_int32 i;
+ #if defined( AFS_OSF_ENV)
+     int vg;
+ #endif
  
      AFS_STATCNT(afs_FindVCache);
  
***************
*** 2570,2576 ****
              }
  #ifdef  AFS_OSF_ENV
  	    /* Grab this vnode, possibly reactivating from the free list */
- 	    int vg;
  	    AFS_GUNLOCK();
  	    vg = vget(AFSTOV(tvc));
  	    AFS_GLOCK();
--- 2583,2588 ----
***************
*** 2578,2592 ****
  		continue;
  #endif /* AFS_OSF_ENV */
  #ifdef  AFS_DARWIN80_ENV
-             int vg;
              if (tvc->states & CDeadVnode) {
                  findvc_sleep(tvc, flag);
  		goto findloop;
              }
!             AFS_GUNLOCK();
!             vg = vnode_get(AFSTOV(tvc));
!             AFS_GLOCK();
!             if (vg)
                  continue;
  #endif
  	    break;
--- 2590,2600 ----
  		continue;
  #endif /* AFS_OSF_ENV */
  #ifdef  AFS_DARWIN80_ENV
              if (tvc->states & CDeadVnode) {
                  findvc_sleep(tvc, flag);
  		goto findloop;
              }
!             if (vnode_get(AFSTOV(tvc)))
                  continue;
  #endif
  	    break;
***************
*** 2688,2693 ****
--- 2696,2704 ----
      afs_int32 i;
      afs_int32 count = 0;
      struct vcache *found_tvc = NULL;
+ #ifdef  AFS_OSF_ENV
+     int vg;
+ #endif
  
      AFS_STATCNT(afs_FindVCache);
  
***************
*** 2710,2716 ****
              }
  #ifdef  AFS_OSF_ENV
  	    /* Grab this vnode, possibly reactivating from the free list */
- 	    int vg;
  	    AFS_GUNLOCK();
  	    vg = vget(AFSTOV(tvc));
  	    AFS_GLOCK();
--- 2721,2726 ----
***************
*** 2720,2735 ****
  	    }
  #endif /* AFS_OSF_ENV */
  #ifdef  AFS_DARWIN80_ENV
-             int vg;
              if (tvc->states & CDeadVnode) {
  		ReleaseSharedLock(&afs_xvcache);
  		afs_osi_Sleep(&tvc->states);
  		goto loop;
              }
!             AFS_GUNLOCK();
!             vg = vnode_get(AFSTOV(tvc));
!             AFS_GLOCK();
!             if (vg) {
                  /* This vnode no longer exists. */
                  continue;
              }
--- 2730,2741 ----
  	    }
  #endif /* AFS_OSF_ENV */
  #ifdef  AFS_DARWIN80_ENV
              if (tvc->states & CDeadVnode) {
  		ReleaseSharedLock(&afs_xvcache);
  		afs_osi_Sleep(&tvc->states);
  		goto loop;
              }
!             if (vnode_get(AFSTOV(tvc))) {
                  /* This vnode no longer exists. */
                  continue;
              }
Index: openafs/src/afs/afs_volume.c
diff -c openafs/src/afs/afs_volume.c:1.26.2.2 openafs/src/afs/afs_volume.c:1.26.2.3
*** openafs/src/afs/afs_volume.c:1.26.2.2	Wed Oct  5 01:58:27 2005
--- openafs/src/afs/afs_volume.c	Thu Jan  5 00:57:56 2006
***************
*** 19,25 ****
  #include "afs/param.h"
  
  RCSID
!     ("$Header: /cvs/openafs/src/afs/afs_volume.c,v 1.26.2.2 2005/10/05 05:58:27 shadow Exp $");
  
  #include "afs/stds.h"
  #include "afs/sysincludes.h"	/* Standard vendor system headers */
--- 19,25 ----
  #include "afs/param.h"
  
  RCSID
!     ("$Header: /cvs/openafs/src/afs/afs_volume.c,v 1.26.2.3 2006/01/05 05:57:56 shadow Exp $");
  
  #include "afs/stds.h"
  #include "afs/sysincludes.h"	/* Standard vendor system headers */
***************
*** 318,323 ****
--- 318,325 ----
  			afs_osi_Sleep(&tvc->states);
                          goto loop;
                      }
+                     if (vnode_get(AFSTOV(tvc)))
+                         continue;
  #endif
  		    AFS_FAST_HOLD(tvc);
  		    ReleaseReadLock(&afs_xvcache);
Index: openafs/src/afs/DARWIN/osi_vnodeops.c
diff -c openafs/src/afs/DARWIN/osi_vnodeops.c:1.18.2.8 openafs/src/afs/DARWIN/osi_vnodeops.c:1.18.2.9
*** openafs/src/afs/DARWIN/osi_vnodeops.c:1.18.2.8	Tue Nov 29 01:54:46 2005
--- openafs/src/afs/DARWIN/osi_vnodeops.c	Thu Jan  5 00:57:56 2006
***************
*** 5,11 ****
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/afs/DARWIN/osi_vnodeops.c,v 1.18.2.8 2005/11/29 06:54:46 shadow Exp $");
  
  #include <afs/sysincludes.h>	/* Standard vendor system headers */
  #include <afsincludes.h>	/* Afs-based standard headers */
--- 5,11 ----
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/afs/DARWIN/osi_vnodeops.c,v 1.18.2.9 2006/01/05 05:57:56 shadow Exp $");
  
  #include <afs/sysincludes.h>	/* Standard vendor system headers */
  #include <afsincludes.h>	/* Afs-based standard headers */
***************
*** 247,253 ****
      if (haveGlock) AFS_GUNLOCK(); 
  
  #ifdef AFS_DARWIN80_ENV
! 	vnode_get(vp);
  	vnode_ref(vp);
  	vnode_put(vp);
  #else
--- 247,262 ----
      if (haveGlock) AFS_GUNLOCK(); 
  
  #ifdef AFS_DARWIN80_ENV
! 	if (vnode_get(vp)) {
!            /* being terminated. kernel won't give us a ref. Now what? our
!               callers don't expect us to fail */
! #if 1
!            panic("vn_hold on terminating vnode");
! #else           
!            if (haveGlock) AFS_GLOCK(); 
!            return;
! #endif
!         }
  	vnode_ref(vp);
  	vnode_put(vp);
  #else
Index: openafs/src/afs/LINUX/osi_vnodeops.c
diff -c openafs/src/afs/LINUX/osi_vnodeops.c:1.81.2.37 openafs/src/afs/LINUX/osi_vnodeops.c:1.81.2.39
*** openafs/src/afs/LINUX/osi_vnodeops.c:1.81.2.37	Sat Oct 15 11:52:13 2005
--- openafs/src/afs/LINUX/osi_vnodeops.c	Sun Dec 18 22:29:58 2005
***************
*** 22,28 ****
  #include "afs/param.h"
  
  RCSID
!     ("$Header: /cvs/openafs/src/afs/LINUX/osi_vnodeops.c,v 1.81.2.37 2005/10/15 15:52:13 shadow Exp $");
  
  #include "afs/sysincludes.h"
  #include "afsincludes.h"
--- 22,28 ----
  #include "afs/param.h"
  
  RCSID
!     ("$Header: /cvs/openafs/src/afs/LINUX/osi_vnodeops.c,v 1.81.2.39 2005/12/19 03:29:58 rra Exp $");
  
  #include "afs/sysincludes.h"
  #include "afsincludes.h"
***************
*** 879,889 ****
  afs_linux_lookup(struct inode *dip, struct dentry *dp)
  #endif
  {
-     struct vattr vattr;
      cred_t *credp = crref();
      struct vcache *vcp = NULL;
      const char *comp = dp->d_name.name;
-     struct dentry *res = NULL;
      struct inode *ip = NULL;
      int code;
  
--- 879,887 ----
***************
*** 894,917 ****
      code = afs_lookup(VTOAFS(dip), comp, &vcp, credp);
      
      if (vcp) {
! 	ip = AFSTOV(vcp);
  
  	afs_getattr(vcp, &vattr, credp);
  	afs_fill_inode(ip, &vattr);
      }
      dp->d_op = &afs_dentry_operations;
      dp->d_time = hgetlo(VTOAFS(dip)->m.DataVersion);
      AFS_GUNLOCK();
  #if defined(AFS_LINUX24_ENV)
      if (ip && S_ISDIR(ip->i_mode)) {
!             d_prune_aliases(ip);
!             res = d_find_alias(ip);
      }
-     if (res) {
- 	if (d_unhashed(res))
- 	    d_rehash(res);
- 	iput(ip);
-     } else
  #endif
      d_add(dp, ip);
  
--- 892,924 ----
      code = afs_lookup(VTOAFS(dip), comp, &vcp, credp);
      
      if (vcp) {
! 	struct vattr vattr;
  
+ 	ip = AFSTOV(vcp);
  	afs_getattr(vcp, &vattr, credp);
  	afs_fill_inode(ip, &vattr);
      }
      dp->d_op = &afs_dentry_operations;
      dp->d_time = hgetlo(VTOAFS(dip)->m.DataVersion);
      AFS_GUNLOCK();
+ 
  #if defined(AFS_LINUX24_ENV)
      if (ip && S_ISDIR(ip->i_mode)) {
! 	struct dentry *alias;
! 
! 	alias = d_find_alias(ip);
! 	if (alias) {
! 	    if (d_invalidate(alias) == 0) {
! 		dput(alias);
! 	    } else {
! 		iput(ip);
! #if defined(AFS_LINUX26_ENV)
! 		unlock_kernel();
! #endif
! 		return alias;
! 	    }
! 	}
      }
  #endif
      d_add(dp, ip);
  
***************
*** 923,932 ****
      /* It's ok for the file to not be found. That's noted by the caller by
       * seeing that the dp->d_inode field is NULL.
       */
- #if defined(AFS_LINUX24_ENV)
-     if (code == 0)
-         return res;
- #endif
  #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,2,10)
      if (code == ENOENT)
  	return ERR_PTR(0);
--- 930,935 ----
***************
*** 1409,1415 ****
--- 1412,1422 ----
  
  #if defined(AFS_LINUX26_ENV)
      if (PageReclaim(pp)) {
+ # if defined(WRITEPAGE_ACTIVATE)
  	return WRITEPAGE_ACTIVATE;
+ # else 
+ 	return AOP_WRITEPAGE_ACTIVATE;
+ # endif
      }
  #else
      if (PageLaunder(pp)) {
Index: openafs/src/afs/VNOPS/afs_vnop_remove.c
diff -c openafs/src/afs/VNOPS/afs_vnop_remove.c:1.31.2.10 openafs/src/afs/VNOPS/afs_vnop_remove.c:1.31.2.11
*** openafs/src/afs/VNOPS/afs_vnop_remove.c:1.31.2.10	Wed Oct  5 01:58:31 2005
--- openafs/src/afs/VNOPS/afs_vnop_remove.c	Fri Dec 23 19:21:45 2005
***************
*** 21,27 ****
  #include "afs/param.h"
  
  RCSID
!     ("$Header: /cvs/openafs/src/afs/VNOPS/afs_vnop_remove.c,v 1.31.2.10 2005/10/05 05:58:31 shadow Exp $");
  
  #include "afs/sysincludes.h"	/* Standard vendor system headers */
  #include "afsincludes.h"	/* Afs-based standard headers */
--- 21,27 ----
  #include "afs/param.h"
  
  RCSID
!     ("$Header: /cvs/openafs/src/afs/VNOPS/afs_vnop_remove.c,v 1.31.2.11 2005/12/24 00:21:45 shadow Exp $");
  
  #include "afs/sysincludes.h"	/* Standard vendor system headers */
  #include "afsincludes.h"	/* Afs-based standard headers */
***************
*** 404,410 ****
  	code = afsremove(adp, tdc, tvc, aname, acred, &treq);
      }
      afs_PutFakeStat(&fakestate);
!     osi_Assert(!WriteLocked(&adp->lock) || !(adp->lock.pid_writer != MyPidxx));
      return code;
  }
  
--- 404,410 ----
  	code = afsremove(adp, tdc, tvc, aname, acred, &treq);
      }
      afs_PutFakeStat(&fakestate);
!     osi_Assert(!WriteLocked(&adp->lock) || (adp->lock.pid_writer != MyPidxx));
      return code;
  }
  
Index: openafs/src/afs/VNOPS/afs_vnop_rename.c
diff -c openafs/src/afs/VNOPS/afs_vnop_rename.c:1.16.2.7 openafs/src/afs/VNOPS/afs_vnop_rename.c:1.16.2.11
*** openafs/src/afs/VNOPS/afs_vnop_rename.c:1.16.2.7	Fri Jun 10 17:11:49 2005
--- openafs/src/afs/VNOPS/afs_vnop_rename.c	Fri Dec 23 19:21:45 2005
***************
*** 18,24 ****
  #include "afs/param.h"
  
  RCSID
!     ("$Header: /cvs/openafs/src/afs/VNOPS/afs_vnop_rename.c,v 1.16.2.7 2005/06/10 21:11:49 jaltman Exp $");
  
  #include "afs/sysincludes.h"	/* Standard vendor system headers */
  #include "afsincludes.h"	/* Afs-based standard headers */
--- 18,24 ----
  #include "afs/param.h"
  
  RCSID
!     ("$Header: /cvs/openafs/src/afs/VNOPS/afs_vnop_rename.c,v 1.16.2.11 2005/12/24 00:21:45 shadow Exp $");
  
  #include "afs/sysincludes.h"	/* Standard vendor system headers */
  #include "afsincludes.h"	/* Afs-based standard headers */
Index: openafs/src/config/NTMakefile.amd64_w2k
diff -c openafs/src/config/NTMakefile.amd64_w2k:1.1.2.23 openafs/src/config/NTMakefile.amd64_w2k:1.1.2.24
*** openafs/src/config/NTMakefile.amd64_w2k:1.1.2.23	Wed Nov 30 01:41:53 2005
--- openafs/src/config/NTMakefile.amd64_w2k	Wed Jan  4 23:43:40 2006
***************
*** 80,86 ****
  #define used in WinNT/2000 installation and program version display
  AFSPRODUCT_VER_MAJOR=1
  AFSPRODUCT_VER_MINOR=4
! AFSPRODUCT_VER_PATCH=0092
  AFSPRODUCT_VER_BUILD=0
  
  AFSPRODUCT_VERSION=$(AFSPRODUCT_VER_MAJOR).$(AFSPRODUCT_VER_MINOR).$(AFSPRODUCT_VER_PATCH)
--- 80,86 ----
  #define used in WinNT/2000 installation and program version display
  AFSPRODUCT_VER_MAJOR=1
  AFSPRODUCT_VER_MINOR=4
! AFSPRODUCT_VER_PATCH=0093
  AFSPRODUCT_VER_BUILD=0
  
  AFSPRODUCT_VERSION=$(AFSPRODUCT_VER_MAJOR).$(AFSPRODUCT_VER_MINOR).$(AFSPRODUCT_VER_PATCH)
Index: openafs/src/config/NTMakefile.i386_nt40
diff -c openafs/src/config/NTMakefile.i386_nt40:1.46.2.38 openafs/src/config/NTMakefile.i386_nt40:1.46.2.39
*** openafs/src/config/NTMakefile.i386_nt40:1.46.2.38	Wed Nov 30 01:41:53 2005
--- openafs/src/config/NTMakefile.i386_nt40	Wed Jan  4 23:43:40 2006
***************
*** 80,86 ****
  #define used in WinNT/2000 installation and program version display
  AFSPRODUCT_VER_MAJOR=1
  AFSPRODUCT_VER_MINOR=4
! AFSPRODUCT_VER_PATCH=0092
  AFSPRODUCT_VER_BUILD=0
  
  AFSPRODUCT_VERSION=$(AFSPRODUCT_VER_MAJOR).$(AFSPRODUCT_VER_MINOR).$(AFSPRODUCT_VER_PATCH)
--- 80,86 ----
  #define used in WinNT/2000 installation and program version display
  AFSPRODUCT_VER_MAJOR=1
  AFSPRODUCT_VER_MINOR=4
! AFSPRODUCT_VER_PATCH=0093
  AFSPRODUCT_VER_BUILD=0
  
  AFSPRODUCT_VERSION=$(AFSPRODUCT_VER_MAJOR).$(AFSPRODUCT_VER_MINOR).$(AFSPRODUCT_VER_PATCH)
Index: openafs/src/config/NTMakefile.i386_w2k
diff -c openafs/src/config/NTMakefile.i386_w2k:1.1.2.25 openafs/src/config/NTMakefile.i386_w2k:1.1.2.26
*** openafs/src/config/NTMakefile.i386_w2k:1.1.2.25	Wed Nov 30 01:41:53 2005
--- openafs/src/config/NTMakefile.i386_w2k	Wed Jan  4 23:43:40 2006
***************
*** 80,86 ****
  #define used in WinNT/2000 installation and program version display
  AFSPRODUCT_VER_MAJOR=1
  AFSPRODUCT_VER_MINOR=4
! AFSPRODUCT_VER_PATCH=0092
  AFSPRODUCT_VER_BUILD=0
  
  AFSPRODUCT_VERSION=$(AFSPRODUCT_VER_MAJOR).$(AFSPRODUCT_VER_MINOR).$(AFSPRODUCT_VER_PATCH)
--- 80,86 ----
  #define used in WinNT/2000 installation and program version display
  AFSPRODUCT_VER_MAJOR=1
  AFSPRODUCT_VER_MINOR=4
! AFSPRODUCT_VER_PATCH=0093
  AFSPRODUCT_VER_BUILD=0
  
  AFSPRODUCT_VERSION=$(AFSPRODUCT_VER_MAJOR).$(AFSPRODUCT_VER_MINOR).$(AFSPRODUCT_VER_PATCH)
Index: openafs/src/config/param.nbsd21.h
diff -c openafs/src/config/param.nbsd21.h:1.1.2.1 openafs/src/config/param.nbsd21.h:1.1.2.2
*** openafs/src/config/param.nbsd21.h:1.1.2.1	Tue Dec  7 00:56:52 2004
--- openafs/src/config/param.nbsd21.h	Sun Dec 11 14:00:19 2005
***************
*** 29,35 ****
  #define AFS_HAVE_FFS            1	/* Use system's ffs. */
  
  #if	!defined(ASSEMBLER) && !defined(__LANGUAGE_ASSEMBLY__) && !defined(IGNORE_STDS_H)
! #if __NetBSD_Version__ >= 200040000
  #define AFS_HAVE_STATVFS    1	/* System supports statvfs */
  #else
  #define AFS_HAVE_STATVFS    0	/* System doesn't supports statvfs */
--- 29,35 ----
  #define AFS_HAVE_FFS            1	/* Use system's ffs. */
  
  #if	!defined(ASSEMBLER) && !defined(__LANGUAGE_ASSEMBLY__) && !defined(IGNORE_STDS_H)
! #if __NetBSD_Version__ >= 299000900
  #define AFS_HAVE_STATVFS    1	/* System supports statvfs */
  #else
  #define AFS_HAVE_STATVFS    0	/* System doesn't supports statvfs */
Index: openafs/src/config/param.sun4x_510.h
diff -c openafs/src/config/param.sun4x_510.h:1.2.2.5 openafs/src/config/param.sun4x_510.h:1.2.2.6
*** openafs/src/config/param.sun4x_510.h:1.2.2.5	Thu Oct 13 11:16:58 2005
--- openafs/src/config/param.sun4x_510.h	Fri Dec 23 20:09:53 2005
***************
*** 81,87 ****
  #define	AFS_UIOUSER		UIO_USERSPACE
  #define	AFS_CLBYTES		MCLBYTES
  #define	AFS_MINCHANGE		2
! #define	osi_GetTime(x)		uniqtime(x)
  
  /**
    * These defines are for the 64 bit Solaris 7 port
--- 81,87 ----
  #define	AFS_UIOUSER		UIO_USERSPACE
  #define	AFS_CLBYTES		MCLBYTES
  #define	AFS_MINCHANGE		2
! #define	osi_GetTime(x)		uniqtime32(x)
  
  /**
    * These defines are for the 64 bit Solaris 7 port
***************
*** 93,109 ****
  #define AFS_64BIT_INO   	1
  #endif
  
- /**
-   * Solaris 7 64 bit has two versions of uniqtime. Since we consistently
-   * use 32 bit quantities for time in afs, we now use uniqtime32
-   */
- #if defined(AFS_SUN57_64BIT_ENV)
- #undef osi_GetTime
- #define osi_GetTime(x)		uniqtime32(x)
- #endif
- 
- 
- 
  #define	AFS_KALLOC(n)		kmem_alloc(n, KM_SLEEP)
  #define AFS_KALLOC_NOSLEEP(n)   kmem_alloc(n, KM_NOSLEEP)
  #define	AFS_KFREE		kmem_free
--- 93,98 ----
Index: openafs/src/config/param.sun4x_57.h
diff -c openafs/src/config/param.sun4x_57.h:1.9.2.3 openafs/src/config/param.sun4x_57.h:1.9.2.4
*** openafs/src/config/param.sun4x_57.h:1.9.2.3	Thu Oct 13 11:16:58 2005
--- openafs/src/config/param.sun4x_57.h	Fri Dec 23 20:09:53 2005
***************
*** 82,88 ****
  #define	AFS_UIOUSER	UIO_USERSPACE
  #define	AFS_CLBYTES	MCLBYTES
  #define	AFS_MINCHANGE	2
! #define	osi_GetTime(x)	uniqtime(x)
  
  /**
    * These defines are for the 64 bit Solaris 7 port
--- 82,88 ----
  #define	AFS_UIOUSER	UIO_USERSPACE
  #define	AFS_CLBYTES	MCLBYTES
  #define	AFS_MINCHANGE	2
! #define	osi_GetTime(x)	uniqtime32(x)
  
  /**
    * These defines are for the 64 bit Solaris 7 port
***************
*** 94,110 ****
  #define AFS_64BIT_INO   	1
  #endif
  
- /**
-   * Solaris 7 64 bit has two versions of uniqtime. Since we consistently
-   * use 32 bit quantities for time in afs, we now use uniqtime32
-   */
- #if defined(AFS_SUN57_64BIT_ENV)
- #undef osi_GetTime
- #define osi_GetTime(x)  uniqtime32(x)
- #endif
- 
- 
- 
  #define	AFS_KALLOC(n)	kmem_alloc(n, KM_SLEEP)
  #define AFS_KALLOC_NOSLEEP(n)   kmem_alloc(n, KM_NOSLEEP)
  #define	AFS_KFREE	kmem_free
--- 94,99 ----
Index: openafs/src/config/param.sun4x_58.h
diff -c openafs/src/config/param.sun4x_58.h:1.11.2.4 openafs/src/config/param.sun4x_58.h:1.11.2.5
*** openafs/src/config/param.sun4x_58.h:1.11.2.4	Thu Oct 13 11:16:58 2005
--- openafs/src/config/param.sun4x_58.h	Fri Dec 23 20:09:53 2005
***************
*** 79,85 ****
  #define	AFS_UIOUSER	UIO_USERSPACE
  #define	AFS_CLBYTES	MCLBYTES
  #define	AFS_MINCHANGE	2
! #define	osi_GetTime(x)	uniqtime(x)
  
  /**
    * These defines are for the 64 bit Solaris 7 port
--- 79,85 ----
  #define	AFS_UIOUSER	UIO_USERSPACE
  #define	AFS_CLBYTES	MCLBYTES
  #define	AFS_MINCHANGE	2
! #define	osi_GetTime(x)	uniqtime32(x)
  
  /**
    * These defines are for the 64 bit Solaris 7 port
***************
*** 91,107 ****
  #define AFS_64BIT_INO   	1
  #endif
  
- /**
-   * Solaris 7 64 bit has two versions of uniqtime. Since we consistently
-   * use 32 bit quantities for time in afs, we now use uniqtime32
-   */
- #if defined(AFS_SUN57_64BIT_ENV)
- #undef osi_GetTime
- #define osi_GetTime(x)  uniqtime32(x)
- #endif
- 
- 
- 
  #define	AFS_KALLOC(n)	kmem_alloc(n, KM_SLEEP)
  #define AFS_KALLOC_NOSLEEP(n)   kmem_alloc(n, KM_NOSLEEP)
  #define	AFS_KFREE	kmem_free
--- 91,96 ----
Index: openafs/src/config/param.sun4x_59.h
diff -c openafs/src/config/param.sun4x_59.h:1.5.2.4 openafs/src/config/param.sun4x_59.h:1.5.2.5
*** openafs/src/config/param.sun4x_59.h:1.5.2.4	Thu Oct 13 11:16:58 2005
--- openafs/src/config/param.sun4x_59.h	Fri Dec 23 20:09:53 2005
***************
*** 80,86 ****
  #define	AFS_UIOUSER	UIO_USERSPACE
  #define	AFS_CLBYTES	MCLBYTES
  #define	AFS_MINCHANGE	2
! #define	osi_GetTime(x)	uniqtime(x)
  
  /**
    * These defines are for the 64 bit Solaris 7 port
--- 80,86 ----
  #define	AFS_UIOUSER	UIO_USERSPACE
  #define	AFS_CLBYTES	MCLBYTES
  #define	AFS_MINCHANGE	2
! #define	osi_GetTime(x)	uniqtime32(x)
  
  /**
    * These defines are for the 64 bit Solaris 7 port
***************
*** 92,108 ****
  #define AFS_64BIT_INO   	1
  #endif
  
- /**
-   * Solaris 7 64 bit has two versions of uniqtime. Since we consistently
-   * use 32 bit quantities for time in afs, we now use uniqtime32
-   */
- #if defined(AFS_SUN57_64BIT_ENV)
- #undef osi_GetTime
- #define osi_GetTime(x)  uniqtime32(x)
- #endif
- 
- 
- 
  #define	AFS_KALLOC(n)	kmem_alloc(n, KM_SLEEP)
  #define AFS_KALLOC_NOSLEEP(n)   kmem_alloc(n, KM_NOSLEEP)
  #define	AFS_KFREE	kmem_free
--- 92,97 ----
Index: openafs/src/config/param.sunx86_510.h
diff -c openafs/src/config/param.sunx86_510.h:1.2.2.7 openafs/src/config/param.sunx86_510.h:1.2.2.8
*** openafs/src/config/param.sunx86_510.h:1.2.2.7	Thu Oct 13 11:16:58 2005
--- openafs/src/config/param.sunx86_510.h	Fri Dec 23 20:09:53 2005
***************
*** 91,97 ****
  #define	AFS_UIOUSER		UIO_USERSPACE
  #define	AFS_CLBYTES		MCLBYTES
  #define	AFS_MINCHANGE		2
! #define	osi_GetTime(x)		uniqtime(x)
  
  /**
    * These defines are for the 64 bit Solaris 7 port
--- 91,97 ----
  #define	AFS_UIOUSER		UIO_USERSPACE
  #define	AFS_CLBYTES		MCLBYTES
  #define	AFS_MINCHANGE		2
! #define	osi_GetTime(x)		uniqtime32(x)
  
  /**
    * These defines are for the 64 bit Solaris 7 port
***************
*** 103,119 ****
  #define AFS_64BIT_INO   	1
  #endif
  
- /**
-   * Solaris 7 64 bit has two versions of uniqtime. Since we consistently
-   * use 32 bit quantities for time in afs, we now use uniqtime32
-   */
- #if defined(AFS_SUN57_64BIT_ENV)
- #undef osi_GetTime
- #define osi_GetTime(x)		uniqtime32(x)
- #endif
- 
- 
- 
  #define	AFS_KALLOC(n)		kmem_alloc(n, KM_SLEEP)
  #define AFS_KALLOC_NOSLEEP(n)   kmem_alloc(n, KM_NOSLEEP)
  #define	AFS_KFREE		kmem_free
--- 103,108 ----
Index: openafs/src/config/param.sunx86_57.h
diff -c openafs/src/config/param.sunx86_57.h:1.4.2.4 openafs/src/config/param.sunx86_57.h:1.4.2.5
*** openafs/src/config/param.sunx86_57.h:1.4.2.4	Thu Oct 13 11:16:58 2005
--- openafs/src/config/param.sunx86_57.h	Fri Dec 23 20:09:53 2005
***************
*** 85,91 ****
  #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, KM_SLEEP)
  #define AFS_KALLOC_NOSLEEP(n)   kmem_alloc(n, KM_NOSLEEP)
--- 85,91 ----
  #define	AFS_UIOUSER	UIO_USERSPACE
  #define	AFS_CLBYTES	MCLBYTES
  #define	AFS_MINCHANGE	2
! #define	osi_GetTime(x)	uniqtime32(x)
  
  #define	AFS_KALLOC(n)	kmem_alloc(n, KM_SLEEP)
  #define AFS_KALLOC_NOSLEEP(n)   kmem_alloc(n, KM_NOSLEEP)
Index: openafs/src/config/param.sunx86_58.h
diff -c openafs/src/config/param.sunx86_58.h:1.6.2.4 openafs/src/config/param.sunx86_58.h:1.6.2.5
*** openafs/src/config/param.sunx86_58.h:1.6.2.4	Thu Oct 13 11:16:58 2005
--- openafs/src/config/param.sunx86_58.h	Fri Dec 23 20:09:53 2005
***************
*** 90,96 ****
  #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, KM_SLEEP)
  #define AFS_KALLOC_NOSLEEP(n)   kmem_alloc(n, KM_NOSLEEP)
--- 90,96 ----
  #define	AFS_UIOUSER	UIO_USERSPACE
  #define	AFS_CLBYTES	MCLBYTES
  #define	AFS_MINCHANGE	2
! #define	osi_GetTime(x)	uniqtime32(x)
  
  #define	AFS_KALLOC(n)	kmem_alloc(n, KM_SLEEP)
  #define AFS_KALLOC_NOSLEEP(n)   kmem_alloc(n, KM_NOSLEEP)
Index: openafs/src/config/param.sunx86_59.h
diff -c openafs/src/config/param.sunx86_59.h:1.2.2.4 openafs/src/config/param.sunx86_59.h:1.2.2.5
*** openafs/src/config/param.sunx86_59.h:1.2.2.4	Thu Oct 13 11:16:59 2005
--- openafs/src/config/param.sunx86_59.h	Fri Dec 23 20:09:53 2005
***************
*** 91,97 ****
  #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, KM_SLEEP)
  #define AFS_KALLOC_NOSLEEP(n)   kmem_alloc(n, KM_NOSLEEP)
--- 91,97 ----
  #define	AFS_UIOUSER	UIO_USERSPACE
  #define	AFS_CLBYTES	MCLBYTES
  #define	AFS_MINCHANGE	2
! #define	osi_GetTime(x)	uniqtime32(x)
  
  #define	AFS_KALLOC(n)	kmem_alloc(n, KM_SLEEP)
  #define AFS_KALLOC_NOSLEEP(n)   kmem_alloc(n, KM_NOSLEEP)
Index: openafs/src/libafs/MakefileProto.LINUX.in
diff -c openafs/src/libafs/MakefileProto.LINUX.in:1.40.2.12 openafs/src/libafs/MakefileProto.LINUX.in:1.40.2.13
*** openafs/src/libafs/MakefileProto.LINUX.in:1.40.2.12	Fri Oct 14 17:28:14 2005
--- openafs/src/libafs/MakefileProto.LINUX.in	Thu Dec  1 10:19:38 2005
***************
*** 171,177 ****
  	ln -fs ${LINUX_KERNEL_PATH}/include/asm-x86_64 asm
  <s390_linux22 s390_linux24 s390_linux26 s390x_linux26>
  	ln -fs ${LINUX_KERNEL_PATH}/include/asm-s390 asm
! <s390x_linux22 s390x_linux24>
  	ln -fs ${LINUX_KERNEL_PATH}/include/asm-s390x asm
  <ppc_linux22 ppc_linux24 ppc_linux26>
  	ln -fs ${LINUX_KERNEL_PATH}/include/asm-ppc asm 
--- 171,177 ----
  	ln -fs ${LINUX_KERNEL_PATH}/include/asm-x86_64 asm
  <s390_linux22 s390_linux24 s390_linux26 s390x_linux26>
  	ln -fs ${LINUX_KERNEL_PATH}/include/asm-s390 asm
! <s390x_linux22 s390x_linux24 s390x_linux26>
  	ln -fs ${LINUX_KERNEL_PATH}/include/asm-s390x asm
  <ppc_linux22 ppc_linux24 ppc_linux26>
  	ln -fs ${LINUX_KERNEL_PATH}/include/asm-ppc asm 
Index: openafs/src/packaging/MacOS/OpenAFS.info
diff -c openafs/src/packaging/MacOS/OpenAFS.info:1.1.4.22 openafs/src/packaging/MacOS/OpenAFS.info:1.1.4.23
*** openafs/src/packaging/MacOS/OpenAFS.info:1.1.4.22	Wed Nov 30 23:09:33 2005
--- openafs/src/packaging/MacOS/OpenAFS.info	Thu Jan  5 01:24:41 2006
***************
*** 1,5 ****
  Title OpenAFS
! Version 1.4.1-rc2
  Description The OpenAFS distributed filesystem. This package installs an almost-ready-to-run client for OpenAFS. see http://www.openafs.org for more information.
  DefaultLocation /
  Diskname (null)
--- 1,5 ----
  Title OpenAFS
! Version 1.4.1-rc3
  Description The OpenAFS distributed filesystem. This package installs an almost-ready-to-run client for OpenAFS. see http://www.openafs.org for more information.
  DefaultLocation /
  Diskname (null)
Index: openafs/src/procmgmt/pmgtprivate.h
diff -c openafs/src/procmgmt/pmgtprivate.h:1.3 openafs/src/procmgmt/pmgtprivate.h:1.3.2.1
*** openafs/src/procmgmt/pmgtprivate.h:1.3	Sun Mar  9 20:59:42 2003
--- openafs/src/procmgmt/pmgtprivate.h	Tue Dec 27 11:18:53 2005
***************
*** 30,35 ****
--- 30,36 ----
  
  extern int pmgt_SignalRaiseLocalByName(const char *signo, int *libSigno);
  extern int pmgt_RedirectNativeSignals(void);
+ extern int pmgt_RestoreNativeSignals(void);
  
  #else
  /* Private process management definitions and declarations for Unix */
Index: openafs/src/procmgmt/procmgmt_nt.c
diff -c openafs/src/procmgmt/procmgmt_nt.c:1.5 openafs/src/procmgmt/procmgmt_nt.c:1.5.2.1
*** openafs/src/procmgmt/procmgmt_nt.c:1.5	Tue Jul 15 19:15:58 2003
--- openafs/src/procmgmt/procmgmt_nt.c	Tue Dec 27 11:18:53 2005
***************
*** 11,17 ****
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/procmgmt/procmgmt_nt.c,v 1.5 2003/07/15 23:15:58 shadow Exp $");
  
  #include <afs/stds.h>
  
--- 11,17 ----
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/procmgmt/procmgmt_nt.c,v 1.5.2.1 2005/12/27 16:18:53 jaltman Exp $");
  
  #include <afs/stds.h>
  
***************
*** 1363,1369 ****
  	DWORD reason,		/* reason function is being called */
  	LPVOID reserved)
  {				/* reserved for future use */
!     if (reason == DLL_PROCESS_ATTACH) {
  	/* library is being attached to a process */
  	if (PmgtLibraryInitialize()) {
  	    /* failed to initialize library */
--- 1363,1370 ----
  	DWORD reason,		/* reason function is being called */
  	LPVOID reserved)
  {				/* reserved for future use */
!     switch (reason) {
!     case DLL_PROCESS_ATTACH:
  	/* library is being attached to a process */
  	if (PmgtLibraryInitialize()) {
  	    /* failed to initialize library */
***************
*** 1372,1378 ****
  
  	/* disable thread attach/detach notifications */
  	(void)DisableThreadLibraryCalls(dllInstHandle);
      }
- 
-     return TRUE;
  }
--- 1373,1383 ----
  
  	/* disable thread attach/detach notifications */
  	(void)DisableThreadLibraryCalls(dllInstHandle);
+ 	return TRUE;
+     case DLL_PROCESS_DETACH:
+ 	pmgt_RestoreNativeSignals();
+     	return TRUE;
+     default:
+ 	return FALSE;
      }
  }
Index: openafs/src/procmgmt/redirect_nt.c
diff -c openafs/src/procmgmt/redirect_nt.c:1.5 openafs/src/procmgmt/redirect_nt.c:1.5.2.1
*** openafs/src/procmgmt/redirect_nt.c:1.5	Tue Jul 15 19:15:59 2003
--- openafs/src/procmgmt/redirect_nt.c	Tue Dec 27 11:18:53 2005
***************
*** 11,17 ****
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/procmgmt/redirect_nt.c,v 1.5 2003/07/15 23:15:59 shadow Exp $");
  
  
  #include <stddef.h>
--- 11,17 ----
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/procmgmt/redirect_nt.c,v 1.5.2.1 2005/12/27 16:18:53 jaltman Exp $");
  
  
  #include <stddef.h>
***************
*** 110,112 ****
--- 110,132 ----
  	return 0;
      }
  }
+ 
+ /*
+  * pmgt_RedirectNativeSignals() -- initialize native signal redirection.
+  */
+ int
+ pmgt_RestoreNativeSignals(void)
+ {
+     if (signal(SIGINT, SIG_DFL) == SIG_ERR
+ 	|| signal(SIGILL, SIG_DFL) == SIG_ERR
+ 	|| signal(SIGFPE, SIG_DFL) == SIG_ERR
+ 	|| signal(SIGSEGV, SIG_DFL) == SIG_ERR
+ 	|| signal(SIGTERM, SIG_DFL) == SIG_ERR
+ 	|| signal(SIGABRT, SIG_DFL) == SIG_ERR) {
+ 	errno = EINVAL;
+ 	return -1;
+     } else {
+ 	return 0;
+     }
+ }
+ 
Index: openafs/src/rx/rx_clock.h
diff -c openafs/src/rx/rx_clock.h:1.13.2.1 openafs/src/rx/rx_clock.h:1.13.2.2
*** openafs/src/rx/rx_clock.h:1.13.2.1	Wed Apr 13 22:10:53 2005
--- openafs/src/rx/rx_clock.h	Fri Dec 23 20:09:54 2005
***************
*** 99,105 ****
         (cv)->usec = (afs_int32)tv.tv_usec;             \
      END
  #else /* defined(AFS_AIX51_ENV) && defined(AFS_64BIT_KERNEL) */
! #define clock_GetTime(cv) osi_GetTime((struct timeval *)cv)
  #endif /* defined(AFS_AIX51_ENV) && defined(AFS_64BIT_KERNEL) */
  #endif
  #define clock_Sec() osi_Time()
--- 99,105 ----
         (cv)->usec = (afs_int32)tv.tv_usec;             \
      END
  #else /* defined(AFS_AIX51_ENV) && defined(AFS_64BIT_KERNEL) */
! #define clock_GetTime(cv) osi_GetTime((osi_timeval_t *)(cv))
  #endif /* defined(AFS_AIX51_ENV) && defined(AFS_64BIT_KERNEL) */
  #endif
  #define clock_Sec() osi_Time()
Index: openafs/src/rx/rx_packet.c
diff -c openafs/src/rx/rx_packet.c:1.35.2.20 openafs/src/rx/rx_packet.c:1.35.2.22
*** openafs/src/rx/rx_packet.c:1.35.2.20	Wed Nov 30 23:00:39 2005
--- openafs/src/rx/rx_packet.c	Sat Dec 17 12:28:31 2005
***************
*** 15,21 ****
  #endif
  
  RCSID
!     ("$Header: /cvs/openafs/src/rx/rx_packet.c,v 1.35.2.20 2005/12/01 04:00:39 shadow Exp $");
  
  #ifdef KERNEL
  #if defined(UKERNEL)
--- 15,21 ----
  #endif
  
  RCSID
!     ("$Header: /cvs/openafs/src/rx/rx_packet.c,v 1.35.2.22 2005/12/17 17:28:31 jaltman Exp $");
  
  #ifdef KERNEL
  #if defined(UKERNEL)
***************
*** 810,815 ****
--- 810,816 ----
  rxi_FreeDataBufsToQueue(struct rx_packet *p, int first, struct rx_queue * q)
  {
      struct iovec *iov;
+     struct rx_packet * cb;
      int count = 0;
  
      if (first < 2)
***************
*** 818,824 ****
  	iov = &p->wirevec[first];
  	if (!iov->iov_base)
  	    osi_Panic("rxi_PacketIOVToQueue: unexpected NULL iov");
! 	queue_Append(q, RX_CBUF_TO_PACKET(iov->iov_base, p));
      }
      p->length = 0;
      p->niovecs = 0;
--- 819,827 ----
  	iov = &p->wirevec[first];
  	if (!iov->iov_base)
  	    osi_Panic("rxi_PacketIOVToQueue: unexpected NULL iov");
! 	cb = RX_CBUF_TO_PACKET(iov->iov_base, p);
! 	RX_FPQ_MARK_FREE(cb);
! 	queue_Append(q, cb);
      }
      p->length = 0;
      p->niovecs = 0;
***************
*** 1311,1317 ****
  }
  
  #ifndef KERNEL
! 
  /* count the number of used FDs */
  static int
  CountFDs(register int amax)
--- 1314,1323 ----
  }
  
  #ifndef KERNEL
! #ifdef AFS_NT40_ENV	 
! /* Windows does not use file descriptors. */
! #define CountFDs(amax) 0
! #else
  /* count the number of used FDs */
  static int
  CountFDs(register int amax)
***************
*** 1328,1334 ****
      }
      return count;
  }
! 
  #else /* KERNEL */
  
  #define CountFDs(amax) amax
--- 1334,1340 ----
      }
      return count;
  }
! #endif /* AFS_NT40_ENV */
  #else /* KERNEL */
  
  #define CountFDs(amax) amax
Index: openafs/src/rx/xdr_array.c
diff -c openafs/src/rx/xdr_array.c:1.9.2.1 openafs/src/rx/xdr_array.c:1.9.2.2
*** openafs/src/rx/xdr_array.c:1.9.2.1	Tue Dec  7 01:10:06 2004
--- openafs/src/rx/xdr_array.c	Thu Dec 15 10:16:45 2005
***************
*** 28,36 ****
   */
  #include <afsconfig.h>
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/rx/xdr_array.c,v 1.9.2.1 2004/12/07 06:10:06 shadow Exp $");
  
  #ifndef	NeXT
  
--- 28,37 ----
   */
  #include <afsconfig.h>
  #include <afs/param.h>
+ #include "rx.h"
  
  RCSID
!     ("$Header: /cvs/openafs/src/rx/xdr_array.c,v 1.9.2.2 2005/12/15 15:16:45 jaltman Exp $");
  
  #ifndef	NeXT
  
Index: openafs/src/rx/xdr_refernce.c
diff -c openafs/src/rx/xdr_refernce.c:1.6 openafs/src/rx/xdr_refernce.c:1.6.2.1
*** openafs/src/rx/xdr_refernce.c:1.6	Tue Jul 15 19:16:13 2003
--- openafs/src/rx/xdr_refernce.c	Thu Dec 15 00:57:12 2005
***************
*** 28,36 ****
   */
  #include <afsconfig.h>
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/rx/xdr_refernce.c,v 1.6 2003/07/15 23:16:13 shadow Exp $");
  
  #ifndef	NeXT
  
--- 28,37 ----
   */
  #include <afsconfig.h>
  #include <afs/param.h>
+ #include "rx.h"
  
  RCSID
!     ("$Header: /cvs/openafs/src/rx/xdr_refernce.c,v 1.6.2.1 2005/12/15 05:57:12 jaltman Exp $");
  
  #ifndef	NeXT
  
Index: openafs/src/rx/DARWIN/rx_kmutex.h
diff -c openafs/src/rx/DARWIN/rx_kmutex.h:1.4.2.1 openafs/src/rx/DARWIN/rx_kmutex.h:1.4.2.2
*** openafs/src/rx/DARWIN/rx_kmutex.h:1.4.2.1	Wed Oct  5 01:58:43 2005
--- openafs/src/rx/DARWIN/rx_kmutex.h	Fri Dec 23 19:10:02 2005
***************
*** 47,68 ****
  #define CV_DESTROY(cv)
  #ifdef AFS_DARWIN14_ENV
  #ifdef AFS_DARWIN80_ENV
! #define VFSSLEEP(cv) msleep(cv, NULL, PVFS, "afs_CV_WAIT", NULL)
! #define VFSTSLEEP(cv,t) do { \
!    struct timespec ts; \
!    ts.ts_sec = t; \
!    ts.ts_nsec = 0; \
!    msleep(cv, NULL, PVFS, "afs_CV_TIMEDWAIT", &ts); \
! } while(0)
  #else
- #define VFSSLEEP(cv) sleep(cv, PVFS)
- #define VFSTSLEEP(cv, t) tsleep(cv,PVFS, "afs_CV_TIMEDWAIT",t)
- #endif
  #define CV_WAIT(cv, lck)    do { \
  	                        int isGlockOwner = ISAFS_GLOCK(); \
  	                        if (isGlockOwner) AFS_GUNLOCK();  \
  	                        MUTEX_EXIT(lck);        \
! 	                        VFSSLEEP(cv);                \
  	                        if (isGlockOwner) AFS_GLOCK();  \
  	                        MUTEX_ENTER(lck); \
  	                    } while(0)
--- 47,86 ----
  #define CV_DESTROY(cv)
  #ifdef AFS_DARWIN14_ENV
  #ifdef AFS_DARWIN80_ENV
! #define CV_WAIT(cv, lck)    do { \
! 	                        int isGlockOwner = ISAFS_GLOCK(); \
! 	                        if (isGlockOwner) AFS_GUNLOCK();  \
! 				osi_Assert((lck)->owner == current_thread()); \
! 				(lck)->owner = (thread_t)0; \
! 				lck_mtx_lock((lck)->meta); \
! 				(lck)->waiters--; \
! 				lck_mtx_unlock((lck)->meta); \
!                                 msleep(cv, (lck)->lock, PDROP|PVFS, "afs_CV_WAIT", NULL); \
! 	                        if (isGlockOwner) AFS_GLOCK();  \
! 	                        MUTEX_ENTER(lck); \
! 	                    } while(0)
! 
! #define CV_TIMEDWAIT(cv,lck,t)  do { \
! 	                        struct timespec ts; \
! 	                        int isGlockOwner = ISAFS_GLOCK(); \
! 	                        ts.ts_sec = t; \
! 	                        ts.ts_nsec = 0; \
! 	                        if (isGlockOwner) AFS_GUNLOCK();  \
! 				osi_Assert((lck)->owner == current_thread()); \
! 				(lck)->owner = (thread_t)0; \
! 				lck_mtx_lock((lck)->meta); \
! 				(lck)->waiters--; \
! 				lck_mtx_unlock((lck)->meta); \
!                                 msleep(cv, (lck)->lock, PDROP|PVFS, "afs_CV_TIMEDWAIT", &ts); \
! 	                        if (isGlockOwner) AFS_GLOCK();  \
! 	                        MUTEX_ENTER(lck);       \
!                             } while(0)
  #else
  #define CV_WAIT(cv, lck)    do { \
  	                        int isGlockOwner = ISAFS_GLOCK(); \
  	                        if (isGlockOwner) AFS_GUNLOCK();  \
  	                        MUTEX_EXIT(lck);        \
! 	                        sleep(cv, PVFS);                \
  	                        if (isGlockOwner) AFS_GLOCK();  \
  	                        MUTEX_ENTER(lck); \
  	                    } while(0)
***************
*** 71,81 ****
  	                        int isGlockOwner = ISAFS_GLOCK(); \
  	                        if (isGlockOwner) AFS_GUNLOCK();  \
  	                        MUTEX_EXIT(lck);        \
! 	                        VFSTSLEEP(cv,t);  \
  	                        if (isGlockOwner) AFS_GLOCK();  \
  	                        MUTEX_ENTER(lck);       \
                              } while(0)
! 
  #define CV_SIGNAL(cv)           wakeup_one((void *)(cv))
  #define CV_BROADCAST(cv)        wakeup((void *)(cv))
  #else
--- 89,99 ----
  	                        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);       \
                              } while(0)
! #endif
  #define CV_SIGNAL(cv)           wakeup_one((void *)(cv))
  #define CV_BROADCAST(cv)        wakeup((void *)(cv))
  #else
Index: openafs/src/shlibafsauthent/Makefile.in
diff -c openafs/src/shlibafsauthent/Makefile.in:1.9.2.5 openafs/src/shlibafsauthent/Makefile.in:1.9.2.6
*** openafs/src/shlibafsauthent/Makefile.in:1.9.2.5	Sat Oct 15 11:21:17 2005
--- openafs/src/shlibafsauthent/Makefile.in	Sat Dec 10 13:45:39 2005
***************
*** 115,121 ****
  	sun*_5*) \
  		${SHLIB_LINKER} -h libafsauthent.${SHLIB_SUFFIX}.${LIBAFSAUTHENTMAJOR} -o ${LIBAFSAUTHENT} ${LIBOBJS} -L${TOP_LIBDIR} -lafsrpc ${MT_LIBS};; \
  	*_linux*) \
! 		${SHLIB_LINKER} -Wl,-h,libafsauthent.${SHLIB_SUFFIX}.${LIBAFSAUTHENTMAJOR} -Wl,--version-script=mapfile -o ${LIBAFSAUTHENT} ${LIBOBJS} -L${TOP_LIBDIR} -lafsrpc ${MT_LIBS};; \
  	*) \
  		${SHLIB_LINKER} -o ${LIBAFSAUTHENT} ${LIBOBJS} -L${TOP_LIBDIR} -lafsrpc ${MT_LIBS};; \
  	esac
--- 115,121 ----
  	sun*_5*) \
  		${SHLIB_LINKER} -h libafsauthent.${SHLIB_SUFFIX}.${LIBAFSAUTHENTMAJOR} -o ${LIBAFSAUTHENT} ${LIBOBJS} -L${TOP_LIBDIR} -lafsrpc ${MT_LIBS};; \
  	*_linux*) \
! 		${SHLIB_LINKER} -Wl,-h,libafsauthent.${SHLIB_SUFFIX}.${LIBAFSAUTHENTMAJOR} -Wl,--version-script=${srcdir}/mapfile -o ${LIBAFSAUTHENT} ${LIBOBJS} -L${TOP_LIBDIR} -lafsrpc ${MT_LIBS};; \
  	*) \
  		${SHLIB_LINKER} -o ${LIBAFSAUTHENT} ${LIBOBJS} -L${TOP_LIBDIR} -lafsrpc ${MT_LIBS};; \
  	esac
Index: openafs/src/shlibafsrpc/Makefile.in
diff -c openafs/src/shlibafsrpc/Makefile.in:1.15.2.6 openafs/src/shlibafsrpc/Makefile.in:1.15.2.7
*** openafs/src/shlibafsrpc/Makefile.in:1.15.2.6	Sat Oct 15 11:09:00 2005
--- openafs/src/shlibafsrpc/Makefile.in	Sat Dec 10 13:45:40 2005
***************
*** 148,154 ****
  	sun*_5*) \
  		${SHLIB_LINKER} -h libafsrpc.${SHLIB_SUFFIX}.${LIBAFSRPCMAJOR} -o ${LIBAFSRPC} ${LIBOBJS} ${MT_LIBS};; \
  	*_linux*) \
! 		${SHLIB_LINKER} -Wl,-h,libafsrpc.${SHLIB_SUFFIX}.${LIBAFSRPCMAJOR} -Wl,--version-script=mapfile -o ${LIBAFSRPC} ${LIBOBJS} ${MT_LIBS};; \
  	*) \
  		${SHLIB_LINKER} -o ${LIBAFSRPC} ${LIBOBJS} ${MT_LIBS};; \
  	esac
--- 148,154 ----
  	sun*_5*) \
  		${SHLIB_LINKER} -h libafsrpc.${SHLIB_SUFFIX}.${LIBAFSRPCMAJOR} -o ${LIBAFSRPC} ${LIBOBJS} ${MT_LIBS};; \
  	*_linux*) \
! 		${SHLIB_LINKER} -Wl,-h,libafsrpc.${SHLIB_SUFFIX}.${LIBAFSRPCMAJOR} -Wl,--version-script=${srcdir}/mapfile -o ${LIBAFSRPC} ${LIBOBJS} ${MT_LIBS};; \
  	*) \
  		${SHLIB_LINKER} -o ${LIBAFSRPC} ${LIBOBJS} ${MT_LIBS};; \
  	esac
***************
*** 280,286 ****
  #
  #   $ what /opt/langtools/bin/pxdb32
  #   /opt/langtools/bin/pxdb32:
! #           HP92453-02 A.10.0A HP-UX SYMBOLIC DEBUGGER (PXDB) $Revision: 1.15.2.6 $
  #
  # 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.
--- 280,286 ----
  #
  #   $ what /opt/langtools/bin/pxdb32
  #   /opt/langtools/bin/pxdb32:
! #           HP92453-02 A.10.0A HP-UX SYMBOLIC DEBUGGER (PXDB) $Revision: 1.15.2.7 $
  #
  # 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/sys/Makefile.in
diff -c openafs/src/sys/Makefile.in:1.27.2.7 openafs/src/sys/Makefile.in:1.27.2.9
*** openafs/src/sys/Makefile.in:1.27.2.7	Tue Oct 25 02:36:39 2005
--- openafs/src/sys/Makefile.in	Sun Dec 11 01:34:33 2005
***************
*** 16,22 ****
  include @TOP_OBJDIR@/src/config/Makefile.config
  
  CFLAGS=-I. -I${srcdir} ${DBUG} -I${TOP_OBJDIR}/src/config -I${TOP_INCDIR}  ${XCFLAGS}
! SFLAGS=-P -I${TOP_INCDIR}
  LIBS=libsys.a ${TOP_LIBDIR}/librx.a libsys.a ${TOP_LIBDIR}/liblwp.a ${TOP_LIBDIR}/util.a ${XLIBS}
  
  OBJECTS= afssyscalls.o setpag.o glue.o syscall.o
--- 16,22 ----
  include @TOP_OBJDIR@/src/config/Makefile.config
  
  CFLAGS=-I. -I${srcdir} ${DBUG} -I${TOP_OBJDIR}/src/config -I${TOP_INCDIR}  ${XCFLAGS}
! SFLAGS=-I${TOP_INCDIR}
  LIBS=libsys.a ${TOP_LIBDIR}/librx.a libsys.a ${TOP_LIBDIR}/liblwp.a ${TOP_LIBDIR}/util.a ${XLIBS}
  
  OBJECTS= afssyscalls.o setpag.o glue.o syscall.o
***************
*** 54,60 ****
  	case ${SYS_NAME} in \
  	*_linux*) \
  	    ${SHLIB_LINKER} -Wl,-h,libafssetpag.so.${LIBAFSSETPAGMAJOR} \
! 	        -o ${LIBAFSSETPAG} -Wl,--version-script=mapfile \
  	        ${SHLIBOBJS};; \
  	rs_aix4*) \
  	    ${SHLIB_LINKER} -o ${LIBAFSSETPAG} ${SHLIBOBJS} \
--- 54,60 ----
  	case ${SYS_NAME} in \
  	*_linux*) \
  	    ${SHLIB_LINKER} -Wl,-h,libafssetpag.so.${LIBAFSSETPAGMAJOR} \
! 	        -o ${LIBAFSSETPAG} -Wl,--version-script=${srcdir}/mapfile \
  	        ${SHLIBOBJS};; \
  	rs_aix4*) \
  	    ${SHLIB_LINKER} -o ${LIBAFSSETPAG} ${SHLIBOBJS} \
***************
*** 62,69 ****
  	sun*_5*) \
  	    ${SHLIB_LINKER} -h libafssetpag.so.${LIBAFSSETPAGMAJOR} \
  	        -o ${LIBAFSSETPAG} ${SHLIBOBJS};; \
- 	*bsd*) \
- 	    touch ${LIBAFSSETPAG};; \
  	*) \
  	    ${SHLIB_LINKER} -o ${LIBAFSSETPAG} ${SHLIBOBJS};; \
  	esac
--- 62,67 ----
***************
*** 73,79 ****
  syscall.o: syscall.s
  	case "$(SYS_NAME)" in \
  	 sun4c_51 | sun4c_52 | sun4m_51 | sun4m_52 | sun4c_53 | sun4m_53  | sun4_53 | sun4_52 | sun4_54 | sun4c_54 | sun4m_54 | sun4x_5? | sun4x_5?? | sunx86_5? | sunx86_5?? ) \
! 		/usr/ccs/lib/cpp  ${SFLAGS} ${srcdir}/syscall.s syscall.ss; \
  		as -o syscall.o syscall.ss;		\
  		$(RM) syscall.ss;;				\
  	 sgi_* |*_darwin* ) \
--- 71,77 ----
  syscall.o: syscall.s
  	case "$(SYS_NAME)" in \
  	 sun4c_51 | sun4c_52 | sun4m_51 | sun4m_52 | sun4c_53 | sun4m_53  | sun4_53 | sun4_52 | sun4_54 | sun4c_54 | sun4m_54 | sun4x_5? | sun4x_5?? | sunx86_5? | sunx86_5?? ) \
! 		/usr/ccs/lib/cpp -P ${SFLAGS} ${srcdir}/syscall.s syscall.ss; \
  		as -o syscall.o syscall.ss;		\
  		$(RM) syscall.ss;;				\
  	 sgi_* |*_darwin* ) \
***************
*** 84,93 ****
  		$(RM) -f syscall.ss syscall.i;; \
  	 hp_ux11? ) \
  		touch syscall.o;; \
! 	amd64_fbsd*|i386_*bsd*|*nbsd*) \
! 		touch syscall.o;; \
  	 *) \
! 		/lib/cpp  ${SFLAGS} ${srcdir}/syscall.s syscall.ss; \
  		as -o syscall.o syscall.ss;		\
  		$(RM) syscall.ss;;				\
  	esac
--- 82,93 ----
  		$(RM) -f syscall.ss syscall.i;; \
  	 hp_ux11? ) \
  		touch syscall.o;; \
! 	 amd64_fbsd*|i386_*bsd*|*nbsd*) \
! 		${CCOBJ} -E ${SFLAGS} syscall.s > syscall.S ; \
! 		${AS} syscall.S -o syscall.o ;  \
! 		$(RM) -f syscall.S ;;\
  	 *) \
! 		/lib/cpp -P ${SFLAGS} ${srcdir}/syscall.s syscall.ss; \
  		as -o syscall.o syscall.ss;		\
  		$(RM) syscall.ss;;				\
  	esac
Index: openafs/src/util/uuid.c
diff -c openafs/src/util/uuid.c:1.16 openafs/src/util/uuid.c:1.16.2.1
*** openafs/src/util/uuid.c:1.16	Tue Jul 15 19:17:16 2003
--- openafs/src/util/uuid.c	Fri Dec 23 20:09:55 2005
***************
*** 50,56 ****
  #endif
  
  RCSID
!     ("$Header: /cvs/openafs/src/util/uuid.c,v 1.16 2003/07/15 23:17:16 shadow Exp $");
  
  #ifdef KERNEL
  #include "afs/sysincludes.h"
--- 50,56 ----
  #endif
  
  RCSID
!     ("$Header: /cvs/openafs/src/util/uuid.c,v 1.16.2.1 2005/12/24 01:09:55 shadow Exp $");
  
  #ifdef KERNEL
  #include "afs/sysincludes.h"
***************
*** 418,424 ****
  void
  uuid__get_os_time(uuid_time_t * os_time)
  {
!     struct timeval tp;
  
      osi_GetTime(&tp);
      os_time->hi = tp.tv_sec;
--- 418,424 ----
  void
  uuid__get_os_time(uuid_time_t * os_time)
  {
!     osi_timeval_t tp;
  
      osi_GetTime(&tp);
      os_time->hi = tp.tv_sec;
Index: openafs/src/viced/callback.c
diff -c openafs/src/viced/callback.c:1.55.2.10 openafs/src/viced/callback.c:1.55.2.12
*** openafs/src/viced/callback.c:1.55.2.10	Thu Jul 28 16:52:21 2005
--- openafs/src/viced/callback.c	Fri Dec 16 08:29:38 2005
***************
*** 83,89 ****
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/viced/callback.c,v 1.55.2.10 2005/07/28 20:52:21 shadow Exp $");
  
  #include <stdio.h>
  #include <stdlib.h>		/* for malloc() */
--- 83,89 ----
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/viced/callback.c,v 1.55.2.12 2005/12/16 13:29:38 shadow Exp $");
  
  #include <stdio.h>
  #include <stdlib.h>		/* for malloc() */
***************
*** 778,783 ****
--- 778,784 ----
      int i, j;
      struct rx_connection *conns[MAX_CB_HOSTS];
      static struct AFSCBs tc = { 0, 0 };
+     int multi_to_cba_map[MAX_CB_HOSTS];
  
      assert(ncbas <= MAX_CB_HOSTS);
  
***************
*** 788,793 ****
--- 789,795 ----
  	    continue;
  	}
  	rx_GetConnection(thishost->callback_rxcon);
+ 	multi_to_cba_map[j] = i;
  	conns[j++] = thishost->callback_rxcon;
  
  #ifdef	ADAPT_MTU
***************
*** 806,833 ****
  		struct host *hp;
  		char hoststr[16];
  
! 		idx = 0;
! 		/* If there's an error, we have to hunt for the right host. 
! 		 * The conns array _should_ correspond one-to-one to the cba
! 		 * array, except in some rare cases it might be missing one 
! 		 * or more elements.  So the optimistic case is almost 
! 		 * always right.  At worst, it's the starting point for the 
! 		 * hunt. */
! 		for (hp = 0, i = multi_i; i < j; i++) {
! 		    hp = cba[i].hp;	/* optimistic, but usually right */
! 		    if (!hp) {
! 			break;
! 		    }
! 		    if (conns[multi_i] == hp->callback_rxcon) {
! 			idx = cba[i].thead;
! 			break;
! 		    }
! 		}
  
! 		if (!hp) {
  		    ViceLog(0,
! 			    ("BCB: INTERNAL ERROR: hp=%x, cba=%x\n", hp,
! 			     cba));
  		} else {
  		    /* 
  		     ** try breaking callbacks on alternate interface addresses
--- 808,821 ----
  		struct host *hp;
  		char hoststr[16];
  
! 		i = multi_to_cba_map[multi_i];
! 		hp = cba[i].hp;
! 		idx = cba[i].thead;
  
! 		if (!hp || !idx) {
  		    ViceLog(0,
! 			    ("BCB: INTERNAL ERROR: hp=%x, cba=%x, thead=%u\n", 
! 			     hp, cba, idx));
  		} else {
  		    /* 
  		     ** try breaking callbacks on alternate interface addresses
***************
*** 1986,1992 ****
      int i, j;
      struct rx_connection **conns;
      struct rx_connection *connSuccess = 0;
!     afs_int32 *addr;
      static struct rx_securityClass *sc = 0;
      static struct AFSCBs tc = { 0, 0 };
      char hoststr[16];
--- 1974,1980 ----
      int i, j;
      struct rx_connection **conns;
      struct rx_connection *connSuccess = 0;
!     struct AddrPort *interfaces;
      static struct rx_securityClass *sc = 0;
      static struct AFSCBs tc = { 0, 0 };
      char hoststr[16];
***************
*** 2006,2014 ****
  	sc = rxnull_NewClientSecurityObject();
  
      i = host->interface->numberOfInterfaces;
!     addr = calloc(i, sizeof(afs_int32));
      conns = calloc(i, sizeof(struct rx_connection *));
!     if (!addr || !conns) {
  	ViceLog(0,
  		("Failed malloc in MultiBreakCallBackAlternateAddress_r\n"));
  	assert(0);
--- 1994,2002 ----
  	sc = rxnull_NewClientSecurityObject();
  
      i = host->interface->numberOfInterfaces;
!     interfaces = calloc(i, sizeof(struct AddrPort));
      conns = calloc(i, sizeof(struct rx_connection *));
!     if (!interfaces || !conns) {
  	ViceLog(0,
  		("Failed malloc in MultiBreakCallBackAlternateAddress_r\n"));
  	assert(0);
***************
*** 2017,2028 ****
      /* initialize alternate rx connections */
      for (i = 0, j = 0; i < host->interface->numberOfInterfaces; i++) {
  	/* this is the current primary address */
! 	if (host->host == host->interface->addr[i])
  	    continue;
  
! 	addr[j] = host->interface->addr[i];
  	conns[j] =
! 	    rx_NewConnection(host->interface->addr[i], host->port, 1, sc, 0);
  	rx_SetConnDeadTime(conns[j], 2);
  	rx_SetConnHardDeadTime(conns[j], AFS_HARDDEADTIME);
  	j++;
--- 2005,2018 ----
      /* initialize alternate rx connections */
      for (i = 0, j = 0; i < host->interface->numberOfInterfaces; i++) {
  	/* this is the current primary address */
! 	if (host->host == host->interface->interface[i].addr &&
! 	    host->port == host->interface->interface[i].port)
  	    continue;
  
! 	interfaces[j] = host->interface->interface[i];
  	conns[j] =
! 	    rx_NewConnection(interfaces[j].addr, 
! 			     interfaces[j].port, 1, sc, 0);
  	rx_SetConnDeadTime(conns[j], 2);
  	rx_SetConnHardDeadTime(conns[j], AFS_HARDDEADTIME);
  	j++;
***************
*** 2041,2053 ****
  	    if (host->callback_rxcon)
  		rx_DestroyConnection(host->callback_rxcon);
  	    host->callback_rxcon = conns[multi_i];
! 	    host->host = addr[multi_i];
  	    connSuccess = conns[multi_i];
  	    rx_SetConnDeadTime(host->callback_rxcon, 50);
  	    rx_SetConnHardDeadTime(host->callback_rxcon, AFS_HARDDEADTIME);
  	    ViceLog(125,
  		    ("multibreakcall success with addr %s\n",
! 		     afs_inet_ntoa_r(addr[multi_i], hoststr)));
  	    H_UNLOCK;
  	    multi_Abort;
  	}
--- 2031,2044 ----
  	    if (host->callback_rxcon)
  		rx_DestroyConnection(host->callback_rxcon);
  	    host->callback_rxcon = conns[multi_i];
! 	    host->host = interfaces[multi_i].addr;
! 	    host->port = interfaces[multi_i].port;
  	    connSuccess = conns[multi_i];
  	    rx_SetConnDeadTime(host->callback_rxcon, 50);
  	    rx_SetConnHardDeadTime(host->callback_rxcon, AFS_HARDDEADTIME);
  	    ViceLog(125,
  		    ("multibreakcall success with addr %s\n",
! 		     afs_inet_ntoa_r(interfaces[multi_i].addr, hoststr)));
  	    H_UNLOCK;
  	    multi_Abort;
  	}
***************
*** 2059,2065 ****
  	if (conns[i] != connSuccess)
  	    rx_DestroyConnection(conns[i]);
  
!     free(addr);
      free(conns);
  
      if (connSuccess)
--- 2050,2056 ----
  	if (conns[i] != connSuccess)
  	    rx_DestroyConnection(conns[i]);
  
!     free(interfaces);
      free(conns);
  
      if (connSuccess)
***************
*** 2079,2085 ****
      int i, j;
      struct rx_connection **conns;
      struct rx_connection *connSuccess = 0;
!     afs_int32 *addr;
      static struct rx_securityClass *sc = 0;
      char hoststr[16];
  
--- 2070,2076 ----
      int i, j;
      struct rx_connection **conns;
      struct rx_connection *connSuccess = 0;
!     struct AddrPort *interfaces;
      static struct rx_securityClass *sc = 0;
      char hoststr[16];
  
***************
*** 2098,2106 ****
  	sc = rxnull_NewClientSecurityObject();
  
      i = host->interface->numberOfInterfaces;
!     addr = calloc(i, sizeof(afs_int32));
      conns = calloc(i, sizeof(struct rx_connection *));
!     if (!addr || !conns) {
  	ViceLog(0, ("Failed malloc in MultiProbeAlternateAddress_r\n"));
  	assert(0);
      }
--- 2089,2097 ----
  	sc = rxnull_NewClientSecurityObject();
  
      i = host->interface->numberOfInterfaces;
!     interfaces = calloc(i, sizeof(struct AddrPort));
      conns = calloc(i, sizeof(struct rx_connection *));
!     if (!interfaces || !conns) {
  	ViceLog(0, ("Failed malloc in MultiProbeAlternateAddress_r\n"));
  	assert(0);
      }
***************
*** 2108,2119 ****
      /* initialize alternate rx connections */
      for (i = 0, j = 0; i < host->interface->numberOfInterfaces; i++) {
  	/* this is the current primary address */
! 	if (host->host == host->interface->addr[i])
  	    continue;
  
! 	addr[j] = host->interface->addr[i];
  	conns[j] =
! 	    rx_NewConnection(host->interface->addr[i], host->port, 1, sc, 0);
  	rx_SetConnDeadTime(conns[j], 2);
  	rx_SetConnHardDeadTime(conns[j], AFS_HARDDEADTIME);
  	j++;
--- 2099,2112 ----
      /* initialize alternate rx connections */
      for (i = 0, j = 0; i < host->interface->numberOfInterfaces; i++) {
  	/* this is the current primary address */
! 	if (host->host == host->interface->interface[i].addr &&
! 	    host->port == host->interface->interface[i].port)
  	    continue;
  
! 	interfaces[j] = host->interface->interface[i];
  	conns[j] =
! 	    rx_NewConnection(interfaces[i].addr, 
! 			     interfaces[i].port, 1, sc, 0);
  	rx_SetConnDeadTime(conns[j], 2);
  	rx_SetConnHardDeadTime(conns[j], AFS_HARDDEADTIME);
  	j++;
***************
*** 2132,2150 ****
  	    if (host->callback_rxcon)
  		rx_DestroyConnection(host->callback_rxcon);
  	    host->callback_rxcon = conns[multi_i];
! 	    host->host = addr[multi_i];
  	    connSuccess = conns[multi_i];
  	    rx_SetConnDeadTime(host->callback_rxcon, 50);
  	    rx_SetConnHardDeadTime(host->callback_rxcon, AFS_HARDDEADTIME);
  	    ViceLog(125,
  		    ("multiprobe success with addr %s\n",
! 		     afs_inet_ntoa_r(addr[multi_i], hoststr)));
  	    H_UNLOCK;
  	    multi_Abort;
  	} else {
  	    ViceLog(125,
  		    ("multiprobe failure with addr %s\n",
! 		     afs_inet_ntoa_r(addr[multi_i], hoststr)));
              
              /* This is less than desirable but its the best we can do.
               * The AFS Cache Manager will return either 0 for a Uuid  
--- 2125,2144 ----
  	    if (host->callback_rxcon)
  		rx_DestroyConnection(host->callback_rxcon);
  	    host->callback_rxcon = conns[multi_i];
! 	    host->host = interfaces[multi_i].addr;
! 	    host->port = interfaces[multi_i].port;
  	    connSuccess = conns[multi_i];
  	    rx_SetConnDeadTime(host->callback_rxcon, 50);
  	    rx_SetConnHardDeadTime(host->callback_rxcon, AFS_HARDDEADTIME);
  	    ViceLog(125,
  		    ("multiprobe success with addr %s\n",
! 		     afs_inet_ntoa_r(interfaces[multi_i].addr, hoststr)));
  	    H_UNLOCK;
  	    multi_Abort;
  	} else {
  	    ViceLog(125,
  		    ("multiprobe failure with addr %s\n",
! 		     afs_inet_ntoa_r(interfaces[multi_i].addr, hoststr)));
              
              /* This is less than desirable but its the best we can do.
               * The AFS Cache Manager will return either 0 for a Uuid  
***************
*** 2159,2166 ****
                  /* remove the current alternate address from this host */
                  H_LOCK;
                  for (i = 0, j = 0; i < host->interface->numberOfInterfaces; i++) {
!                     if (addr[multi_i] != host->interface->addr[i]) {
!                         host->interface->addr[j] = host->interface->addr[i];
                          j++;
                      }
                  }
--- 2153,2161 ----
                  /* remove the current alternate address from this host */
                  H_LOCK;
                  for (i = 0, j = 0; i < host->interface->numberOfInterfaces; i++) {
!                     if (interfaces[multi_i].addr != host->interface->interface[i].addr &&
! 			interfaces[multi_i].port != host->interface->interface[i].port) {
!                         host->interface->interface[j] = host->interface->interface[i];
                          j++;
                      }
                  }
***************
*** 2176,2182 ****
  	if (conns[i] != connSuccess)
  	    rx_DestroyConnection(conns[i]);
  
!     free(addr);
      free(conns);
  
      if (connSuccess)
--- 2171,2177 ----
  	if (conns[i] != connSuccess)
  	    rx_DestroyConnection(conns[i]);
  
!     free(interfaces);
      free(conns);
  
      if (connSuccess)
Index: openafs/src/viced/host.c
diff -c openafs/src/viced/host.c:1.57.2.6 openafs/src/viced/host.c:1.57.2.7
*** openafs/src/viced/host.c:1.57.2.6	Mon Nov 28 22:41:48 2005
--- openafs/src/viced/host.c	Fri Dec 16 08:29:38 2005
***************
*** 11,17 ****
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/viced/host.c,v 1.57.2.6 2005/11/29 03:41:48 shadow Exp $");
  
  #include <stdio.h>
  #include <errno.h>
--- 11,17 ----
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/viced/host.c,v 1.57.2.7 2005/12/16 13:29:38 shadow Exp $");
  
  #include <stdio.h>
  #include <errno.h>
***************
*** 613,632 ****
  /* Note: host should be released by caller if 0 == *heldp and non-null */
  /* hostaddr and hport are in network order */
  struct host *
! h_Lookup_r(afs_uint32 hostaddr, afs_uint32 hport, int *heldp)
  {
      register afs_int32 now;
      register struct host *host = 0;
      register struct h_hashChain *chain;
!     register index = h_HashIndex(hostaddr);
      extern int hostaclRefresh;
  
    restart:
      for (chain = hostHashTable[index]; chain; chain = chain->next) {
  	host = chain->hostPtr;
  	assert(host);
! 	if (!(host->hostFlags & HOSTDELETED) && chain->addr == hostaddr
! 	    && host->port == hport) {
  	    *heldp = h_Held_r(host);
  	    if (!*heldp)
  		h_Hold_r(host);
--- 613,632 ----
  /* Note: host should be released by caller if 0 == *heldp and non-null */
  /* hostaddr and hport are in network order */
  struct host *
! h_Lookup_r(afs_uint32 haddr, afs_uint32 hport, int *heldp)
  {
      register afs_int32 now;
      register struct host *host = 0;
      register struct h_hashChain *chain;
!     register index = h_HashIndex(haddr);
      extern int hostaclRefresh;
  
    restart:
      for (chain = hostHashTable[index]; chain; chain = chain->next) {
  	host = chain->hostPtr;
  	assert(host);
! 	if (!(host->hostFlags & HOSTDELETED) && chain->addr == haddr
! 	    && chain->port == hport) {
  	    *heldp = h_Held_r(host);
  	    if (!*heldp)
  		h_Hold_r(host);
***************
*** 746,752 ****
  	register struct h_hashChain **hp, *th;
  	register struct rx_connection *rxconn;
  	afsUUID *uuidp;
! 	afs_uint32 hostAddr;
  	int i;
  
  	if (host->Console & 1)
--- 746,752 ----
  	register struct h_hashChain **hp, *th;
  	register struct rx_connection *rxconn;
  	afsUUID *uuidp;
! 	struct AddrPort hostAddrPort;
  	int i;
  
  	if (host->Console & 1)
***************
*** 800,807 ****
  	    /* delete all hash entries for alternate addresses */
  	    assert(host->interface->numberOfInterfaces > 0);
  	    for (i = 0; i < host->interface->numberOfInterfaces; i++) {
! 		hostAddr = host->interface->addr[i];
! 		for (hp = &hostHashTable[h_HashIndex(hostAddr)]; (th = *hp);
  		     hp = &th->next) {
  		    assert(th->hostPtr);
  		    if (th->hostPtr == host) {
--- 800,808 ----
  	    /* delete all hash entries for alternate addresses */
  	    assert(host->interface->numberOfInterfaces > 0);
  	    for (i = 0; i < host->interface->numberOfInterfaces; i++) {
! 		hostAddrPort = host->interface->interface[i];
! 
! 		for (hp = &hostHashTable[h_HashIndex(hostAddrPort.addr)]; (th = *hp);
  		     hp = &th->next) {
  		    assert(th->hostPtr);
  		    if (th->hostPtr == host) {
***************
*** 935,940 ****
--- 936,1023 ----
      hostUuidHashTable[index] = chain;
  }
  
+ 
+ /* inserts a new HashChain structure corresponding to this address */
+ void
+ hashInsert_r(afs_uint32 addr, afs_uint16 port, struct host *host)
+ {
+     int index;
+     struct h_hashChain *chain;
+ 
+     /* hash into proper bucket */
+     index = h_HashIndex(addr);
+ 
+     /* insert into beginning of list for this bucket */
+     chain = (struct h_hashChain *)malloc(sizeof(struct h_hashChain));
+     if (!chain) {
+ 	ViceLog(0, ("Failed malloc in hashInsert_r\n"));
+ 	assert(0);
+     }
+     chain->hostPtr = host;
+     chain->next = hostHashTable[index];
+     chain->addr = addr;
+     chain->port = port;
+     hostHashTable[index] = chain;
+ 
+ }
+ 
+ /*
+  * This is called with host locked and held. At this point, the
+  * hostHashTable should not be having entries for the alternate
+  * interfaces. This function has to insert these entries in the
+  * hostHashTable.
+  *
+  * All addresses are in network byte order.
+  */
+ int
+ addInterfaceAddr_r(struct host *host, afs_uint32 addr, afs_uint16 port)
+ {
+     int i;
+     int number;
+     int found;
+     struct Interface *interface;
+ 
+     assert(host);
+     assert(host->interface);
+ 
+     ViceLog(125, ("addInterfaceAddr : host %x addr %x:%d\n", host->host, addr, ntohs(port)));
+ 
+     /*
+      * Make sure this address is on the list of known addresses
+      * for this host.
+      */
+     number = host->interface->numberOfInterfaces;
+     for (i = 0, found = 0; i < number && !found; i++) {
+ 	if (host->interface->interface[i].addr == addr &&
+ 	    host->interface->interface[i].port == port)
+ 	    found = 1;
+     }
+     if (!found) {
+ 	interface = (struct Interface *)
+ 	    malloc(sizeof(struct Interface) + (sizeof(struct AddrPort) * number));
+ 	if (!interface) {
+ 	    ViceLog(0, ("Failed malloc in addInterfaceAddr_r\n"));
+ 	    assert(0);
+ 	}
+ 	interface->numberOfInterfaces = number + 1;
+ 	interface->uuid = host->interface->uuid;
+ 	for (i = 0; i < number; i++)
+ 	    interface->interface[i] = host->interface->interface[i];
+ 	interface->interface[number].addr = addr;
+ 	interface->interface[number].port = port;
+ 	free(host->interface);
+ 	host->interface = interface;
+     }
+ 
+     /*
+      * Create a hash table entry for this address
+      */
+     hashInsert_r(addr, port, host);
+ 
+     return 0;
+ }
+ 
+ 
  /* Host is returned held */
  struct host *
  h_GetHost_r(struct rx_connection *tcon)
***************
*** 947,953 ****
      int interfValid = 0;
      struct Identity *identP = NULL;
      afs_int32 haddr;
!     afs_int32 hport;
      char hoststr[16], hoststr2[16];
      Capabilities caps;
      struct rx_connection *cb_conn = NULL;
--- 1030,1036 ----
      int interfValid = 0;
      struct Identity *identP = NULL;
      afs_int32 haddr;
!     afs_int16 hport;
      char hoststr[16], hoststr2[16];
      Capabilities caps;
      struct rx_connection *cb_conn = NULL;
***************
*** 1210,1216 ****
  			     ntohs(host->port), afs_inet_ntoa_r(oldHost->host,
  								hoststr2),
  			     ntohs(oldHost->port)));
! 		    addInterfaceAddr_r(oldHost, haddr);
  		    host->hostFlags |= HOSTDELETED;
  		    h_Unlock_r(host);
  		    h_Release_r(host);
--- 1293,1299 ----
  			     ntohs(host->port), afs_inet_ntoa_r(oldHost->host,
  								hoststr2),
  			     ntohs(oldHost->port)));
! 		    addInterfaceAddr_r(oldHost, haddr, hport);
  		    host->hostFlags |= HOSTDELETED;
  		    h_Unlock_r(host);
  		    h_Release_r(host);
***************
*** 1843,1849 ****
      (void)STREAM_WRITE(tmpStr, strlen(tmpStr), 1, file);
      if (host->interface)
  	for (i = 0; i < host->interface->numberOfInterfaces; i++) {
! 	    sprintf(tmpStr, " %x", host->interface->addr[i]);
  	    (void)STREAM_WRITE(tmpStr, strlen(tmpStr), 1, file);
  	}
      sprintf(tmpStr, "] holds: ");
--- 1926,1933 ----
      (void)STREAM_WRITE(tmpStr, strlen(tmpStr), 1, file);
      if (host->interface)
  	for (i = 0; i < host->interface->numberOfInterfaces; i++) {
! 	    sprintf(tmpStr, " %x:%d", host->interface->interface[i].addr,
! 		     ntohs(host->interface->interface[i].port));
  	    (void)STREAM_WRITE(tmpStr, strlen(tmpStr), 1, file);
  	}
      sprintf(tmpStr, "] holds: ");
***************
*** 2224,2241 ****
  
  /*
   * This is called with host locked and held. At this point, the
!  * hostHashTable should not be having entries for the alternate
   * interfaces. This function has to insert these entries in the
   * hostHashTable.
   *
!  * The addresses in the ineterfaceAddr list are in host byte order.
   */
  int
  initInterfaceAddr_r(struct host *host, struct interfaceAddr *interf)
  {
      int i, j;
      int number, count;
!     afs_int32 myHost;
      int found;
      struct Interface *interface;
  
--- 2308,2326 ----
  
  /*
   * This is called with host locked and held. At this point, the
!  * hostHashTable should not have any entries for the alternate
   * interfaces. This function has to insert these entries in the
   * hostHashTable.
   *
!  * The addresses in the interfaceAddr list are in host byte order.
   */
  int
  initInterfaceAddr_r(struct host *host, struct interfaceAddr *interf)
  {
      int i, j;
      int number, count;
!     afs_uint32 myAddr;
!     afs_uint16 myPort;
      int found;
      struct Interface *interface;
  
***************
*** 2247,2253 ****
  	     interf->numberOfInterfaces));
  
      number = interf->numberOfInterfaces;
!     myHost = host->host;	/* current interface address */
  
      /* validation checks */
      if (number < 0 || number > AFS_MAX_INTERFACE_ADDR) {
--- 2332,2339 ----
  	     interf->numberOfInterfaces));
  
      number = interf->numberOfInterfaces;
!     myAddr = host->host;	/* current interface address */
!     myPort = host->port;	/* current port */
  
      /* validation checks */
      if (number < 0 || number > AFS_MAX_INTERFACE_ADDR) {
***************
*** 2268,2274 ****
  	}
  	if (j == count) {
  	    interf->addr_in[count] = interf->addr_in[i];
! 	    if (interf->addr_in[count] == myHost)
  		found = 1;
  	    count++;
  	}
--- 2354,2360 ----
  	}
  	if (j == count) {
  	    interf->addr_in[count] = interf->addr_in[i];
! 	    if (interf->addr_in[count] == myAddr)
  		found = 1;
  	    count++;
  	}
***************
*** 2280,2286 ****
      if (found) {
  	interface = (struct Interface *)
  	    malloc(sizeof(struct Interface) +
! 		   (sizeof(afs_int32) * (count - 1)));
  	if (!interface) {
  	    ViceLog(0, ("Failed malloc in initInterfaceAddr_r\n"));
  	    assert(0);
--- 2366,2372 ----
      if (found) {
  	interface = (struct Interface *)
  	    malloc(sizeof(struct Interface) +
! 		   (sizeof(struct AddrPort) * (count - 1)));
  	if (!interface) {
  	    ViceLog(0, ("Failed malloc in initInterfaceAddr_r\n"));
  	    assert(0);
***************
*** 2288,2400 ****
  	interface->numberOfInterfaces = count;
      } else {
  	interface = (struct Interface *)
! 	    malloc(sizeof(struct Interface) + (sizeof(afs_int32) * count));
  	assert(interface);
  	interface->numberOfInterfaces = count + 1;
! 	interface->addr[count] = myHost;
      }
      interface->uuid = interf->uuid;
!     for (i = 0; i < count; i++)
! 	interface->addr[i] = interf->addr_in[i];
  
      assert(!host->interface);
      host->interface = interface;
  
      for (i = 0; i < host->interface->numberOfInterfaces; i++) {
! 	ViceLog(125, ("--- alt address %x\n", host->interface->addr[i]));
!     }
! 
!     return 0;
! }
! 
! /* inserts a new HashChain structure corresponding to this address */
! void
! hashInsert_r(afs_int32 addr, struct host *host)
! {
!     int index;
!     struct h_hashChain *chain;
! 
!     /* hash into proper bucket */
!     index = h_HashIndex(addr);
! 
!     /* insert into beginning of list for this bucket */
!     chain = (struct h_hashChain *)malloc(sizeof(struct h_hashChain));
!     if (!chain) {
! 	ViceLog(0, ("Failed malloc in hashInsert_r\n"));
! 	assert(0);
!     }
!     chain->hostPtr = host;
!     chain->next = hostHashTable[index];
!     chain->addr = addr;
!     hostHashTable[index] = chain;
! 
! }
! 
! /*
!  * This is called with host locked and held. At this point, the
!  * hostHashTable should not be having entries for the alternate
!  * interfaces. This function has to insert these entries in the
!  * hostHashTable.
!  *
!  * All addresses are in network byte order.
!  */
! int
! addInterfaceAddr_r(struct host *host, afs_int32 addr)
! {
!     int i;
!     int number;
!     int found;
!     struct Interface *interface;
! 
!     assert(host);
!     assert(host->interface);
! 
!     ViceLog(125, ("addInterfaceAddr : host %x addr %d\n", host->host, addr));
! 
!     /*
!      * Make sure this address is on the list of known addresses
!      * for this host.
!      */
!     number = host->interface->numberOfInterfaces;
!     for (i = 0, found = 0; i < number && !found; i++) {
! 	if (host->interface->addr[i] == addr)
! 	    found = 1;
!     }
!     if (!found) {
! 	interface = (struct Interface *)
! 	    malloc(sizeof(struct Interface) + (sizeof(afs_int32) * number));
! 	if (!interface) {
! 	    ViceLog(0, ("Failed malloc in addInterfaceAddr_r\n"));
! 	    assert(0);
! 	}
! 	interface->numberOfInterfaces = number + 1;
! 	interface->uuid = host->interface->uuid;
! 	for (i = 0; i < number; i++)
! 	    interface->addr[i] = host->interface->addr[i];
! 	interface->addr[number] = addr;
! 	free(host->interface);
! 	host->interface = interface;
      }
  
-     /*
-      * Create a hash table entry for this address
-      */
-     hashInsert_r(addr, host);
- 
      return 0;
  }
  
  /* deleted a HashChain structure for this address and host */
  /* returns 1 on success */
  int
! hashDelete_r(afs_int32 addr, struct host *host)
  {
      int flag;
      register struct h_hashChain **hp, *th;
  
      for (hp = &hostHashTable[h_HashIndex(addr)]; (th = *hp);) {
  	assert(th->hostPtr);
! 	if (th->hostPtr == host && th->addr == addr) {
  	    *hp = th->next;
  	    free(th);
  	    flag = 1;
--- 2374,2417 ----
  	interface->numberOfInterfaces = count;
      } else {
  	interface = (struct Interface *)
! 	    malloc(sizeof(struct Interface) + (sizeof(struct AddrPort) * count));
  	assert(interface);
  	interface->numberOfInterfaces = count + 1;
! 	interface->interface[count].addr = myAddr;
! 	interface->interface[count].port = myPort;
      }
      interface->uuid = interf->uuid;
!     for (i = 0; i < count; i++) {
! 	interface->interface[i].addr = interf->addr_in[i];
! 	/* We store the port as 7001 because the addresses reported by 
! 	 * TellMeAboutYourself and WhoAreYou RPCs are only valid if they
! 	 * are coming from fully connected hosts (no NAT/PATs)
! 	 */
! 	interface->interface[i].port = htons(7001);
!     }
  
      assert(!host->interface);
      host->interface = interface;
  
      for (i = 0; i < host->interface->numberOfInterfaces; i++) {
! 	ViceLog(125, ("--- alt address %x:%d\n", host->interface->interface[i].addr,
! 		       ntohs(host->interface->interface[i].port)));
      }
  
      return 0;
  }
  
  /* deleted a HashChain structure for this address and host */
  /* returns 1 on success */
  int
! hashDelete_r(afs_uint32 addr, afs_uint16 port, struct host *host)
  {
      int flag;
      register struct h_hashChain **hp, *th;
  
      for (hp = &hostHashTable[h_HashIndex(addr)]; (th = *hp);) {
  	assert(th->hostPtr);
! 	if (th->hostPtr == host && th->addr == addr && th->port == port) {
  	    *hp = th->next;
  	    free(th);
  	    flag = 1;
***************
*** 2420,2426 ****
  	number = host->interface->numberOfInterfaces;
  	assert(number > 0);
  	for (i = 0; i < number; i++)
! 	    ViceLog(level, ("%x ", host->interface->addr[i]));
      }
      ViceLog(level, ("\n"));
  }
--- 2437,2444 ----
  	number = host->interface->numberOfInterfaces;
  	assert(number > 0);
  	for (i = 0; i < number; i++)
! 	    ViceLog(level, ("%x:%d ", host->interface->interface[i].addr,
! 			     ntohs(host->interface->interface[i].port)));
      }
      ViceLog(level, ("\n"));
  }
Index: openafs/src/viced/host.h
diff -c openafs/src/viced/host.h:1.9.2.1 openafs/src/viced/host.h:1.9.2.2
*** openafs/src/viced/host.h:1.9.2.1	Wed Feb 23 23:46:39 2005
--- openafs/src/viced/host.h	Fri Dec 16 08:29:38 2005
***************
*** 48,57 ****
      afsUUID uuid;
  };
  
  struct Interface {
-     int numberOfInterfaces;
      afsUUID uuid;
!     afs_int32 addr[1];		/* there are actually more than one here */
      /* in network byte order */
  };
  struct host {
--- 48,62 ----
      afsUUID uuid;
  };
  
+ struct AddrPort  {
+     afs_uint32 addr;		/* in network byte order */
+     afs_uint16 port;		/* in network byte order */
+ };
+ 
  struct Interface {
      afsUUID uuid;
!     int numberOfInterfaces;
!     struct AddrPort interface[1];/* there are actually more than one here */
      /* in network byte order */
  };
  struct host {
***************
*** 99,105 ****
  struct h_hashChain {
      struct host *hostPtr;
      struct h_hashChain *next;
!     afs_int32 addr;
  };
  
  struct client {
--- 104,111 ----
  struct h_hashChain {
      struct host *hostPtr;
      struct h_hashChain *next;
!     afs_uint32 addr;
!     afs_uint16 port;
  };
  
  struct client {
Index: openafs/src/volser/vos.c
diff -c openafs/src/volser/vos.c:1.40.2.12 openafs/src/volser/vos.c:1.40.2.13
*** openafs/src/volser/vos.c:1.40.2.12	Mon Aug 15 11:55:49 2005
--- openafs/src/volser/vos.c	Thu Dec 15 23:26:40 2005
***************
*** 11,17 ****
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/volser/vos.c,v 1.40.2.12 2005/08/15 15:55:49 shadow Exp $");
  
  #include <sys/types.h>
  #ifdef AFS_NT40_ENV
--- 11,17 ----
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/volser/vos.c,v 1.40.2.13 2005/12/16 04:26:40 shadow Exp $");
  
  #include <sys/types.h>
  #ifdef AFS_NT40_ENV
***************
*** 2880,2886 ****
       register struct cmd_syndesc *as;
  
  {
!     afs_int32 avolid, aserver, apart, code, vcode, err;
      afs_int32 aoverwrite = ASK;
      afs_int32 acreation = 0, alastupdate = 0;
      int restoreflags, readonly = 0, offline = 0, voltype = RWVOL;
--- 2880,2886 ----
       register struct cmd_syndesc *as;
  
  {
!     afs_int32 avolid, aparentid, aserver, apart, code, vcode, err;
      afs_int32 aoverwrite = ASK;
      afs_int32 acreation = 0, alastupdate = 0;
      int restoreflags, readonly = 0, offline = 0, voltype = RWVOL;
***************
*** 2891,2896 ****
--- 2891,2897 ----
  
      prompt = 'n';
  
+     aparentid = 0;
      if (as->parms[4].items) {
  	avolid = vsu_GetVolumeID(as->parms[4].items->data, cstruct, &err);
  	if (avolid == 0) {
***************
*** 3032,3037 ****
--- 3033,3039 ----
  		   && entry.volumeId[voltype] != avolid) {
  	    avolid = entry.volumeId[voltype];
  	}
+         aparentid = entry.volumeId[RWVOL];
      }
  
      else {			/* volume exists - do we do a full incremental or abort */
***************
*** 3045,3050 ****
--- 3047,3053 ----
  		   && entry.volumeId[voltype] != avolid) {
  	    avolid = entry.volumeId[voltype];
  	}
+         aparentid = entry.volumeId[RWVOL];
  
  	/* A file name was specified  - check if volume is on another partition */
  	vcode = GetVolumeInfo(avolid, &Oserver, &Opart, &Otype, &Oentry);
***************
*** 3147,3154 ****
      }
  
      code =
! 	UV_RestoreVolume(aserver, apart, avolid, avolname, restoreflags,
! 			 WriteData, afilename);
      if (code) {
  	PrintDiagnostics("restore", code);
  	exit(1);
--- 3150,3157 ----
      }
  
      code =
! 	UV_RestoreVolume2(aserver, apart, avolid, aparentid,
!                           avolname, restoreflags, WriteData, afilename);
      if (code) {
  	PrintDiagnostics("restore", code);
  	exit(1);
Index: openafs/src/volser/vsprocs.c
diff -c openafs/src/volser/vsprocs.c:1.33.2.4 openafs/src/volser/vsprocs.c:1.33.2.5
*** openafs/src/volser/vsprocs.c:1.33.2.4	Fri Apr 15 14:46:26 2005
--- openafs/src/volser/vsprocs.c	Thu Dec 15 23:26:41 2005
***************
*** 11,17 ****
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/volser/vsprocs.c,v 1.33.2.4 2005/04/15 18:46:26 shadow Exp $");
  
  #include <stdio.h>
  #include <sys/types.h>
--- 11,17 ----
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/volser/vsprocs.c,v 1.33.2.5 2005/12/16 04:26:41 shadow Exp $");
  
  #include <stdio.h>
  #include <sys/types.h>
***************
*** 4047,4055 ****
   * after extracting params from the rock 
   */
  int
! UV_RestoreVolume(afs_int32 toserver, afs_int32 topart, afs_int32 tovolid,
! 		 char tovolname[], int flags, afs_int32(*WriteData) (),
! 		 char *rock)
  {
      struct rx_connection *toconn, *tempconn;
      struct rx_call *tocall;
--- 4047,4055 ----
   * after extracting params from the rock 
   */
  int
! UV_RestoreVolume2(afs_int32 toserver, afs_int32 topart, afs_int32 tovolid,
! 		  afs_int32 toparentid, char tovolname[], int flags,
! 		  afs_int32(*WriteData) (), char *rock)
  {
      struct rx_connection *toconn, *tempconn;
      struct rx_call *tocall;
***************
*** 4058,4064 ****
      struct volser_status tstatus;
      struct volintInfo vinfo;
      char partName[10];
!     afs_int32 pvolid;
      afs_int32 temptid;
      int success;
      struct nvldbentry entry, storeEntry;
--- 4058,4064 ----
      struct volser_status tstatus;
      struct volintInfo vinfo;
      char partName[10];
!     afs_int32 pvolid, pparentid;
      afs_int32 temptid;
      int success;
      struct nvldbentry entry, storeEntry;
***************
*** 4092,4097 ****
--- 4092,4098 ----
      }
  
      pvolid = tovolid;
+     pparentid = toparentid;
      toconn = UV_Bind(toserver, AFSCONF_VOLUMEPORT);
      if (pvolid == 0) {		/*alot a new id if needed */
  	vcode = VLDB_GetEntryByName(tovolname, &entry);
***************
*** 4120,4129 ****
--- 4121,4133 ----
  		goto refail;
  	    }
  	    pvolid = entry.volumeId[ROVOL];
+ 	    pparentid = entry.volumeId[RWVOL];
  	} else {
  	    pvolid = entry.volumeId[RWVOL];
+ 	    pparentid = entry.volumeId[RWVOL];
  	}
      }
+     if (!pparentid) pparentid = pvolid;
      /* at this point we have a volume id to use/reuse for the volume to be restored */
      if (strlen(tovolname) > (VOLSER_OLDMAXVOLNAME - 1)) {
  	EGOTO1(refail, VOLSERBADOP,
***************
*** 4136,4142 ****
  	    hostutil_GetNameByINet(toserver), partName);
      fflush(STDOUT);
      code =
! 	AFSVolCreateVolume(toconn, topart, tovolname, volsertype, 0, &pvolid,
  			   &totid);
      if (code) {
  	if (flags & RV_FULLRST) {	/* full restore: delete then create anew */
--- 4140,4146 ----
  	    hostutil_GetNameByINet(toserver), partName);
      fflush(STDOUT);
      code =
! 	AFSVolCreateVolume(toconn, topart, tovolname, volsertype, pparentid, &pvolid,
  			   &totid);
      if (code) {
  	if (flags & RV_FULLRST) {	/* full restore: delete then create anew */
***************
*** 4172,4178 ****
  	    VDONE;
  
  	    code =
! 		AFSVolCreateVolume(toconn, topart, tovolname, volsertype, 0,
  				   &pvolid, &totid);
  	    EGOTO1(refail, code, "Could not create new volume %u\n", pvolid);
  	} else {
--- 4176,4182 ----
  	    VDONE;
  
  	    code =
! 		AFSVolCreateVolume(toconn, topart, tovolname, volsertype, pparentid,
  				   &pvolid, &totid);
  	    EGOTO1(refail, code, "Could not create new volume %u\n", pvolid);
  	} else {
***************
*** 4193,4199 ****
  	oldUpdateDate = 0;
      }
  
!     cookie.parent = pvolid;
      cookie.type = voltype;
      cookie.clone = 0;
      strncpy(cookie.name, tovolname, VOLSER_OLDMAXVOLNAME);
--- 4197,4203 ----
  	oldUpdateDate = 0;
      }
  
!     cookie.parent = pparentid;
      cookie.type = voltype;
      cookie.clone = 0;
      strncpy(cookie.name, tovolname, VOLSER_OLDMAXVOLNAME);
***************
*** 4226,4232 ****
  	error = code;
  	goto refail;
      }
!     code = AFSVolSetIdsTypes(toconn, totid, tovolname, voltype, pvolid, 0, 0);
      if (code) {
  	fprintf(STDERR, "Could not set the right type and ID on %lu\n",
  		(unsigned long)pvolid);
--- 4230,4236 ----
  	error = code;
  	goto refail;
      }
!     code = AFSVolSetIdsTypes(toconn, totid, tovolname, voltype, pparentid, 0, 0);
      if (code) {
  	fprintf(STDERR, "Could not set the right type and ID on %lu\n",
  		(unsigned long)pvolid);
***************
*** 4316,4322 ****
  		entry.volumeId[ROVOL] = tstatus.cloneID;	/*this should come from status info on the volume if non zero */
  	    } else
  		entry.volumeId[ROVOL] = INVALID_BID;
! 	    entry.volumeId[RWVOL] = pvolid;
  	    entry.cloneId = 0;
  	    if (tstatus.backupID != 0) {
  		entry.volumeId[BACKVOL] = tstatus.backupID;
--- 4320,4326 ----
  		entry.volumeId[ROVOL] = tstatus.cloneID;	/*this should come from status info on the volume if non zero */
  	    } else
  		entry.volumeId[ROVOL] = INVALID_BID;
! 	    entry.volumeId[RWVOL] = pparentid;
  	    entry.cloneId = 0;
  	    if (tstatus.backupID != 0) {
  		entry.volumeId[BACKVOL] = tstatus.backupID;
***************
*** 4502,4507 ****
--- 4506,4520 ----
      return error;
  }
  
+ int
+ UV_RestoreVolume(afs_int32 toserver, afs_int32 topart, afs_int32 tovolid,
+ 		 char tovolname[], int flags, afs_int32(*WriteData) (),
+ 		 char *rock)
+ {
+     return UV_RestoreVolume2(toserver, topart, tovolid, 0, tovolname, flags,
+ 			     WriteData, rock);
+ }
+ 
  
  /*unlocks the vldb entry associated with <volid> */
  int
