Index: openafs/src/WINNT/afsd/cm_callback.c
diff -c openafs/src/WINNT/afsd/cm_callback.c:1.4.2.2 openafs/src/WINNT/afsd/cm_callback.c:1.4.2.3
*** openafs/src/WINNT/afsd/cm_callback.c:1.4.2.2	Sun Jan 20 04:09:11 2002
--- openafs/src/WINNT/afsd/cm_callback.c	Wed Jul 10 15:38:54 2002
***************
*** 435,448 ****
      struct rx_call *a_call,
      afs_int32 a_index,
      char **a_name,
!     afs_int32 *a_hosts)
  {
      char *t_name;
  
      t_name = (char *)malloc(AFSNAMEMAX);
      t_name[0] = '\0';
      *a_name = t_name;
!     memset(a_hosts, 0, AFSMAXCELLHOSTS * sizeof(afs_int32));
      return 0;
  }
  
--- 435,448 ----
      struct rx_call *a_call,
      afs_int32 a_index,
      char **a_name,
!     serverList *a_hosts)
  {
      char *t_name;
  
      t_name = (char *)malloc(AFSNAMEMAX);
      t_name[0] = '\0';
      *a_name = t_name;
!     a_hosts->serverList_len = 0;
      return 0;
  }
  
***************
*** 472,481 ****
  {
      char *t_name;
  
-     t_name = (char *)malloc(AFSNAMEMAX);
      if (cm_rootCellp) {
          strcpy(t_name, cm_rootCellp->namep);
      } else {
  	t_name[0] = '\0';
      }
      *a_name = t_name;
--- 472,482 ----
  {
      char *t_name;
  
      if (cm_rootCellp) {
+ 	t_name = (char *)malloc(strlen(cm_rootCellp->namep)+1);
          strcpy(t_name, cm_rootCellp->namep);
      } else {
+ 	t_name = (char *)malloc(1);
  	t_name[0] = '\0';
      }
      *a_name = t_name;
Index: openafs/src/WINNT/afsd/smb.c
diff -c openafs/src/WINNT/afsd/smb.c:1.4.4.1 openafs/src/WINNT/afsd/smb.c:1.4.4.2
*** openafs/src/WINNT/afsd/smb.c:1.4.4.1	Wed Nov 14 22:38:47 2001
--- openafs/src/WINNT/afsd/smb.c	Fri Jul 26 01:14:25 2002
***************
*** 9,14 ****
--- 9,16 ----
  
  //#define NOSERVICE 1
  
+ #define NOMOREFILESFIX 1
+ 
  #include <afs/param.h>
  #include <afs/stds.h>
  
***************
*** 2276,2281 ****
--- 2278,2284 ----
                  namep += entryLength;
                  tcounter++;		/* which proto entry we're looking at */
          }
+ #ifndef NOMOREFILESFIX
  	/* 
  	 * NOTE: We can determine what OS (NT4.0, W2K, W9X, etc)
  	 * the client is running by reading the protocol signature.
***************
*** 2310,2315 ****
--- 2313,2320 ----
  		       */
  	       }
  	}
+ 	// NOMOREFILESFIX
+ #endif
  
          if (NTProtoIndex != -1) {
  		protoIndex = NTProtoIndex;
Index: openafs/src/WINNT/afsd/smb3.c
diff -c openafs/src/WINNT/afsd/smb3.c:1.5.4.1 openafs/src/WINNT/afsd/smb3.c:1.5.4.2
*** openafs/src/WINNT/afsd/smb3.c:1.5.4.1	Wed Nov 14 22:38:48 2001
--- openafs/src/WINNT/afsd/smb3.c	Fri Jul 26 01:14:25 2002
***************
*** 1148,1154 ****
  		spacep = cm_GetSpace();
  		smb_StripLastComponent(spacep->data, &lastComp,
  					(char *)(&p->parmsp[3]));
! 		if (strcmp(lastComp, "\\desktop.ini") == 0) {
  			code = cm_NameI(cm_rootSCachep, spacep->data,
  					CM_FLAG_CASEFOLD
  					  | CM_FLAG_DIRSEARCH
--- 1148,1156 ----
  		spacep = cm_GetSpace();
  		smb_StripLastComponent(spacep->data, &lastComp,
  					(char *)(&p->parmsp[3]));
! 		/* Make sure that lastComp is not NULL */
! 		if (lastComp)
! 		    if (strcmp(lastComp, "\\desktop.ini") == 0) {
  			code = cm_NameI(cm_rootSCachep, spacep->data,
  					CM_FLAG_CASEFOLD
  					  | CM_FLAG_DIRSEARCH
Index: openafs/src/afs/Makefile.in
diff -c openafs/src/afs/Makefile.in:1.4.2.1 openafs/src/afs/Makefile.in:1.4.2.2
*** openafs/src/afs/Makefile.in:1.4.2.1	Wed Dec 26 15:09:03 2001
--- openafs/src/afs/Makefile.in	Wed Jul 10 15:40:22 2002
***************
*** 76,82 ****
  	esac
  	case ${SYS_NAME} in \
  		*linux* ) \
! 			${INSTALL} ${AFS_OSTYPE}/osi_vfs.h ${DESTDIR}${includedir}/afs ;;\
  		* ) \
  			echo No vfs headers to install for ${SYS_NAME};; \
  	esac
--- 76,82 ----
  	esac
  	case ${SYS_NAME} in \
  		*linux* ) \
! 			${INSTALL} ${AFS_OSTYPE}/osi_vfs.h ${DESTDIR}${includedir}/afs || true ;;\
  		* ) \
  			echo No vfs headers to install for ${SYS_NAME};; \
  	esac
***************
*** 152,158 ****
  	esac
  	case ${SYS_NAME} in \
  		*linux* ) \
! 			${INSTALL} ${AFS_OSTYPE}/osi_vfs.h ${DEST}/include/afs ;;\
  		* ) \
  			echo No vfs headers to install for ${SYS_NAME};; \
  	esac
--- 152,158 ----
  	esac
  	case ${SYS_NAME} in \
  		*linux* ) \
! 			${INSTALL} ${AFS_OSTYPE}/osi_vfs.h ${DEST}/include/afs || true ;;\
  		* ) \
  			echo No vfs headers to install for ${SYS_NAME};; \
  	esac
Index: openafs/src/afs/afs.h
diff -c openafs/src/afs/afs.h:1.9.2.6 openafs/src/afs/afs.h:1.9.2.8
*** openafs/src/afs/afs.h:1.9.2.6	Tue Apr 23 21:49:34 2002
--- openafs/src/afs/afs.h	Wed Jul 31 18:19:50 2002
***************
*** 201,206 ****
--- 201,207 ----
      u_short vlport;			    /* volume server port */
      short states;			    /* state flags */
      short cellIndex;			    /* relative index number per cell */
+     short realcellIndex;		    /* as above but ignoring aliases */
      time_t timeout;			    /* data expire time, if non-zero */
      char *realName;			    /* who this cell is an alias for */
  };
***************
*** 616,622 ****
  #ifdef AFS_DARWIN_ENV
      struct lock__bsd__      rwlock;
  #endif
!     afs_int32 parentVnode;			/* Parent dir, if a file. */
      afs_int32 parentUnique;
      struct VenusFid *mvid;		/* Either parent dir (if root) or root (if mt pt) */
      char *linkData;			/* Link data if a symlink. */
--- 617,623 ----
  #ifdef AFS_DARWIN_ENV
      struct lock__bsd__      rwlock;
  #endif
!     afs_int32 parentVnode;		/* Parent dir, if a file. */
      afs_int32 parentUnique;
      struct VenusFid *mvid;		/* Either parent dir (if root) or root (if mt pt) */
      char *linkData;			/* Link data if a symlink. */
***************
*** 1140,1145 ****
--- 1141,1158 ----
  #endif /* AFS_DECOSF_ENV */
  #endif /* AFS_SGI62_ENV */
  #endif
+ 
+ /* fakestat support: opaque storage for afs_EvalFakeStat to remember
+  * what vcache should be released.
+  */
+ struct afs_fakestat_state {
+     char valid;
+     char did_eval;
+     char need_release;
+     struct vcache *root_vp;
+ };
+ 
+ extern int afs_fakestat_enable;
  
  #endif	/* _AFS_H_ */
  
Index: openafs/src/afs/afs_call.c
diff -c openafs/src/afs/afs_call.c:1.14.2.9 openafs/src/afs/afs_call.c:1.14.2.10
*** openafs/src/afs/afs_call.c:1.14.2.9	Sat Jun  8 16:29:49 2002
--- openafs/src/afs/afs_call.c	Mon Jul 22 19:14:45 2002
***************
*** 10,16 ****
  #include <afsconfig.h>
  #include "../afs/param.h"
  
! RCSID("$Header: /data/cvs/openafs/src/afs/afs_call.c,v 1.14.2.9 2002/06/08 20:29:49 shadow Exp $");
  
  #include "../afs/sysincludes.h"	/* Standard vendor system headers */
  #include "../afs/afsincludes.h"	/* Afs-based standard headers */
--- 10,16 ----
  #include <afsconfig.h>
  #include "../afs/param.h"
  
! RCSID("$Header: /data/cvs/openafs/src/afs/afs_call.c,v 1.14.2.10 2002/07/22 23:14:45 zacheiss Exp $");
  
  #include "../afs/sysincludes.h"	/* Standard vendor system headers */
  #include "../afs/afsincludes.h"	/* Afs-based standard headers */
***************
*** 659,664 ****
--- 659,668 ----
  #endif
      else if (parm == AFSOP_SET_DYNROOT) {
  	code = afs_SetDynrootEnable(parm2);
+     }
+     else if (parm == AFSOP_SET_FAKESTAT) {
+     	afs_fakestat_enable = parm2;
+     	code = 0;
      }
      else
        code = EINVAL;
Index: openafs/src/afs/afs_cell.c
diff -c openafs/src/afs/afs_cell.c:1.7.2.5 openafs/src/afs/afs_cell.c:1.7.2.6
*** openafs/src/afs/afs_cell.c:1.7.2.5	Sun Jan 20 03:33:04 2002
--- openafs/src/afs/afs_cell.c	Wed Jul 31 18:19:50 2002
***************
*** 13,19 ****
  #include <afsconfig.h>
  #include "../afs/param.h"
  
! RCSID("$Header: /data/cvs/openafs/src/afs/afs_cell.c,v 1.7.2.5 2002/01/20 08:33:04 shadow Exp $");
  
  #include "../afs/stds.h"
  #include "../afs/sysincludes.h"	/* Standard vendor system headers */
--- 13,19 ----
  #include <afsconfig.h>
  #include "../afs/param.h"
  
! RCSID("$Header: /data/cvs/openafs/src/afs/afs_cell.c,v 1.7.2.6 2002/07/31 22:19:50 shadow Exp $");
  
  #include "../afs/stds.h"
  #include "../afs/sysincludes.h"	/* Standard vendor system headers */
***************
*** 46,54 ****
  afs_rwlock_t afs_xcell;			/* allocation lock for cells */
  struct afs_q CellLRU;
  afs_int32 afs_cellindex=0;
  afs_uint32 afs_nextCellNum = 0x100;
  
- 
  /* Local variables. */
  struct cell *afs_rootcell = 0;
  
--- 46,54 ----
  afs_rwlock_t afs_xcell;			/* allocation lock for cells */
  struct afs_q CellLRU;
  afs_int32 afs_cellindex=0;
+ afs_int32 afs_realcellindex=0;
  afs_uint32 afs_nextCellNum = 0x100;
  
  /* Local variables. */
  struct cell *afs_rootcell = 0;
  
***************
*** 417,422 ****
--- 417,447 ----
  } /*afs_GetCellByIndex*/
  
  
+ struct cell *afs_GetRealCellByIndex(cellindex, locktype, refresh)
+     register afs_int32 cellindex;
+     afs_int32 locktype;
+     afs_int32 refresh;
+ {
+     register struct cell *tc;
+     register struct afs_q *cq, *tq;
+ 
+     AFS_STATCNT(afs_GetCellByIndex);
+     ObtainWriteLock(&afs_xcell,102);
+     for (cq = CellLRU.next; cq != &CellLRU; cq = tq) {
+ 	tc = QTOC(cq); tq = QNext(cq);
+ 	if (tc->realcellIndex == cellindex) {
+ 	    QRemove(&tc->lruq);
+ 	    QAdd(&CellLRU, &tc->lruq);
+ 	    ReleaseWriteLock(&afs_xcell);
+ 	    if (refresh) afs_RefreshCell(tc);
+ 	    return tc;
+ 	}
+     }
+     ReleaseWriteLock(&afs_xcell);
+     return (struct cell *) 0;
+ } /*afs_GetRealCellByIndex*/
+ 
+ 
  afs_int32 afs_NewCell(acellName, acellHosts, aflags, linkedcname, fsport, vlport, timeout, aliasFor)
      int aflags;
      char *acellName;
***************
*** 484,489 ****
--- 509,519 ----
  	tc->vlport = (vlport ? vlport : AFS_VLPORT);
  	afs_stats_cmperf.numCellsVisible++;
  	newc++;
+ 	if (!aflags & CAlias) {
+ 	    tc->realcellIndex = afs_realcellindex++;
+ 	} else {
+ 	    tc->realcellIndex = -1;
+ 	}
      }
  
      if (aflags & CLinkedCell) {
***************
*** 513,519 ****
      tc->timeout = timeout;
  
      /* Allow converting an alias into a real cell */
!     if (!(aflags & CAlias)) tc->states &= ~CAlias;
   
      memset((char *)tc->cellHosts, 0, sizeof(tc->cellHosts));
      if (aflags & CAlias) {
--- 543,552 ----
      tc->timeout = timeout;
  
      /* Allow converting an alias into a real cell */
!     if (!(aflags & CAlias)) {
! 	tc->states &= ~CAlias;
! 	tc->realcellIndex = afs_realcellindex++;
!     }
   
      memset((char *)tc->cellHosts, 0, sizeof(tc->cellHosts));
      if (aflags & CAlias) {
Index: openafs/src/afs/afs_dynroot.c
diff -c openafs/src/afs/afs_dynroot.c:1.1.2.3 openafs/src/afs/afs_dynroot.c:1.1.2.4
*** openafs/src/afs/afs_dynroot.c:1.1.2.3	Sun Jan 20 03:20:54 2002
--- openafs/src/afs/afs_dynroot.c	Fri Jul 26 16:41:10 2002
***************
*** 299,310 ****
  
      for (cellidx = 0; cellidx < maxcellidx; cellidx++) {
  	c = afs_GetCellByIndex(cellidx, READ_LOCK, 0 /* don't refresh */);
! 	afs_dynroot_addDirEnt(dirHeader, &curPage, &curChunk,
! 			      c->cellName, VNUM_FROM_CIDX_RW(cellidx, 0));
  
  	dotCell = afs_osi_Alloc(strlen(c->cellName) + 2);
  	strcpy(dotCell, ".");
  	strcat(dotCell, c->cellName);
  	afs_dynroot_addDirEnt(dirHeader, &curPage, &curChunk,
  			      dotCell, VNUM_FROM_CIDX_RW(cellidx, 1));
  
--- 299,311 ----
  
      for (cellidx = 0; cellidx < maxcellidx; cellidx++) {
  	c = afs_GetCellByIndex(cellidx, READ_LOCK, 0 /* don't refresh */);
! 	if (!c) continue;
  
  	dotCell = afs_osi_Alloc(strlen(c->cellName) + 2);
  	strcpy(dotCell, ".");
  	strcat(dotCell, c->cellName);
+ 	afs_dynroot_addDirEnt(dirHeader, &curPage, &curChunk,
+ 			      c->cellName, VNUM_FROM_CIDX_RW(cellidx, 0));
  	afs_dynroot_addDirEnt(dirHeader, &curPage, &curChunk,
  			      dotCell, VNUM_FROM_CIDX_RW(cellidx, 1));
  
Index: openafs/src/afs/afs_nfsdisp.c
diff -c openafs/src/afs/afs_nfsdisp.c:1.1.2.4 openafs/src/afs/afs_nfsdisp.c:1.1.2.5
*** openafs/src/afs/afs_nfsdisp.c:1.1.2.4	Tue Apr 23 21:41:16 2002
--- openafs/src/afs/afs_nfsdisp.c	Fri Jul 26 16:56:32 2002
***************
*** 10,17 ****
  #include <afsconfig.h>
  #include "../afs/param.h"
  
! RCSID("$Header: /data/cvs/openafs/src/afs/afs_nfsdisp.c,v 1.1.2.4 2002/04/24 01:41:16 zacheiss Exp $");
  
  #include "../afs/stds.h"
  #include "../afs/sysincludes.h" /* Standard vendor system headers */
  #if defined(AFS_SUN55_ENV) && !defined(AFS_NONFSTRANS) 
--- 10,19 ----
  #include <afsconfig.h>
  #include "../afs/param.h"
  
! RCSID("$Header: /data/cvs/openafs/src/afs/afs_nfsdisp.c,v 1.1.2.5 2002/07/26 20:56:32 shadow Exp $");
  
+ /* Ugly Ugly Ugly  but precludes conflicting XDR macros; We want kernel xdr */
+ #define __XDR_INCLUDE__
  #include "../afs/stds.h"
  #include "../afs/sysincludes.h" /* Standard vendor system headers */
  #if defined(AFS_SUN55_ENV) && !defined(AFS_NONFSTRANS) 
Index: openafs/src/afs/afs_osi.c
diff -c openafs/src/afs/afs_osi.c:1.8.2.6 openafs/src/afs/afs_osi.c:1.8.2.8
*** openafs/src/afs/afs_osi.c:1.8.2.6	Tue Apr 23 21:41:16 2002
--- openafs/src/afs/afs_osi.c	Wed Jul 31 18:31:10 2002
***************
*** 10,16 ****
  #include <afsconfig.h>
  #include "../afs/param.h"
  
! RCSID("$Header: /data/cvs/openafs/src/afs/afs_osi.c,v 1.8.2.6 2002/04/24 01:41:16 zacheiss Exp $");
  
  #include "../afs/sysincludes.h"	/* Standard vendor system headers */
  #include "../afs/afsincludes.h"	/* Afs-based standard headers */
--- 10,16 ----
  #include <afsconfig.h>
  #include "../afs/param.h"
  
! RCSID("$Header: /data/cvs/openafs/src/afs/afs_osi.c,v 1.8.2.8 2002/07/31 22:31:10 shadow Exp $");
  
  #include "../afs/sysincludes.h"	/* Standard vendor system headers */
  #include "../afs/afsincludes.h"	/* Afs-based standard headers */
***************
*** 420,426 ****
      AFS_STATS(afs_stats_cmperf.OutStandingAllocs++);
      AFS_STATS(afs_stats_cmperf.OutStandingMemUsage += x);
  #ifdef AFS_LINUX20_ENV
!     return osi_linux_alloc(x);
  #else
      size = x;
      tm = (struct osimem *) AFS_KALLOC(size);
--- 420,426 ----
      AFS_STATS(afs_stats_cmperf.OutStandingAllocs++);
      AFS_STATS(afs_stats_cmperf.OutStandingMemUsage += x);
  #ifdef AFS_LINUX20_ENV
!     return osi_linux_alloc(x, 1);
  #else
      size = x;
      tm = (struct osimem *) AFS_KALLOC(size);
***************
*** 775,780 ****
--- 775,796 ----
  }   
  #endif
  
+ #if defined(AFS_LINUX22_ENV)
+ void afs_osi_TraverseProcTable()
+ {   
+     struct task_struct *p;
+     for_each_task(p) if (p->pid) {
+         if (p->state & TASK_ZOMBIE)
+             continue;
+ #if 0
+         if (p->flags & )
+             continue;
+ #endif
+ 	afs_GCPAGs_perproc_func(p);
+     }
+ }   
+ #endif
+ 
  /* return a pointer (sometimes a static copy ) to the cred for a
   * given AFS_PROC.
   * subsequent calls may overwrite the previously returned value.
***************
*** 951,956 ****
--- 967,997 ----
         memcpy(cr.cr_groups, pr->p_cred->pc_ucred->cr_groups, NGROUPS *
               sizeof(gid_t));
         pcred_unlock(pr);
+        rv = &cr;
+     }
+     
+     return rv;
+ }  
+ #elif defined(AFS_LINUX22_ENV)
+ const struct AFS_UCRED *afs_osi_proc2cred(AFS_PROC *pr)
+ {   
+     struct AFS_UCRED *rv=NULL;
+     static struct AFS_UCRED cr;
+ 
+     if(pr == NULL) {
+        return NULL;
+     }
+    
+     if ((pr->state == TASK_RUNNING) ||
+ 	(pr->state == TASK_INTERRUPTIBLE) ||
+ 	(pr->state == TASK_UNINTERRUPTIBLE) ||
+ 	(pr->state == TASK_STOPPED)) {
+ 	read_lock(&tasklist_lock);
+        cr.cr_ref=1;
+        cr.cr_uid=pr->uid;
+        cr.cr_ngroups=pr->ngroups;
+        memcpy(cr.cr_groups, pr->groups, NGROUPS * sizeof(gid_t));
+        read_unlock(&tasklist_lock);  
         rv = &cr;
      }
      
Index: openafs/src/afs/afs_pioctl.c
diff -c openafs/src/afs/afs_pioctl.c:1.22.2.5 openafs/src/afs/afs_pioctl.c:1.22.2.9
*** openafs/src/afs/afs_pioctl.c:1.22.2.5	Fri Jun  7 20:18:35 2002
--- openafs/src/afs/afs_pioctl.c	Wed Jul 31 18:19:50 2002
***************
*** 10,16 ****
  #include <afsconfig.h>
  #include "../afs/param.h"
  
! RCSID("$Header: /data/cvs/openafs/src/afs/afs_pioctl.c,v 1.22.2.5 2002/06/08 00:18:35 shadow Exp $");
  
  #include "../afs/sysincludes.h"	/* Standard vendor system headers */
  #include "../afs/afsincludes.h"	/* Afs-based standard headers */
--- 10,16 ----
  #include <afsconfig.h>
  #include "../afs/param.h"
  
! RCSID("$Header: /data/cvs/openafs/src/afs/afs_pioctl.c,v 1.22.2.9 2002/07/31 22:19:50 shadow Exp $");
  
  #include "../afs/sysincludes.h"	/* Standard vendor system headers */
  #include "../afs/afsincludes.h"	/* Afs-based standard headers */
***************
*** 131,148 ****
    PRxStatPeer,			/* 54 - control peer RX statistics */
    PGetRxkcrypt,			/* 55 -- Get rxkad encryption flag */
    PSetRxkcrypt,			/* 56 -- Set rxkad encryption flag */
!   PNoop,			/* 57 -- arla: set file prio */
!   PNoop,			/* 58 -- arla: fallback getfh */
!   PNoop,			/* 59 -- arla: fallback fhopen */
!   PNoop,			/* 60 -- arla: controls xfsdebug */
!   PNoop,			/* 61 -- arla: controls arla debug */
!   PNoop,			/* 62 -- arla: debug interface */
!   PNoop,			/* 63 -- arla: print xfs status */
!   PNoop,			/* 64 -- arla: force cache check */
!   PNoop,			/* 65 -- arla: break callback */
    PPrefetchFromTape,            /* 66 -- MR-AFS: prefetch file from tape */
    PResidencyCmd,                /* 67 -- MR-AFS: generic commnd interface */
!   PNoop,			/* 68 -- arla: fetch stats */
  };
  
  static int (*(CpioctlSw[]))() = {
--- 131,148 ----
    PRxStatPeer,			/* 54 - control peer RX statistics */
    PGetRxkcrypt,			/* 55 -- Get rxkad encryption flag */
    PSetRxkcrypt,			/* 56 -- Set rxkad encryption flag */
!   PBogus,			/* 57 -- arla: set file prio */
!   PBogus,			/* 58 -- arla: fallback getfh */
!   PBogus,			/* 59 -- arla: fallback fhopen */
!   PBogus,			/* 60 -- arla: controls xfsdebug */
!   PBogus,			/* 61 -- arla: controls arla debug */
!   PBogus,			/* 62 -- arla: debug interface */
!   PBogus,			/* 63 -- arla: print xfs status */
!   PBogus,			/* 64 -- arla: force cache check */
!   PBogus,			/* 65 -- arla: break callback */
    PPrefetchFromTape,            /* 66 -- MR-AFS: prefetch file from tape */
    PResidencyCmd,                /* 67 -- MR-AFS: generic commnd interface */
!   PBogus,			/* 68 -- arla: fetch stats */
  };
  
  static int (*(CpioctlSw[]))() = {
***************
*** 1021,1027 ****
    
    
  afs_HandlePioctl(avc, acom, ablob, afollow, acred)
!      register struct vcache *avc;
       afs_int32 acom;
       struct AFS_UCRED **acred;
       register struct afs_ioctl *ablob;
--- 1021,1027 ----
    
    
  afs_HandlePioctl(avc, acom, ablob, afollow, acred)
!      struct vcache *avc;
       afs_int32 acom;
       struct AFS_UCRED **acred;
       register struct afs_ioctl *ablob;
***************
*** 1034,1044 ****
--- 1034,1053 ----
      char *inData, *outData;
      int (*(*pioctlSw))();
      int pioctlSwSize;
+     struct afs_fakestat_state fakestate;
  
      afs_Trace3(afs_iclSetp, CM_TRACE_PIOCTL, ICL_TYPE_INT32, acom & 0xff,
  	       ICL_TYPE_POINTER, avc, ICL_TYPE_INT32, afollow);
      AFS_STATCNT(HandlePioctl);
      if (code = afs_InitReq(&treq, *acred)) return code;
+     afs_InitFakeStat(&fakestate);
+     if (avc) {
+ 	code = afs_EvalFakeStat(&avc, &fakestate, &treq);
+ 	if (code) {
+ 	    afs_PutFakeStat(&fakestate);
+ 	    return code;
+ 	}
+     }
      device = (acom & 0xff00) >> 8;
      switch (device) {
  	case 'V':	/* Original pioctl's */
***************
*** 1050,1060 ****
  		pioctlSwSize = sizeof(CpioctlSw);
  		break;
  	default:
  		return EINVAL;
      }
      function = acom & 0xff;
      if (function >= (pioctlSwSize / sizeof(char *))) {
!       return EINVAL;	/* out of range */
      }
      inSize = ablob->in_size;
      if (inSize >= PIGGYSIZE) return E2BIG;
--- 1059,1071 ----
  		pioctlSwSize = sizeof(CpioctlSw);
  		break;
  	default:
+ 		afs_PutFakeStat(&fakestate);
  		return EINVAL;
      }
      function = acom & 0xff;
      if (function >= (pioctlSwSize / sizeof(char *))) {
! 	afs_PutFakeStat(&fakestate);
! 	return EINVAL;	/* out of range */
      }
      inSize = ablob->in_size;
      if (inSize >= PIGGYSIZE) return E2BIG;
***************
*** 1064,1071 ****
      }
      else code = 0;
      if (code) {
!       osi_FreeLargeSpace(inData);
!       return code;
      }
      outData = osi_AllocLargeSpace(AFS_LRALLOCSIZ);
      outSize = 0;
--- 1075,1083 ----
      }
      else code = 0;
      if (code) {
! 	osi_FreeLargeSpace(inData);
! 	afs_PutFakeStat(&fakestate);
! 	return code;
      }
      outData = osi_AllocLargeSpace(AFS_LRALLOCSIZ);
      outSize = 0;
***************
*** 1081,1086 ****
--- 1093,1099 ----
  	AFS_COPYOUT(outData, ablob->out, outSize, code);
      }
      osi_FreeLargeSpace(outData);
+     afs_PutFakeStat(&fakestate);
      return afs_CheckCode(code, &treq, 41);
    }
    
***************
*** 1415,1421 ****
        ain += sizeof(afs_int32);			/* skip id field */
        /* rest is cell name, look it up */
        /* some versions of gcc appear to need != 0 in order to get this right */
!       if (flag & 0x8000 != 0) {			/* XXX Use Constant XXX */
  	  flag &= ~0x8000;
  	  set_parent_pag = 1;
        }
--- 1428,1434 ----
        ain += sizeof(afs_int32);			/* skip id field */
        /* rest is cell name, look it up */
        /* some versions of gcc appear to need != 0 in order to get this right */
!       if ((flag & 0x8000) != 0) {		/* XXX Use Constant XXX */
  	  flag &= ~0x8000;
  	  set_parent_pag = 1;
        }
***************
*** 1715,1721 ****
  	code = ENOENT;
  	goto out;
      }
!     if (vType(tvc) != VLNK) {
  	afs_PutVCache(tvc, WRITE_LOCK);
  	code = EINVAL;
  	goto out;
--- 1728,1734 ----
  	code = ENOENT;
  	goto out;
      }
!     if (tvc->mvstat != 1) {
  	afs_PutVCache(tvc, WRITE_LOCK);
  	code = EINVAL;
  	goto out;
***************
*** 2374,2390 ****
  
      memcpy((char *)&whichCell, tp, sizeof(afs_int32));
      tp += sizeof(afs_int32);
!     ObtainReadLock(&afs_xcell);
!     for (cq = CellLRU.next; cq != &CellLRU; cq = tq) {
! 	tcell = QTOC(cq); tq = QNext(cq);
! 	if (tcell->states & CAlias) {
! 	    tcell = 0;
! 	    continue;
! 	}
! 	if (whichCell == 0) break;
! 	tcell = 0;
! 	whichCell--;
!     }
      if (tcell) {
  	cp = aout;
  	memset(cp, 0, MAXCELLHOSTS * sizeof(afs_int32));
--- 2387,2393 ----
  
      memcpy((char *)&whichCell, tp, sizeof(afs_int32));
      tp += sizeof(afs_int32);
!     tcell = afs_GetRealCellByIndex(whichCell, READ_LOCK, 0);
      if (tcell) {
  	cp = aout;
  	memset(cp, 0, MAXCELLHOSTS * sizeof(afs_int32));
***************
*** 2398,2404 ****
  	cp += strlen(tcell->cellName)+1;
  	*aoutSize = cp - aout;
      }
-     ReleaseReadLock(&afs_xcell);
      if (tcell) return 0;
      else return EDOM;
  }
--- 2401,2406 ----
***************
*** 2501,2507 ****
  	afs_PutDCache(tdc);
  	goto out;
      }
!     if (vType(tvc) != VLNK) {
  	afs_PutDCache(tdc);
  	afs_PutVCache(tvc, WRITE_LOCK);
  	code = EINVAL;
--- 2503,2509 ----
  	afs_PutDCache(tdc);
  	goto out;
      }
!     if (tvc->mvstat != 1) {
  	afs_PutDCache(tdc);
  	afs_PutVCache(tvc, WRITE_LOCK);
  	code = EINVAL;
***************
*** 3698,3704 ****
  	code = ENOENT;
  	goto out;
      }
!     if (vType(tvc) != VLNK) {
  	afs_PutVCache(tvc, WRITE_LOCK);
  	code = EINVAL;
  	goto out;
--- 3700,3706 ----
  	code = ENOENT;
  	goto out;
      }
!     if (tvc->mvstat != 1) {
  	afs_PutVCache(tvc, WRITE_LOCK);
  	code = EINVAL;
  	goto out;
Index: openafs/src/afs/afs_prototypes.h
diff -c openafs/src/afs/afs_prototypes.h:1.4 openafs/src/afs/afs_prototypes.h:1.4.4.1
*** openafs/src/afs/afs_prototypes.h:1.4	Sat Apr 14 13:27:32 2001
--- openafs/src/afs/afs_prototypes.h	Wed Jul 31 23:35:11 2002
***************
*** 17,22 ****
--- 17,27 ----
  			register struct vrequest *areq, int op, afs_int32 locktype,
  			struct cell *cellp);
  
+ /* afs_cell.c */
+ extern struct cell *afs_GetRealCellByIndex(register afs_int32 cellindex,
+ 					   afs_int32 locktype,
+ 					   afs_int32 refresh);
+ 
  /* afs_conn.c */
  extern struct conn *afs_ConnBySA(struct srvAddr *sap, unsigned short aport,
  			  afs_int32 acell, struct unixuser *tu,
Index: openafs/src/afs/afs_stats.h
diff -c openafs/src/afs/afs_stats.h:1.3 openafs/src/afs/afs_stats.h:1.3.6.1
*** openafs/src/afs/afs_stats.h:1.3	Sat Feb 10 16:26:15 2001
--- openafs/src/afs/afs_stats.h	Wed Jul 31 18:19:50 2002
***************
*** 455,460 ****
--- 455,461 ----
      afs_int32 C_afs_GetCell;	/* afs_resource.c*/
      afs_int32 C_afs_GetCellByIndex;	/* afs_resource.c*/
      afs_int32 C_afs_GetCellByName;	/* afs_resource.c*/
+     afs_int32 C_afs_GetRealCellByIndex;	/* afs_resource.c*/
      afs_int32 C_afs_NewCell;	/* afs_resource.c*/
      afs_int32 C_afs_GetUser;	/* afs_resource.c*/
      afs_int32 C_afs_PutUser;	/* afs_resource.c*/
Index: openafs/src/afs/afs_trace.et
diff -c openafs/src/afs/afs_trace.et:1.3.6.1 openafs/src/afs/afs_trace.et:1.3.6.3
*** openafs/src/afs/afs_trace.et:1.3.6.1	Wed Sep 19 18:40:21 2001
--- openafs/src/afs/afs_trace.et	Mon Jul 22 18:14:52 2002
***************
*** 129,133 ****
--- 129,136 ----
  	ec	CM_TRACE_VM_CLOSE, "VMclose ip 0x%lx mapcnt %d opens %d XoW %d"
  	ec      CM_TRACE_PREFETCHCMD, "PrefetchCmd tvc 0x%x tfid (%d:%d.%d.%d) fid (%d:%d.%d.%d)"
  	ec      CM_TRACE_RESIDCMD, "ResidencyCmd tvc 0x%x command %d fid (%d:%d.%d.%d)"
+ 	ec 	CM_TRACE_DENTRYDELETE, "d_delete inode 0x%x d_name %s/%s"
+ 	ec	CM_TRACE_DENTRYIPUT, "d_iput inode 0x%x d_name %s/%s"
+ 	ec	CM_TRACE_TRYFLUSHDCACHECHILDREN, "TryFlushDcacheChildren ip 0x%x"
  end
  
Index: openafs/src/afs/afs_vcache.c
diff -c openafs/src/afs/afs_vcache.c:1.9.2.10 openafs/src/afs/afs_vcache.c:1.9.2.13
*** openafs/src/afs/afs_vcache.c:1.9.2.10	Tue Apr 23 21:49:34 2002
--- openafs/src/afs/afs_vcache.c	Mon Jul 22 19:14:45 2002
***************
*** 38,44 ****
  #include <afsconfig.h>
  #include "../afs/param.h"
  
! RCSID("$Header: /data/cvs/openafs/src/afs/afs_vcache.c,v 1.9.2.10 2002/04/24 01:49:34 zacheiss Exp $");
  
  #include "../afs/sysincludes.h" /*Standard vendor system headers*/
  #include "../afs/afsincludes.h" /*AFS-based standard headers*/
--- 38,44 ----
  #include <afsconfig.h>
  #include "../afs/param.h"
  
! RCSID("$Header: /data/cvs/openafs/src/afs/afs_vcache.c,v 1.9.2.13 2002/07/22 23:14:45 zacheiss Exp $");
  
  #include "../afs/sysincludes.h" /*Standard vendor system headers*/
  #include "../afs/afsincludes.h" /*AFS-based standard headers*/
***************
*** 495,501 ****
  	repeat:
  	    next = this_parent->d_subdirs.next;
  	resume:
! 	    while (next != &this_parent->d_subdirs) {
  		struct list_head *tmp = next;
  		struct dentry *dchld = list_entry(tmp, struct dentry, d_child);
  		
--- 495,501 ----
  	repeat:
  	    next = this_parent->d_subdirs.next;
  	resume:
! 	    while (next && next != &this_parent->d_subdirs) {
  		struct list_head *tmp = next;
  		struct dentry *dchld = list_entry(tmp, struct dentry, d_child);
  		
***************
*** 977,982 ****
--- 977,985 ----
  	INIT_LIST_HEAD(&ip->i_devices);
  #endif
  	ip->i_data.host = (void*) ip;
+ #ifdef STRUCT_ADDRESS_SPACE_HAS_GFP_MASK
+ 	ip->i_data.gfp_mask = GFP_HIGHUSER;
+ #endif
  	ip->i_mapping = &ip->i_data;
  #ifdef STRUCT_INODE_HAS_I_TRUNCATE_SEM
  	init_rwsem(&ip->i_truncate_sem);
***************
*** 1486,1494 ****
  	avc->m.Mode |= S_IFDIR;
      }
      else if (astat->FileType == SymbolicLink) {
! 	vSetType(avc, VLNK);
! 	avc->m.Mode |= S_IFLNK;
! 	if ((avc->m.Mode & 0111) == 0) avc->mvstat = 1;
      }
      avc->anyAccess = astat->AnonymousAccess;
  #ifdef badidea
--- 1489,1504 ----
  	avc->m.Mode |= S_IFDIR;
      }
      else if (astat->FileType == SymbolicLink) {
! 	if (afs_fakestat_enable && (avc->m.Mode & 0111) == 0) {
! 	    vSetType(avc, VDIR);
! 	    avc->m.Mode |= S_IFDIR;
! 	} else {
! 	    vSetType(avc, VLNK);
! 	    avc->m.Mode |= S_IFLNK;
! 	}
! 	if ((avc->m.Mode & 0111) == 0) {
! 	    avc->mvstat = 1;
! 	}
      }
      avc->anyAccess = astat->AnonymousAccess;
  #ifdef badidea
Index: openafs/src/afs/DARWIN/osi_vm.c
diff -c openafs/src/afs/DARWIN/osi_vm.c:1.3.4.2 openafs/src/afs/DARWIN/osi_vm.c:1.3.4.3
*** openafs/src/afs/DARWIN/osi_vm.c:1.3.4.2	Tue Apr 23 21:41:22 2002
--- openafs/src/afs/DARWIN/osi_vm.c	Wed Jul 10 22:34:13 2002
***************
*** 10,16 ****
  #include <afsconfig.h>
  #include "../afs/param.h"
  
! RCSID("$Header: /data/cvs/openafs/src/afs/DARWIN/osi_vm.c,v 1.3.4.2 2002/04/24 01:41:22 zacheiss Exp $");
  
  #include "../afs/sysincludes.h" /* Standard vendor system headers */
  #include "../afs/afsincludes.h" /* Afs-based standard headers */
--- 10,16 ----
  #include <afsconfig.h>
  #include "../afs/param.h"
  
! RCSID("$Header: /data/cvs/openafs/src/afs/DARWIN/osi_vm.c,v 1.3.4.3 2002/07/11 02:34:13 shadow Exp $");
  
  #include "../afs/sysincludes.h" /* Standard vendor system headers */
  #include "../afs/afsincludes.h" /* Afs-based standard headers */
***************
*** 193,199 ****
          return;
      }
  #ifdef AFS_DARWIN14_ENV
!     if (vp->v_ubcinfo->ui_refcount > 1) {
          simple_unlock(&vp->v_interlock);
          AFS_RELE(vp);
          return;
--- 193,199 ----
          return;
      }
  #ifdef AFS_DARWIN14_ENV
!     if (vp->v_ubcinfo->ui_refcount > 1 || vp->v_ubcinfo->ui_mapped) {
          simple_unlock(&vp->v_interlock);
          AFS_RELE(vp);
          return;
Index: openafs/src/afs/DUX/osi_vfsops.c
diff -c openafs/src/afs/DUX/osi_vfsops.c:1.7.2.1 openafs/src/afs/DUX/osi_vfsops.c:1.7.2.2
*** openafs/src/afs/DUX/osi_vfsops.c:1.7.2.1	Tue Apr 23 21:41:25 2002
--- openafs/src/afs/DUX/osi_vfsops.c	Wed Jul 10 16:01:29 2002
***************
*** 13,19 ****
  #include <afsconfig.h>
  #include "../afs/param.h"
  
! RCSID("$Header: /data/cvs/openafs/src/afs/DUX/osi_vfsops.c,v 1.7.2.1 2002/04/24 01:41:25 zacheiss Exp $");
  
  #include "../afs/sysincludes.h"	/* Standard vendor system headers */
  #include "../afs/afsincludes.h"	/* Afs-based standard headers */
--- 13,19 ----
  #include <afsconfig.h>
  #include "../afs/param.h"
  
! RCSID("$Header: /data/cvs/openafs/src/afs/DUX/osi_vfsops.c,v 1.7.2.2 2002/07/10 20:01:29 shadow Exp $");
  
  #include "../afs/sysincludes.h"	/* Standard vendor system headers */
  #include "../afs/afsincludes.h"	/* Afs-based standard headers */
***************
*** 484,497 ****
      extern int Afs_xsetgroups(), afs_xioctl(), afs3_syscall();
      
      AFS_GLOCK();
!     sysent[AFS_SYSCALL].sy_call = afs3_syscall;
  #ifdef SY_NARG
!     sysent[AFS_SYSCALL].sy_info = 6;
  #else
!     sysent[AFS_SYSCALL].sy_parallel = 0;
!     sysent[AFS_SYSCALL].sy_narg = 6;
  #endif
!     sysent[SYS_setgroups].sy_call = Afs_xsetgroups;
      afs_xioctl_func = afsxioctl;    
      afs_xsetgroups_func = afsxsetgroups;
      afs_syscall_func = afssyscall;
--- 484,499 ----
      extern int Afs_xsetgroups(), afs_xioctl(), afs3_syscall();
      
      AFS_GLOCK();
!     ((struct sysent *) (&sysent[AFS_SYSCALL]))->sy_call = afs3_syscall;
  #ifdef SY_NARG
!     ((struct sysent *) (&sysent[AFS_SYSCALL]))->sy_info = 6;
  #else
!     ((struct sysent *) (&sysent[AFS_SYSCALL]))->sy_parallel = 0;
!     ((struct sysent *) (&sysent[AFS_SYSCALL]))->sy_narg = 6;
  #endif
! 
!     ((struct sysent *) (&sysent[SYS_setgroups]))->sy_call =
!       Afs_xsetgroups;
      afs_xioctl_func = afsxioctl;    
      afs_xsetgroups_func = afsxsetgroups;
      afs_syscall_func = afssyscall;
Index: openafs/src/afs/LINUX/osi_alloc.c
diff -c openafs/src/afs/LINUX/osi_alloc.c:1.9.2.4 openafs/src/afs/LINUX/osi_alloc.c:1.9.2.7
*** openafs/src/afs/LINUX/osi_alloc.c:1.9.2.4	Mon Apr 22 23:32:36 2002
--- openafs/src/afs/LINUX/osi_alloc.c	Thu Aug  1 12:13:21 2002
***************
*** 14,20 ****
  #include <afsconfig.h>
  #include "../afs/param.h"
  
! RCSID("$Header: /data/cvs/openafs/src/afs/LINUX/osi_alloc.c,v 1.9.2.4 2002/04/23 03:32:36 zacheiss Exp $");
  
  #include "../afs/sysincludes.h"
  #include "../afs/afsincludes.h"
--- 14,20 ----
  #include <afsconfig.h>
  #include "../afs/param.h"
  
! RCSID("$Header: /data/cvs/openafs/src/afs/LINUX/osi_alloc.c,v 1.9.2.7 2002/08/01 16:13:21 shadow Exp $");
  
  #include "../afs/sysincludes.h"
  #include "../afs/afsincludes.h"
***************
*** 24,30 ****
  #include "../afs/afs_atomlist.h"
  #include "../afs/afs_lhash.h"
  
! #define MAX_KMALLOC_SIZE (131072-16) /* Max we can alloc in physmem */
  #define MAX_BUCKET_LEN 30 /* max. no. of entries per buckets we expect to see */
  #define STAT_INTERVAL 8192 /* we collect stats once every STAT_INTERVAL allocs*/
  
--- 24,30 ----
  #include "../afs/afs_atomlist.h"
  #include "../afs/afs_lhash.h"
  
! #define MAX_KMALLOC_SIZE PAGE_SIZE /* Max we should alloc with kmalloc */
  #define MAX_BUCKET_LEN 30 /* max. no. of entries per buckets we expect to see */
  #define STAT_INTERVAL 8192 /* we collect stats once every STAT_INTERVAL allocs*/
  
***************
*** 76,92 ****
   *  returns NULL if we failed to allocate memory.
   *  or pointer to memory if we succeeded.
   */
! static void *linux_alloc(unsigned int asize)
  {
      void *new = NULL;
!     int has_afs_glock = ISAFS_GLOCK();
  
-     /* if global lock has been held save this info and unlock it. */
-     if (has_afs_glock)
-         AFS_GUNLOCK();
- 
      /*  if we can use kmalloc use it to allocate the required memory. */
!     if (asize <  MAX_KMALLOC_SIZE) {
          new = (void *)(unsigned long)kmalloc(asize, 
  #ifdef GFP_NOFS
  					     GFP_NOFS
--- 76,91 ----
   *  returns NULL if we failed to allocate memory.
   *  or pointer to memory if we succeeded.
   */
! static void *linux_alloc(unsigned int asize, int drop_glock)
  {
      void *new = NULL;
!     int max_retry = 10;
!     int haveGlock = ISAFS_GLOCK();
  
      /*  if we can use kmalloc use it to allocate the required memory. */
!     while(!new && max_retry)
!     {
!         if (asize <=  MAX_KMALLOC_SIZE) {
          new = (void *)(unsigned long)kmalloc(asize, 
  #ifdef GFP_NOFS
  					     GFP_NOFS
***************
*** 96,125 ****
  					     );
          if (new) /* piggy back alloc type */
              (unsigned long)new |= KM_TYPE;
!     }
!     if (!new) { /* otherwise use vmalloc  */
! 	int max_wait = 10;
!         while (!(new = (void *)vmalloc(asize))) {
!             if (--max_wait <=0) {
! 		break;
              }
  #ifdef set_current_state
  	    set_current_state(TASK_INTERRUPTIBLE);
  #else
  	    current->state = TASK_INTERRUPTIBLE;
  #endif
  	    schedule_timeout(HZ);
          }
- 	if (new) /* piggy back alloc type */
- 	    (unsigned long)new |= VM_TYPE;
      }
      if (new)
  	memset(MEMADDR(new), 0, asize);
  
-     /* if the global lock had been held, lock it again. */
-     if (has_afs_glock)
-         AFS_GLOCK();
- 
      return new;
  }
  
--- 95,126 ----
  					     );
          if (new) /* piggy back alloc type */
              (unsigned long)new |= KM_TYPE;
!         } else {
!             new = (void *)vmalloc(asize);
! 	    if (new) /* piggy back alloc type */
! 	        (unsigned long)new |= VM_TYPE;
              }
+ 
+ 	if (!new) {
  #ifdef set_current_state
  	    set_current_state(TASK_INTERRUPTIBLE);
  #else
  	    current->state = TASK_INTERRUPTIBLE;
  #endif
+ 	    if (drop_glock && haveGlock) AFS_GUNLOCK();
  	    schedule_timeout(HZ);
+ 	    if (drop_glock && haveGlock) AFS_GLOCK();
+ #ifdef set_current_state
+             set_current_state(TASK_RUNNING);
+ #else
+             current->state = TASK_RUNNING;
+ #endif
+             --max_retry;
          }
      }
      if (new)
  	memset(MEMADDR(new), 0, asize);
  
      return new;
  }
  
***************
*** 282,307 ****
  struct semaphore afs_linux_alloc_sem = MUTEX;
  #endif
  
! void *osi_linux_alloc(unsigned int asize)
  {
      void *new = NULL;
      struct osi_linux_mem *lmem;
  
      down(&afs_linux_alloc_sem);
  
!     if (allocator_init == 0) { /* allocator hasn't been initialized yet */
  	if (linux_alloc_init() == 0) {
  	    goto error;
  	 }
  	allocator_init = 1; /* initialization complete */
-     }
- 
-     up(&afs_linux_alloc_sem);
-     new = linux_alloc(asize); /* get a chunk of memory of size asize */
-     down(&afs_linux_alloc_sem);
-     if (!new) {
- 	printf("afs_osi_Alloc: Can't vmalloc %d bytes.\n", asize);
- 	goto error;
      }
      
      /* get an atom to store the pointer to the chunk */
--- 283,308 ----
  struct semaphore afs_linux_alloc_sem = MUTEX;
  #endif
  
! void *osi_linux_alloc(unsigned int asize, int drop_glock)
  {
      void *new = NULL;
      struct osi_linux_mem *lmem;
  
+     new = linux_alloc(asize, drop_glock); /* get a chunk of memory of size asize */
+ 
+     if (!new) {
+ 	printf("afs_osi_Alloc: Can't vmalloc %d bytes.\n", asize);
+ 	return new;
+     }
+ 
      down(&afs_linux_alloc_sem);
  
!     /* allocator hasn't been initialized yet */
!     if (allocator_init == 0) {
  	if (linux_alloc_init() == 0) {
  	    goto error;
  	 }
  	allocator_init = 1; /* initialization complete */
      }
      
      /* get an atom to store the pointer to the chunk */
Index: openafs/src/afs/LINUX/osi_machdep.h
diff -c openafs/src/afs/LINUX/osi_machdep.h:1.5.2.1 openafs/src/afs/LINUX/osi_machdep.h:1.5.2.2
*** openafs/src/afs/LINUX/osi_machdep.h:1.5.2.1	Sun Jan 20 03:57:44 2002
--- openafs/src/afs/LINUX/osi_machdep.h	Wed Jul 10 16:42:33 2002
***************
*** 108,113 ****
--- 108,114 ----
      int cr_ngroups;
  } cred_t;
  #define AFS_UCRED cred
+ #define AFS_PROC struct task_struct
  #define crhold(c) (c)->cr_ref++
  
  /* UIO manipulation */
Index: openafs/src/afs/LINUX/osi_misc.c
diff -c openafs/src/afs/LINUX/osi_misc.c:1.12.2.5 openafs/src/afs/LINUX/osi_misc.c:1.12.2.6
*** openafs/src/afs/LINUX/osi_misc.c:1.12.2.5	Wed May 15 16:07:29 2002
--- openafs/src/afs/LINUX/osi_misc.c	Mon Jul 22 18:05:50 2002
***************
*** 14,20 ****
  #include <afsconfig.h>
  #include "../afs/param.h"
  
! RCSID("$Header: /data/cvs/openafs/src/afs/LINUX/osi_misc.c,v 1.12.2.5 2002/05/15 20:07:29 zacheiss Exp $");
  
  #include "../afs/sysincludes.h"
  #include "../afs/afsincludes.h"
--- 14,20 ----
  #include <afsconfig.h>
  #include "../afs/param.h"
  
! RCSID("$Header: /data/cvs/openafs/src/afs/LINUX/osi_misc.c,v 1.12.2.6 2002/07/22 22:05:50 zacheiss Exp $");
  
  #include "../afs/sysincludes.h"
  #include "../afs/afsincludes.h"
***************
*** 329,335 ****
  void osi_clear_inode(struct inode *ip)
  {
      cred_t *credp = crref();
!     struct vcache *vc = ITOAFS(ip);
  
  #if defined(AFS_LINUX24_ENV)
      if (atomic_read(&ip->i_count) > 1)
--- 329,335 ----
  void osi_clear_inode(struct inode *ip)
  {
      cred_t *credp = crref();
!     struct vcache *vcp = ITOAFS(ip);
  
  #if defined(AFS_LINUX24_ENV)
      if (atomic_read(&ip->i_count) > 1)
***************
*** 338,352 ****
  #endif
          printf("afs_put_inode: ino %d (0x%x) has count %d\n", ip->i_ino, ip);
  
!     ObtainWriteLock(&vc->lock, 504);
!     afs_InactiveVCache(vc, credp);
!     ReleaseWriteLock(&vc->lock);
  #if defined(AFS_LINUX24_ENV)
      atomic_set(&ip->i_count, 0);
  #else
      ip->i_count = 0;
  #endif
      ip->i_nlink = 0; /* iput checks this after calling this routine. */
      crfree(credp);
  }
  
--- 338,352 ----
  #endif
          printf("afs_put_inode: ino %d (0x%x) has count %d\n", ip->i_ino, ip);
  
!     afs_InactiveVCache(vcp, credp);
!     ObtainWriteLock(&vcp->lock, 504);
  #if defined(AFS_LINUX24_ENV)
      atomic_set(&ip->i_count, 0);
  #else
      ip->i_count = 0;
  #endif
      ip->i_nlink = 0; /* iput checks this after calling this routine. */
+     ReleaseWriteLock(&vcp->lock);
      crfree(credp);
  }
  
Index: openafs/src/afs/LINUX/osi_prototypes.h
diff -c openafs/src/afs/LINUX/osi_prototypes.h:1.2 openafs/src/afs/LINUX/osi_prototypes.h:1.2.8.1
*** openafs/src/afs/LINUX/osi_prototypes.h:1.2	Sat Nov  4 05:03:25 2000
--- openafs/src/afs/LINUX/osi_prototypes.h	Wed Jul 31 18:31:15 2002
***************
*** 14,20 ****
  #define _OSI_PROTO_H_
  
  /* osi_alloc.c */
! extern void *osi_linux_alloc(unsigned int size);
  extern void osi_linux_free(void *addr);
  extern void osi_linux_free_afs_memory(void);
  /* Debugging aid */
--- 14,20 ----
  #define _OSI_PROTO_H_
  
  /* osi_alloc.c */
! extern void *osi_linux_alloc(unsigned int size, int drop_glock);
  extern void osi_linux_free(void *addr);
  extern void osi_linux_free_afs_memory(void);
  /* Debugging aid */
Index: openafs/src/afs/LINUX/osi_sleep.c
diff -c openafs/src/afs/LINUX/osi_sleep.c:1.6.4.4 openafs/src/afs/LINUX/osi_sleep.c:1.6.4.7
*** openafs/src/afs/LINUX/osi_sleep.c:1.6.4.4	Tue Jan 29 14:45:39 2002
--- openafs/src/afs/LINUX/osi_sleep.c	Wed Jul 31 18:31:15 2002
***************
*** 10,16 ****
  #include <afsconfig.h>
  #include "../afs/param.h"
  
! RCSID("$Header: /data/cvs/openafs/src/afs/LINUX/osi_sleep.c,v 1.6.4.4 2002/01/29 19:45:39 shadow Exp $");
  
  #include "../afs/sysincludes.h"	/* Standard vendor system headers */
  #include "../afs/afsincludes.h"	/* Afs-based standard headers */
--- 10,16 ----
  #include <afsconfig.h>
  #include "../afs/param.h"
  
! RCSID("$Header: /data/cvs/openafs/src/afs/LINUX/osi_sleep.c,v 1.6.4.7 2002/07/31 22:31:15 shadow Exp $");
  
  #include "../afs/sysincludes.h"	/* Standard vendor system headers */
  #include "../afs/afsincludes.h"	/* Afs-based standard headers */
***************
*** 18,68 ****
  
  
  
- #if defined(AFS_GLOBAL_SUNLOCK)
  static int osi_TimedSleep(char *event, afs_int32 ams, int aintok);
- #endif
- 
  void afs_osi_Wakeup(char *event);
  void afs_osi_Sleep(char *event);
  
  static char waitV, dummyV;
  
- #if ! defined(AFS_GLOBAL_SUNLOCK)
- 
- /* call procedure aproc with arock as an argument, in ams milliseconds */
- static struct timer_list *afs_osi_CallProc(void *aproc, void *arock, int ams)
- {
-     struct timer_list *timer = NULL;
-     
-     timer = (struct timer_list*)osi_Alloc(sizeof(struct timer_list));
-     if (timer) {
- 	init_timer(timer);
- 	timer->expires = (ams*afs_hz)/1000 + 1;
- 	timer->data = (unsigned long)arock;
- 	timer->function = aproc;
- 	add_timer(timer);
-     }
-     return timer;
- }
- 
- /* cancel a timeout, whether or not it has already occurred */
- static int afs_osi_CancelProc(struct timer_list *timer)
- {
-     if (timer) {
- 	del_timer(timer);
- 	osi_Free(timer, sizeof(struct timer_list));
-     }
-     return 0;
- }
- 
- static AfsWaitHack()
- {
-     AFS_STATCNT(WaitHack);
-     wakeup(&waitV);
- }
- 
- #endif
- 
  void afs_osi_InitWaitHandle(struct afs_osi_WaitHandle *achandle)
  {
      AFS_STATCNT(osi_InitWaitHandle);
--- 18,29 ----
***************
*** 96,120 ****
      if (ahandle)
  	ahandle->proc = (caddr_t) current;
  
-     AFS_ASSERT_GLOCK();
      do {
! #if	defined(AFS_GLOBAL_SUNLOCK)
!         code = osi_TimedSleep(&waitV, ams, 1);
!         if (code == EINTR) {
!                 if (aintok) 
! 		    return EINTR;
!         }
! #else
! 	timer = afs_osi_CallProc(AfsWaitHack, (char *) current, ams);
! 	afs_osi_Sleep(&waitV);
! 	afs_osi_CancelProc(timer);
! #endif /* AFS_GLOBAL_SUNLOCK */
  	if (ahandle && (ahandle->proc == (caddr_t) 0)) {
  	    /* we've been signalled */
! 	    return EINTR;
  	}
      } while (osi_Time() < endTime);
!     return 0;
  }
  
  
--- 57,74 ----
      if (ahandle)
  	ahandle->proc = (caddr_t) current;
  
      do {
!         AFS_ASSERT_GLOCK();
!         code = 0;
!         code = osi_TimedSleep(&waitV, ams, aintok);
! 
!         if (code) break;
  	if (ahandle && (ahandle->proc == (caddr_t) 0)) {
  	    /* we've been signalled */
! 	    break;
  	}
      } while (osi_Time() < endTime);
!     return code;
  }
  
  
***************
*** 185,191 ****
      
      AFS_ASSERT_GLOCK();
      hashcode = afs_evhash(event);
!     newp = osi_AllocSmallSpace(sizeof(afs_event_t));
      afs_evhashcnt++;
      newp->next = afs_evhasht[hashcode];
      afs_evhasht[hashcode] = newp;
--- 139,145 ----
      
      AFS_ASSERT_GLOCK();
      hashcode = afs_evhash(event);
!     newp = osi_linux_alloc(sizeof(afs_event_t), 0);
      afs_evhashcnt++;
      newp->next = afs_evhasht[hashcode];
      afs_evhasht[hashcode] = newp;
***************
*** 199,230 ****
      newp->refcount = 0;
  }
  
  
  /* Release the specified event */
  #define relevent(evp) ((evp)->refcount--)
  
! /* afs_osi_Sleep -- waits for an event to be notified. */
! 
  void afs_osi_Sleep(char *event)
  {
      struct afs_event *evp;
      int seq;
  
      evp = afs_getevent(event);
      if (!evp) {
- 	/* Can't block because allocating a new event would require dropping
-          * the GLOCK, which may cause us to miss the wakeup.  So call the
-          * allocator then return immediately.  We'll find the new event next
-          * time around without dropping the GLOCK. */
          afs_addevent(event);
!         return;
      }
  
      seq = evp->seq;
  
      while (seq == evp->seq) {
  	sigset_t saved_set;
  
  	AFS_ASSERT_GLOCK();
  	AFS_GUNLOCK();
  	spin_lock_irq(&current->sigmask_lock);
--- 153,195 ----
      newp->refcount = 0;
  }
  
+ #ifndef set_current_state
+ #define set_current_state(x)            current->state = (x);
+ #endif
  
  /* Release the specified event */
  #define relevent(evp) ((evp)->refcount--)
  
! /* afs_osi_Sleep -- waits for an event to be notified, ignoring signals.
!  * - NOTE: that on Linux, there are circumstances in which TASK_INTERRUPTIBLE
!  *   can wake up, even if all signals are blocked
!  * - TODO: handle signals correctly by passing an indication back to the
!  *   caller that the wait has been interrupted and the stack should be cleaned
!  *   up preparatory to signal delivery
!  */
  void afs_osi_Sleep(char *event)
  {
      struct afs_event *evp;
      int seq;
+ #ifdef DECLARE_WAITQUEUE
+     DECLARE_WAITQUEUE(wait, current);
+ #else
+     struct wait_queue wait = { current, NULL };
+ #endif
  
      evp = afs_getevent(event);
      if (!evp) {
          afs_addevent(event);
! 	evp = afs_getevent(event);
      }
  
      seq = evp->seq;
  
+     add_wait_queue(&evp->cond, &wait);
      while (seq == evp->seq) {
  	sigset_t saved_set;
  
+ 	set_current_state(TASK_INTERRUPTIBLE);
  	AFS_ASSERT_GLOCK();
  	AFS_GUNLOCK();
  	spin_lock_irq(&current->sigmask_lock);
***************
*** 233,239 ****
  	recalc_sigpending(current);
  	spin_unlock_irq(&current->sigmask_lock);
  
! 	interruptible_sleep_on(&evp->cond);
  
  	spin_lock_irq(&current->sigmask_lock);
  	current->blocked = saved_set;
--- 198,204 ----
  	recalc_sigpending(current);
  	spin_unlock_irq(&current->sigmask_lock);
  
! 	schedule();
  
  	spin_lock_irq(&current->sigmask_lock);
  	current->blocked = saved_set;
***************
*** 241,246 ****
--- 206,214 ----
  	spin_unlock_irq(&current->sigmask_lock);
  	AFS_GLOCK();
      }
+     remove_wait_queue(&evp->cond, &wait);
+     set_current_state(TASK_RUNNING);
+ 
      relevent(evp);
  }
  
***************
*** 256,284 ****
   */
  static int osi_TimedSleep(char *event, afs_int32 ams, int aintok)
  {
!     long t = ams * HZ / 1000;
      struct afs_event *evp;
  
      evp = afs_getevent(event);
      if (!evp) {
-         /* Can't block because allocating a new event would require dropping
-          * the GLOCK, which may cause us to miss the wakeup.  So call the
-          * allocator then return immediately.  We'll find the new event next
-          * time around without dropping the GLOCK. */
          afs_addevent(event);
!         return EAGAIN;
      }
  
      AFS_GUNLOCK();
!     if (aintok)
! 	t = interruptible_sleep_on_timeout(&evp->cond, t);
!     else
! 	t = sleep_on_timeout(&evp->cond, t);
      AFS_GLOCK();
  
      relevent(evp);
  
!     return t ? EINTR : 0;
  }
  
  
--- 224,263 ----
   */
  static int osi_TimedSleep(char *event, afs_int32 ams, int aintok)
  {
!     int code = 0;
!     long ticks = (ams * HZ / 1000) + 1;
      struct afs_event *evp;
+ #ifdef DECLARE_WAITQUEUE
+     DECLARE_WAITQUEUE(wait, current);
+ #else
+     struct wait_queue wait = { current, NULL };
+ #endif
  
      evp = afs_getevent(event);
      if (!evp) {
          afs_addevent(event);
! 	evp = afs_getevent(event);
      }
  
+     add_wait_queue(&evp->cond, &wait);
+     set_current_state(TASK_INTERRUPTIBLE);
+     /* always sleep TASK_INTERRUPTIBLE to keep load average
+        from artifically increasing. */
+ 
      AFS_GUNLOCK();
!     if (aintok) {
!         if (schedule_timeout(ticks))
!             code = EINTR;
!     } else
!         schedule_timeout(ticks);
      AFS_GLOCK();
  
+     remove_wait_queue(&evp->cond, &wait);
+     set_current_state(TASK_RUNNING);
+ 
      relevent(evp);
  
!     return code;
  }
  
  
Index: openafs/src/afs/LINUX/osi_sysctl.c
diff -c openafs/src/afs/LINUX/osi_sysctl.c:1.2.4.2 openafs/src/afs/LINUX/osi_sysctl.c:1.2.4.3
*** openafs/src/afs/LINUX/osi_sysctl.c:1.2.4.2	Mon Apr  1 21:10:03 2002
--- openafs/src/afs/LINUX/osi_sysctl.c	Wed Jul 10 16:42:33 2002
***************
*** 1,7 ****
  /*
   * osi_sysctl.c: Linux sysctl interface to OpenAFS
   *
!  * $Id: osi_sysctl.c,v 1.2.4.2 2002/04/02 02:10:03 shadow Exp $
   *
   * Written Jan 30, 2002 by Kris Van Hees (Sine Nomine Associates)
   */
--- 1,7 ----
  /*
   * osi_sysctl.c: Linux sysctl interface to OpenAFS
   *
!  * $Id: osi_sysctl.c,v 1.2.4.3 2002/07/10 20:42:33 shadow Exp $
   *
   * Written Jan 30, 2002 by Kris Van Hees (Sine Nomine Associates)
   */
***************
*** 33,38 ****
--- 33,41 ----
           &proc_dointvec},
          {3, "hm_retry_int",
           &hm_retry_int, sizeof(afs_int32), 0644, NULL,
+          &proc_dointvec},
+         {4, "GCPAGs",
+          &afs_gcpags, sizeof(afs_int32), 0644, NULL,
           &proc_dointvec},
  	{0}
  };
Index: openafs/src/afs/LINUX/osi_vfsops.c
diff -c openafs/src/afs/LINUX/osi_vfsops.c:1.11.2.4 openafs/src/afs/LINUX/osi_vfsops.c:1.11.2.5
*** openafs/src/afs/LINUX/osi_vfsops.c:1.11.2.4	Tue Apr 23 21:49:38 2002
--- openafs/src/afs/LINUX/osi_vfsops.c	Mon Jul 22 19:14:51 2002
***************
*** 15,21 ****
  #include <afsconfig.h>
  #include "../afs/param.h"
  
! RCSID("$Header: /data/cvs/openafs/src/afs/LINUX/osi_vfsops.c,v 1.11.2.4 2002/04/24 01:49:38 zacheiss Exp $");
  
  #include "../afs/sysincludes.h"
  #include "../afs/afsincludes.h"
--- 15,21 ----
  #include <afsconfig.h>
  #include "../afs/param.h"
  
! RCSID("$Header: /data/cvs/openafs/src/afs/LINUX/osi_vfsops.c,v 1.11.2.5 2002/07/22 23:14:51 zacheiss Exp $");
  
  #include "../afs/sysincludes.h"
  #include "../afs/afsincludes.h"
***************
*** 462,465 ****
--- 462,475 ----
  
      VATTR_NULL(&vattr);
      afs_CopyOutAttrs(avc, &vattr); /* calls vattr2inode */
+ }
+ 
+ /* Yet another one for fakestat'ed mountpoints */
+ void vcache2fakeinode(struct vcache *rootvp, struct vcache *mpvp)
+ {
+     struct vattr vattr;
+ 
+     VATTR_NULL(&vattr);
+     afs_CopyOutAttrs(rootvp, &vattr);
+     vattr2inode(AFSTOV(mpvp), &vattr);
  }
Index: openafs/src/afs/LINUX/osi_vnodeops.c
diff -c openafs/src/afs/LINUX/osi_vnodeops.c:1.29.2.11 openafs/src/afs/LINUX/osi_vnodeops.c:1.29.2.17
*** openafs/src/afs/LINUX/osi_vnodeops.c:1.29.2.11	Mon May  6 12:21:42 2002
--- openafs/src/afs/LINUX/osi_vnodeops.c	Thu Aug  1 15:12:01 2002
***************
*** 23,29 ****
  #include <afsconfig.h>
  #include "../afs/param.h"
  
! RCSID("$Header: /data/cvs/openafs/src/afs/LINUX/osi_vnodeops.c,v 1.29.2.11 2002/05/06 16:21:42 shadow Exp $");
  
  #include "../afs/sysincludes.h"
  #include "../afs/afsincludes.h"
--- 23,29 ----
  #include <afsconfig.h>
  #include "../afs/param.h"
  
! RCSID("$Header: /data/cvs/openafs/src/afs/LINUX/osi_vnodeops.c,v 1.29.2.17 2002/08/01 19:12:01 shadow Exp $");
  
  #include "../afs/sysincludes.h"
  #include "../afs/afsincludes.h"
***************
*** 42,47 ****
--- 42,48 ----
  #endif
  
  extern struct vcache *afs_globalVp;
+ extern afs_rwlock_t afs_xvcache;
  
  extern struct dentry_operations *afs_dops;
  #if defined(AFS_LINUX24_ENV)
***************
*** 169,174 ****
--- 170,176 ----
      int len;
      int origOffset;
      cred_t *credp = crref();
+     struct afs_fakestat_state fakestat;
  
      AFS_GLOCK();
      AFS_STATCNT(afs_readdir);
***************
*** 180,189 ****
--- 182,200 ----
  	return -code;
      }
  
+     afs_InitFakeStat(&fakestat);
+     code = afs_EvalFakeStat(&avc, &fakestat, &treq);
+     if (code) {
+ 	afs_PutFakeStat(&fakestat);
+ 	AFS_GUNLOCK();
+ 	return -code;
+     }
+ 
      /* update the cache entry */
  tagain:
      code = afs_VerifyVCache(avc, &treq);
      if (code) {
+ 	afs_PutFakeStat(&fakestat);
  	AFS_GUNLOCK();
  	return -code;
      }
***************
*** 191,196 ****
--- 202,208 ----
      /* get a reference to the entire directory */
      tdc = afs_GetDCache(avc, 0, &treq, &origOffset, &len, 1);
      if (!tdc) {
+ 	afs_PutFakeStat(&fakestat);
  	AFS_GUNLOCK();
  	return -ENOENT;
      }
***************
*** 284,289 ****
--- 296,302 ----
  
      afs_PutDCache(tdc);
      ReleaseReadLock(&avc->lock);
+     afs_PutFakeStat(&fakestat);
      AFS_GUNLOCK();
      return 0;
  }
***************
*** 530,535 ****
--- 543,555 ----
      AFS_GLOCK();
      code = afs_lockctl(vcp, &flock, cmd, credp);
      AFS_GUNLOCK();
+ 
+     /* Convert flock back to Linux's file_lock */
+     flp->fl_type = flock.l_type;
+     flp->fl_pid = flock.l_pid;
+     flp->fl_start = flock.l_start;
+     flp->fl_end = flock.l_start + flock.l_len;
+ 
      crfree(credp);
      return -code;
      
***************
*** 654,673 ****
      cred_t *credp;
      struct vrequest treq;
      struct vcache *vcp = ITOAFS(dp->d_inode);
  
      AFS_GLOCK();
  #ifdef AFS_LINUX24_ENV
      lock_kernel();
  #endif
  
      /* Make this a fast path (no crref), since it's called so often. */
      if (vcp->states & CStatd) {
!         if (*dp->d_name.name != '/' && vcp->mvstat == 2) /* root vnode */
  	    check_bad_parent(dp); /* check and correct mvid */
! 	vcache2inode(vcp);
  #ifdef AFS_LINUX24_ENV
  	unlock_kernel();
  #endif
  	AFS_GUNLOCK();
  	return 0;
      }
--- 674,706 ----
      cred_t *credp;
      struct vrequest treq;
      struct vcache *vcp = ITOAFS(dp->d_inode);
+     struct vcache *rootvp = NULL;
  
      AFS_GLOCK();
+ 
+     if (afs_fakestat_enable && vcp->mvstat == 1 && vcp->mvid &&
+ 	(vcp->states & CMValid) && (vcp->states & CStatd)) {
+ 	ObtainSharedLock(&afs_xvcache, 680);
+ 	rootvp = afs_FindVCache(vcp->mvid, 0, 0, 0, 0);
+ 	ReleaseSharedLock(&afs_xvcache);
+     }
+ 
  #ifdef AFS_LINUX24_ENV
      lock_kernel();
  #endif
  
      /* Make this a fast path (no crref), since it's called so often. */
      if (vcp->states & CStatd) {
! 	if (*dp->d_name.name != '/' && vcp->mvstat == 2) /* root vnode */
  	    check_bad_parent(dp); /* check and correct mvid */
! 	if (rootvp)
! 	    vcache2fakeinode(rootvp, vcp);
! 	else
! 	    vcache2inode(vcp);
  #ifdef AFS_LINUX24_ENV
  	unlock_kernel();
  #endif
+ 	if (rootvp) afs_PutVCache(rootvp);
  	AFS_GUNLOCK();
  	return 0;
      }
***************
*** 808,820 ****
--- 841,879 ----
  /* afs_dentry_iput */
  static void afs_dentry_iput(struct dentry *dp, struct inode *ip)
  {
+     if (ICL_SETACTIVE(afs_iclSetp)) {
+ 	AFS_GLOCK();
+ 	afs_Trace3(afs_iclSetp, CM_TRACE_DENTRYIPUT,
+ 		   ICL_TYPE_POINTER, ip,
+ 		   ICL_TYPE_STRING, dp->d_parent->d_name.name,
+ 		   ICL_TYPE_STRING, dp->d_name.name);
+ 	AFS_GUNLOCK();
+     }
+ 
      osi_iput(ip);
  }
  
+ static int afs_dentry_delete(struct dentry *dp)
+ {
+     if (ICL_SETACTIVE(afs_iclSetp)) {
+ 	AFS_GLOCK();
+ 	afs_Trace3(afs_iclSetp, CM_TRACE_DENTRYDELETE, ICL_TYPE_POINTER, 
+ 		   dp->d_inode, ICL_TYPE_STRING, dp->d_parent->d_name.name,
+ 		   ICL_TYPE_STRING, dp->d_name.name);
+ 	AFS_GUNLOCK();
+     }
+ 
+     if (dp->d_inode && (ITOAFS(dp->d_inode)->states & CUnlinked))
+ 	return 1;               /* bad inode? */
+ 
+     return 0;
+ }
+ 
  #if defined(AFS_LINUX24_ENV)
  struct dentry_operations afs_dentry_operations = {
         d_revalidate:   afs_linux_dentry_revalidate,
         d_iput:         afs_dentry_iput,
+        d_delete:       afs_dentry_delete,
  };
  struct dentry_operations *afs_dops = &afs_dentry_operations;
  #else
***************
*** 822,828 ****
  	afs_linux_dentry_revalidate,	/* d_validate(struct dentry *) */
  	NULL,			/* d_hash */
  	NULL,			/* d_compare */
! 	NULL,			/* d_delete(struct dentry *) */
  	NULL,			/* d_release(struct dentry *) */
  	afs_dentry_iput		/* d_iput(struct dentry *, struct inode *) */
  };
--- 881,887 ----
  	afs_linux_dentry_revalidate,	/* d_validate(struct dentry *) */
  	NULL,			/* d_hash */
  	NULL,			/* d_compare */
! 	afs_dentry_delete,	/* d_delete(struct dentry *) */
  	NULL,			/* d_release(struct dentry *) */
  	afs_dentry_iput		/* d_iput(struct dentry *, struct inode *) */
  };
***************
*** 977,983 ****
      int code;
      cred_t *credp = crref();
      const char *name = dp->d_name.name;
-     int putback = 0;
  
      AFS_GLOCK();
      code = afs_remove(ITOAFS(dip), name, credp);
--- 1036,1041 ----
***************
*** 1347,1359 ****
--- 1405,1428 ----
                ICL_TYPE_POINTER, pp,
                ICL_TYPE_INT32, atomic_read(&pp->count),
                ICL_TYPE_INT32, 99999);
+ 
      setup_uio(&tuio, &iovec, buffer, base, count, UIO_WRITE, AFS_UIOSYS);
  
      code = afs_write(vcp, &tuio, f_flags, credp, 0);
  
      vcache2inode(vcp);
  
+     if (!code && afs_stats_cmperf.cacheCurrDirtyChunks >
+ 		 afs_stats_cmperf.cacheMaxDirtyChunks) {
+ 	struct vrequest treq;
+ 
+ 	ObtainWriteLock(&vcp->lock, 533);
+ 	if (!afs_InitReq(&treq, credp))
+ 	    code = afs_DoPartialWrite(vcp, &treq);
+ 	ReleaseWriteLock(&vcp->lock);
+     }
      code = code ? -code : count - tuio.uio_resid;
+ 
      afs_Trace4(afs_iclSetp, CM_TRACE_UPDATEPAGE, ICL_TYPE_POINTER, vcp,
                ICL_TYPE_POINTER, pp,
                ICL_TYPE_INT32, atomic_read(&pp->count),
Index: openafs/src/afs/SOLARIS/osi_machdep.h
diff -c openafs/src/afs/SOLARIS/osi_machdep.h:1.2.8.1 openafs/src/afs/SOLARIS/osi_machdep.h:1.2.8.3
*** openafs/src/afs/SOLARIS/osi_machdep.h:1.2.8.1	Tue Apr 23 21:41:36 2002
--- openafs/src/afs/SOLARIS/osi_machdep.h	Mon Jul 22 18:17:26 2002
***************
*** 39,45 ****
--- 39,57 ----
   * Time related macros
   */
  #define	afs_hz	    hz
+ #ifdef AFS_SUN59_ENV
+ #define osi_Time() local_osi_Time()
+ extern void gethrestime(timespec_t *);
+ static int
+ local_osi_Time()
+ {
+    timespec_t start;
+    gethrestime(&start);
+    return start.tv_sec;
+ }
+ #else
  #define osi_Time() (hrestime.tv_sec)
+ #endif
  
  #undef afs_osi_Alloc_NoSleep
  extern void *afs_osi_Alloc_NoSleep(size_t size);
***************
*** 90,96 ****
  #undef AfsLargeFileUio
  #define AfsLargeFileUio(uio)       ( (uio)->_uio_offset._p._u ? 1 : 0 )
  #undef AfsLargeFileSize
! #define AfsLargeFileSize(pos, off) ( ((offset_t)(pos)+(offset_t)(off) > (offset_t)MAXOFF_T)?1:0)
  #endif
  
  #endif /* _OSI_MACHDEP_H_ */
--- 102,108 ----
  #undef AfsLargeFileUio
  #define AfsLargeFileUio(uio)       ( (uio)->_uio_offset._p._u ? 1 : 0 )
  #undef AfsLargeFileSize
! #define AfsLargeFileSize(pos, off) ( ((offset_t)(pos)+(offset_t)(off) > (offset_t)0x7fffffff)?1:0)
  #endif
  
  #endif /* _OSI_MACHDEP_H_ */
Index: openafs/src/afs/SOLARIS/osi_vnodeops.c
diff -c openafs/src/afs/SOLARIS/osi_vnodeops.c:1.7.2.2 openafs/src/afs/SOLARIS/osi_vnodeops.c:1.7.2.3
*** openafs/src/afs/SOLARIS/osi_vnodeops.c:1.7.2.2	Tue Apr 23 21:41:36 2002
--- openafs/src/afs/SOLARIS/osi_vnodeops.c	Mon Jul 22 18:19:14 2002
***************
*** 10,16 ****
  #include <afsconfig.h>
  #include "../afs/param.h"
  
! RCSID("$Header: /data/cvs/openafs/src/afs/SOLARIS/osi_vnodeops.c,v 1.7.2.2 2002/04/24 01:41:36 zacheiss Exp $");
  
  #if	defined(AFS_SUN_ENV) || defined(AFS_SUN5_ENV)
  /*
--- 10,16 ----
  #include <afsconfig.h>
  #include "../afs/param.h"
  
! RCSID("$Header: /data/cvs/openafs/src/afs/SOLARIS/osi_vnodeops.c,v 1.7.2.3 2002/07/22 22:19:14 zacheiss Exp $");
  
  #if	defined(AFS_SUN_ENV) || defined(AFS_SUN5_ENV)
  /*
***************
*** 81,86 ****
--- 81,105 ----
  #endif
  
  
+ /* Translate a faultcode_t as returned by some of the vm routines
+  * into a suitable errno value.
+  */
+ static int
+ afs_fc2errno(faultcode_t fc)
+ {
+     switch (FC_CODE(fc)) {
+     case 0:
+ 	return 0;
+ 
+     case FC_OBJERR:
+ 	return FC_ERRNO(fc);
+ 
+     default:
+ 	return EIO;
+     }
+ }
+ 
+ 
  extern struct as kas;	/* kernel addr space */
  extern unsigned char *afs_indexFlags;	       
  extern afs_lock_t afs_xdcache;		
***************
*** 1070,1076 ****
  	data = segmap_getmap(segkmap, AFSTOV(avc), pageBase);
  #endif
  #ifndef	AFS_SUN5_ENV
! 	code = as_fault(&kas, data+pageOffset, tsize, F_SOFTLOCK, mode);
  	if (code == 0) {
  	    AFS_UIOMOVE(data+pageOffset, tsize, arw, auio, code);
  	    as_fault(&kas, data+pageOffset, tsize, F_SOFTUNLOCK, mode);
--- 1089,1096 ----
  	data = segmap_getmap(segkmap, AFSTOV(avc), pageBase);
  #endif
  #ifndef	AFS_SUN5_ENV
! 	code = afs_fc2errno(as_fault(&kas, data+pageOffset, tsize,
! 				     F_SOFTLOCK, mode));
  	if (code == 0) {
  	    AFS_UIOMOVE(data+pageOffset, tsize, arw, auio, code);
  	    as_fault(&kas, data+pageOffset, tsize, F_SOFTUNLOCK, mode);
***************
*** 1131,1137 ****
  		AFS_GUNLOCK();
  	    }
  	    if (!created)
! 		code = segmap_fault(kas.a_hat, segkmap, raddr, rsize, F_SOFTLOCK, mode);
  	}
  	if (code == 0) {
  	    AFS_UIOMOVE(data+pageOffset, tsize, arw, auio, code);
--- 1151,1158 ----
  		AFS_GUNLOCK();
  	    }
  	    if (!created)
! 		code = afs_fc2errno(segmap_fault(kas.a_hat, segkmap, raddr,
! 						 rsize, F_SOFTLOCK, mode));
  	}
  	if (code == 0) {
  	    AFS_UIOMOVE(data+pageOffset, tsize, arw, auio, code);
Index: openafs/src/afs/VNOPS/afs_vnop_access.c
diff -c openafs/src/afs/VNOPS/afs_vnop_access.c:1.5 openafs/src/afs/VNOPS/afs_vnop_access.c:1.5.4.1
*** openafs/src/afs/VNOPS/afs_vnop_access.c:1.5	Thu Jul 12 15:58:22 2001
--- openafs/src/afs/VNOPS/afs_vnop_access.c	Mon Jul 22 19:14:54 2002
***************
*** 22,28 ****
  #include <afsconfig.h>
  #include "../afs/param.h"
  
! RCSID("$Header: /data/cvs/openafs/src/afs/VNOPS/afs_vnop_access.c,v 1.5 2001/07/12 19:58:22 shadow Exp $");
  
  #include "../afs/sysincludes.h"	/* Standard vendor system headers */
  #include "../afs/afsincludes.h"	/* Afs-based standard headers */
--- 22,28 ----
  #include <afsconfig.h>
  #include "../afs/param.h"
  
! RCSID("$Header: /data/cvs/openafs/src/afs/VNOPS/afs_vnop_access.c,v 1.5.4.1 2002/07/22 23:14:54 zacheiss Exp $");
  
  #include "../afs/sysincludes.h"	/* Standard vendor system headers */
  #include "../afs/afsincludes.h"	/* Afs-based standard headers */
***************
*** 188,208 ****
--- 188,218 ----
      struct AFS_UCRED *acred; {
      register afs_int32 code;
      struct vrequest treq;
+     struct afs_fakestat_state fakestate;
      OSI_VC_CONVERT(avc)
  
      AFS_STATCNT(afs_access);
      afs_Trace3(afs_iclSetp, CM_TRACE_ACCESS, ICL_TYPE_POINTER, avc, 
  	       ICL_TYPE_INT32, amode, ICL_TYPE_INT32, avc->m.Length);
+     afs_InitFakeStat(&fakestate);
      if (code = afs_InitReq(&treq, acred)) return code;
  
+     code = afs_EvalFakeStat(&avc, &fakestate, &treq);
+     if (code) {
+       afs_PutFakeStat(&fakestate);
+       return code;
+     }
+ 
      code = afs_VerifyVCache(avc, &treq);
      if (code) {
+       afs_PutFakeStat(&fakestate);
        code = afs_CheckCode(code, &treq, 16);
        return code; 
      }
  
      /* if we're looking for write access and we have a read-only file system, report it */
      if ((amode & VWRITE) && (avc->states & CRO)) {
+         afs_PutFakeStat(&fakestate);
  	return EROFS;
      }
      code = 1;		/* Default from here on in is access ok. */
***************
*** 269,279 ****
  	       code = afs_AccessOK(avc, PRSFS_READ, &treq, CHECK_MODE_BITS);
  	}
      }
!     if (code)
  	return 0;		/* if access is ok */
!     else {
!       code = afs_CheckCode(EACCES, &treq, 17);	     /* failure code */
!       return code;
      }
  }
  
--- 279,290 ----
  	       code = afs_AccessOK(avc, PRSFS_READ, &treq, CHECK_MODE_BITS);
  	}
      }
!     afs_PutFakeStat(&fakestate);
!     if (code) {
  	return 0;		/* if access is ok */
!     } else {
! 	code = afs_CheckCode(EACCES, &treq, 17);	     /* failure code */
! 	return code;
      }
  }
  
Index: openafs/src/afs/VNOPS/afs_vnop_attrs.c
diff -c openafs/src/afs/VNOPS/afs_vnop_attrs.c:1.8.4.2 openafs/src/afs/VNOPS/afs_vnop_attrs.c:1.8.4.3
*** openafs/src/afs/VNOPS/afs_vnop_attrs.c:1.8.4.2	Fri Jun  7 20:19:39 2002
--- openafs/src/afs/VNOPS/afs_vnop_attrs.c	Mon Jul 22 19:14:54 2002
***************
*** 21,27 ****
  #include <afsconfig.h>
  #include "../afs/param.h"
  
! RCSID("$Header: /data/cvs/openafs/src/afs/VNOPS/afs_vnop_attrs.c,v 1.8.4.2 2002/06/08 00:19:39 shadow Exp $");
  
  #include "../afs/sysincludes.h"	/* Standard vendor system headers */
  #include "../afs/afsincludes.h"	/* Afs-based standard headers */
--- 21,27 ----
  #include <afsconfig.h>
  #include "../afs/param.h"
  
! RCSID("$Header: /data/cvs/openafs/src/afs/VNOPS/afs_vnop_attrs.c,v 1.8.4.3 2002/07/22 23:14:54 zacheiss Exp $");
  
  #include "../afs/sysincludes.h"	/* Standard vendor system headers */
  #include "../afs/afsincludes.h"	/* Afs-based standard headers */
***************
*** 37,56 ****
  /* copy out attributes from cache entry */
  afs_CopyOutAttrs(avc, attrs)
      register struct vattr *attrs;
!     register struct vcache *avc; {
      register struct volume *tvp;
      register struct cell *tcell;
      register afs_int32 i;
  
      AFS_STATCNT(afs_CopyOutAttrs);
  #if	defined(AFS_MACH_ENV )
!     attrs->va_mode = vType(avc) | (avc->m.Mode&~VFMT);
  #else /* AFS_MACH_ENV */
!     attrs->va_type = vType(avc);
  #if defined(AFS_SGI_ENV) || defined(AFS_AIX32_ENV) || defined(AFS_SUN5_ENV)
!     attrs->va_mode = (mode_t)(avc->m.Mode & 0xffff);
  #else
!     attrs->va_mode = avc->m.Mode;
  #endif
  #endif /* AFS_MACH_ENV */
  
--- 37,60 ----
  /* copy out attributes from cache entry */
  afs_CopyOutAttrs(avc, attrs)
      register struct vattr *attrs;
!     register struct vcache *avc;
! {
      register struct volume *tvp;
      register struct cell *tcell;
      register afs_int32 i;
+     int fakedir = 0;
  
      AFS_STATCNT(afs_CopyOutAttrs);
+     if (afs_fakestat_enable && avc->mvstat == 1)
+ 	fakedir = 1;
  #if	defined(AFS_MACH_ENV )
!     attrs->va_mode = fakedir ? VDIR | 0755 : vType(avc) | (avc->m.Mode&~VFMT);
  #else /* AFS_MACH_ENV */
!     attrs->va_type = fakedir ? VDIR : vType(avc);
  #if defined(AFS_SGI_ENV) || defined(AFS_AIX32_ENV) || defined(AFS_SUN5_ENV)
!     attrs->va_mode = fakedir ? 0755 : (mode_t)(avc->m.Mode & 0xffff);
  #else
!     attrs->va_mode = fakedir ? VDIR | 0755 : avc->m.Mode;
  #endif
  #endif /* AFS_MACH_ENV */
  
***************
*** 60,67 ****
  	if (tcell && (tcell->states & CNoSUID))
  	    attrs->va_mode &= ~(VSUID|VSGID);
      }
!     attrs->va_uid = avc->m.Owner;
!     attrs->va_gid = avc->m.Group;   /* yeah! */
  #if	defined(AFS_SUN56_ENV)
      attrs->va_fsid = avc->v.v_vfsp->vfs_fsid.val[0];
  #else
--- 64,71 ----
  	if (tcell && (tcell->states & CNoSUID))
  	    attrs->va_mode &= ~(VSUID|VSGID);
      }
!     attrs->va_uid = fakedir ? 0 : avc->m.Owner;
!     attrs->va_gid = fakedir ? 0 : avc->m.Group;   /* yeah! */
  #if	defined(AFS_SUN56_ENV)
      attrs->va_fsid = avc->v.v_vfsp->vfs_fsid.val[0];
  #else
***************
*** 90,99 ****
      }
      else attrs->va_nodeid = avc->fid.Fid.Vnode + (avc->fid.Fid.Volume << 16);
      attrs->va_nodeid &= 0x7fffffff;	/* Saber C hates negative inode #s! */
!     attrs->va_nlink = avc->m.LinkCount;
!     attrs->va_size = avc->m.Length;
      attrs->va_atime.tv_sec = attrs->va_mtime.tv_sec = attrs->va_ctime.tv_sec =
! 	(int)avc->m.Date;
      /* set microseconds to be dataversion # so that we approximate NFS-style
       * use of mtime as a dataversion #.  We take it mod 512K because
       * microseconds *must* be less than a million, and 512K is the biggest
--- 94,103 ----
      }
      else attrs->va_nodeid = avc->fid.Fid.Vnode + (avc->fid.Fid.Volume << 16);
      attrs->va_nodeid &= 0x7fffffff;	/* Saber C hates negative inode #s! */
!     attrs->va_nlink = fakedir ? 100 : avc->m.LinkCount;
!     attrs->va_size = fakedir ? 4096 : avc->m.Length;
      attrs->va_atime.tv_sec = attrs->va_mtime.tv_sec = attrs->va_ctime.tv_sec =
! 	fakedir ? 0 : (int)avc->m.Date;
      /* set microseconds to be dataversion # so that we approximate NFS-style
       * use of mtime as a dataversion #.  We take it mod 512K because
       * microseconds *must* be less than a million, and 512K is the biggest
***************
*** 192,197 ****
--- 196,218 ----
      afs_Trace2(afs_iclSetp, CM_TRACE_GETATTR, ICL_TYPE_POINTER, avc, 
  	       ICL_TYPE_INT32, avc->m.Length);
  
+     if (afs_fakestat_enable && avc->mvstat == 1) {
+ 	struct afs_fakestat_state fakestat;
+ 
+ 	code = afs_InitReq(&treq, acred);
+ 	if (code) return code;
+ 	afs_InitFakeStat(&fakestat);
+ 	code = afs_TryEvalFakeStat(&avc, &fakestat, &treq);
+ 	if (code) {
+ 	    afs_PutFakeStat(&fakestat);
+ 	    return code;
+ 	}
+ 
+ 	code = afs_CopyOutAttrs(avc, attrs);
+ 	afs_PutFakeStat(&fakestat);
+ 	return code;
+     }
+ 
  #if defined(AFS_SUN5_ENV)
      if (flags & ATTR_HINT) {
         code = afs_CopyOutAttrs(avc, attrs);
***************
*** 392,403 ****
--- 413,431 ----
      struct vrequest treq;
      struct AFSStoreStatus astat;
      register afs_int32 code;
+     struct afs_fakestat_state fakestate;
      OSI_VC_CONVERT(avc)
  
      AFS_STATCNT(afs_setattr);
      afs_Trace2(afs_iclSetp, CM_TRACE_SETATTR, ICL_TYPE_POINTER, avc, 
  	       ICL_TYPE_INT32, avc->m.Length);
      if (code = afs_InitReq(&treq, acred)) return code;
+ 
+     afs_InitFakeStat(&fakestate);
+     code = afs_EvalFakeStat(&avc, &fakestate, &treq);
+     if (code)
+       goto done;
+ 
      if (avc->states & CRO) {
  	code=EROFS;
  	goto done;
***************
*** 516,521 ****
--- 544,550 ----
      AFS_RWUNLOCK((vnode_t *)avc, VRWLOCK_WRITE);
  #endif
  done:
+     afs_PutFakeStat(&fakestate);
      code = afs_CheckCode(code, &treq, 15);
      return code;
  }
Index: openafs/src/afs/VNOPS/afs_vnop_create.c
diff -c openafs/src/afs/VNOPS/afs_vnop_create.c:1.6.4.3 openafs/src/afs/VNOPS/afs_vnop_create.c:1.6.4.4
*** openafs/src/afs/VNOPS/afs_vnop_create.c:1.6.4.3	Tue Apr 23 21:41:40 2002
--- openafs/src/afs/VNOPS/afs_vnop_create.c	Mon Jul 22 19:14:54 2002
***************
*** 16,22 ****
  #include <afsconfig.h>
  #include "../afs/param.h"
  
! RCSID("$Header: /data/cvs/openafs/src/afs/VNOPS/afs_vnop_create.c,v 1.6.4.3 2002/04/24 01:41:40 zacheiss Exp $");
  
  #include "../afs/sysincludes.h"	/* Standard vendor system headers */
  #include "../afs/afsincludes.h"	/* Afs-based standard headers */
--- 16,22 ----
  #include <afsconfig.h>
  #include "../afs/param.h"
  
! RCSID("$Header: /data/cvs/openafs/src/afs/VNOPS/afs_vnop_create.c,v 1.6.4.4 2002/07/22 23:14:54 zacheiss Exp $");
  
  #include "../afs/sysincludes.h"	/* Standard vendor system headers */
  #include "../afs/afsincludes.h"	/* Afs-based standard headers */
***************
*** 72,77 ****
--- 72,78 ----
      struct server *hostp=0;
      struct vcache *tvc;
      struct volume*	volp = 0;
+     struct afs_fakestat_state fakestate;
      XSTATS_DECLS
      OSI_VC_CONVERT(adp)
  
***************
*** 83,88 ****
--- 84,91 ----
      afs_Trace3(afs_iclSetp, CM_TRACE_CREATE, ICL_TYPE_POINTER, adp,
  	       ICL_TYPE_STRING, aname, ICL_TYPE_INT32, amode);
  
+     afs_InitFakeStat(&fakestate);
+ 
  #ifdef AFS_SGI65_ENV
      /* If avcp is passed not null, it's the old reference to this file.
       * We can use this to avoid create races. For now, just decrement
***************
*** 112,117 ****
--- 115,122 ----
  	code = EINVAL;		
  	goto done;
      }
+     code = afs_EvalFakeStat(&adp, &fakestate, &treq);
+     if (code) goto done;
  tagain:
      code = afs_VerifyVCache(adp, &treq);
      if (code) goto done;
***************
*** 454,459 ****
--- 459,465 ----
  	tvc->states |= CCore1;
  #endif
  
+     afs_PutFakeStat(&fakestate);
      code = afs_CheckCode(code, &treq, 20);
  
  done2:
Index: openafs/src/afs/VNOPS/afs_vnop_dirops.c
diff -c openafs/src/afs/VNOPS/afs_vnop_dirops.c:1.4.4.3 openafs/src/afs/VNOPS/afs_vnop_dirops.c:1.4.4.4
*** openafs/src/afs/VNOPS/afs_vnop_dirops.c:1.4.4.3	Tue Apr 23 21:41:40 2002
--- openafs/src/afs/VNOPS/afs_vnop_dirops.c	Mon Jul 22 19:14:54 2002
***************
*** 20,26 ****
  #include <afsconfig.h>
  #include "../afs/param.h"
  
! RCSID("$Header: /data/cvs/openafs/src/afs/VNOPS/afs_vnop_dirops.c,v 1.4.4.3 2002/04/24 01:41:40 zacheiss Exp $");
  
  #include "../afs/sysincludes.h"	/* Standard vendor system headers */
  #include "../afs/afsincludes.h"	/* Afs-based standard headers */
--- 20,26 ----
  #include <afsconfig.h>
  #include "../afs/param.h"
  
! RCSID("$Header: /data/cvs/openafs/src/afs/VNOPS/afs_vnop_dirops.c,v 1.4.4.4 2002/07/22 23:14:54 zacheiss Exp $");
  
  #include "../afs/sysincludes.h"	/* Standard vendor system headers */
  #include "../afs/afsincludes.h"	/* Afs-based standard headers */
***************
*** 62,67 ****
--- 62,68 ----
      struct AFSCallBack CallBack;
      struct AFSVolSync tsync;
      afs_int32 now;
+     struct afs_fakestat_state fakestate;
      XSTATS_DECLS
      OSI_VC_CONVERT(adp)
  
***************
*** 71,76 ****
--- 72,78 ----
  
      if (code = afs_InitReq(&treq, acred)) 
  	goto done2;
+     afs_InitFakeStat(&fakestate);
  
      if (strlen(aname) > AFSNAMEMAX) {
  	code = ENAMETOOLONG;
***************
*** 81,86 ****
--- 83,90 ----
  	code = EINVAL;
  	goto done;
      }
+     code = afs_EvalFakeStat(&adp, &fakestate, &treq);
+     if (code) goto done;
      code = afs_VerifyVCache(adp, &treq);
      if (code) goto done;
  
***************
*** 157,162 ****
--- 161,167 ----
      }
      else code = ENOENT;
  done:
+     afs_PutFakeStat(&fakestate);
      code = afs_CheckCode(code, &treq, 26);
  done2:
  #ifdef	AFS_OSF_ENV
***************
*** 192,197 ****
--- 197,203 ----
      afs_int32 offset, len;
      struct AFSFetchStatus OutDirStatus;
      struct AFSVolSync tsync;
+     struct afs_fakestat_state fakestate;
      XSTATS_DECLS
      OSI_VC_CONVERT(adp)
  
***************
*** 202,213 ****
--- 208,223 ----
  
      if (code = afs_InitReq(&treq, acred)) 
  	goto done2;
+     afs_InitFakeStat(&fakestate);
  
      if (strlen(aname) > AFSNAMEMAX) {
  	code = ENAMETOOLONG;
  	goto done;
      }
  
+     code = afs_EvalFakeStat(&adp, &fakestate, &treq);
+     if (code)
+ 	goto done;
      code = afs_VerifyVCache(adp, &treq);
      if (code) goto done;
  
***************
*** 306,311 ****
--- 316,322 ----
      code = 0;
  
  done:
+     afs_PutFakeStat(&fakestate);
      code = afs_CheckCode(code, &treq, 27); 
  done2:
  #ifdef	AFS_OSF_ENV
Index: openafs/src/afs/VNOPS/afs_vnop_flock.c
diff -c openafs/src/afs/VNOPS/afs_vnop_flock.c:1.10.4.2 openafs/src/afs/VNOPS/afs_vnop_flock.c:1.10.4.3
*** openafs/src/afs/VNOPS/afs_vnop_flock.c:1.10.4.2	Tue Apr 23 21:41:40 2002
--- openafs/src/afs/VNOPS/afs_vnop_flock.c	Mon Jul 22 19:14:54 2002
***************
*** 15,21 ****
  #include <afsconfig.h>
  #include "../afs/param.h"
  
! RCSID("$Header: /data/cvs/openafs/src/afs/VNOPS/afs_vnop_flock.c,v 1.10.4.2 2002/04/24 01:41:40 zacheiss Exp $");
  
  #include "../afs/sysincludes.h"	/* Standard vendor system headers */
  #include "../afs/afsincludes.h"	/* Afs-based standard headers */
--- 15,21 ----
  #include <afsconfig.h>
  #include "../afs/param.h"
  
! RCSID("$Header: /data/cvs/openafs/src/afs/VNOPS/afs_vnop_flock.c,v 1.10.4.3 2002/07/22 23:14:54 zacheiss Exp $");
  
  #include "../afs/sysincludes.h"	/* Standard vendor system headers */
  #include "../afs/afsincludes.h"	/* Afs-based standard headers */
***************
*** 502,512 ****
  #ifdef	AFS_OSF_ENV
      int acmd = 0;
  #endif
  
      AFS_STATCNT(afs_lockctl);
      if (code = afs_InitReq(&treq, acred)) return code;
  #ifdef	AFS_OSF_ENV
!     if (flag & VNOFLCK)	return 0;
      if (flag & CLNFLCK) {
  	acmd = LOCK_UN;
      } else if ((flag & GETFLCK) || (flag & RGETFLCK)) {
--- 502,522 ----
  #ifdef	AFS_OSF_ENV
      int acmd = 0;
  #endif
+     struct afs_fakestat_state fakestate;
  
      AFS_STATCNT(afs_lockctl);
      if (code = afs_InitReq(&treq, acred)) return code;
+     afs_InitFakeStat(&fakestate);
+     code = afs_EvalFakeStat(&avc, &fakestate, &treq);
+     if (code) {
+ 	afs_PutFakeStat(&fakestate);
+ 	return code;
+     }
  #ifdef	AFS_OSF_ENV
!     if (flag & VNOFLCK)	{
! 	afs_PutFakeStat(&fakestate);
! 	return 0;
!     }
      if (flag & CLNFLCK) {
  	acmd = LOCK_UN;
      } else if ((flag & GETFLCK) || (flag & RGETFLCK)) {
***************
*** 520,531 ****
  #else
      if (acmd == F_GETLK) {
  #endif
! 	if (af->l_type == F_UNLCK)
  	    return 0;
  #ifndef	AFS_OSF_ENV	/* getlock is a no-op for osf (for now) */
  	code = HandleGetLock(avc, af, &treq, clid);
  #endif
  	code = afs_CheckCode(code, &treq, 2); /* defeat buggy AIX optimz */
  	return code;
      }
      else if ((acmd == F_SETLK) || (acmd == F_SETLKW) 
--- 530,544 ----
  #else
      if (acmd == F_GETLK) {
  #endif
! 	if (af->l_type == F_UNLCK) {
! 	    afs_PutFakeStat(&fakestate);
  	    return 0;
+ 	}
  #ifndef	AFS_OSF_ENV	/* getlock is a no-op for osf (for now) */
  	code = HandleGetLock(avc, af, &treq, clid);
  #endif
  	code = afs_CheckCode(code, &treq, 2); /* defeat buggy AIX optimz */
+ 	afs_PutFakeStat(&fakestate);
  	return code;
      }
      else if ((acmd == F_SETLK) || (acmd == F_SETLKW) 
***************
*** 553,565 ****
  	   even when they should block */
  	if (af->l_whence != 0 || af->l_start != 0 || af->l_len != 0) {
  	    DoLockWarning();
  	    return 0;
  	}
  	/* otherwise we can turn this into a whole-file flock */
  	if (af->l_type == F_RDLCK) code = LOCK_SH;
  	else if (af->l_type == F_WRLCK) code = LOCK_EX;
  	else if (af->l_type == F_UNLCK) code = LOCK_UN;
! 	else return EINVAL; /* unknown lock type */
  	if (((acmd == F_SETLK) 
  #if 	(defined(AFS_SGI_ENV) || defined(AFS_SUN_ENV)) && !defined(AFS_SUN58_ENV)
  	|| (acmd == F_RSETLK) 
--- 566,582 ----
  	   even when they should block */
  	if (af->l_whence != 0 || af->l_start != 0 || af->l_len != 0) {
  	    DoLockWarning();
+ 	    afs_PutFakeStat(&fakestate);
  	    return 0;
  	}
  	/* otherwise we can turn this into a whole-file flock */
  	if (af->l_type == F_RDLCK) code = LOCK_SH;
  	else if (af->l_type == F_WRLCK) code = LOCK_EX;
  	else if (af->l_type == F_UNLCK) code = LOCK_UN;
! 	else {
! 	    afs_PutFakeStat(&fakestate);
! 	    return EINVAL; /* unknown lock type */
! 	}
  	if (((acmd == F_SETLK) 
  #if 	(defined(AFS_SGI_ENV) || defined(AFS_SUN_ENV)) && !defined(AFS_SUN58_ENV)
  	|| (acmd == F_RSETLK) 
***************
*** 578,585 ****
--- 595,604 ----
  #endif
  #endif
  	code = afs_CheckCode(code, &treq, 3); /* defeat AIX -O bug */
+ 	afs_PutFakeStat(&fakestate);
  	return code;
      }
+     afs_PutFakeStat(&fakestate);
      return EINVAL;
  }
  
***************
*** 858,864 ****
--- 877,885 ----
      struct vrequest treq;
      struct vcache *tvc;
      int flockDone;
+     struct afs_fakestat_state fakestate;
  
+     afs_InitFakeStat(&fakestate);
      AFS_STATCNT(afs_xflock);
      flockDone = 0;
  #ifdef AFS_OSF_ENV
***************
*** 872,880 ****
  #endif /* AFS_FBSD_ENV */
      fd = getf(uap->fd);
  #endif
!     if (!fd) return;
  
!     if (flockDone = afs_InitReq(&treq, u.u_cred)) return flockDone;
      /* first determine whether this is any sort of vnode */
      if (fd->f_type == DTYPE_VNODE) {
  	/* good, this is a vnode; next see if it is an AFS vnode */
--- 893,907 ----
  #endif /* AFS_FBSD_ENV */
      fd = getf(uap->fd);
  #endif
!     if (!fd) {
! 	afs_PutFakeStat(&fakestate);
! 	return;
!     }
  
!     if (flockDone = afs_InitReq(&treq, u.u_cred)) {
! 	afs_PutFakeStat(&fakestate);
! 	return flockDone;
!     }
      /* first determine whether this is any sort of vnode */
      if (fd->f_type == DTYPE_VNODE) {
  	/* good, this is a vnode; next see if it is an AFS vnode */
***************
*** 888,896 ****
--- 915,929 ----
  	    tvc = VTOAFS(afs_gntovn)(tvc);
  	    if (!tvc) {
  		u.u_error = ENOENT;
+ 		afs_PutFakeStat(&fakestate);
  		return;
  	    }
  #endif
+ 	    code = afs_EvalFakeStat(&tvc, &fakestate, &treq);
+ 	    if (code) {
+ 		afs_PutFakeStat(&fakestate);
+ 		return code;
+ 	    }
  	    if ((fd->f_flag & (FEXLOCK | FSHLOCK)) && !(uap->com & LOCK_UN)) {
  		/* First, if fd already has lock, release it for relock path */
  #if defined(AFS_SGI_ENV) || defined(AFS_OSF_ENV) || (defined(AFS_SUN_ENV) && !defined(AFS_SUN5_ENV))
***************
*** 938,943 ****
--- 971,977 ----
  #else
      FP_UNREF(fd);
  #endif
+     afs_PutFakeStat(&fakestate);
      return code;
  #else	/* AFS_OSF_ENV */
      if (!flockDone)
***************
*** 946,951 ****
--- 980,986 ----
  #else
      	flock();
  #endif
+     afs_PutFakeStat(&fakestate);
      return;
  #endif
  }
Index: openafs/src/afs/VNOPS/afs_vnop_link.c
diff -c openafs/src/afs/VNOPS/afs_vnop_link.c:1.4.4.3 openafs/src/afs/VNOPS/afs_vnop_link.c:1.4.4.5
*** openafs/src/afs/VNOPS/afs_vnop_link.c:1.4.4.3	Tue Apr 23 21:41:41 2002
--- openafs/src/afs/VNOPS/afs_vnop_link.c	Wed Jul 31 14:55:32 2002
***************
*** 16,22 ****
  #include <afsconfig.h>
  #include "../afs/param.h"
  
! RCSID("$Header: /data/cvs/openafs/src/afs/VNOPS/afs_vnop_link.c,v 1.4.4.3 2002/04/24 01:41:41 zacheiss Exp $");
  
  #include "../afs/sysincludes.h"	/* Standard vendor system headers */
  #include "../afs/afsincludes.h"	/* Afs-based standard headers */
--- 16,22 ----
  #include <afsconfig.h>
  #include "../afs/param.h"
  
! RCSID("$Header: /data/cvs/openafs/src/afs/VNOPS/afs_vnop_link.c,v 1.4.4.5 2002/07/31 18:55:32 zacheiss Exp $");
  
  #include "../afs/sysincludes.h"	/* Standard vendor system headers */
  #include "../afs/afsincludes.h"	/* Afs-based standard headers */
***************
*** 32,40 ****
  
  #ifdef	AFS_OSF_ENV
  afs_link(avc, ndp)
!     register struct vcache *avc;
      struct nameidata *ndp; {
!     register struct vcache *adp = VTOAFS(ndp->ni_dvp);
      char *aname = ndp->ni_dent.d_name;
      struct ucred *acred = ndp->ni_cred;
  #else	/* AFS_OSF_ENV */
--- 32,40 ----
  
  #ifdef	AFS_OSF_ENV
  afs_link(avc, ndp)
!     struct vcache *avc;
      struct nameidata *ndp; {
!     struct vcache *adp = VTOAFS(ndp->ni_dvp);
      char *aname = ndp->ni_dent.d_name;
      struct ucred *acred = ndp->ni_cred;
  #else	/* AFS_OSF_ENV */
***************
*** 44,50 ****
  afs_link(avc, OSI_VC_ARG(adp), aname, acred)
  #endif
      OSI_VC_DECL(adp);
!     register struct vcache *avc;
      char *aname;
      struct AFS_UCRED *acred;
  {
--- 44,50 ----
  afs_link(avc, OSI_VC_ARG(adp), aname, acred)
  #endif
      OSI_VC_DECL(adp);
!     struct vcache *avc;
      char *aname;
      struct AFS_UCRED *acred;
  {
***************
*** 56,61 ****
--- 56,62 ----
      afs_int32 offset, len;
      struct AFSFetchStatus OutFidStatus, OutDirStatus;
      struct AFSVolSync tsync;
+     struct afs_fakestat_state vfakestate, dfakestate;
      XSTATS_DECLS
      OSI_VC_CONVERT(adp)
  
***************
*** 66,71 ****
--- 67,79 ----
      if (code = afs_InitReq(&treq, acred)) 
  	goto done2;
  
+     afs_InitFakeStat(&vfakestate);
+     afs_InitFakeStat(&dfakestate);
+     code = afs_EvalFakeStat(&avc, &vfakestate, &treq);
+     if (code) goto done;
+     code = afs_EvalFakeStat(&adp, &dfakestate, &treq);
+     if (code) goto done;
+ 
      if (avc->fid.Cell != adp->fid.Cell || avc->fid.Fid.Volume != adp->fid.Fid.Volume) {
  	code = EXDEV;
  	goto done;
***************
*** 151,156 ****
--- 159,166 ----
      code = 0;
  done:
      code = afs_CheckCode(code, &treq, 24);
+     afs_PutFakeStat(&vfakestate);
+     afs_PutFakeStat(&dfakestate);
  done2:
  #ifdef	AFS_OSF_ENV
      afs_PutVCache(adp, WRITE_LOCK);
Index: openafs/src/afs/VNOPS/afs_vnop_lookup.c
diff -c openafs/src/afs/VNOPS/afs_vnop_lookup.c:1.14.2.4 openafs/src/afs/VNOPS/afs_vnop_lookup.c:1.14.2.5
*** openafs/src/afs/VNOPS/afs_vnop_lookup.c:1.14.2.4	Tue Apr 23 21:41:41 2002
--- openafs/src/afs/VNOPS/afs_vnop_lookup.c	Mon Jul 22 19:14:54 2002
***************
*** 22,28 ****
  #include <afsconfig.h>
  #include "../afs/param.h"
  
! RCSID("$Header: /data/cvs/openafs/src/afs/VNOPS/afs_vnop_lookup.c,v 1.14.2.4 2002/04/24 01:41:41 zacheiss Exp $");
  
  #include "../afs/sysincludes.h"	/* Standard vendor system headers */
  #include "../afs/afsincludes.h"	/* Afs-based standard headers */
--- 22,28 ----
  #include <afsconfig.h>
  #include "../afs/param.h"
  
! RCSID("$Header: /data/cvs/openafs/src/afs/VNOPS/afs_vnop_lookup.c,v 1.14.2.5 2002/07/22 23:14:54 zacheiss Exp $");
  
  #include "../afs/sysincludes.h"	/* Standard vendor system headers */
  #include "../afs/afsincludes.h"	/* Afs-based standard headers */
***************
*** 54,59 ****
--- 54,60 ----
  
  afs_int32 afs_bulkStatsDone;
  static int bulkStatCounter = 0;	/* counter for bulk stat seq. numbers */
+ int afs_fakestat_enable = 0;
  
  
  /* this would be faster if it did comparison as int32word, but would be 
***************
*** 90,97 ****
  }
  
  /* call under write lock, evaluate mvid field from a mt pt.
!  * avc is the vnode of the mount point object.
!  * advc is the vnode of the containing directory
   * avolpp is where we return a pointer to the volume named by the mount pt, if success
   * areq is the identity of the caller.
   *
--- 91,99 ----
  }
  
  /* call under write lock, evaluate mvid field from a mt pt.
!  * avc is the vnode of the mount point object; must be write-locked.
!  * advc is the vnode of the containing directory (optional; if NULL and
!  *   EvalMountPoint succeeds, caller must initialize *avolpp->dotdot)
   * avolpp is where we return a pointer to the volume named by the mount pt, if success
   * areq is the identity of the caller.
   *
***************
*** 231,241 ****
       * to the new path.
       */
      tvp->mtpoint = avc->fid;	/* setup back pointer to mtpoint */
!     tvp->dotdot  = advc->fid;
  
      *avolpp = tvp;
      return 0;
  }
      
  afs_ENameOK(aname)
      register char *aname; {
--- 233,407 ----
       * to the new path.
       */
      tvp->mtpoint = avc->fid;	/* setup back pointer to mtpoint */
!     if (advc) tvp->dotdot  = advc->fid;
  
      *avolpp = tvp;
      return 0;
  }
+ 
+ /*
+  * afs_InitFakeStat
+  *
+  * Must be called on an afs_fakestat_state object before calling
+  * afs_EvalFakeStat or afs_PutFakeStat.  Calling afs_PutFakeStat
+  * without calling afs_EvalFakeStat is legal, as long as this
+  * function is called.
+  */
+ 
+ void
+ afs_InitFakeStat(state)
+     struct afs_fakestat_state *state;
+ {
+     state->valid = 1;
+     state->did_eval = 0;
+     state->need_release = 0;
+ }
+ 
+ /*
+  * afs_EvalFakeStat_int
+  *
+  * The actual implementation of afs_EvalFakeStat and afs_TryEvalFakeStat,
+  * which is called by those wrapper functions.
+  *
+  * Only issues RPCs if canblock is non-zero.
+  */
+ static int
+ afs_EvalFakeStat_int(avcp, state, areq, canblock)
+     struct vcache **avcp;
+     struct afs_fakestat_state *state;
+     struct vrequest *areq;
+     int canblock;
+ {
+     struct vcache *tvc, *root_vp;
+     struct volume *tvolp = NULL;
+     int code = 0;
+ 
+     osi_Assert(state->valid == 1);
+     osi_Assert(state->did_eval == 0);
+     state->did_eval = 1;
+     if (!afs_fakestat_enable)
+ 	return 0;
+     tvc = *avcp;
+     if (tvc->mvstat != 1)
+ 	return 0;
+ 
+     /* Is the call to VerifyVCache really necessary? */
+     code = afs_VerifyVCache(tvc, areq);
+     if (code)
+ 	goto done;
+     if (canblock) {
+ 	ObtainWriteLock(&tvc->lock, 599);
+ 	code = EvalMountPoint(tvc, NULL, &tvolp, areq);
+ 	ReleaseWriteLock(&tvc->lock);
+ 	if (code)
+ 	    goto done;
+ 	if (tvolp) {
+ 	    tvolp->dotdot = tvc->fid;
+ 	    tvolp->dotdot.Fid.Vnode = tvc->parentVnode;
+ 	    tvolp->dotdot.Fid.Unique = tvc->parentUnique;
+ 	}
+     }
+     if (tvc->mvid && (tvc->states & CMValid)) {
+ 	if (!canblock) {
+ 	    afs_int32 retry;
+ 
+ 	    do {
+ 		retry = 0;
+ 		ObtainWriteLock(&afs_xvcache, 597);
+ 		root_vp = afs_FindVCache(tvc->mvid, 0, 0, &retry, 0);
+ 		if (root_vp && retry) {
+ 		    ReleaseWriteLock(&afs_xvcache);
+ 		    afs_PutVCache(root_vp, 0);
+ 		}
+ 	    } while (root_vp && retry);
+ 	    ReleaseWriteLock(&afs_xvcache);
+ 	} else {
+ 	    root_vp = afs_GetVCache(tvc->mvid, areq, NULL, NULL, WRITE_LOCK);
+ 	}
+ 	if (!root_vp) {
+ 	    code = canblock ? ENOENT : 0;
+ 	    goto done;
+ 	}
+ 	if (tvolp) {
+ 	    /* Is this always kosher?  Perhaps we should instead use
+ 	     * NBObtainWriteLock to avoid potential deadlock.
+ 	     */
+ 	    ObtainWriteLock(&root_vp->lock, 598);
+ 	    if (!root_vp->mvid)
+ 		root_vp->mvid = osi_AllocSmallSpace(sizeof(struct VenusFid));
+ 	    *root_vp->mvid = tvolp->dotdot;
+ 	    ReleaseWriteLock(&root_vp->lock);
+ 	}
+ 	state->need_release = 1;
+ 	state->root_vp = root_vp;
+ 	*avcp = root_vp;
+ 	code = 0;
+     } else {
+ 	code = canblock ? ENOENT : 0;
+     }
+ 
+ done:
+     if (tvolp)
+ 	afs_PutVolume(tvolp, WRITE_LOCK);
+     return code;
+ }
+ 
+ /*
+  * afs_EvalFakeStat
+  *
+  * Automatically does the equivalent of EvalMountPoint for vcache entries
+  * which are mount points.  Remembers enough state to properly release
+  * the volume root vcache when afs_PutFakeStat() is called.
+  *
+  * State variable must be initialized by afs_InitFakeState() beforehand.
+  *
+  * Returns 0 when everything succeeds and *avcp points to the vcache entry
+  * that should be used for the real vnode operation.  Returns non-zero if
+  * something goes wrong and the error code should be returned to the user.
+  */
+ int
+ afs_EvalFakeStat(avcp, state, areq)
+     struct vcache **avcp;
+     struct afs_fakestat_state *state;
+     struct vrequest *areq;
+ {
+     return afs_EvalFakeStat_int(avcp, state, areq, 1);
+ }
+ 
+ /*
+  * afs_TryEvalFakeStat
+  *
+  * Same as afs_EvalFakeStat, but tries not to talk to remote servers
+  * and only evaluate the mount point if all the data is already in
+  * local caches.
+  *
+  * Returns 0 if everything succeeds and *avcp points to a valid
+  * vcache entry (possibly evaluated).
+  */
+ int
+ afs_TryEvalFakeStat(avcp, state, areq)
+     struct vcache **avcp;
+     struct afs_fakestat_state *state;
+     struct vrequest *areq;
+ {
+     return afs_EvalFakeStat_int(avcp, state, areq, 0);
+ }
+ 
+ /*
+  * afs_PutFakeStat
+  *
+  * Perform any necessary cleanup at the end of a vnode op, given that
+  * afs_InitFakeStat was previously called with this state.
+  */
+ void
+ afs_PutFakeStat(state)
+     struct afs_fakestat_state *state;
+ {
+     osi_Assert(state->valid == 1);
+     if (state->need_release)
+ 	afs_PutVCache(state->root_vp, 0);
+     state->valid = 0;
+ }
      
  afs_ENameOK(aname)
      register char *aname; {
***************
*** 921,928 ****
--- 1087,1103 ----
      int no_read_access = 0;
      struct sysname_info sysState;   /* used only for @sys checking */
      int dynrootRetry = 1;
+     struct afs_fakestat_state fakestate;
  
      AFS_STATCNT(afs_lookup);
+     afs_InitFakeStat(&fakestate);
+ 
+     if (code = afs_InitReq(&treq, acred))
+ 	goto done;
+ 
+     code = afs_EvalFakeStat(&adp, &fakestate, &treq);
+     if (code)
+ 	goto done;
  #ifdef	AFS_OSF_ENV
      ndp->ni_dvp = AFSTOV(adp);
      memcpy(aname, ndp->ni_ptr, ndp->ni_namelen);
***************
*** 931,940 ****
  
      *avcp = (struct vcache *) 0;   /* Since some callers don't initialize it */
  
-     if (code = afs_InitReq(&treq, acred)) { 
- 	goto done;
-     }
- 
      /* come back to here if we encounter a non-existent object in a read-only
         volume's directory */
  
--- 1106,1111 ----
***************
*** 1217,1225 ****
          if (!(flags & AFS_LOOKUP_NOEVAL))
            /* don't eval mount points */
  #endif /* UKERNEL && AFS_WEB_ENHANCEMENTS */
! 	if (tvc->mvstat == 1) {
! 	  /* a mt point, possibly unevaluated */
! 	  struct volume *tvolp;
  
  	    ObtainWriteLock(&tvc->lock,133);
  	    code = EvalMountPoint(tvc, adp, &tvolp, &treq);
--- 1388,1396 ----
          if (!(flags & AFS_LOOKUP_NOEVAL))
            /* don't eval mount points */
  #endif /* UKERNEL && AFS_WEB_ENHANCEMENTS */
! 	if (!afs_fakestat_enable && tvc->mvstat == 1) {
! 	    /* a mt point, possibly unevaluated */
! 	    struct volume *tvolp;
  
  	    ObtainWriteLock(&tvc->lock,133);
  	    code = EvalMountPoint(tvc, adp, &tvolp, &treq);
***************
*** 1319,1324 ****
--- 1490,1496 ----
  	    if (!FidCmp(&(tvc->fid), &(adp->fid))) { 
  		afs_PutVCache(*avcp, WRITE_LOCK);
  		*avcp = NULL;
+ 		afs_PutFakeStat(&fakestate);
  		return afs_CheckCode(EISDIR, &treq, 18);
  	    }
  	}
***************
*** 1342,1347 ****
--- 1514,1520 ----
  	    /* So Linux inode cache is up to date. */
  	    code = afs_VerifyVCache(tvc, &treq);
  #else
+ 	    afs_PutFakeStat(&fakestate);
  	    return 0;  /* can't have been any errors if hit and !code */
  #endif
  	}
***************
*** 1355,1359 ****
--- 1528,1533 ----
         *avcp = (struct vcache *)0;
      }
  
+     afs_PutFakeStat(&fakestate);
      return code;
  }
Index: openafs/src/afs/VNOPS/afs_vnop_open.c
diff -c openafs/src/afs/VNOPS/afs_vnop_open.c:1.4.4.1 openafs/src/afs/VNOPS/afs_vnop_open.c:1.4.4.2
*** openafs/src/afs/VNOPS/afs_vnop_open.c:1.4.4.1	Tue Apr 23 21:41:41 2002
--- openafs/src/afs/VNOPS/afs_vnop_open.c	Mon Jul 22 19:14:54 2002
***************
*** 17,23 ****
  #include <afsconfig.h>
  #include "../afs/param.h"
  
! RCSID("$Header: /data/cvs/openafs/src/afs/VNOPS/afs_vnop_open.c,v 1.4.4.1 2002/04/24 01:41:41 zacheiss Exp $");
  
  #include "../afs/sysincludes.h"	/* Standard vendor system headers */
  #include "../afs/afsincludes.h"	/* Afs-based standard headers */
--- 17,23 ----
  #include <afsconfig.h>
  #include "../afs/param.h"
  
! RCSID("$Header: /data/cvs/openafs/src/afs/VNOPS/afs_vnop_open.c,v 1.4.4.2 2002/07/22 23:14:54 zacheiss Exp $");
  
  #include "../afs/sysincludes.h"	/* Standard vendor system headers */
  #include "../afs/afsincludes.h"	/* Afs-based standard headers */
***************
*** 44,51 ****
  {
      register afs_int32 code;
      struct vrequest treq;
!     register struct vcache *tvc;
      int writing;
      
      AFS_STATCNT(afs_open);
      if (code = afs_InitReq(&treq, acred)) return code;
--- 44,52 ----
  {
      register afs_int32 code;
      struct vrequest treq;
!     struct vcache *tvc;
      int writing;
+     struct afs_fakestat_state fakestate;
      
      AFS_STATCNT(afs_open);
      if (code = afs_InitReq(&treq, acred)) return code;
***************
*** 57,62 ****
--- 58,66 ----
  #endif
      afs_Trace2(afs_iclSetp, CM_TRACE_OPEN, ICL_TYPE_POINTER, tvc,
  	       ICL_TYPE_INT32, aflags);
+     afs_InitFakeStat(&fakestate);
+     code = afs_EvalFakeStat(&tvc, &fakestate, &treq);
+     if (code) goto done;
      code = afs_VerifyVCache(tvc, &treq);
      if (code) goto done;
      if (aflags & (FWRITE | FTRUNC)) writing = 1;
***************
*** 143,148 ****
--- 147,153 ----
  #endif
      ReleaseReadLock(&tvc->lock);
  done:
+     afs_PutFakeStat(&fakestate);
      code = afs_CheckCode(code, &treq, 4); /* avoid AIX -O bug */
  
      afs_Trace2(afs_iclSetp, CM_TRACE_OPEN, ICL_TYPE_POINTER, tvc,
Index: openafs/src/afs/VNOPS/afs_vnop_read.c
diff -c openafs/src/afs/VNOPS/afs_vnop_read.c:1.5 openafs/src/afs/VNOPS/afs_vnop_read.c:1.5.4.1
*** openafs/src/afs/VNOPS/afs_vnop_read.c:1.5	Thu Jul 12 15:58:22 2001
--- openafs/src/afs/VNOPS/afs_vnop_read.c	Wed Jul 10 16:04:36 2002
***************
*** 19,25 ****
  #include <afsconfig.h>
  #include "../afs/param.h"
  
! RCSID("$Header: /data/cvs/openafs/src/afs/VNOPS/afs_vnop_read.c,v 1.5 2001/07/12 19:58:22 shadow Exp $");
  
  #include "../afs/sysincludes.h"	/* Standard vendor system headers */
  #include "../afs/afsincludes.h"	/* Afs-based standard headers */
--- 19,25 ----
  #include <afsconfig.h>
  #include "../afs/param.h"
  
! RCSID("$Header: /data/cvs/openafs/src/afs/VNOPS/afs_vnop_read.c,v 1.5.4.1 2002/07/10 20:04:36 shadow Exp $");
  
  #include "../afs/sysincludes.h"	/* Standard vendor system headers */
  #include "../afs/afsincludes.h"	/* Afs-based standard headers */
***************
*** 490,496 ****
      struct vrequest treq;
  
      AFS_STATCNT(afs_UFSRead);
!     if (avc->vc_error)
  	return EIO;
  
      /* check that we have the latest status info in the vnode cache */
--- 490,496 ----
      struct vrequest treq;
  
      AFS_STATCNT(afs_UFSRead);
!     if (avc && avc->vc_error)
  	return EIO;
  
      /* check that we have the latest status info in the vnode cache */
Index: openafs/src/afs/VNOPS/afs_vnop_readdir.c
diff -c openafs/src/afs/VNOPS/afs_vnop_readdir.c:1.8 openafs/src/afs/VNOPS/afs_vnop_readdir.c:1.8.4.1
*** openafs/src/afs/VNOPS/afs_vnop_readdir.c:1.8	Thu Jul 12 15:58:22 2001
--- openafs/src/afs/VNOPS/afs_vnop_readdir.c	Mon Jul 22 19:14:54 2002
***************
*** 22,28 ****
  #include <afsconfig.h>
  #include "../afs/param.h"
  
! RCSID("$Header: /data/cvs/openafs/src/afs/VNOPS/afs_vnop_readdir.c,v 1.8 2001/07/12 19:58:22 shadow Exp $");
  
  #include "../afs/sysincludes.h"	/* Standard vendor system headers */
  #include "../afs/afsincludes.h"	/* Afs-based standard headers */
--- 22,28 ----
  #include <afsconfig.h>
  #include "../afs/param.h"
  
! RCSID("$Header: /data/cvs/openafs/src/afs/VNOPS/afs_vnop_readdir.c,v 1.8.4.1 2002/07/22 23:14:54 zacheiss Exp $");
  
  #include "../afs/sysincludes.h"	/* Standard vendor system headers */
  #include "../afs/afsincludes.h"	/* Afs-based standard headers */
***************
*** 443,448 ****
--- 443,449 ----
      struct DirEntry *ode = 0, *nde = 0;
      int o_slen = 0, n_slen = 0;
      afs_uint32 us;
+     struct afs_fakestat_state fakestate;
  #if defined(AFS_SGI53_ENV)
      afs_int32 use64BitDirent;
  #endif /* defined(AFS_SGI53_ENV) */
***************
*** 495,500 ****
--- 496,504 ----
  	return code;
      }
      /* update the cache entry */
+     afs_InitFakeStat(&fakestate);
+     code = afs_EvalFakeStat(&avc, &fakestate, &treq);
+     if (code) goto done;
  tagain:
      code = afs_VerifyVCache(avc, &treq);
      if (code) goto done;
***************
*** 729,734 ****
--- 733,739 ----
  #ifdef	AFS_HPUX_ENV
      osi_FreeSmallSpace((char *)sdirEntry);
  #endif
+     afs_PutFakeStat(&fakestate);
      code = afs_CheckCode(code, &treq, 28);
      return code;
  }
***************
*** 759,764 ****
--- 764,770 ----
      struct minnfs_direct *sdirEntry = (struct minnfs_direct *)osi_AllocSmallSpace(sizeof(struct min_direct));
      afs_int32 rlen;
  #endif
+     struct afs_fakestat_state fakestate;
  
      AFS_STATCNT(afs_readdir);
  #if	defined(AFS_SUN5_ENV) || defined(AFS_SGI_ENV) || defined(AFS_OSF_ENV)
***************
*** 770,775 ****
--- 776,790 ----
  #endif
  	return code;
      }
+     afs_InitFakeStat(&fakestate);
+     code = afs_EvalFakeStat(&avc, &fakestate, &treq);
+     if (code) {
+ #ifdef	AFS_HPUX_ENV
+ 	osi_FreeSmallSpace((char *)sdirEntry);
+ #endif
+ 	afs_PutFakeStat(&fakestate);
+ 	return code;
+     }
      /* update the cache entry */
  tagain:
      code = afs_VerifyVCache(avc, &treq);
***************
*** 955,960 ****
--- 970,976 ----
  #if	defined(AFS_HPUX_ENV) || defined(AFS_OSF_ENV)
      osi_FreeSmallSpace((char *)sdirEntry);
  #endif
+     afs_PutFakeStat(&fakestate);
      code = afs_CheckCode(code, &treq, 29);
      return code;
  }
Index: openafs/src/afs/VNOPS/afs_vnop_remove.c
diff -c openafs/src/afs/VNOPS/afs_vnop_remove.c:1.4.4.8 openafs/src/afs/VNOPS/afs_vnop_remove.c:1.4.4.10
*** openafs/src/afs/VNOPS/afs_vnop_remove.c:1.4.4.8	Fri Jun  7 20:13:41 2002
--- openafs/src/afs/VNOPS/afs_vnop_remove.c	Mon Jul 22 19:47:11 2002
***************
*** 22,28 ****
  #include <afsconfig.h>
  #include "../afs/param.h"
  
! RCSID("$Header: /data/cvs/openafs/src/afs/VNOPS/afs_vnop_remove.c,v 1.4.4.8 2002/06/08 00:13:41 shadow Exp $");
  
  #include "../afs/sysincludes.h"	/* Standard vendor system headers */
  #include "../afs/afsincludes.h"	/* Afs-based standard headers */
--- 22,28 ----
  #include <afsconfig.h>
  #include "../afs/param.h"
  
! RCSID("$Header: /data/cvs/openafs/src/afs/VNOPS/afs_vnop_remove.c,v 1.4.4.10 2002/07/22 23:47:11 zacheiss Exp $");
  
  #include "../afs/sysincludes.h"	/* Standard vendor system headers */
  #include "../afs/afsincludes.h"	/* Afs-based standard headers */
***************
*** 226,231 ****
--- 226,232 ----
      afs_int32 offset, len;
      struct AFSFetchStatus OutDirStatus;
      struct AFSVolSync tsync;
+     struct afs_fakestat_state fakestate;
      XSTATS_DECLS
      OSI_VC_CONVERT(adp)
  
***************
*** 237,259 ****
      tvc = (struct vcache *)ndp->ni_vp;  /* should never be null */
  #endif
  
!     /* Check if this is dynroot */
!     if (afs_IsDynroot(adp)) {
  #ifdef  AFS_OSF_ENV
          afs_PutVCache(adp, 0);
          afs_PutVCache(tvc, 0);
  #endif
! 	return afs_DynrootVOPRemove(adp, acred, aname);
      }
  
!     if (code = afs_InitReq(&treq, acred)) {
  #ifdef  AFS_OSF_ENV
!         afs_PutVCache(adp, 0);
!         afs_PutVCache(tvc, 0);
  #endif
!       return code;
      }
      if (strlen(aname) > AFSNAMEMAX) {
  #ifdef  AFS_OSF_ENV
  	afs_PutVCache(adp, 0);
  	afs_PutVCache(tvc, 0);
--- 238,274 ----
      tvc = (struct vcache *)ndp->ni_vp;  /* should never be null */
  #endif
  
!     if (code = afs_InitReq(&treq, acred)) {
  #ifdef  AFS_OSF_ENV
          afs_PutVCache(adp, 0);
          afs_PutVCache(tvc, 0);
  #endif
!       return code;
      }
  
!     afs_InitFakeStat(&fakestate);
!     code = afs_EvalFakeStat(&adp, &fakestate, &treq);
!     if (code) {
! 	afs_PutFakeStat(&fakestate);
  #ifdef  AFS_OSF_ENV
! 	afs_PutVCache(adp, 0);
! 	afs_PutVCache(tvc, 0);
  #endif
! 	return code;
      }
+ 
+     /* Check if this is dynroot */
+     if (afs_IsDynroot(adp)) {
+ 	code = afs_DynrootVOPRemove(adp, acred, aname);
+ 	afs_PutFakeStat(&fakestate);
+ #ifdef  AFS_OSF_ENV
+ 	afs_PutVCache(adp, 0);
+ 	afs_PutVCache(tvc, 0);
+ #endif
+ 	return code;
+     }
      if (strlen(aname) > AFSNAMEMAX) {
+ 	afs_PutFakeStat(&fakestate);
  #ifdef  AFS_OSF_ENV
  	afs_PutVCache(adp, 0);
  	afs_PutVCache(tvc, 0);
***************
*** 267,279 ****
      if (code) {
  	afs_PutVCache(adp, 0);
  	afs_PutVCache(tvc, 0);
  	return afs_CheckCode(code, &treq, 22);
      }
  #else	/* AFS_OSF_ENV */
      tvc = (struct vcache *) 0;
      if (code) {
!       code = afs_CheckCode(code, &treq, 23);
!       return code;
      }
  #endif
  
--- 282,296 ----
      if (code) {
  	afs_PutVCache(adp, 0);
  	afs_PutVCache(tvc, 0);
+ 	afs_PutFakeStat(&fakestate);
  	return afs_CheckCode(code, &treq, 22);
      }
  #else	/* AFS_OSF_ENV */
      tvc = (struct vcache *) 0;
      if (code) {
! 	code = afs_CheckCode(code, &treq, 23);
! 	afs_PutFakeStat(&fakestate);
! 	return code;
      }
  #endif
  
***************
*** 286,291 ****
--- 303,309 ----
          afs_PutVCache(tvc, 0);
  #endif
          code = EROFS;
+ 	afs_PutFakeStat(&fakestate);
  	return code;
      }
  
***************
*** 378,383 ****
--- 396,402 ----
  #ifdef	AFS_OSF_ENV
      afs_PutVCache(adp, WRITE_LOCK);
  #endif	/* AFS_OSF_ENV */
+     afs_PutFakeStat(&fakestate);
      return code;
  }
  
Index: openafs/src/afs/VNOPS/afs_vnop_rename.c
diff -c openafs/src/afs/VNOPS/afs_vnop_rename.c:1.4.4.2 openafs/src/afs/VNOPS/afs_vnop_rename.c:1.4.4.3
*** openafs/src/afs/VNOPS/afs_vnop_rename.c:1.4.4.2	Tue Apr 23 21:41:41 2002
--- openafs/src/afs/VNOPS/afs_vnop_rename.c	Mon Jul 22 19:14:54 2002
***************
*** 17,23 ****
  #include <afsconfig.h>
  #include "../afs/param.h"
  
! RCSID("$Header: /data/cvs/openafs/src/afs/VNOPS/afs_vnop_rename.c,v 1.4.4.2 2002/04/24 01:41:41 zacheiss Exp $");
  
  #include "../afs/sysincludes.h"	/* Standard vendor system headers */
  #include "../afs/afsincludes.h"	/* Afs-based standard headers */
--- 17,23 ----
  #include <afsconfig.h>
  #include "../afs/param.h"
  
! RCSID("$Header: /data/cvs/openafs/src/afs/VNOPS/afs_vnop_rename.c,v 1.4.4.3 2002/07/22 23:14:54 zacheiss Exp $");
  
  #include "../afs/sysincludes.h"	/* Standard vendor system headers */
  #include "../afs/afsincludes.h"	/* Afs-based standard headers */
***************
*** 31,41 ****
  /* Note that we don't set CDirty here, this is OK because the rename
   * RPC is called synchronously. */
  
! afsrename(aodp, aname1, andp, aname2, acred)
!     register struct vcache *aodp, *andp;
      char *aname1, *aname2;
!     struct AFS_UCRED *acred; {
!     struct vrequest treq;
      register struct conn *tc;
      register afs_int32 code;
      afs_int32 returnCode;
--- 31,42 ----
  /* Note that we don't set CDirty here, this is OK because the rename
   * RPC is called synchronously. */
  
! afsrename(aodp, aname1, andp, aname2, acred, areq)
!     struct vcache *aodp, *andp;
      char *aname1, *aname2;
!     struct AFS_UCRED *acred;
!     struct vrequest *areq;
! {
      register struct conn *tc;
      register afs_int32 code;
      afs_int32 returnCode;
***************
*** 53,60 ****
  	       ICL_TYPE_STRING, aname1, ICL_TYPE_POINTER, andp,
  	       ICL_TYPE_STRING, aname2);
  
-     if (code = afs_InitReq(&treq, acred)) return code;
- 
      if (strlen(aname1) > AFSNAMEMAX || strlen(aname2) > AFSNAMEMAX) {
  	code = ENAMETOOLONG;
  	goto done;
--- 54,59 ----
***************
*** 62,70 ****
  
      /* verify the latest versions of the stat cache entries */
  tagain:
!     code = afs_VerifyVCache(aodp, &treq);
      if (code) goto done;
!     code = afs_VerifyVCache(andp, &treq);
      if (code) goto done;
      
      /* lock in appropriate order, after some checks */
--- 61,69 ----
  
      /* verify the latest versions of the stat cache entries */
  tagain:
!     code = afs_VerifyVCache(aodp, areq);
      if (code) goto done;
!     code = afs_VerifyVCache(andp, areq);
      if (code) goto done;
      
      /* lock in appropriate order, after some checks */
***************
*** 107,113 ****
       * fileFid in order to handle ".." invalidation at the very end.
       */
      code = 0;
!     tdc1 = afs_GetDCache(aodp, 0, &treq, &offset, &len, 0);
      if (!tdc1) {
  	code = ENOENT;
      }
--- 106,112 ----
       * fileFid in order to handle ".." invalidation at the very end.
       */
      code = 0;
!     tdc1 = afs_GetDCache(aodp, 0, areq, &offset, &len, 0);
      if (!tdc1) {
  	code = ENOENT;
      }
***************
*** 135,141 ****
  
      /* locks are now set, proceed to do the real work */
      do {
! 	tc = afs_Conn(&aodp->fid, &treq, SHARED_LOCK);
  	if (tc) {
            XSTATS_START_TIME(AFS_STATS_FS_RPCIDX_RENAME);
  #ifdef RX_ENABLE_LOCKS
--- 134,140 ----
  
      /* locks are now set, proceed to do the real work */
      do {
! 	tc = afs_Conn(&aodp->fid, areq, SHARED_LOCK);
  	if (tc) {
            XSTATS_START_TIME(AFS_STATS_FS_RPCIDX_RENAME);
  #ifdef RX_ENABLE_LOCKS
***************
*** 151,157 ****
  	} else code = -1;
  
      } while
! 	(afs_Analyze(tc, code, &andp->fid, &treq,
  		     AFS_STATS_FS_RPCIDX_RENAME, SHARED_LOCK, (struct cell *)0));
  
      returnCode = code;	    /* remember for later */
--- 150,156 ----
  	} else code = -1;
  
      } while
! 	(afs_Analyze(tc, code, &andp->fid, areq,
  		     AFS_STATS_FS_RPCIDX_RENAME, SHARED_LOCK, (struct cell *)0));
  
      returnCode = code;	    /* remember for later */
***************
*** 265,275 ****
  	unlinkFid.Cell = aodp->fid.Cell;
  	tvc = (struct vcache *)0;
  	if (!unlinkFid.Fid.Unique) {
! 	    tvc = afs_LookupVCache(&unlinkFid, &treq, (afs_int32 *)0, WRITE_LOCK,
  				   aodp, aname1);
  	}
  	if (!tvc) /* lookup failed or wasn't called */
! 	   tvc = afs_GetVCache(&unlinkFid, &treq, (afs_int32 *)0,
  			       (struct vcache*)0, WRITE_LOCK);
  
  	if (tvc) {
--- 264,274 ----
  	unlinkFid.Cell = aodp->fid.Cell;
  	tvc = (struct vcache *)0;
  	if (!unlinkFid.Fid.Unique) {
! 	    tvc = afs_LookupVCache(&unlinkFid, areq, (afs_int32 *)0, WRITE_LOCK,
  				   aodp, aname1);
  	}
  	if (!tvc) /* lookup failed or wasn't called */
! 	   tvc = afs_GetVCache(&unlinkFid, areq, (afs_int32 *)0,
  			       (struct vcache*)0, WRITE_LOCK);
  
  	if (tvc) {
***************
*** 303,311 ****
  	fileFid.Fid.Volume = aodp->fid.Fid.Volume;
  	fileFid.Cell = aodp->fid.Cell;
  	if (!fileFid.Fid.Unique)
! 	    tvc = afs_LookupVCache(&fileFid, &treq, (afs_int32 *)0, WRITE_LOCK, andp, aname2);
  	else
! 	    tvc = afs_GetVCache(&fileFid, &treq, (afs_int32 *)0,
  				(struct vcache*)0, WRITE_LOCK);
  	if (tvc && (vType(tvc) == VDIR)) {
  	    ObtainWriteLock(&tvc->lock,152);
--- 302,310 ----
  	fileFid.Fid.Volume = aodp->fid.Fid.Volume;
  	fileFid.Cell = aodp->fid.Cell;
  	if (!fileFid.Fid.Unique)
! 	    tvc = afs_LookupVCache(&fileFid, areq, (afs_int32 *)0, WRITE_LOCK, andp, aname2);
  	else
! 	    tvc = afs_GetVCache(&fileFid, areq, (afs_int32 *)0,
  				(struct vcache*)0, WRITE_LOCK);
  	if (tvc && (vType(tvc) == VDIR)) {
  	    ObtainWriteLock(&tvc->lock,152);
***************
*** 327,342 ****
      }
      code = returnCode;
  done:
-     code = afs_CheckCode(code, &treq, 25);
      return code;
  }
  
  #ifdef	AFS_OSF_ENV
  afs_rename(fndp, tndp)
      struct nameidata *fndp, *tndp; {
!     register struct vcache *aodp = VTOAFS(fndp->ni_dvp);
      char *aname1 = fndp->ni_dent.d_name;
!     register struct vcache *andp = VTOAFS(tndp->ni_dvp);
      char *aname2 = tndp->ni_dent.d_name;
      struct ucred *acred = tndp->ni_cred;
  #else	/* AFS_OSF_ENV */
--- 326,340 ----
      }
      code = returnCode;
  done:
      return code;
  }
  
  #ifdef	AFS_OSF_ENV
  afs_rename(fndp, tndp)
      struct nameidata *fndp, *tndp; {
!     struct vcache *aodp = VTOAFS(fndp->ni_dvp);
      char *aname1 = fndp->ni_dent.d_name;
!     struct vcache *andp = VTOAFS(tndp->ni_dvp);
      char *aname2 = tndp->ni_dent.d_name;
      struct ucred *acred = tndp->ni_cred;
  #else	/* AFS_OSF_ENV */
***************
*** 347,360 ****
  afs_rename(OSI_VC_ARG(aodp), aname1, andp, aname2, acred)
  #endif
      OSI_VC_DECL(aodp);
!     register struct vcache *andp;
      char *aname1, *aname2;
      struct AFS_UCRED *acred; {
  #endif
      register afs_int32 code;
      OSI_VC_CONVERT(aodp)
  
!     code = afsrename(aodp, aname1, andp, aname2, acred);
  #ifdef	AFS_OSF_ENV
      AFS_RELE(tndp->ni_dvp);
      if (tndp->ni_vp != NULL) {
--- 345,372 ----
  afs_rename(OSI_VC_ARG(aodp), aname1, andp, aname2, acred)
  #endif
      OSI_VC_DECL(aodp);
!     struct vcache *andp;
      char *aname1, *aname2;
      struct AFS_UCRED *acred; {
  #endif
      register afs_int32 code;
+     struct afs_fakestat_state ofakestate;
+     struct afs_fakestat_state nfakestate;
+     struct vrequest treq;
      OSI_VC_CONVERT(aodp)
  
!     code = afs_InitReq(&treq, acred);
!     if (code) return code;
!     afs_InitFakeStat(&ofakestate);
!     afs_InitFakeStat(&nfakestate);
!     code = afs_EvalFakeStat(&aodp, &ofakestate, &treq);
!     if (code) goto done;
!     code = afs_EvalFakeStat(&andp, &nfakestate, &treq);
!     if (code) goto done;
!     code = afsrename(aodp, aname1, andp, aname2, acred, &treq);
! done:
!     afs_PutFakeStat(&ofakestate);
!     afs_PutFakeStat(&nfakestate);
  #ifdef	AFS_OSF_ENV
      AFS_RELE(tndp->ni_dvp);
      if (tndp->ni_vp != NULL) {
***************
*** 363,367 ****
--- 375,380 ----
      AFS_RELE(fndp->ni_dvp);
      AFS_RELE(fndp->ni_vp);
  #endif	/* AFS_OSF_ENV */
+     code = afs_CheckCode(code, &treq, 25);
      return code;
  }
Index: openafs/src/afs/VNOPS/afs_vnop_symlink.c
diff -c openafs/src/afs/VNOPS/afs_vnop_symlink.c:1.4.4.5 openafs/src/afs/VNOPS/afs_vnop_symlink.c:1.4.4.6
*** openafs/src/afs/VNOPS/afs_vnop_symlink.c:1.4.4.5	Tue Apr 23 21:41:41 2002
--- openafs/src/afs/VNOPS/afs_vnop_symlink.c	Mon Jul 22 19:14:54 2002
***************
*** 21,27 ****
  #include <afsconfig.h>
  #include "../afs/param.h"
  
! RCSID("$Header: /data/cvs/openafs/src/afs/VNOPS/afs_vnop_symlink.c,v 1.4.4.5 2002/04/24 01:41:41 zacheiss Exp $");
  
  #include "../afs/sysincludes.h"	/* Standard vendor system headers */
  #include "../afs/afsincludes.h"	/* Afs-based standard headers */
--- 21,27 ----
  #include <afsconfig.h>
  #include "../afs/param.h"
  
! RCSID("$Header: /data/cvs/openafs/src/afs/VNOPS/afs_vnop_symlink.c,v 1.4.4.6 2002/07/22 23:14:54 zacheiss Exp $");
  
  #include "../afs/sysincludes.h"	/* Standard vendor system headers */
  #include "../afs/afsincludes.h"	/* Afs-based standard headers */
***************
*** 71,76 ****
--- 71,77 ----
      struct AFSCallBack CallBack;
      struct AFSVolSync tsync;
      struct volume*    volp=0;
+     struct afs_fakestat_state fakestate;
      XSTATS_DECLS
      OSI_VC_CONVERT(adp)
      
***************
*** 78,83 ****
--- 79,92 ----
      afs_Trace2(afs_iclSetp, CM_TRACE_SYMLINK, ICL_TYPE_POINTER, adp,
                  ICL_TYPE_STRING, aname);
  
+     if (code = afs_InitReq(&treq, acred))
+ 	goto done2;
+ 
+     afs_InitFakeStat(&fakestate);
+     code = afs_EvalFakeStat(&adp, &fakestate, &treq);
+     if (code)
+ 	goto done;
+ 
      if (strlen(aname) > AFSNAMEMAX || strlen(atargetName) > AFSPATHMAX) {
  	code = ENAMETOOLONG;
  	goto done2;
***************
*** 88,96 ****
  	goto done2;
      }
  
-     if (code = afs_InitReq(&treq, acred))
- 	goto done2;
- 
      code = afs_VerifyVCache(adp, &treq);
      if (code) { 
        code = afs_CheckCode(code, &treq, 30);
--- 97,102 ----
***************
*** 217,222 ****
--- 223,229 ----
      afs_PutVCache(tvc, WRITE_LOCK);
      code = 0;
  done:
+     afs_PutFakeStat(&fakestate);
      if ( volp ) 
  	afs_PutVolume(volp, READ_LOCK);
      code = afs_CheckCode(code, &treq, 31);
***************
*** 322,332 ****
--- 329,343 ----
      register afs_int32 code;
      struct vrequest treq;
      register char *tp;
+     struct afs_fakestat_state fakestat;
      OSI_VC_CONVERT(avc)
  
      AFS_STATCNT(afs_readlink);
      afs_Trace1(afs_iclSetp, CM_TRACE_READLINK, ICL_TYPE_POINTER, avc);
      if (code = afs_InitReq(&treq, acred)) return code;
+     afs_InitFakeStat(&fakestat);
+     code = afs_EvalFakeStat(&avc, &fakestat, &treq);
+     if (code) goto done;
      code = afs_VerifyVCache(avc, &treq);
      if (code) goto done;
      if (vType(avc) != VLNK) {
***************
*** 345,350 ****
--- 356,362 ----
      }
      ReleaseWriteLock(&avc->lock);
  done:
+     afs_PutFakeStat(&fakestat);
      code = afs_CheckCode(code, &treq, 32);
      return code;
  }
Index: openafs/src/afs/VNOPS/afs_vnop_write.c
diff -c openafs/src/afs/VNOPS/afs_vnop_write.c:1.8.2.6 openafs/src/afs/VNOPS/afs_vnop_write.c:1.8.2.9
*** openafs/src/afs/VNOPS/afs_vnop_write.c:1.8.2.6	Tue Apr 23 21:41:41 2002
--- openafs/src/afs/VNOPS/afs_vnop_write.c	Thu Aug  1 15:12:03 2002
***************
*** 20,26 ****
  #include <afsconfig.h>
  #include "../afs/param.h"
  
! RCSID("$Header: /data/cvs/openafs/src/afs/VNOPS/afs_vnop_write.c,v 1.8.2.6 2002/04/24 01:41:41 zacheiss Exp $");
  
  #include "../afs/sysincludes.h"	/* Standard vendor system headers */
  #include "../afs/afsincludes.h"	/* Afs-based standard headers */
--- 20,26 ----
  #include <afsconfig.h>
  #include "../afs/param.h"
  
! RCSID("$Header: /data/cvs/openafs/src/afs/VNOPS/afs_vnop_write.c,v 1.8.2.9 2002/08/01 19:12:03 shadow Exp $");
  
  #include "../afs/sysincludes.h"	/* Standard vendor system headers */
  #include "../afs/afsincludes.h"	/* Afs-based standard headers */
***************
*** 283,289 ****
  	if (filePos > avc->m.Length)
  	    avc->m.Length = filePos;
  #endif
! #ifndef AFS_VM_RDWR_ENV
  	/*
  	 * If write is implemented via VM, afs_DoPartialWrite() is called from
  	 * the high-level write op.
--- 283,289 ----
  	if (filePos > avc->m.Length)
  	    avc->m.Length = filePos;
  #endif
! #if !defined(AFS_VM_RDWR_ENV)
  	/*
  	 * If write is implemented via VM, afs_DoPartialWrite() is called from
  	 * the high-level write op.
***************
*** 580,586 ****
  	}
  #endif
  	osi_UFSClose(tfile);
! #ifndef	AFS_VM_RDWR_ENV
  	/*
  	 * If write is implemented via VM, afs_DoPartialWrite() is called from
  	 * the high-level write op.
--- 580,586 ----
  	}
  #endif
  	osi_UFSClose(tfile);
! #if !defined(AFS_VM_RDWR_ENV)
  	/*
  	 * If write is implemented via VM, afs_DoPartialWrite() is called from
  	 * the high-level write op.
***************
*** 685,694 ****
--- 685,696 ----
      afs_int32 flags;
      int closeDone;
      afs_int32 code = 0;
+     struct afs_fakestat_state fakestat;
  
      AFS_STATCNT(afs_closex);
      /* setup the credentials */
      if (code = afs_InitReq(&treq, u.u_cred)) return code;
+     afs_InitFakeStat(&fakestat);
  
      closeDone = 0;
      /* we're the last one.  If we're an AFS vnode, clear the flags,
***************
*** 697,702 ****
--- 699,709 ----
      if (afd->f_type == DTYPE_VNODE) {
  	tvc = VTOAFS(afd->f_data);
  	if (IsAfsVnode(AFSTOV(tvc))) {
+ 	    code = afs_EvalFakeStat(&tvc, &fakestat, &treq);
+ 	    if (code) {
+ 	      afs_PutFakeStat(&fakestat);
+ 	      return code;
+ 	    }
  	    VN_HOLD(AFSTOV(tvc));
  	    flags = afd->f_flag & (FSHLOCK | FEXLOCK);
  	    afd->f_flag &= ~(FSHLOCK | FEXLOCK);
***************
*** 720,725 ****
--- 727,733 ----
      if (!closeDone) {
  	code = vno_close(afd);
      }
+     afs_PutFakeStat(&fakestat);
      return code;	/* return code from vnode layer */
  }
  #endif
***************
*** 760,800 ****
      afs_int32 aflags;
      struct AFS_UCRED *acred; 
  {
!     register afs_int32 code, initreq=0;
      register struct brequest *tb;
      struct vrequest treq;
  #ifdef AFS_SGI65_ENV
      struct flid flid;
  #endif
      OSI_VC_CONVERT(avc)
  
      AFS_STATCNT(afs_close);
      afs_Trace2(afs_iclSetp, CM_TRACE_CLOSE, ICL_TYPE_POINTER, avc,
  	       ICL_TYPE_INT32, aflags);
  #ifdef	AFS_SUN5_ENV
      if (avc->flockCount) {
- 	if (code = afs_InitReq(&treq, acred)) return code;
- 	initreq = 1;
  	HandleFlock(avc, LOCK_UN, &treq, 0, 1/*onlymine*/);
      }
  #endif
  #if defined(AFS_SGI_ENV)
!     if (!lastclose)
   	return 0;
  #else
  #if	defined(AFS_SUN_ENV) || defined(AFS_SGI_ENV)
      if (count > 1) {
  	/* The vfs layer may call this repeatedly with higher "count"; only on the last close (i.e. count = 1) we should actually proceed with the close. */
  	return 0;
      }
  #endif
- #ifdef	AFS_SUN5_ENV
-     if (!initreq) {
- #endif
- #endif
- 	if (code = afs_InitReq(&treq, acred)) return code;
- #ifdef	AFS_SUN5_ENV
-     }
  #endif
  #ifndef	AFS_SUN5_ENV
  #if defined(AFS_SGI_ENV)
--- 768,811 ----
      afs_int32 aflags;
      struct AFS_UCRED *acred; 
  {
!     register afs_int32 code;
      register struct brequest *tb;
      struct vrequest treq;
  #ifdef AFS_SGI65_ENV
      struct flid flid;
  #endif
+     struct afs_fakestat_state fakestat;
      OSI_VC_CONVERT(avc)
  
      AFS_STATCNT(afs_close);
      afs_Trace2(afs_iclSetp, CM_TRACE_CLOSE, ICL_TYPE_POINTER, avc,
  	       ICL_TYPE_INT32, aflags);
+     code = afs_InitReq(&treq, acred);
+     if (code) return code;
+     afs_InitFakeStat(&fakestat);
+     code = afs_EvalFakeStat(&avc, &fakestat, &treq);
+     if (code) {
+ 	afs_PutFakeStat(&fakestat);
+ 	return code;
+     }
  #ifdef	AFS_SUN5_ENV
      if (avc->flockCount) {
  	HandleFlock(avc, LOCK_UN, &treq, 0, 1/*onlymine*/);
      }
  #endif
  #if defined(AFS_SGI_ENV)
!     if (!lastclose) {
! 	afs_PutFakeStat(&fakestat);
   	return 0;
+     }
  #else
  #if	defined(AFS_SUN_ENV) || defined(AFS_SGI_ENV)
      if (count > 1) {
  	/* The vfs layer may call this repeatedly with higher "count"; only on the last close (i.e. count = 1) we should actually proceed with the close. */
+ 	afs_PutFakeStat(&fakestat);
  	return 0;
      }
  #endif
  #endif
  #ifndef	AFS_SUN5_ENV
  #if defined(AFS_SGI_ENV)
***************
*** 916,921 ****
--- 927,933 ----
  	afs_remunlink(avc, 1);	/* ignore any return code */
      }
  #endif
+     afs_PutFakeStat(&fakestat);
      code = afs_CheckCode(code, &treq, 5);
      return code;
  }
Index: openafs/src/afsd/afs.rc.linux
diff -c openafs/src/afsd/afs.rc.linux:1.2.8.3 openafs/src/afsd/afs.rc.linux:1.2.8.4
*** openafs/src/afsd/afs.rc.linux:1.2.8.3	Wed Dec 26 15:48:16 2001
--- openafs/src/afsd/afs.rc.linux	Wed Jul 31 18:41:54 2002
***************
*** 223,229 ****
  case "$1" in 
    start)
      if [ ! "$afs_rh" -o ! -f /var/lock/subsys/afs ]; then
! 	on_network || exit 1
  	# Load kernel extensions
  	if  load_client  ; then :
  	else
--- 223,231 ----
  case "$1" in 
    start)
      if [ ! "$afs_rh" -o ! -f /var/lock/subsys/afs ]; then
!         if [ `echo "$OPTIONS" | grep -c dynroot` = 0 ]; then
!             on_network || exit 1
!         fi
  	# Load kernel extensions
  	if  load_client  ; then :
  	else
Index: openafs/src/afsd/afsd.c
diff -c openafs/src/afsd/afsd.c:1.13.2.6 openafs/src/afsd/afsd.c:1.13.2.9
*** openafs/src/afsd/afsd.c:1.13.2.6	Fri Jun  7 21:34:03 2002
--- openafs/src/afsd/afsd.c	Mon Jul 22 19:53:40 2002
***************
*** 55,61 ****
  #include <afsconfig.h>
  #include <afs/param.h>
  
! RCSID("$Header: /data/cvs/openafs/src/afsd/afsd.c,v 1.13.2.6 2002/06/08 01:34:03 zacheiss Exp $");
  
  #define VFS 1
  
--- 55,61 ----
  #include <afsconfig.h>
  #include <afs/param.h>
  
! RCSID("$Header: /data/cvs/openafs/src/afsd/afsd.c,v 1.13.2.9 2002/07/22 23:53:40 zacheiss Exp $");
  
  #define VFS 1
  
***************
*** 240,245 ****
--- 240,246 ----
  static int enable_afsdb = 0;		/* enable AFSDB support */
  #endif
  static int enable_dynroot = 0;		/* enable dynroot support */
+ static int enable_fakestat = 0;		/* enable fakestat support */
  #ifdef notdef
  static int inodes = 60;		        /* VERY conservative, but has to be */
  #endif
***************
*** 341,348 ****
  	    printf("\t%d out of 3 fields successfully parsed.\n",
  		   parseResult);
  
- 	printf("\tcacheMountDir: '%s'\n\tcacheBaseDir: '%s'\n\tcacheBlocks: %d\n",
- 	       cacheMountDir, cacheBaseDir, cacheBlocks);
  	return(1);
      }
  
--- 342,347 ----
***************
*** 1330,1335 ****
--- 1329,1338 ----
  	/* -dynroot */
  	enable_dynroot = 1;
      }
+     if (as->parms[27].items) {
+ 	/* -fakestat */
+ 	enable_fakestat = 1;
+     }
  
      /*
       * Pull out all the configuration info for the workstation's AFS cache and
***************
*** 1569,1574 ****
--- 1572,1585 ----
  	    printf("%s: Error enabling dynroot support.\n", rn);
      }
  
+     if (enable_fakestat) {
+ 	if (afsd_verbose)
+ 	    printf("%s: Enabling fakestat support in kernel.\n", rn);
+ 	code = call_syscall(AFSOP_SET_FAKESTAT, 1);
+ 	if (code)
+ 	    printf("%s: Error enabling fakestat support.\n", rn);
+     }
+ 
      /* Initialize AFS daemon threads. */
      if (afsd_verbose)
  	printf("%s: Forking AFS daemon.\n", rn);
***************
*** 1922,1927 ****
--- 1933,1939 ----
  		), "Enable AFSDB support");
      cmd_AddParm(ts, "-files_per_subdir", CMD_SINGLE, CMD_OPTIONAL, "log(2) of the number of cache files per cache subdirectory");
      cmd_AddParm(ts, "-dynroot", CMD_FLAG, CMD_OPTIONAL, "Enable dynroot support");
+     cmd_AddParm(ts, "-fakestat", CMD_FLAG, CMD_OPTIONAL, "Enable fakestat support");
      return (cmd_Dispatch(argc, argv));
  }
  
Index: openafs/src/cf/linux-test2.m4
diff -c openafs/src/cf/linux-test2.m4:1.2.4.2 openafs/src/cf/linux-test2.m4:1.2.4.3
*** openafs/src/cf/linux-test2.m4:1.2.4.2	Wed Dec 26 15:14:08 2001
--- openafs/src/cf/linux-test2.m4	Wed Jul 10 16:41:09 2002
***************
*** 1,3 ****
--- 1,18 ----
+ AC_DEFUN(LINUX_FS_STRUCT_ADDRESS_SPACE_HAS_GFP_MASK, [
+ AC_MSG_CHECKING(for gfp_mask in struct address_space)
+ save_CPPFLAGS="$CPPFLAGS"
+ CPPFLAGS="-I${LINUX_KERNEL_PATH}/include -D__KERNEL__ $CPPFLAGS"
+ AC_CACHE_VAL(ac_cv_linux_fs_struct_address_space_has_gfp_mask, 
+ [
+ AC_TRY_COMPILE(
+ [#include <linux/fs.h>],
+ [struct address_space _a;
+ printf("%d\n", _a.gfp_mask);], 
+ ac_cv_linux_fs_struct_address_space_has_gfp_mask=yes,
+ ac_cv_linux_fs_struct_address_space_has_gfp_mask=no)])
+ AC_MSG_RESULT($ac_cv_linux_fs_struct_address_space_has_gfp_mask)
+ CPPFLAGS="$save_CPPFLAGS"])
+ 
  AC_DEFUN(LINUX_FS_STRUCT_INODE_HAS_I_BYTES, [
  AC_MSG_CHECKING(for i_bytes in struct inode)
  save_CPPFLAGS="$CPPFLAGS"
Index: openafs/src/config/Makefile.sunx86_57.in
diff -c /dev/null openafs/src/config/Makefile.sunx86_57.in:1.1.4.1
*** /dev/null	Fri Aug  2 03:59:40 2002
--- openafs/src/config/Makefile.sunx86_57.in	Wed Jul 10 15:57:43 2002
***************
*** 0 ****
--- 1,48 ----
+ # Keep macros within each section in sorted order for clean diff displays.
+ #
+ # AFS_OSTYPE used to indicate suffixes and os specific subdirectories.
+ AFS_OSTYPE = SOLARIS
+ #
+ # compilation and link editor flags
+ XCFLAGS=-dy -Bdynamic
+ MT_CFLAGS=-mt -DAFS_PTHREAD_ENV ${XCFLAGS}
+ PAM_CFLAGS = -KPIC
+ PAMLIBS= -lc -lpam -lsocket -lnsl -lm
+ SHARE_LDFLAGS = -G -Bsymbolic
+ LWP_OPTMZ=-g
+ OPTMZ=-O
+ DBG=-g
+ 
+ ## Compilation flags for 64 bit Solaris
+ XCFLAGS64 = ${XCFLAGS} -xarch=v9
+ 
+ #
+ # libraries
+ XLIBS=@LIB_AFSDB@ -lsocket -lnsl -lintl -ldl 
+ TXLIBS=-lcurses
+ MTLIBS=-lpthread -lsocket
+ XLIBELFA=-lelf
+ XLIBKVM=-lkvm
+ #
+ SHLIB_SUFFIX=so
+ SHLIB_CFLAGS=-KPIC
+ #
+ # programs
+ AR=/usr/ccs/bin/ar
+ AS=as
+ CC=/opt/SUNWspro/bin/cc
+ MT_CC=/opt/SUNWspro/bin/cc
+ CP=/bin/cp
+ LEX=lex
+ LD= /usr/ccs/bin/ld
+ LORDER = /usr/ccs/bin/lorder
+ MV=mv
+ RANLIB=/bin/true
+ RM=rm
+ STRIP= /usr/ccs/bin/strip
+ INSTALL=${TOP_SRCDIR}/pinstall/pinstall
+ #
+ # this is for the vol package
+ FS_CONV_SOL26         = fs_conv_sol26
+ install_FS_CONV_SOL26 = $(DESTDIR)${afssrvsbindir}/fs_conv_sol26
+ dest_FS_CONV_SOL26    = $(DEST)/root.server/usr/afs/bin/fs_conv_sol26
Index: openafs/src/config/afs_args.h
diff -c openafs/src/config/afs_args.h:1.3.4.2 openafs/src/config/afs_args.h:1.3.4.3
*** openafs/src/config/afs_args.h:1.3.4.2	Sun Jan 20 03:21:02 2002
--- openafs/src/config/afs_args.h	Mon Jul 22 19:14:59 2002
***************
*** 41,46 ****
--- 41,47 ----
  #define	AFSOP_AFSDB_HANDLER	 30	/* userspace AFSDB lookup handler */
  #define	AFSOP_SET_DYNROOT	 31	/* enable/disable dynroot support */
  #define	AFSOP_ADDCELLALIAS	 32	/* create alias for existing cell */
+ #define	AFSOP_SET_FAKESTAT	 33	/* enable/disable fakestat support */
  
  /* The range 20-30 is reserved for AFS system offsets in the afs_syscall */
  #define	AFSCALL_PIOCTL		20
Index: openafs/src/config/param.alpha_linux_22.h
diff -c openafs/src/config/param.alpha_linux_22.h:1.1 openafs/src/config/param.alpha_linux_22.h:1.1.4.2
*** openafs/src/config/param.alpha_linux_22.h:1.1	Thu Jun 28 00:07:16 2001
--- openafs/src/config/param.alpha_linux_22.h	Wed Jul 10 16:42:34 2002
***************
*** 35,41 ****
   * MP to compile for Linux
   */
  #ifdef AFS_SMP
! #define CONFIG_SMP
  #ifndef __SMP__
  #define __SMP__
  #endif
--- 35,41 ----
   * MP to compile for Linux
   */
  #ifdef AFS_SMP
! #define CONFIG_SMP 1
  #ifndef __SMP__
  #define __SMP__
  #endif
***************
*** 51,57 ****
  
  #define AFS_USERSPACE_IP_ADDR 1
  #define RXK_LISTENER_ENV 1
! #define AFS_GCPAGS             0       /* if nonzero, garbage collect PAGs */
  
  /* Machine / Operating system information */
  #define SYS_NAME       "alpha_linux_22"
--- 51,57 ----
  
  #define AFS_USERSPACE_IP_ADDR 1
  #define RXK_LISTENER_ENV 1
! #define AFS_GCPAGS       2 /* Set to Userdisabled, allow sysctl to override */
  
  /* Machine / Operating system information */
  #define SYS_NAME       "alpha_linux_22"
Index: openafs/src/config/param.alpha_linux_24.h
diff -c openafs/src/config/param.alpha_linux_24.h:1.1.2.1 openafs/src/config/param.alpha_linux_24.h:1.1.2.3
*** openafs/src/config/param.alpha_linux_24.h:1.1.2.1	Sat Oct 13 00:36:14 2001
--- openafs/src/config/param.alpha_linux_24.h	Wed Jul 10 16:42:34 2002
***************
*** 37,43 ****
   * MP to compile for Linux
   */
  #ifdef AFS_SMP
! #define CONFIG_SMP
  #ifndef __SMP__
  #define __SMP__
  #endif
--- 37,43 ----
   * MP to compile for Linux
   */
  #ifdef AFS_SMP
! #define CONFIG_SMP 1
  #ifndef __SMP__
  #define __SMP__
  #endif
***************
*** 53,59 ****
  
  #define AFS_USERSPACE_IP_ADDR 1
  #define RXK_LISTENER_ENV 1
! #define AFS_GCPAGS             0       /* if nonzero, garbage collect PAGs */
  
  /* Machine / Operating system information */
  #define SYS_NAME       "alpha_linux_24"
--- 53,59 ----
  
  #define AFS_USERSPACE_IP_ADDR 1
  #define RXK_LISTENER_ENV 1
! #define AFS_GCPAGS       2 /* Set to Userdisabled, allow sysctl to override */
  
  /* Machine / Operating system information */
  #define SYS_NAME       "alpha_linux_24"
Index: openafs/src/config/param.i386_linux22.h
diff -c openafs/src/config/param.i386_linux22.h:1.10 openafs/src/config/param.i386_linux22.h:1.10.2.2
*** openafs/src/config/param.i386_linux22.h:1.10	Mon Jul 16 18:06:26 2001
--- openafs/src/config/param.i386_linux22.h	Wed Jul 10 16:42:34 2002
***************
*** 37,43 ****
   * MP to compile for Linux
   */
  #ifdef AFS_SMP
! #define CONFIG_SMP
  #ifndef CONFIG_X86_LOCAL_APIC
  #define CONFIG_X86_LOCAL_APIC
  #endif
--- 37,43 ----
   * MP to compile for Linux
   */
  #ifdef AFS_SMP
! #define CONFIG_SMP 1
  #ifndef CONFIG_X86_LOCAL_APIC
  #define CONFIG_X86_LOCAL_APIC
  #endif
***************
*** 58,64 ****
  
  #define AFS_USERSPACE_IP_ADDR 1
  #define RXK_LISTENER_ENV 1
! #define AFS_GCPAGS		0       /* if nonzero, garbage collect PAGs */
  
  /* Machine / Operating system information */
  #define SYS_NAME	"i386_linux22"
--- 58,65 ----
  
  #define AFS_USERSPACE_IP_ADDR 1
  #define RXK_LISTENER_ENV 1
! #define AFS_GCPAGS       2 /* Set to Userdisabled, allow sysctl to override */
! 
  
  /* Machine / Operating system information */
  #define SYS_NAME	"i386_linux22"
Index: openafs/src/config/param.i386_linux24.h
diff -c openafs/src/config/param.i386_linux24.h:1.8 openafs/src/config/param.i386_linux24.h:1.8.4.2
*** openafs/src/config/param.i386_linux24.h:1.8	Thu Jul  5 11:20:18 2001
--- openafs/src/config/param.i386_linux24.h	Wed Jul 10 16:42:34 2002
***************
*** 30,36 ****
   * MP to compile for Linux
   */
  #ifdef AFS_SMP
! #define CONFIG_SMP
  #ifndef CONFIG_X86_LOCAL_APIC
  #define CONFIG_X86_LOCAL_APIC
  #endif
--- 30,36 ----
   * MP to compile for Linux
   */
  #ifdef AFS_SMP
! #define CONFIG_SMP 1
  #ifndef CONFIG_X86_LOCAL_APIC
  #define CONFIG_X86_LOCAL_APIC
  #endif
***************
*** 50,56 ****
  #include <afs/afs_sysnames.h>
  #define AFS_USERSPACE_IP_ADDR 1
  #define RXK_LISTENER_ENV 1
! #define AFS_GCPAGS             0       /* if nonzero, garbage collect PAGs */
  
  #define AFSLITTLE_ENDIAN    1
  #define AFS_HAVE_FFS        1       /* Use system's ffs. */
--- 50,56 ----
  #include <afs/afs_sysnames.h>
  #define AFS_USERSPACE_IP_ADDR 1
  #define RXK_LISTENER_ENV 1
! #define AFS_GCPAGS       2 /* Set to Userdisabled, allow sysctl to override */
  
  #define AFSLITTLE_ENDIAN    1
  #define AFS_HAVE_FFS        1       /* Use system's ffs. */
Index: openafs/src/config/param.ia64_linux24.h
diff -c openafs/src/config/param.ia64_linux24.h:1.1 openafs/src/config/param.ia64_linux24.h:1.1.2.2
*** openafs/src/config/param.ia64_linux24.h:1.1	Mon Aug  6 20:05:00 2001
--- openafs/src/config/param.ia64_linux24.h	Wed Jul 10 16:42:34 2002
***************
*** 38,44 ****
   * MP to compile for Linux
   */
  #ifdef AFS_SMP
! #define CONFIG_SMP
  #ifndef __SMP__
  #define __SMP__
  #endif
--- 38,44 ----
   * MP to compile for Linux
   */
  #ifdef AFS_SMP
! #define CONFIG_SMP 1
  #ifndef __SMP__
  #define __SMP__
  #endif
***************
*** 56,62 ****
  
  #define AFS_USERSPACE_IP_ADDR 1
  #define RXK_LISTENER_ENV 1
! #define AFS_GCPAGS		0       /* if nonzero, garbage collect PAGs */
  
  /* Machine / Operating system information */
  #define SYS_NAME	"ia64_linux24"
--- 56,62 ----
  
  #define AFS_USERSPACE_IP_ADDR 1
  #define RXK_LISTENER_ENV 1
! #define AFS_GCPAGS       2 /* Set to Userdisabled, allow sysctl to override */
  
  /* Machine / Operating system information */
  #define SYS_NAME	"ia64_linux24"
Index: openafs/src/config/param.parisc_linux24.h
diff -c openafs/src/config/param.parisc_linux24.h:1.1.2.1 openafs/src/config/param.parisc_linux24.h:1.1.2.3
*** openafs/src/config/param.parisc_linux24.h:1.1.2.1	Sat Oct 13 00:36:14 2001
--- openafs/src/config/param.parisc_linux24.h	Wed Jul 10 16:42:34 2002
***************
*** 28,34 ****
   * MP to compile for Linux
   */
  #ifdef AFS_SMP
! #define CONFIG_SMP
  #ifndef __SMP__
  #define __SMP__
  #endif
--- 28,34 ----
   * MP to compile for Linux
   */
  #ifdef AFS_SMP
! #define CONFIG_SMP 1
  #ifndef __SMP__
  #define __SMP__
  #endif
***************
*** 45,52 ****
  
  #define AFS_USERSPACE_IP_ADDR 1
  #define RXK_LISTENER_ENV 1
! #define AFS_GCPAGS             0       /* if nonzero, garbage collect PAGs */
! 
  
  /* Machine / Operating system information */
  #define SYS_NAME       "parisc_linux24"
--- 45,51 ----
  
  #define AFS_USERSPACE_IP_ADDR 1
  #define RXK_LISTENER_ENV 1
! #define AFS_GCPAGS       2 /* Set to Userdisabled, allow sysctl to override */
  
  /* Machine / Operating system information */
  #define SYS_NAME       "parisc_linux24"
Index: openafs/src/config/param.ppc_linux22.h
diff -c openafs/src/config/param.ppc_linux22.h:1.4 openafs/src/config/param.ppc_linux22.h:1.4.4.2
*** openafs/src/config/param.ppc_linux22.h:1.4	Thu Jul  5 11:20:18 2001
--- openafs/src/config/param.ppc_linux22.h	Wed Jul 10 16:42:34 2002
***************
*** 28,34 ****
   * MP to compile for Linux
   */
  #ifdef AFS_SMP
! #define CONFIG_SMP
  #ifndef __SMP__
  #define __SMP__
  #endif
--- 28,34 ----
   * MP to compile for Linux
   */
  #ifdef AFS_SMP
! #define CONFIG_SMP 1
  #ifndef __SMP__
  #define __SMP__
  #endif
***************
*** 46,53 ****
  
  #define AFS_USERSPACE_IP_ADDR 1
  #define RXK_LISTENER_ENV 1
! #define AFS_GCPAGS             0       /* if nonzero, garbage collect PAGs */
! 
  
  /* Machine / Operating system information */
  #define SYS_NAME       "ppc_linux22"
--- 46,52 ----
  
  #define AFS_USERSPACE_IP_ADDR 1
  #define RXK_LISTENER_ENV 1
! #define AFS_GCPAGS       2 /* Set to Userdisabled, allow sysctl to override */
  
  /* Machine / Operating system information */
  #define SYS_NAME       "ppc_linux22"
Index: openafs/src/config/param.ppc_linux24.h
diff -c openafs/src/config/param.ppc_linux24.h:1.4 openafs/src/config/param.ppc_linux24.h:1.4.4.2
*** openafs/src/config/param.ppc_linux24.h:1.4	Thu Jul  5 11:20:18 2001
--- openafs/src/config/param.ppc_linux24.h	Wed Jul 10 16:42:34 2002
***************
*** 30,36 ****
   * MP to compile for Linux
   */
  #ifdef AFS_SMP
! #define CONFIG_SMP
  #ifndef __SMP__
  #define __SMP__
  #endif
--- 30,36 ----
   * MP to compile for Linux
   */
  #ifdef AFS_SMP
! #define CONFIG_SMP 1
  #ifndef __SMP__
  #define __SMP__
  #endif
***************
*** 47,54 ****
  
  #define AFS_USERSPACE_IP_ADDR 1
  #define RXK_LISTENER_ENV 1
! #define AFS_GCPAGS             0       /* if nonzero, garbage collect PAGs */
! 
  
  /* Machine / Operating system information */
  #define SYS_NAME       "ppc_linux24"
--- 47,53 ----
  
  #define AFS_USERSPACE_IP_ADDR 1
  #define RXK_LISTENER_ENV 1
! #define AFS_GCPAGS       2 /* Set to Userdisabled, allow sysctl to override */
  
  /* Machine / Operating system information */
  #define SYS_NAME       "ppc_linux24"
Index: openafs/src/config/param.s390_linux22.h
diff -c openafs/src/config/param.s390_linux22.h:1.4 openafs/src/config/param.s390_linux22.h:1.4.4.2
*** openafs/src/config/param.s390_linux22.h:1.4	Thu Jul  5 11:20:18 2001
--- openafs/src/config/param.s390_linux22.h	Wed Jul 10 16:42:34 2002
***************
*** 31,37 ****
   * MP to compile for Linux
   */
  #ifdef AFS_SMP
! #define CONFIG_SMP
  #ifndef CONFIG_S390_LOCAL_APIC
  #define CONFIG_S390_LOCAL_APIC
  #endif
--- 31,37 ----
   * MP to compile for Linux
   */
  #ifdef AFS_SMP
! #define CONFIG_SMP 1
  #ifndef CONFIG_S390_LOCAL_APIC
  #define CONFIG_S390_LOCAL_APIC
  #endif
***************
*** 52,58 ****
  
  #define AFS_USERSPACE_IP_ADDR 1
  #define RXK_LISTENER_ENV 1
! #define AFS_GCPAGS		0       /* if nonzero, garbage collect PAGs */
  
  /* Machine / Operating system information */
  #define SYS_NAME	"s390_linux22"
--- 52,58 ----
  
  #define AFS_USERSPACE_IP_ADDR 1
  #define RXK_LISTENER_ENV 1
! #define AFS_GCPAGS       2 /* Set to Userdisabled, allow sysctl to override */
  
  /* Machine / Operating system information */
  #define SYS_NAME	"s390_linux22"
Index: openafs/src/config/param.s390_linux24.h
diff -c openafs/src/config/param.s390_linux24.h:1.4 openafs/src/config/param.s390_linux24.h:1.4.4.2
*** openafs/src/config/param.s390_linux24.h:1.4	Thu Jul  5 11:20:18 2001
--- openafs/src/config/param.s390_linux24.h	Wed Jul 10 16:42:34 2002
***************
*** 33,39 ****
   * MP to compile for Linux
   */
  #ifdef AFS_SMP
! #define CONFIG_SMP
  #ifndef CONFIG_S390_LOCAL_APIC
  #define CONFIG_S390_LOCAL_APIC
  #endif
--- 33,39 ----
   * MP to compile for Linux
   */
  #ifdef AFS_SMP
! #define CONFIG_SMP 1
  #ifndef CONFIG_S390_LOCAL_APIC
  #define CONFIG_S390_LOCAL_APIC
  #endif
***************
*** 52,58 ****
  
  #define AFS_USERSPACE_IP_ADDR 1
  #define RXK_LISTENER_ENV 1
! #define AFS_GCPAGS		0       /* if nonzero, garbage collect PAGs */
  
  /* Machine / Operating system information */
  #define SYS_NAME	"s390_linux24"
--- 52,58 ----
  
  #define AFS_USERSPACE_IP_ADDR 1
  #define RXK_LISTENER_ENV 1
! #define AFS_GCPAGS       2 /* Set to Userdisabled, allow sysctl to override */
  
  /* Machine / Operating system information */
  #define SYS_NAME	"s390_linux24"
Index: openafs/src/config/param.sparc64_linux22.h
diff -c openafs/src/config/param.sparc64_linux22.h:1.4 openafs/src/config/param.sparc64_linux22.h:1.4.4.1
*** openafs/src/config/param.sparc64_linux22.h:1.4	Thu Jul  5 11:20:18 2001
--- openafs/src/config/param.sparc64_linux22.h	Wed Jul 10 16:03:29 2002
***************
*** 36,42 ****
   * MP to compile for Linux
   */
  #ifdef AFS_SMP
! #define CONFIG_SMP
  #ifndef __SMP__
  #define __SMP__
  #endif
--- 36,42 ----
   * MP to compile for Linux
   */
  #ifdef AFS_SMP
! #define CONFIG_SMP 1
  #ifndef __SMP__
  #define __SMP__
  #endif
Index: openafs/src/config/param.sparc64_linux24.h
diff -c openafs/src/config/param.sparc64_linux24.h:1.1 openafs/src/config/param.sparc64_linux24.h:1.1.4.1
*** openafs/src/config/param.sparc64_linux24.h:1.1	Fri Jun 29 00:44:00 2001
--- openafs/src/config/param.sparc64_linux24.h	Wed Jul 10 16:03:29 2002
***************
*** 42,48 ****
   * MP to compile for Linux
   */
  #ifdef AFS_SMP
! #define CONFIG_SMP
  #define __SMP__
  #define AFS_GLOBAL_SUNLOCK
  #endif
--- 42,48 ----
   * MP to compile for Linux
   */
  #ifdef AFS_SMP
! #define CONFIG_SMP 1
  #define __SMP__
  #define AFS_GLOBAL_SUNLOCK
  #endif
Index: openafs/src/config/param.sparc_linux22.h
diff -c openafs/src/config/param.sparc_linux22.h:1.4 openafs/src/config/param.sparc_linux22.h:1.4.4.2
*** openafs/src/config/param.sparc_linux22.h:1.4	Thu Jul  5 11:20:18 2001
--- openafs/src/config/param.sparc_linux22.h	Wed Jul 10 16:42:34 2002
***************
*** 31,37 ****
   * MP to compile for Linux
   */
  #ifdef AFS_SMP
! #define CONFIG_SMP
  #ifndef __SMP__
  #define __SMP__
  #endif
--- 31,37 ----
   * MP to compile for Linux
   */
  #ifdef AFS_SMP
! #define CONFIG_SMP 1
  #ifndef __SMP__
  #define __SMP__
  #endif
***************
*** 48,54 ****
  
  #define AFS_USERSPACE_IP_ADDR 1
  #define RXK_LISTENER_ENV 1
! #define AFS_GCPAGS		0       /* if nonzero, garbage collect PAGs */
  
  /* Machine / Operating system information */
  #define SYS_NAME	"sparc_linux22"
--- 48,54 ----
  
  #define AFS_USERSPACE_IP_ADDR 1
  #define RXK_LISTENER_ENV 1
! #define AFS_GCPAGS       2 /* Set to Userdisabled, allow sysctl to override */
  
  /* Machine / Operating system information */
  #define SYS_NAME	"sparc_linux22"
Index: openafs/src/config/param.sparc_linux24.h
diff -c openafs/src/config/param.sparc_linux24.h:1.1.2.1 openafs/src/config/param.sparc_linux24.h:1.1.2.3
*** openafs/src/config/param.sparc_linux24.h:1.1.2.1	Sun Jan 20 03:49:33 2002
--- openafs/src/config/param.sparc_linux24.h	Wed Jul 10 16:42:34 2002
***************
*** 33,39 ****
   * MP to compile for Linux
   */
  #ifdef AFS_SMP
! #define CONFIG_SMP
  #ifndef __SMP__
  #define __SMP__
  #endif
--- 33,39 ----
   * MP to compile for Linux
   */
  #ifdef AFS_SMP
! #define CONFIG_SMP 1
  #ifndef __SMP__
  #define __SMP__
  #endif
***************
*** 50,56 ****
  
  #define AFS_USERSPACE_IP_ADDR 1
  #define RXK_LISTENER_ENV 1
! #define AFS_GCPAGS		0       /* if nonzero, garbage collect PAGs */
  
  /* Machine / Operating system information */
  #define SYS_NAME	"sparc_linux24"
--- 50,56 ----
  
  #define AFS_USERSPACE_IP_ADDR 1
  #define RXK_LISTENER_ENV 1
! #define AFS_GCPAGS       2 /* Set to Userdisabled, allow sysctl to override */
  
  /* Machine / Operating system information */
  #define SYS_NAME	"sparc_linux24"
Index: openafs/src/config/param.sunx86_57.h
diff -c /dev/null openafs/src/config/param.sunx86_57.h:1.1.4.1
*** /dev/null	Fri Aug  2 03:59:40 2002
--- openafs/src/config/param.sunx86_57.h	Wed Jul 10 15:57:43 2002
***************
*** 0 ****
--- 1,116 ----
+ /*
+  * Copyright 2000, International Business Machines Corporation and others.
+  * All Rights Reserved.
+  * 
+  * This software has been released under the terms of the IBM Public
+  * License.  For details, see the LICENSE file in the top-level source
+  * directory or online at http://www.openafs.org/dl/license10.html
+  */
+ 
+ #ifndef	AFS_PARAM_H
+ #define	AFS_PARAM_H
+ 
+ #define AFS_VFS_ENV	1
+ /* Used only in vfsck code; is it needed any more???? */
+ 
+ #define AFS_VFSINCL_ENV	1	/* NOBODY uses this.... */
+ #define AFS_GREEDY43_ENV	1	/* Used only in rx/rx_user.c */
+ #define AFS_ENV			1
+ #define AFS_SUN_ENV		1
+ #define AFS_SUN5_ENV		1
+ #define	AFS_SUN52_ENV		1
+ #define	AFS_SUN53_ENV		1
+ #define	AFS_SUN54_ENV		1
+ #define	AFS_SUN55_ENV		1
+ #define	AFS_SUN56_ENV		1
+ #define AFS_SUN57_ENV		1
+ #define AFS_X86_ENV		1
+ 
+ #define AFS_64BIT_ENV		1       /* Defines afs_int32 as int, not long. */
+ 
+ #include <afs/afs_sysnames.h>
+ 
+ #define AFS_GLOBAL_SUNLOCK	1	/* For global locking */
+ #define RXK_LISTENER_ENV   1
+ #define AFS_GCPAGS		1       /* if nonzero, garbage collect PAGs */
+ 
+ #define	AFS_3DISPARES		1	/* Utilize the 3 available disk inode 'spares' */
+ #define	AFS_SYSCALL		73
+ 
+ /* File system entry (used if mount.h doesn't define MOUNT_AFS */
+ #define AFS_MOUNT_AFS	 "afs"
+ 
+ /* Machine / Operating system information */
+ #define sys_sunx86_57	1
+ #define SYS_NAME	"sunx86_57"
+ #define SYS_NAME_ID	SYS_NAME_ID_sunx86_57
+ #define AFSLITTLE_ENDIAN	1
+ #define AFS_HAVE_FFS    1       /* Use system's ffs. */
+ #define AFS_HAVE_VXFS	1	/* Support cache on Veritas vxfs file system */
+ #define AFS_HAVE_STATVFS 1	/* System supports statvfs */
+ #define AFS_VM_RDWR_ENV	1	/* read/write implemented via VM */
+ #define AFS_USE_GETTIMEOFDAY 1  /* use gettimeofday to implement rx clock */
+ 
+ #define NEARINODE_HINT  1   /* hint to ufs module to scatter inodes on disk*/
+ #define nearInodeHash(volid, hval) {                                 \
+                 unsigned char*  ts = (unsigned char*)&(volid)+sizeof(volid)-1;\
+                 for ( (hval)=0; ts >= (unsigned char*)&(volid); ts--){\
+                     (hval) *= 173;                      \
+                     (hval) += *ts;                      \
+                 }                                       \
+                 }
+ 
+ /* Extra kernel definitions (from kdefs file) */
+ #ifdef KERNEL
+ /* sun definitions here */
+ #define	AFS_UIOFMODE		1	/* Only in afs/afs_vnodeops.c (afs_ustrategy) */
+ #define	AFS_SYSVLOCK		1	/* sys v locking supported */
+ /*#define	AFS_USEBUFFERS	1*/
+ #define	afsio_iov		uio_iov
+ #define	afsio_iovcnt	uio_iovcnt
+ #define	afsio_offset	uio_offset
+ #define	afsio_seg		uio_segflg
+ #define	afsio_fmode	uio_fmode
+ #define	afsio_resid	uio_resid
+ #define	AFS_UIOSYS	UIO_SYSSPACE
+ #define	AFS_UIOUSER	UIO_USERSPACE
+ #define	AFS_CLBYTES	MCLBYTES
+ #define	AFS_MINCHANGE	2
+ #define	osi_GetTime(x)	uniqtime(x)
+ 
+ /**
+   * These defines are for the 64 bit Solaris 7 port
+   * AFS_SYSCALL32 is used to protect the ILP32 syscall interface
+   * AFS_64BIT_ENV is for use of 64 bit inode numbers
+   */
+ #if defined(__sparcv9)
+ #define	AFS_SUN57_64BIT_ENV	1
+ #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
+ #define	VATTR_NULL	vattr_null
+ #define memset(A, B, S) bzero(A, S)
+ #define memcpy(B, A, S) bcopy(A, B, S)
+ #define memcmp(A, B, S) bcmp(A, B, S)
+ #endif /* KERNEL */
+ #define	AFS_DIRENT	
+ #ifndef CMSERVERPREF
+ #define CMSERVERPREF
+ #endif
+ #define	ROOTINO		UFSROOTINO
+ 
+ #endif /* AFS_PARAM_H */
Index: openafs/src/config/param.sunx86_57_usr.h
diff -c /dev/null openafs/src/config/param.sunx86_57_usr.h:1.1.4.1
*** /dev/null	Fri Aug  2 03:59:40 2002
--- openafs/src/config/param.sunx86_57_usr.h	Wed Jul 10 15:57:43 2002
***************
*** 0 ****
--- 1,66 ----
+ /*
+  * Copyright 2000, International Business Machines Corporation and others.
+  * All Rights Reserved.
+  * 
+  * This software has been released under the terms of the IBM Public
+  * License.  For details, see the LICENSE file in the top-level source
+  * directory or online at http://www.openafs.org/dl/license10.html
+  */
+ 
+ #ifndef	AFS_PARAM_H
+ #define	AFS_PARAM_H
+ 
+ #define AFS_VFS_ENV	1
+ /* Used only in vfsck code; is it needed any more???? */
+ #define RXK_LISTENER_ENV	1
+ #define AFS_USERSPACE_IP_ADDR	1
+ #define AFS_GCPAGS		0       /* if nonzero, garbage collect PAGs */
+ 
+ #define UKERNEL			1	/* user space kernel */
+ #define AFS_GREEDY43_ENV	1	/* Used only in rx/rx_user.c */
+ #define AFS_ENV			1
+ #define AFS_USR_SUN5_ENV	1
+ #define AFS_USR_SUN6_ENV	1
+ 
+ #include <afs/afs_sysnames.h>
+ 
+ /*#define AFS_GLOBAL_SUNLOCK	1	/* For global locking */
+ 
+ #define	AFS_3DISPARES		1	/* Utilize the 3 available disk inode 'spares' */
+ #define	AFS_SYSCALL		73
+ 
+ /* File system entry (used if mount.h doesn't define MOUNT_AFS */
+ #define AFS_MOUNT_AFS	 1
+ 
+ /* Machine / Operating system information */
+ #define sys_sun4x_55	1
+ #define SYS_NAME	"sun4x_55"
+ #define SYS_NAME_ID	SYS_NAME_ID_sun4x_55
+ #define AFSLITTLE_ENDIAN	1
+ #define AFS_HAVE_FFS            1       /* Use system's ffs. */
+ #define AFS_HAVE_STATVFS      0       /* System doesn't support statvfs */
+ 
+ /* Extra kernel definitions (from kdefs file) */
+ #ifdef KERNEL
+ #define	AFS_UIOFMODE		1	/* Only in afs/afs_vnodeops.c (afs_ustrategy) */
+ #define	AFS_SYSVLOCK		1	/* sys v locking supported */
+ /*#define	AFS_USEBUFFERS	1*/
+ #define	afsio_iov	uio_iov
+ #define	afsio_iovcnt	uio_iovcnt
+ #define	afsio_offset	uio_offset
+ #define	afsio_seg	uio_segflg
+ #define	afsio_fmode	uio_fmode
+ #define	afsio_resid	uio_resid
+ #define	AFS_UIOSYS	1
+ #define	AFS_UIOUSER	UIO_USERSPACE
+ #define	AFS_CLBYTES	MCLBYTES
+ #define	AFS_MINCHANGE	2
+ #define	VATTR_NULL	usr_vattr_null
+ #endif /* KERNEL */
+ #define	AFS_DIRENT	
+ #ifndef CMSERVERPREF
+ #define CMSERVERPREF
+ #endif
+ #define	ROOTINO		UFSROOTINO
+ 
+ #endif /* AFS_PARAM_H */
Index: openafs/src/config/param.sunx86_58.h
diff -c /dev/null openafs/src/config/param.sunx86_58.h:1.2.2.1
*** /dev/null	Fri Aug  2 03:59:40 2002
--- openafs/src/config/param.sunx86_58.h	Wed Jul 10 15:57:43 2002
***************
*** 0 ****
--- 1,122 ----
+ /*
+  * Copyright 2000, International Business Machines Corporation and others.
+  * All Rights Reserved.
+  * 
+  * This software has been released under the terms of the IBM Public
+  * License.  For details, see the LICENSE file in the top-level source
+  * directory or online at http://www.openafs.org/dl/license10.html
+  */
+ 
+ #ifndef	AFS_PARAM_H
+ #define	AFS_PARAM_H
+ 
+ #define AFS_VFS_ENV	1
+ /* Used only in vfsck code; is it needed any more???? */
+ 
+ #define AFS_VFSINCL_ENV	1	/* NOBODY uses this.... */
+ #define AFS_GREEDY43_ENV	1	/* Used only in rx/rx_user.c */
+ #define AFS_ENV			1
+ #define AFS_SUN_ENV		1
+ #define AFS_SUN5_ENV		1
+ #define	AFS_SUN52_ENV		1
+ #define	AFS_SUN53_ENV		1
+ #define	AFS_SUN54_ENV		1
+ #define	AFS_SUN55_ENV		1
+ #define	AFS_SUN56_ENV		1
+ #define AFS_SUN57_ENV		1
+ #define AFS_SUN58_ENV		1
+ #define AFS_X86_ENV		1
+ 
+ #define AFS_64BIT_ENV		1       /* Defines afs_int32 as int, not long. */
+ 
+ #include <afs/afs_sysnames.h>
+ 
+ #define AFS_GLOBAL_SUNLOCK	1	/* For global locking */
+ #define RXK_LISTENER_ENV   1
+ #define AFS_GCPAGS		1       /* if nonzero, garbage collect PAGs */
+ 
+ #ifdef AFS_NAMEI_ENV
+ #define AFS_64BIT_IOPS_ENV	1	/* needed for NAMEI... */
+ #else /* AFS_NAMEI_ENV */
+ #define	AFS_3DISPARES		1	/* Utilize the 3 available disk inode 'spares' */
+ #endif /* AFS_NAMEI_ENV */
+ 
+ #define	AFS_SYSCALL		65
+ 
+ /* File system entry (used if mount.h doesn't define MOUNT_AFS */
+ #define AFS_MOUNT_AFS	 "afs"
+ 
+ /* Machine / Operating system information */
+ #define sys_sunx86_58	1
+ #define SYS_NAME	"sunx86_58"
+ #define SYS_NAME_ID	SYS_NAME_ID_sunx86_58
+ #define AFSLITTLE_ENDIAN	1
+ #define AFS_HAVE_FFS    1       /* Use system's ffs. */
+ #define AFS_HAVE_VXFS	1	/* Support cache on Veritas vxfs file system */
+ #define AFS_HAVE_STATVFS 1	/* System supports statvfs */
+ #define AFS_VM_RDWR_ENV	1	/* read/write implemented via VM */
+ #define AFS_USE_GETTIMEOFDAY 1  /* use gettimeofday to implement rx clock */
+ 
+ #define NEARINODE_HINT  1   /* hint to ufs module to scatter inodes on disk*/
+ #define nearInodeHash(volid, hval) {                                 \
+                 unsigned char*  ts = (unsigned char*)&(volid)+sizeof(volid)-1;\
+                 for ( (hval)=0; ts >= (unsigned char*)&(volid); ts--){\
+                     (hval) *= 173;                      \
+                     (hval) += *ts;                      \
+                 }                                       \
+                 }
+ 
+ /* Extra kernel definitions (from kdefs file) */
+ #ifdef KERNEL
+ /* sun definitions here */
+ #define	AFS_UIOFMODE		1	/* Only in afs/afs_vnodeops.c (afs_ustrategy) */
+ #define	AFS_SYSVLOCK		1	/* sys v locking supported */
+ /*#define	AFS_USEBUFFERS	1*/
+ #define	afsio_iov		uio_iov
+ #define	afsio_iovcnt	uio_iovcnt
+ #define	afsio_offset	uio_offset
+ #define	afsio_seg		uio_segflg
+ #define	afsio_fmode	uio_fmode
+ #define	afsio_resid	uio_resid
+ #define	AFS_UIOSYS	UIO_SYSSPACE
+ #define	AFS_UIOUSER	UIO_USERSPACE
+ #define	AFS_CLBYTES	MCLBYTES
+ #define	AFS_MINCHANGE	2
+ #define	osi_GetTime(x)	uniqtime(x)
+ 
+ /**
+   * These defines are for the 64 bit Solaris 7 port
+   * AFS_SYSCALL32 is used to protect the ILP32 syscall interface
+   * AFS_64BIT_ENV is for use of 64 bit inode numbers
+   */
+ #if defined(__sparcv9)
+ #define	AFS_SUN57_64BIT_ENV	1
+ #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
+ #define	VATTR_NULL	vattr_null
+ #define memset(A, B, S) bzero(A, S)
+ #define memcpy(B, A, S) bcopy(A, B, S)
+ #define memcmp(A, B, S) bcmp(A, B, S)
+ #endif /* KERNEL */
+ #define	AFS_DIRENT	
+ #ifndef CMSERVERPREF
+ #define CMSERVERPREF
+ #endif
+ #define	ROOTINO		UFSROOTINO
+ 
+ #endif /* AFS_PARAM_H */
Index: openafs/src/config/param.sunx86_58_usr.h
diff -c /dev/null openafs/src/config/param.sunx86_58_usr.h:1.2.2.1
*** /dev/null	Fri Aug  2 03:59:40 2002
--- openafs/src/config/param.sunx86_58_usr.h	Wed Jul 10 15:57:43 2002
***************
*** 0 ****
--- 1,66 ----
+ /*
+  * Copyright 2000, International Business Machines Corporation and others.
+  * All Rights Reserved.
+  * 
+  * This software has been released under the terms of the IBM Public
+  * License.  For details, see the LICENSE file in the top-level source
+  * directory or online at http://www.openafs.org/dl/license10.html
+  */
+ 
+ #ifndef	AFS_PARAM_H
+ #define	AFS_PARAM_H
+ 
+ #define AFS_VFS_ENV	1
+ /* Used only in vfsck code; is it needed any more???? */
+ #define RXK_LISTENER_ENV	1
+ #define AFS_USERSPACE_IP_ADDR	1
+ #define AFS_GCPAGS		0       /* if nonzero, garbage collect PAGs */
+ 
+ #define UKERNEL			1	/* user space kernel */
+ #define AFS_GREEDY43_ENV	1	/* Used only in rx/rx_user.c */
+ #define AFS_ENV			1
+ #define AFS_USR_SUN5_ENV	1
+ #define AFS_USR_SUN6_ENV	1
+ 
+ #include <afs/afs_sysnames.h>
+ 
+ /*#define AFS_GLOBAL_SUNLOCK	1	/* For global locking */
+ 
+ #define	AFS_3DISPARES		1	/* Utilize the 3 available disk inode 'spares' */
+ #define	AFS_SYSCALL		65
+ 
+ /* File system entry (used if mount.h doesn't define MOUNT_AFS */
+ #define AFS_MOUNT_AFS	 1
+ 
+ /* Machine / Operating system information */
+ #define sys_sun4x_55	1
+ #define SYS_NAME	"sun4x_55"
+ #define SYS_NAME_ID	SYS_NAME_ID_sun4x_55
+ #define AFSLITTLE_ENDIAN	1
+ #define AFS_HAVE_FFS            1       /* Use system's ffs. */
+ #define AFS_HAVE_STATVFS      0       /* System doesn't support statvfs */
+ 
+ /* Extra kernel definitions (from kdefs file) */
+ #ifdef KERNEL
+ #define	AFS_UIOFMODE		1	/* Only in afs/afs_vnodeops.c (afs_ustrategy) */
+ #define	AFS_SYSVLOCK		1	/* sys v locking supported */
+ /*#define	AFS_USEBUFFERS	1*/
+ #define	afsio_iov	uio_iov
+ #define	afsio_iovcnt	uio_iovcnt
+ #define	afsio_offset	uio_offset
+ #define	afsio_seg	uio_segflg
+ #define	afsio_fmode	uio_fmode
+ #define	afsio_resid	uio_resid
+ #define	AFS_UIOSYS	1
+ #define	AFS_UIOUSER	UIO_USERSPACE
+ #define	AFS_CLBYTES	MCLBYTES
+ #define	AFS_MINCHANGE	2
+ #define	VATTR_NULL	usr_vattr_null
+ #endif /* KERNEL */
+ #define	AFS_DIRENT	
+ #ifndef CMSERVERPREF
+ #define CMSERVERPREF
+ #endif
+ #define	ROOTINO		UFSROOTINO
+ 
+ #endif /* AFS_PARAM_H */
Index: openafs/src/kauth/krb_udp.c
diff -c openafs/src/kauth/krb_udp.c:1.14.2.2 openafs/src/kauth/krb_udp.c:1.14.2.4
*** openafs/src/kauth/krb_udp.c:1.14.2.2	Sat Oct 13 00:21:33 2001
--- openafs/src/kauth/krb_udp.c	Wed Jul 31 22:46:21 2002
***************
*** 15,26 ****
  #include <afsconfig.h>
  #include <afs/param.h>
  
! RCSID("$Header: /data/cvs/openafs/src/kauth/krb_udp.c,v 1.14.2.2 2001/10/13 04:21:33 shadow Exp $");
  
  #include <afs/stds.h>
  #include <sys/types.h>
  #ifdef AFS_NT40_ENV
  #include <winsock2.h>
  #define snprintf _snprintf
  #else
  #include <sys/socket.h>
--- 15,28 ----
  #include <afsconfig.h>
  #include <afs/param.h>
  
! RCSID("$Header: /data/cvs/openafs/src/kauth/krb_udp.c,v 1.14.2.4 2002/08/01 02:46:21 zacheiss Exp $");
  
  #include <afs/stds.h>
  #include <sys/types.h>
+ #include <errno.h>
  #ifdef AFS_NT40_ENV
  #include <winsock2.h>
+ #include <afs/errmap_nt.h>
  #define snprintf _snprintf
  #else
  #include <sys/socket.h>
***************
*** 778,783 ****
--- 780,787 ----
  	    code = recvfrom(sock_kerb, packet.data, sizeof(packet.data), 0,
  			    (struct sockaddr *) &packet.from, &fromLen);
  	    if (code < 0) {
+ 		if (errno == EAGAIN || errno == ECONNREFUSED) 
+ 		    goto try_kerb5;
  		perror ("calling recvfrom");
  		break;
  	    }
***************
*** 792,801 ****
--- 796,808 ----
  	    packet.time = 0;
  	    process_udp_request (sock_kerb, &packet);
  	} 
+ try_kerb5:
  	if ((sock_kerb5 >= 0) && FD_ISSET(sock_kerb5, &rfds)) {
  	    code = recvfrom(sock_kerb5, packet.data, sizeof(packet.data), 0,
  			    (struct sockaddr *) &packet.from, &fromLen);
  	    if (code < 0) {
+ 		if (errno == EAGAIN || errno == ECONNREFUSED) 
+ 		    continue;
  		perror ("calling recvfrom");
  		break;
  	    }
***************
*** 811,816 ****
--- 818,832 ----
  	    process_udp_request (sock_kerb5, &packet);
  	} 
      }
+     if (sock_kerb >= 0) {
+ 	close(sock_kerb);
+ 	sock_kerb = -1;
+     }
+     if (sock_kerb5 >= 0) {
+ 	close(sock_kerb5);
+ 	sock_kerb5 = -1;
+     }
+     printf("UDP SocketListener exiting due to error\n");
  }
  
  #if MAIN
Index: openafs/src/libafs/Makefile.common
diff -c openafs/src/libafs/Makefile.common:1.14.2.2 openafs/src/libafs/Makefile.common:1.14.2.3
*** openafs/src/libafs/Makefile.common:1.14.2.2	Sat Jun  8 00:47:42 2002
--- openafs/src/libafs/Makefile.common	Fri Jul 26 16:56:35 2002
***************
*** 127,133 ****
  AFSNFSOBJS = \
  	afs_nfsclnt.o	\
  	afs_nfsdisp.o	\
- 	afs_nfsdisp_v3.o \
  	afs_call_nfs.o \
  	afs_pioctl_nfs.o \
  	$(AFS_OS_NFSOBJS)
--- 127,132 ----
***************
*** 261,268 ****
  afs_nfsclnt.o: $(AFS)/afs_nfsclnt.c
  	$(CRULE1);
  afs_nfsdisp.o: $(AFS)/afs_nfsdisp.c
- 	$(CRULE1);
- afs_nfsdisp_v3.o: $(AFS)/afs_nfsdisp_v3.c
  	$(CRULE1);
  rx.o: $(RX)/rx.c
  	$(CRULE1);
--- 260,265 ----
Index: openafs/src/libafsrpc/Makefile.in
diff -c openafs/src/libafsrpc/Makefile.in:1.5 openafs/src/libafsrpc/Makefile.in:1.5.2.1
*** openafs/src/libafsrpc/Makefile.in:1.5	Mon Sep 10 16:21:10 2001
--- openafs/src/libafsrpc/Makefile.in	Wed Jul 10 15:57:44 2002
***************
*** 256,262 ****
  #
  #   $ what /opt/langtools/bin/pxdb32
  #   /opt/langtools/bin/pxdb32:
! #           HP92453-02 A.10.0A HP-UX SYMBOLIC DEBUGGER (PXDB) $Revision: 1.5 $
  #
  # The problem occurs when -g and -O are both used when compiling des.c.
  # The simplest way to work around the problem is to leave out either -g or -O.
--- 256,262 ----
  #
  #   $ what /opt/langtools/bin/pxdb32
  #   /opt/langtools/bin/pxdb32:
! #           HP92453-02 A.10.0A HP-UX SYMBOLIC DEBUGGER (PXDB) $Revision: 1.5.2.1 $
  #
  # The problem occurs when -g and -O are both used when compiling des.c.
  # The simplest way to work around the problem is to leave out either -g or -O.
***************
*** 331,337 ****
  
  syscall.o: ${SYS}/syscall.s
  	case "$(SYS_NAME)" in \
! 	     sun4x_5*) \
  		/usr/ccs/lib/cpp  ${SFLAGS} ${SYS}/syscall.s syscall.ss; \
  		as -o syscall.o syscall.ss;		\
  		$(RM) syscall.ss;;				\
--- 331,337 ----
  
  syscall.o: ${SYS}/syscall.s
  	case "$(SYS_NAME)" in \
! 	     sun4x_5*|sunx86_5*) \
  		/usr/ccs/lib/cpp  ${SFLAGS} ${SYS}/syscall.s syscall.ss; \
  		as -o syscall.o syscall.ss;		\
  		$(RM) syscall.ss;;				\
Index: openafs/src/login/Makefile.in
diff -c openafs/src/login/Makefile.in:1.5.2.1 openafs/src/login/Makefile.in:1.5.2.2
*** openafs/src/login/Makefile.in:1.5.2.1	Sat Oct 13 00:21:41 2001
--- openafs/src/login/Makefile.in	Wed Jul 10 15:57:44 2002
***************
*** 71,83 ****
  
  login:	${OBJS} ${LIBS}
  	case ${SYS_NAME} in \
! 	sun4x_5? ) ${CC} -g -o $@ ${CFLAGS} ${OBJS} -lc ${LIBS} ${XLIBS} -lcmd;;\
  	*) ${CC} -g -o $@ ${CFLAGS} ${OBJS} ${LIBS} ${XLIBS} ;;\
  	esac 
  
  login.krb: ${KOBJS} ${KLIBS}
  	case ${SYS_NAME} in \
! 	sun4x_5? ) ${CC} -g -o $@ ${CFLAGS} ${KOBJS} -lc ${KLIBS} ${XLIBS} -lcmd;;\
  	*) ${CC} -g -o $@ ${CFLAGS} ${KOBJS} ${KLIBS} ${XLIBS} ;;\
  	esac 
  
--- 71,83 ----
  
  login:	${OBJS} ${LIBS}
  	case ${SYS_NAME} in \
! 	sun4x_5? | sunx86_5? ) ${CC} -g -o $@ ${CFLAGS} ${OBJS} -lc ${LIBS} ${XLIBS} -lcmd;;\
  	*) ${CC} -g -o $@ ${CFLAGS} ${OBJS} ${LIBS} ${XLIBS} ;;\
  	esac 
  
  login.krb: ${KOBJS} ${KLIBS}
  	case ${SYS_NAME} in \
! 	sun4x_5? | sunx86_5? ) ${CC} -g -o $@ ${CFLAGS} ${KOBJS} -lc ${KLIBS} ${XLIBS} -lcmd;;\
  	*) ${CC} -g -o $@ ${CFLAGS} ${KOBJS} ${KLIBS} ${XLIBS} ;;\
  	esac 
  
Index: openafs/src/pam/Makefile.in
diff -c openafs/src/pam/Makefile.in:1.5.2.1 openafs/src/pam/Makefile.in:1.5.2.2
*** openafs/src/pam/Makefile.in:1.5.2.1	Fri Apr 19 01:37:28 2002
--- openafs/src/pam/Makefile.in	Tue Jun 11 20:16:52 2002
***************
*** 40,47 ****
  	  ${AFSLIBS} ${PAMLIBS} @LIB_AFSDB@
    KLIBS = ${TOP_LIBDIR}/libkauth.krb.a ${LIBSA} ${TOP_LIBDIR}/libauth.krb.a \
  	  ${AFSLIBS} ${PAMLIBS} @LIB_AFSDB@
!  SHOBJS = afs_auth.o afs_account.o afs_session.o afs_password.o \
! 	  afs_pam_msg.o afs_message.o afs_util.o AFS_component_version_number.o
     OBJS = $(SHOBJS) test_pam.o
  INCLUDES=-I${TOP_SRCDIR}/config -I${TOP_INCDIR} \
  	-I/usr/include -I/usr/include/sys
--- 40,47 ----
  	  ${AFSLIBS} ${PAMLIBS} @LIB_AFSDB@
    KLIBS = ${TOP_LIBDIR}/libkauth.krb.a ${LIBSA} ${TOP_LIBDIR}/libauth.krb.a \
  	  ${AFSLIBS} ${PAMLIBS} @LIB_AFSDB@
!  SHOBJS = afs_account.o afs_session.o afs_password.o \
! 	  afs_pam_msg.o afs_message.o AFS_component_version_number.o
     OBJS = $(SHOBJS) test_pam.o
  INCLUDES=-I${TOP_SRCDIR}/config -I${TOP_INCDIR} \
  	-I/usr/include -I/usr/include/sys
***************
*** 55,90 ****
  afs_setcred_krb.o: afs_setcred.c afs_pam_msg.h afs_message.h afs_util.h
  	${CC} ${CFLAGS} -DAFS_KERBEROS_ENV -c afs_setcred.c -o afs_setcred_krb.o
  
! pam_afs.so.1: $(SHOBJS) afs_setcred.o
  	set -x; \
  	case "$(SYS_NAME)" in \
  	hp_ux*) \
! 		$(LD) $(LDFLAGS) -c mapfile.hp -o $@ afs_setcred.o \
  			$(SHOBJS) $(LIBS) ;; \
  	sun*_5*) \
! 		$(LD) $(LDFLAGS) -M mapfile -o $@ afs_setcred.o \
  			$(SHOBJS) $(LIBS) ;; \
  	*linux*) \
! 		$(CC) $(LDFLAGS) -o $@ afs_setcred.o $(SHOBJS) $(LIBS) ;;\
  	*fbsd*) \
! 		$(CC) $(LDFLAGS) -o $@ afs_setcred.o $(SHOBJS) $(LIBS) ;;\
  	* ) \
  		echo No link line for system $(SYS_NAME). ;; \
  	esac
  
! pam_afs.krb.so.1: $(SHOBJS) afs_setcred_krb.o
  	set -x; \
  	case "$(SYS_NAME)" in \
  	hp_ux*) \
  		$(LD) $(LDFLAGS) -c mapfile.hp -o $@ \
! 			afs_setcred_krb.o $(SHOBJS) $(LDFLAGS) $(KLIBS) ;; \
  	sun*_5*) \
  		$(LD) $(LDFLAGS) -M mapfile -o $@ \
! 			afs_setcred_krb.o $(SHOBJS) $(LDFLAGS) $(KLIBS) ;; \
  	*linux*) \
! 		$(CC) $(LDFLAGS) -o $@ afs_setcred_krb.o $(SHOBJS) $(KLIBS) ;;\
  	*fbsd*) \
! 		$(CC) $(LDFLAGS) -o $@ afs_setcred_krb.o $(SHOBJS) $(KLIBS) ;;\
  	* ) \
  		echo No link line for system $(SYS_NAME). ;; \
  	esac
--- 55,102 ----
  afs_setcred_krb.o: afs_setcred.c afs_pam_msg.h afs_message.h afs_util.h
  	${CC} ${CFLAGS} -DAFS_KERBEROS_ENV -c afs_setcred.c -o afs_setcred_krb.o
  
! afs_auth.o: afs_auth.c afs_pam_msg.h afs_message.h afs_util.h
! 	${CC} ${CFLAGS}  -c afs_auth.c -o afs_auth.o
! 
! afs_auth_krb.o: afs_auth.c afs_pam_msg.h afs_message.h afs_util.h
! 	${CC} ${CFLAGS} -DAFS_KERBEROS_ENV  -c afs_auth.c -o afs_auth_krb.o
! 
! afs_util.o: afs_util.c afs_util.h
! 	${CC} ${CFLAGS} -c afs_util.c -o afs_util.o
! 
! afs_util_krb.o: afs_util.c afs_util.h
! 	${CC} ${CFLAGS} -DAFS_KERBEROS_ENV -c afs_util.c -o afs_util_krb.o
! 
! pam_afs.so.1: $(SHOBJS) afs_setcred.o afs_auth.o afs_util.o
  	set -x; \
  	case "$(SYS_NAME)" in \
  	hp_ux*) \
! 		$(LD) $(LDFLAGS) -c mapfile.hp -o $@ afs_setcred.o afs_auth.o afs_util.o\
  			$(SHOBJS) $(LIBS) ;; \
  	sun*_5*) \
! 		$(LD) $(LDFLAGS) -M mapfile -o $@ afs_setcred.o afs_auth.o afs_util.o\
  			$(SHOBJS) $(LIBS) ;; \
  	*linux*) \
! 		$(CC) $(LDFLAGS) -o $@ afs_setcred.o afs_auth.o afs_util.o $(SHOBJS) $(LIBS) ;;\
  	*fbsd*) \
! 		$(CC) $(LDFLAGS) -o $@ afs_setcred.o afs_auth.o afs_util.o $(SHOBJS) $(LIBS) ;;\
  	* ) \
  		echo No link line for system $(SYS_NAME). ;; \
  	esac
  
! pam_afs.krb.so.1: $(SHOBJS) afs_setcred_krb.o afs_auth_krb.o afs_util_krb.o
  	set -x; \
  	case "$(SYS_NAME)" in \
  	hp_ux*) \
  		$(LD) $(LDFLAGS) -c mapfile.hp -o $@ \
! 			afs_setcred_krb.o afs_auth_krb.o afs_util_krb.o $(SHOBJS) $(LDFLAGS) $(KLIBS) ;; \
  	sun*_5*) \
  		$(LD) $(LDFLAGS) -M mapfile -o $@ \
! 			afs_setcred_krb.o afs_auth_krb.o afs_util_krb.o $(SHOBJS) $(LDFLAGS) $(KLIBS) ;; \
  	*linux*) \
! 		$(CC) $(LDFLAGS) -o $@ afs_setcred_krb.o afs_auth_krb.o afs_util_krb.o $(SHOBJS) $(KLIBS) ;;\
  	*fbsd*) \
! 		$(CC) $(LDFLAGS) -o $@ afs_setcred_krb.o afs_auth_krb.o afs_util_krb.o $(SHOBJS) $(KLIBS) ;;\
  	* ) \
  		echo No link line for system $(SYS_NAME). ;; \
  	esac
Index: openafs/src/rx/Makefile.in
diff -c openafs/src/rx/Makefile.in:1.4.2.1 openafs/src/rx/Makefile.in:1.4.2.2
*** openafs/src/rx/Makefile.in:1.4.2.1	Sun Jan 20 03:38:38 2002
--- openafs/src/rx/Makefile.in	Thu Aug  1 22:45:14 2002
***************
*** 38,44 ****
  # Generic xdr objects (or, at least, xdr stuff that's not newly defined for rx).
  # Really the xdr stuff should be in its own directory.
  #
! XDROBJS = xdr_arrayn.o xdr_rx.o xdr_afsuuid.o
  
  RXOBJS = rx_clock.o rx_event.o rx_user.o rx_lwp.o rx.o rx_null.o rx_globals.o \
  	rx_getaddr.o rx_misc.o rx_packet.o rx_rdwr.o  rx_trace.o rx_conncache.o \
--- 38,44 ----
  # Generic xdr objects (or, at least, xdr stuff that's not newly defined for rx).
  # Really the xdr stuff should be in its own directory.
  #
! XDROBJS = xdr.o xdr_array.o xdr_arrayn.o xdr_rx.o xdr_afsuuid.o
  
  RXOBJS = rx_clock.o rx_event.o rx_user.o rx_lwp.o rx.o rx_null.o rx_globals.o \
  	rx_getaddr.o rx_misc.o rx_packet.o rx_rdwr.o  rx_trace.o rx_conncache.o \
Index: openafs/src/rx/rx_clock.c
diff -c openafs/src/rx/rx_clock.c:1.5.4.1 openafs/src/rx/rx_clock.c:1.5.4.2
*** openafs/src/rx/rx_clock.c:1.5.4.1	Sat Oct 13 00:21:49 2001
--- openafs/src/rx/rx_clock.c	Wed Jul 10 15:43:17 2002
***************
*** 17,23 ****
  #endif
  #include <afsconfig.h>
  
! RCSID("$Header: /data/cvs/openafs/src/rx/rx_clock.c,v 1.5.4.1 2001/10/13 04:21:49 shadow Exp $");
  
  #ifdef KERNEL
  #ifndef UKERNEL
--- 17,27 ----
  #endif
  #include <afsconfig.h>
  
! #ifdef AFS_SUN59_ENV
! #include <sys/time_impl.h>
! #endif
! 
! RCSID("$Header: /data/cvs/openafs/src/rx/rx_clock.c,v 1.5.4.2 2002/07/10 19:43:17 shadow Exp $");
  
  #ifdef KERNEL
  #ifndef UKERNEL
Index: openafs/src/rx/rx_event.c
diff -c openafs/src/rx/rx_event.c:1.7.2.1 openafs/src/rx/rx_event.c:1.7.2.2
*** openafs/src/rx/rx_event.c:1.7.2.1	Fri Apr 19 00:42:11 2002
--- openafs/src/rx/rx_event.c	Wed Jul 10 15:43:18 2002
***************
*** 14,20 ****
  #include <afs/param.h>
  #endif
  
! RCSID("$Header: /data/cvs/openafs/src/rx/rx_event.c,v 1.7.2.1 2002/04/19 04:42:11 zacheiss Exp $");
  
  #ifdef KERNEL
  #ifndef UKERNEL
--- 14,24 ----
  #include <afs/param.h>
  #endif
  
! #ifdef AFS_SUN59_ENV
! #include <sys/time_impl.h>
! #endif
! 
! RCSID("$Header: /data/cvs/openafs/src/rx/rx_event.c,v 1.7.2.2 2002/07/10 19:43:18 shadow Exp $");
  
  #ifdef KERNEL
  #ifndef UKERNEL
Index: openafs/src/rx/rx_lwp.c
diff -c openafs/src/rx/rx_lwp.c:1.10 openafs/src/rx/rx_lwp.c:1.10.4.1
*** openafs/src/rx/rx_lwp.c:1.10	Thu Jul 12 15:58:56 2001
--- openafs/src/rx/rx_lwp.c	Wed Jul 31 18:36:11 2002
***************
*** 12,18 ****
  #include <afsconfig.h>
  #include <afs/param.h>
  
! RCSID("$Header: /data/cvs/openafs/src/rx/rx_lwp.c,v 1.10 2001/07/12 19:58:56 shadow Exp $");
  
  # include <sys/types.h>		/* fd_set on older platforms */
  # include <errno.h>
--- 12,18 ----
  #include <afsconfig.h>
  #include <afs/param.h>
  
! RCSID("$Header: /data/cvs/openafs/src/rx/rx_lwp.c,v 1.10.4.1 2002/07/31 22:36:11 shadow Exp $");
  
  # include <sys/types.h>		/* fd_set on older platforms */
  # include <errno.h>
***************
*** 431,437 ****
  #elif defined(AFS_LINUX22_ENV)
  	  /* linux unfortunately returns ECONNREFUSED if the target port
  	   * is no longer in use */
! 	if (errno != EWOULDBLOCK && errno != ENOBUFS && errno != ECONNREFUSED)
  #else
  	if (errno != EWOULDBLOCK && errno != ENOBUFS)
  #endif
--- 431,439 ----
  #elif defined(AFS_LINUX22_ENV)
  	  /* linux unfortunately returns ECONNREFUSED if the target port
  	   * is no longer in use */
! 	  /* and EAGAIN if a UDP checksum is incorrect */
! 	if (errno != EWOULDBLOCK && errno != ENOBUFS &&
! 	    errno != ECONNREFUSED && errno != EAGAIN)
  #else
  	if (errno != EWOULDBLOCK && errno != ENOBUFS)
  #endif
Index: openafs/src/rx/rx_pthread.c
diff -c openafs/src/rx/rx_pthread.c:1.6.4.2 openafs/src/rx/rx_pthread.c:1.6.4.3
*** openafs/src/rx/rx_pthread.c:1.6.4.2	Sat Oct 13 00:21:49 2001
--- openafs/src/rx/rx_pthread.c	Wed Jul 31 18:36:11 2002
***************
*** 18,24 ****
  #include <afsconfig.h>
  #include <afs/param.h>
  
! RCSID("$Header: /data/cvs/openafs/src/rx/rx_pthread.c,v 1.6.4.2 2001/10/13 04:21:49 shadow Exp $");
  
  #include <sys/types.h>
  #include <errno.h>
--- 18,24 ----
  #include <afsconfig.h>
  #include <afs/param.h>
  
! RCSID("$Header: /data/cvs/openafs/src/rx/rx_pthread.c,v 1.6.4.3 2002/07/31 22:36:11 shadow Exp $");
  
  #include <sys/types.h>
  #include <errno.h>
***************
*** 403,409 ****
  #ifdef AFS_LINUX22_ENV
      /* linux unfortunately returns ECONNREFUSED if the target port
       * is no longer in use */
!     if (ret == -1 && errno != ECONNREFUSED) {
  #else
      if (ret == -1) {
  #endif
--- 403,410 ----
  #ifdef AFS_LINUX22_ENV
      /* linux unfortunately returns ECONNREFUSED if the target port
       * is no longer in use */
!     /* and EAGAIN if a UDP checksum is incorrect */
!     if (ret == -1 && errno != ECONNREFUSED && errno != EAGAIN) {
  #else
      if (ret == -1) {
  #endif
Index: openafs/src/rx/xdr.c
diff -c openafs/src/rx/xdr.c:1.3.4.1 openafs/src/rx/xdr.c:1.3.4.2
*** openafs/src/rx/xdr.c:1.3.4.1	Sat Jun  8 00:47:43 2002
--- openafs/src/rx/xdr.c	Wed Jul 31 19:13:49 2002
***************
*** 34,40 ****
  #include <afs/param.h>
  #endif
  
! RCSID("$Header: /data/cvs/openafs/src/rx/xdr.c,v 1.3.4.1 2002/06/08 04:47:43 shadow Exp $");
  
  /*
   * xdr.c, Generic XDR routines implementation.
--- 34,40 ----
  #include <afs/param.h>
  #endif
  
! RCSID("$Header: /data/cvs/openafs/src/rx/xdr.c,v 1.3.4.2 2002/07/31 23:13:49 shadow Exp $");
  
  /*
   * xdr.c, Generic XDR routines implementation.
***************
*** 557,562 ****
--- 557,564 ----
  	register char *sp = *cpp;  /* sp is the actual string pointer */
  	u_int size;
  	u_int nodesize;
+ 
+         if (maxsize > ((~0) >> 1) - 1) maxsize = ((~0) >> 1) - 1;
  
  	/*
  	 * first deal with the length since xdr strings are counted-strings
Index: openafs/src/rx/xdr_array.c
diff -c openafs/src/rx/xdr_array.c:1.4 openafs/src/rx/xdr_array.c:1.4.2.1
*** openafs/src/rx/xdr_array.c:1.4	Tue Aug  7 20:03:57 2001
--- openafs/src/rx/xdr_array.c	Wed Jul 31 19:13:49 2002
***************
*** 29,35 ****
  #include <afsconfig.h>
  #include <afs/param.h>
  
! RCSID("$Header: /data/cvs/openafs/src/rx/xdr_array.c,v 1.4 2001/08/08 00:03:57 shadow Exp $");
  
  #ifndef	NeXT
  
--- 29,35 ----
  #include <afsconfig.h>
  #include <afs/param.h>
  
! RCSID("$Header: /data/cvs/openafs/src/rx/xdr_array.c,v 1.4.2.1 2002/07/31 23:13:49 shadow Exp $");
  
  #ifndef	NeXT
  
***************
*** 84,90 ****
  	register caddr_t target = *addrp;
  	register u_int c;  /* the actual element count */
  	register bool_t stat = TRUE;
! 	register int nodesize;
  
  	/* like strings, arrays are really counted arrays */
  	if (! xdr_u_int(xdrs, sizep)) {
--- 84,93 ----
  	register caddr_t target = *addrp;
  	register u_int c;  /* the actual element count */
  	register bool_t stat = TRUE;
! 	register u_int nodesize;
! 
!         i = ((~0) >> 1) / elsize;
!         if (maxsize > i) maxsize = i;
  
  	/* like strings, arrays are really counted arrays */
  	if (! xdr_u_int(xdrs, sizep)) {
Index: openafs/src/rx/xdr_arrayn.c
diff -c openafs/src/rx/xdr_arrayn.c:1.4 openafs/src/rx/xdr_arrayn.c:1.4.2.1
*** openafs/src/rx/xdr_arrayn.c:1.4	Tue Aug  7 20:03:57 2001
--- openafs/src/rx/xdr_arrayn.c	Wed Jul 31 19:13:49 2002
***************
*** 29,35 ****
  #include <afsconfig.h>
  #include <afs/param.h>
  
! RCSID("$Header: /data/cvs/openafs/src/rx/xdr_arrayn.c,v 1.4 2001/08/08 00:03:57 shadow Exp $");
  
  #if !defined(NeXT)
  
--- 29,35 ----
  #include <afsconfig.h>
  #include <afs/param.h>
  
! RCSID("$Header: /data/cvs/openafs/src/rx/xdr_arrayn.c,v 1.4.2.1 2002/07/31 23:13:49 shadow Exp $");
  
  #if !defined(NeXT)
  
***************
*** 89,95 ****
  	register caddr_t target = *addrp;
  	register u_int c;  /* the actual element count */
  	register bool_t stat = TRUE;
! 	register int nodesize;
  
  	/* like strings, arrays are really counted arrays */
  	if (! xdr_u_int(xdrs, sizep)) {
--- 89,98 ----
  	register caddr_t target = *addrp;
  	register u_int c;  /* the actual element count */
  	register bool_t stat = TRUE;
! 	register u_int nodesize;
! 
!         i = ((~0) >> 1) / elsize;
!         if (maxsize > i) maxsize = i;
  
  	/* like strings, arrays are really counted arrays */
  	if (! xdr_u_int(xdrs, sizep)) {
Index: openafs/src/rx/LINUX/rx_kmutex.h
diff -c openafs/src/rx/LINUX/rx_kmutex.h:1.4.4.1 openafs/src/rx/LINUX/rx_kmutex.h:1.4.4.5
*** openafs/src/rx/LINUX/rx_kmutex.h:1.4.4.1	Wed Jan 30 16:15:36 2002
--- openafs/src/rx/LINUX/rx_kmutex.h	Wed Jul 31 18:00:04 2002
***************
*** 75,86 ****
  /* And how to do a good tryenter? */
  static inline int MUTEX_TRYENTER(afs_kmutex_t *l)
  {
!     if (!l->owner) {
! 	MUTEX_ENTER(l);
! 	return 1;
!     }
!     else
! 	return 0;
  }
  
  static inline void MUTEX_EXIT(afs_kmutex_t *l)
--- 75,84 ----
  /* And how to do a good tryenter? */
  static inline int MUTEX_TRYENTER(afs_kmutex_t *l)
  {
!     if (down_trylock(&l->sem))
!         return 0;
!     l->owner = current->pid;
!     return 1;
  }
  
  static inline void MUTEX_EXIT(afs_kmutex_t *l)
***************
*** 99,112 ****
  #endif
  #define CV_DESTROY(cv)
  
! /* CV_WAIT and CV_TIMEDWAIT rely on the fact that the Linux kernel has
!  * a global lock. Thus we can safely drop our locks before calling the
!  * kernel sleep services.
   */
  static inline int CV_WAIT(afs_kcondvar_t *cv, afs_kmutex_t *l)
  {
      int isAFSGlocked = ISAFS_GLOCK(); 
      sigset_t saved_set;
  
      if (isAFSGlocked) AFS_GUNLOCK();
      MUTEX_EXIT(l);
--- 97,122 ----
  #endif
  #define CV_DESTROY(cv)
  
! /* CV_WAIT and CV_TIMEDWAIT sleep until the specified event occurs, or, in the
!  * case of CV_TIMEDWAIT, until the specified timeout occurs.
!  * - NOTE: that on Linux, there are circumstances in which TASK_INTERRUPTIBLE
!  *   can wake up, even if all signals are blocked
!  * - TODO: handle signals correctly by passing an indication back to the
!  *   caller that the wait has been interrupted and the stack should be cleaned
!  *   up preparatory to signal delivery
   */
  static inline int CV_WAIT(afs_kcondvar_t *cv, afs_kmutex_t *l)
  {
      int isAFSGlocked = ISAFS_GLOCK(); 
      sigset_t saved_set;
+ #ifdef DECLARE_WAITQUEUE
+     DECLARE_WAITQUEUE(wait, current);
+ #else
+     struct wait_queue wait = { current, NULL };
+ #endif
+  
+     add_wait_queue(cv, &wait);
+     set_current_state(TASK_INTERRUPTIBLE);
  
      if (isAFSGlocked) AFS_GUNLOCK();
      MUTEX_EXIT(l);
***************
*** 117,135 ****
      recalc_sigpending(current);
      spin_unlock_irq(&current->sigmask_lock);
  
! #if defined(AFS_LINUX24_ENV)
!     interruptible_sleep_on((wait_queue_head_t *)cv);
! #else
!     interruptible_sleep_on((struct wait_queue**)cv);
! #endif
  
      spin_lock_irq(&current->sigmask_lock);
      current->blocked = saved_set;
      recalc_sigpending(current);
      spin_unlock_irq(&current->sigmask_lock);
  
-     MUTEX_ENTER(l);
      if (isAFSGlocked) AFS_GLOCK();
  
      return 0;
  }
--- 127,142 ----
      recalc_sigpending(current);
      spin_unlock_irq(&current->sigmask_lock);
  
!     schedule();
!     remove_wait_queue(cv, &wait);
  
      spin_lock_irq(&current->sigmask_lock);
      current->blocked = saved_set;
      recalc_sigpending(current);
      spin_unlock_irq(&current->sigmask_lock);
  
      if (isAFSGlocked) AFS_GLOCK();
+     MUTEX_ENTER(l);
  
      return 0;
  }
***************
*** 139,144 ****
--- 146,159 ----
      int isAFSGlocked = ISAFS_GLOCK();
      long t = waittime * HZ / 1000;
      sigset_t saved_set;
+ #ifdef DECLARE_WAITQUEUE
+     DECLARE_WAITQUEUE(wait, current);
+ #else
+     struct wait_queue wait = { current, NULL };
+ #endif
+  
+     add_wait_queue(cv, &wait);
+     set_current_state(TASK_INTERRUPTIBLE);
  
      if (isAFSGlocked) AFS_GUNLOCK();
      MUTEX_EXIT(l);
***************
*** 149,167 ****
      recalc_sigpending(current);
      spin_unlock_irq(&current->sigmask_lock);
  
! #if defined(AFS_LINUX24_ENV)
!     t = interruptible_sleep_on_timeout((wait_queue_head_t *)cv, t);
! #else
!     t = interruptible_sleep_on_timeout((struct wait_queue**)cv, t);
! #endif
      
      spin_lock_irq(&current->sigmask_lock);
      current->blocked = saved_set;
      recalc_sigpending(current);
      spin_unlock_irq(&current->sigmask_lock);
  
-     MUTEX_ENTER(l);
      if (isAFSGlocked) AFS_GLOCK();
  
      return 0;
  }
--- 164,179 ----
      recalc_sigpending(current);
      spin_unlock_irq(&current->sigmask_lock);
  
!     t = schedule_timeout(t);
!     remove_wait_queue(cv, &wait);
      
      spin_lock_irq(&current->sigmask_lock);
      current->blocked = saved_set;
      recalc_sigpending(current);
      spin_unlock_irq(&current->sigmask_lock);
  
      if (isAFSGlocked) AFS_GLOCK();
+     MUTEX_ENTER(l);
  
      return 0;
  }
Index: openafs/src/rxkad/rxkad_common.c
diff -c openafs/src/rxkad/rxkad_common.c:1.8.2.3 openafs/src/rxkad/rxkad_common.c:1.8.2.4
*** openafs/src/rxkad/rxkad_common.c:1.8.2.3	Sat Jun  8 00:47:45 2002
--- openafs/src/rxkad/rxkad_common.c	Wed Jul 10 15:43:20 2002
***************
*** 16,22 ****
  #include <afs/param.h>
  #endif
  
! RCSID("$Header: /data/cvs/openafs/src/rxkad/rxkad_common.c,v 1.8.2.3 2002/06/08 04:47:45 shadow Exp $");
  
  #ifdef KERNEL
  #ifndef UKERNEL
--- 16,26 ----
  #include <afs/param.h>
  #endif
  
! #ifdef AFS_SUN59_ENV
! #include <sys/time_impl.h>
! #endif
! 
! RCSID("$Header: /data/cvs/openafs/src/rxkad/rxkad_common.c,v 1.8.2.4 2002/07/10 19:43:20 shadow Exp $");
  
  #ifdef KERNEL
  #ifndef UKERNEL
Index: openafs/src/tbutc/Makefile.in
diff -c openafs/src/tbutc/Makefile.in:1.5.2.1 openafs/src/tbutc/Makefile.in:1.5.2.2
*** openafs/src/tbutc/Makefile.in:1.5.2.1	Sat Oct 13 00:21:56 2001
--- openafs/src/tbutc/Makefile.in	Fri Jul 26 01:00:27 2002
***************
*** 45,51 ****
  VOLSER  = ../volser
  
  BUCOORDOBJS=ubik_db_if.o ${BUCOORD}/volstub.o ${BUCOORD}/dlq.o \
! 	    ${BUCOORD}/status.o ${BUCOORD}/bucoord_errs.o
  
  VOLSERLIBOBJ=${VOLSER}/volint.cs.o  vsprocs.o              ${VOLSER}/vsutils.o \
              ${VOLSER}/lockprocs.o  ${VOLSER}/volint.xdr.o ${VOLSER}/volerr.o \
--- 45,51 ----
  VOLSER  = ../volser
  
  BUCOORDOBJS=ubik_db_if.o ${BUCOORD}/volstub.o ${BUCOORD}/dlq.o \
! 	    status.o ${BUCOORD}/bucoord_errs.o
  
  VOLSERLIBOBJ=${VOLSER}/volint.cs.o  vsprocs.o              ${VOLSER}/vsutils.o \
              ${VOLSER}/lockprocs.o  ${VOLSER}/volint.xdr.o ${VOLSER}/volerr.o \
***************
*** 137,142 ****
--- 137,145 ----
  
  ubik_db_if.o: ${BUCOORD}/ubik_db_if.c
  	${CC} ${CFLAGS} -c ${BUCOORD}/ubik_db_if.c
+ 
+ status.o: ${BUCOORD}/status.c
+ 	${CC} ${CFLAGS} -c ${BUCOORD}/status.c
  
  vsprocs.o: ${VOLSER}/vsprocs.c
  	${CC} ${CFLAGS} -c ${VOLSER}/vsprocs.c
Index: openafs/src/tools/openafs-tools-cmd.README
diff -c openafs/src/tools/openafs-tools-cmd.README:1.1.2.1 openafs/src/tools/openafs-tools-cmd.README:1.1.2.2
*** openafs/src/tools/openafs-tools-cmd.README:1.1.2.1	Sun Jan 20 04:05:08 2002
--- openafs/src/tools/openafs-tools-cmd.README	Wed Jul 10 16:43:57 2002
***************
*** 9,15 ****
  ## License.  For details, see the LICENSE file in the top-level source
  ## directory or online at http://www.openafs.org/dl/license10.html
  ##
! ## openafs-tools, Version 1.2.2 ##
  
  ####################### TABLE OF CONTENTS ###########################
  
--- 9,15 ----
  ## License.  For details, see the LICENSE file in the top-level source
  ## directory or online at http://www.openafs.org/dl/license10.html
  ##
! ## openafs-tools, Version 1.2.5 ##
  
  ####################### TABLE OF CONTENTS ###########################
  
***************
*** 57,63 ****
        openafs-server-1.2.2-rh6.2.1.i386.rpm
      Red Hat 7.1:
        openafs-kernel-1.2.2-rh7.1.1.i386.rpm
!       openafs-1.2.2-rh7.11..i386.rpm 
        openafs-client-1.2.2-rh7.1.1.i386.rpm 
        openafs-server-1.2.2-rh7.1.1.i386.rpm
  Once these are downloaded, install them (using an rpm -i or rpm -U
--- 57,63 ----
        openafs-server-1.2.2-rh6.2.1.i386.rpm
      Red Hat 7.1:
        openafs-kernel-1.2.2-rh7.1.1.i386.rpm
!       openafs-1.2.2-rh7.1.1.i386.rpm 
        openafs-client-1.2.2-rh7.1.1.i386.rpm 
        openafs-server-1.2.2-rh7.1.1.i386.rpm
  Once these are downloaded, install them (using an rpm -i or rpm -U
***************
*** 65,71 ****
  
  c) OpenAFS Tools
      Now all that's left to do is install the OpenAFS Tools rpm.  The
! file you need is openafs-tools-1.1.1-1.i386.rpm.  Install it using 
  an rpm -i or rpm -U command.  This will create several directories
  and populate your system with necessary files.  The main directories
  created and populated is:
--- 65,71 ----
  
  c) OpenAFS Tools
      Now all that's left to do is install the OpenAFS Tools rpm.  The
! file you need is openafs-tools-1.2.2-1.i386.rpm.  Install it using 
  an rpm -i or rpm -U command.  This will create several directories
  and populate your system with necessary files.  The main directories
  created and populated is:
***************
*** 82,91 ****
  on the command line, you will be prompted for them interactively.
  To get a rundown on how to use install_afs, execute:
    /usr/afs/tools/install/install_afs help
- Once configured correctly, this machine will run the installation 
- program (the same one run by the web interface), and restart your
- computer.
  
  b) OpenAFS Uninstallation 
  
      The uninstallation program is very simple.  Just run
--- 82,110 ----
  on the command line, you will be prompted for them interactively.
  To get a rundown on how to use install_afs, execute:
    /usr/afs/tools/install/install_afs help
  
+ If you are creating an additional server or not a server, OpenAFS 
+ Tools will ensure that you have all the required files on your 
+ system.  These are files needed by the OpenAFS installation program 
+ to connect you to cells that already exist.  You must get these files
+ manually from an existing server, as we have not yet implemented
+ a secure way of doing this automatically.  For additional servers,
+ the files you need to copy are:
+     - Copy the /usr/afs/etc/ThisCell file from the existing server
+ to /usr/afs/tools/install/afs/ThisCell on your machine.
+     - Copy the /usr/afs/etc/CellServDB file from the existing server
+ to /usr/afs/tools/install/afs/CellServDB on your machine.
+     - Copy the /usr/afs/etc/KeyFile file from the existing server
+ to /usr/afs/tools/install/afs/KeyFile on your machine.
+     - Copy the /usr/afs/etc/UserList file from the existing server
+ to /usr/afs/tools/install/afs/UserList on your machine.
+     - Copy the /usr/vice/etc/CellServDB file from the existing server
+ to /usr/afs/tools/install/vice/CellServDB on your machine.
+ 
+     For client-only installation, you need the following file:
+     - Copy the /usr/vice/etc/CellServDB file from the existing server
+ to /usr/afs/tools/install/vice/CellServDB on your machine.
+ 
  b) OpenAFS Uninstallation 
  
      The uninstallation program is very simple.  Just run
***************
*** 126,132 ****
    - Installation starts with the script install_afs.  The first thing
  it does is ensure that the files needed for setting up additional 
  servers and/or clients exist in the appropriate places (see section 
! 3.a.i for a description of these files).  Then, after indicating to 
  the state file that installation has begun, it begins installing 
  OpenAFS.
    - For clients, it then enables Pam Login Authentication using
--- 145,151 ----
    - Installation starts with the script install_afs.  The first thing
  it does is ensure that the files needed for setting up additional 
  servers and/or clients exist in the appropriate places (see section 
! 3.a for a description of these files).  Then, after indicating to 
  the state file that installation has begun, it begins installing 
  OpenAFS.
    - For clients, it then enables Pam Login Authentication using
***************
*** 149,155 ****
  Currently we use the administrative password for the afs account
  password.  The admin account is now added to the bos server database
  and a pts entry is created as well.  Also, the afs account password
! is added as a key for the server. The kaserver proces is terminated.  
  The pts database is then bootstrapped to add the administrator to it.  
    - For first servers, a normal bosserver is started.  It then 
  creates the database server processes (kaserver, buserver, ptserver, 
--- 168,174 ----
  Currently we use the administrative password for the afs account
  password.  The admin account is now added to the bos server database
  and a pts entry is created as well.  Also, the afs account password
! is added as a key for the server. The kaserver process is terminated.  
  The pts database is then bootstrapped to add the administrator to it.  
    - For first servers, a normal bosserver is started.  It then 
  creates the database server processes (kaserver, buserver, ptserver, 
***************
*** 182,189 ****
  
  b) OpenAFS Uninstallation
  
!     Uninstallation has only two files: the main script and the 
! redirection script.
    /usr/afs/tools/install/afs_uninstall
  Here is a brief summary of what it does to uninstall OpenAFS:
    - First it indicates to the state file that uninstallation has 
--- 201,207 ----
  
  b) OpenAFS Uninstallation
  
!     Uninstallation has only one file:
    /usr/afs/tools/install/afs_uninstall
  Here is a brief summary of what it does to uninstall OpenAFS:
    - First it indicates to the state file that uninstallation has 
Index: openafs/src/tools/install/.afs_state
diff -c /dev/null openafs/src/tools/install/.afs_state:1.1.4.1
*** /dev/null	Fri Aug  2 03:59:57 2002
--- openafs/src/tools/install/.afs_state	Wed Jul 10 16:44:01 2002
***************
*** 0 ****
--- 1,2 ----
+ Uninstall
+ complete
Index: openafs/src/tools/install/K5_README
diff -c /dev/null openafs/src/tools/install/K5_README:1.1.4.1
*** /dev/null	Fri Aug  2 03:59:57 2002
--- openafs/src/tools/install/K5_README	Wed Jul 10 16:44:01 2002
***************
*** 0 ****
--- 1,104 ----
+ 6/27/02
+ 
+ This is a brief description of how to use the OpenAFS Tools to create a cell
+ that uses Kerberos 5 authentication, rather than the kaserver program that
+ comes with OpenAFS.
+ 
+ *** INTRODUCTION ***
+ 
+ Kerberos 5 is an authentication protocol that is widely used by many
+ applications.  If you have an OpenAFS environment that is K5-aware, your
+ users will not have to obtain authenticate separately with OpenAFS -- they
+ can use their Kerberos tickets instead.  For more information about the
+ benefits of K5 over AFS authentication, see the following webpage:
+ 
+ http://www.mathematik.uni-karlsruhe.de/~iwrmm/Persons/Schulz/Unix/afs/afs-krb5.html
+ 
+ You should also check out AFSLore (http://grand.central.org/twiki/).
+ 
+ Also, refer to the OpenAFS Tools README for a much more complete set
+ of requirements and instructions.  This document contains only things that
+ are specific to the process of using Kerberos; it assumes you are already
+ familiar with the other OpenAFS Tools requirements.
+ 
+ *** REQUIREMENTS ***
+ 
+ There are two major implementations of K5 -- MIT, and Heimdal.  From what
+ I can gather, one is not significantly better than the other.  Unfortunately,
+ their command line interfaces differ slightly, so for these tools I had to
+ choose one with which to be compatible.  I chose the MIT version.  It is
+ available at http://web.mit.edu/kerberos/www/index.html.  You should download,
+ compile, and install this if you haven't already.
+ 
+ If you have an existing Kerberos realm that you plan to use, you only need to
+ configure your soon-to-be OpenAFS server as a Kerberos client.  If you're
+ making a new realm, you're going to have to create a master KDC (which can
+ be the same as your OpenAFS server if you want, but that's not advised), and
+ also configure your OpenAFS server to be a client.  The aforementioned MIT
+ website has all the information you'll need on how to create or connect to
+ a K5 realm.  IMPORTANT NOTE: If you're creating a new realm, keep in mind
+ that the OpenAFS cell you will be creating later must have the same name as
+ the realm, except the name of the realm must be in all caps.
+ 
+ The next step is to install the OpenAFS RPMs, available at 
+ http://www.openafs.org/.  You'll need to get the openafs, openafs-kernel,
+ openafs-client, openafs-server, and openafs-krb5 packages, and install
+ them all.  
+ 
+ *** INSTALLATION ***
+ 
+ Installation is pretty easy.  Just do a normal install_afs command (as 
+ described in the OpenAFS Tools README), but specify the "-k" option.  This
+ informs the program that you are going to be using Kerberos for authentication.
+ During the installation process, it will ask for a Kerberos administration
+ password; this is the password for the admin/admin principal in your
+ Kerberos realm.  If it is not correct, the installation will not work!
+ 
+ IMPORTANT NOTE: As far as I can tell, the name of your cell must be THE SAME
+ as the name of the Kerberos realm you are using, except in should be in lower
+ case letters instead of upper case.  Supposedly there are ways to get around
+ this, but I have not found them.  Currently, the OpenAFS Tools supports only
+ same-name integration.
+ 
+ *** USE ***
+ 
+ After the install_afs program completes, you should be ready to go.  To test
+ it out, execute the following commands.
+ 
+   kinit admin
+   aklog
+   vos create <machine_name> <partition_name> test.vol
+ 
+ This will create a test volume in your AFS cell.  If you see any error 
+ messages about authentication, then something's not working.
+ 
+ If everything works, you can start using your AFS cell.  When you want to make
+ new users, make them a Kerberos account, and then give them a PTS entry in
+ your OpenAFS cell.  That should be it!
+ 
+ *** COMMON PROBLEMS ***
+ 
+ Here are some solutions to problems I've encountered:
+ 
+ - Some KDC in your Kerberos realm must be running the following programs 
+ before you run the OpenAFS installation program:
+   kadmind
+   krb5kdc
+   krb524d -m
+ - The name of your OpenAFS cell and Kerberos realm must be the same, except
+ for differences in capitalization.
+ - Make sure, after uninstalling OpenAFS, to delete the 'admin' and 'afs'
+ principals from the Kerberos database.
+ 
+ *** Future Work ***
+ 
+ These tools should support both MIT and Heimdal implementations, and any
+ others that may exist.  Unfortunately, the only reasonable way to do this 
+ that I can see is to use the actual Kerberos 5 API.  This would require 
+ writing a C program or two and integrating them into the OpenAFS
+ installation script.  While certainly possible, this would probably take
+ some work.
+ 
+ Removing the same name dependency between the OpenAFS cell and the Kerberos
+ realm would be fantastic.
+ 
Index: openafs/src/tools/install/RPM.README
diff -c openafs/src/tools/install/RPM.README:1.1.2.1 openafs/src/tools/install/RPM.README:1.1.2.2
*** openafs/src/tools/install/RPM.README:1.1.2.1	Sun Jan 20 04:05:09 2002
--- openafs/src/tools/install/RPM.README	Wed Jul 10 16:44:01 2002
***************
*** 8,21 ****
  ## License.  For details, see the LICENSE file in the top-level source
  ## directory or online at http://www.openafs.org/dl/license10.html
  ##
! ## openafs-tools, Version 1.2.2 ##
  
  Follow these steps to create a binary distribution RPM for the 
  openafs-tools-cmd package no Red Hat Linux:
  
  1) Copy the spec file to your SPECS directory.
  
!   cp openafs-tools-cmd-1.2.2-1.spec /usr/src/redhat/SPECS/
  
  2) Create the source package by running:
  
--- 8,21 ----
  ## License.  For details, see the LICENSE file in the top-level source
  ## directory or online at http://www.openafs.org/dl/license10.html
  ##
! ## openafs-tools, Version 1.2.5 ##
  
  Follow these steps to create a binary distribution RPM for the 
  openafs-tools-cmd package no Red Hat Linux:
  
  1) Copy the spec file to your SPECS directory.
  
!   cp openafs-tools-cmd-1.2.5-1.spec /usr/src/redhat/SPECS/
  
  2) Create the source package by running:
  
***************
*** 27,33 ****
  3) Now you can create the RPM:
  
    cd /usr/src/redhat/SPECS
!   rpm -ba --clean openafs-tools-cmd-1.2.2-1.i386.rpm
  
    The RPM is now ready for use in the 
  /usr/src/redhat/RPMS directory.
--- 27,33 ----
  3) Now you can create the RPM:
  
    cd /usr/src/redhat/SPECS
!   rpm -ba --clean openafs-tools-cmd-1.2.5-1.i386.rpm
  
    The RPM is now ready for use in the 
  /usr/src/redhat/RPMS directory.
Index: openafs/src/tools/install/afs_uninstall
diff -c openafs/src/tools/install/afs_uninstall:1.1.2.1 openafs/src/tools/install/afs_uninstall:1.1.2.2
*** openafs/src/tools/install/afs_uninstall:1.1.2.1	Sun Jan 20 04:05:09 2002
--- openafs/src/tools/install/afs_uninstall	Wed Jul 10 16:44:01 2002
***************
*** 28,34 ****
--- 28,37 ----
  rm -f /usr/vice/etc/ThisCell
  rm -f /usr/vice/etc/AFSLog
  rm -rf /usr/vice/cache
+ rm -f $afscodeFileDir/install_output
+ rm -f $afscodeFileDir/done.txt
  mkdir /usr/vice/cache
+ echo "If you were using K5 authentication, make sure you delete all AFS related principals."
  echo "Uninstall" > $afscodeFileDir/.afs_state
  echo "complete" >> $afscodeFileDir/.afs_state
  
Index: openafs/src/tools/install/install_afs
diff -c openafs/src/tools/install/install_afs:1.1.2.1 openafs/src/tools/install/install_afs:1.1.2.2
*** openafs/src/tools/install/install_afs:1.1.2.1	Sun Jan 20 04:05:09 2002
--- openafs/src/tools/install/install_afs	Wed Jul 10 16:44:01 2002
***************
*** 35,40 ****
--- 35,42 ----
    echo -e "\t-adminPassword (or -p) password: the administrative\n\t    password of the cell.  Ignored if this is not a server"
    echo -e "\t-existingServer (or -e) name: the name of an\n\t   existing server already in the cell.  Ignored if\n\t   this is not an additional server"
    echo -e "\t-scriptDirectory (or -d) name: the name of the\n\t   directory containing these OpenAFS installation\n\t   scripts"
+   echo -e "\t-krb5 (or -k): Set up Kerberos 5 authentication on this\n\t   machine.  Assumes this machine is a client of a Kerberos\n\t   realm that has the same name as the cell being created,\n\t   but all caps.  Ignored if this is not a first server."
+   echo -e "\t-kadminPassword (or -ka) password: the administrative\n\t   password of the kerberos realm.  Ignored if the -krb5\n\t   flag is not set."
    echo -e "\t-noConf (or -n): Do not ask for confirmation before\n\t    performing the installation."
    echo -e "\thelp: Display this help dialogue"
    echo
***************
*** 57,63 ****
    if [ $# -ne 0 ]; then 
      shift
    fi
!   if [ $flag != "-noConf" -a $flag != "-n" ]; then
      val=$1
      if [ $# -ne 0 ]; then 
        shift
--- 59,65 ----
    if [ $# -ne 0 ]; then 
      shift
    fi
!   if [ $flag != "-noConf" -a $flag != "-n" -a $flag != "-krb5" -a $flag != "-k" ]; then
      val=$1
      if [ $# -ne 0 ]; then 
        shift
***************
*** 126,135 ****
    else
    if [ $flag = "-noConf"  -o $flag = "-n" ]; then
       noConf=$val
    else
      echo Invalid flag $flag.  Use \"install_afs help\" for syntax.
      exit 0;
!   fi fi fi fi fi fi fi fi fi fi
  done
  
  # Collect variables not given:
--- 128,143 ----
    else
    if [ $flag = "-noConf"  -o $flag = "-n" ]; then
       noConf=$val
+   else 
+   if [ $flag = "-krb5"  -o $flag = "-k" ]; then
+      krb5=$val
+   else
+   if [ $flag = "-kadminPassword" -o $flag = "-ka" ]; then
+      kadminPassword=$val
    else
      echo Invalid flag $flag.  Use \"install_afs help\" for syntax.
      exit 0;
!   fi fi fi fi fi fi fi fi fi fi fi fi
  done
  
  # Collect variables not given:
***************
*** 267,272 ****
--- 275,305 ----
    done
  fi
  
+ if [ $krb5 -ne 0 ]; then 
+   while [ -z $kadminPassword ]; do
+     echo -ne "Provide the administrative password of the Kerberos realm: "
+     stty -echo echonl
+     read kadminPassword
+     stty echo
+     echo -ne "Please confirm the password: "
+     stty -echo echonl
+     read kadminPassword2
+     stty echo
+ 
+     if [ -z $kadminPassword ]; then
+       echo -e "You must give a password"
+     else 
+     if [ -z $kadminPassword2 ]; then
+       echo -e "You must confirm the password"
+       adminPassword=""
+     else
+     if [ $kadminPassword != $kadminPassword2 ]; then
+       echo -e "Passwords do not match"
+       kadminPassword=""
+     fi fi fi
+   done
+ fi
+ 
  # Make sure the needed files exist:
  if [ $serverType -eq $addServer ]; then
    while [ ! -e $scriptDir/afs/ -o ! -e $scriptDir/afs/ThisCell -o ! -e $scriptDir/afs/CellServDB -o ! -e $scriptDir/afs/KeyFile -o  ! -e $scriptDir/afs/UserList ]; do
***************
*** 430,450 ****
      echo kill ${bosserver_process%% /*}
      kill ${bosserver_process%% /*}
  
!     /usr/afs/bin/kaserver -noauth &
   
!     echo Configuring kaserver
!     kas create afs -initial_password $afsPassword -cell $cellName -noauth
!     kas examine -name afs -cell $cellName -noauth
!     kas create admin -initial_password $adminPassword -cell $cellName -noauth
!     kas setfields admin -flags admin -cell $cellName -noauth
!     kas examine -name admin -cell $cellName -noauth
      
!     kaserver_process=$(ps -Ao pid,cmd | grep kaserver)
!     echo kill ${kaserver_process%% /*}
!     kill ${kaserver_process%% /*}
  
      echo Bootstrapping ptserver
!     echo -e "admin 128/20 1 -204 -204\nsystem:administrators 130/20 -204 -204 -204\n   admin   1\n" | pt_util -p /usr/afs/db/prdb.DB0 -w
  
    fi
  
--- 463,497 ----
      echo kill ${bosserver_process%% /*}
      kill ${bosserver_process%% /*}
  
!     if [ -z $krb5 ]; then
!       /usr/afs/bin/kaserver -noauth &
   
!       echo Configuring kaserver
!       kas create afs -initial_password $afsPassword -cell $cellName -noauth
!       kas examine -name afs -cell $cellName -noauth
!       kas create admin -initial_password $adminPassword -cell $cellName -noauth
!       kas setfields admin -flags admin -cell $cellName -noauth
!       kas examine -name admin -cell $cellName -noauth
      
!       kaserver_process=$(ps -Ao pid,cmd | grep kaserver)
!       echo kill ${kaserver_process%% /*}
!       kill ${kaserver_process%% /*}
!    
!     else 
! 
!       echo Setting up krb5
!       kadmin -p admin/admin -w $kadminPassword -q "addprinc -pw $adminPassword afs"
!       kadmin -p admin/admin -w $kadminPassword -q "modprinc -kvno 0 afs"
!       kadmin -p admin/admin -w $kadminPassword -q "ktadd -k /etc/krb5.keytab -e des-cbc-crc:afs3 afs"
!       asetkey add 1 /etc/krb5.keytab afs
!       kadmin -p admin/admin -w $kadminPassword -q "ktremove -k /etc/krb5.keytab afs all"
!       kadmin -p admin/admin -w $kadminPassword -q "addprinc -pw $adminPassword admin"
!       kadmin -p admin/admin -w $kadminPassword -q "ktadd -k /etc/krb5.keytab admin" 
  
+     fi
+ 
      echo Bootstrapping ptserver
!     echo -e "admin 128/20 1 -204 -204\nsystem:administrators 130/20 -204 -204 -204\n   admin   1\n" | /usr/afs/bin/pt_util -p /usr/afs/db/prdb.DB0 -w
  
    fi
  
***************
*** 464,471 ****
  #
    echo Starting the Database Server Processes
  #
!   echo bos create -server $machineName -instance kaserver -type simple -cmd /usr/afs/bin/kaserver -cell $cellName -localauth
!   bos create -server $machineName -instance kaserver -type simple -cmd /usr/afs/bin/kaserver -cell $cellName -localauth
    echo bos create -server $machineName -instance buserver -type simple -cmd /usr/afs/bin/buserver -cell $cellName -localauth
    bos create -server $machineName -instance buserver -type simple -cmd /usr/afs/bin/buserver -cell $cellName -localauth
    echo bos create -server $machineName -instance ptserver -type simple -cmd /usr/afs/bin/ptserver -cell $cellName -localauth
--- 511,520 ----
  #
    echo Starting the Database Server Processes
  #
!   if [ -z $krb5 ]; then
!     echo bos create -server $machineName -instance kaserver -type simple -cmd /usr/afs/bin/kaserver -cell $cellName -localauth
!     bos create -server $machineName -instance kaserver -type simple -cmd /usr/afs/bin/kaserver -cell $cellName -localauth
!   fi
    echo bos create -server $machineName -instance buserver -type simple -cmd /usr/afs/bin/buserver -cell $cellName -localauth
    bos create -server $machineName -instance buserver -type simple -cmd /usr/afs/bin/buserver -cell $cellName -localauth
    echo bos create -server $machineName -instance ptserver -type simple -cmd /usr/afs/bin/ptserver -cell $cellName -localauth
***************
*** 552,560 ****
  echo /etc/rc.d/init.d/afs start
  /etc/rc.d/init.d/afs start
  if [ $serverType -ne $notServer ]; then
!   # klog in as admin
!   echo klog admin -password 
!   klog admin -password $adminPassword
    # verify klog worked correctly:
    echo tokens
    tokens
--- 601,616 ----
  echo /etc/rc.d/init.d/afs start
  /etc/rc.d/init.d/afs start
  if [ $serverType -ne $notServer ]; then
!  
!   if [ -z $krb5 ]; then
!     # klog in as admin
!     echo klog admin -password 
!     klog admin -password $adminPassword
!   else
!     kinit -t /etc/krb5.keytab admin
!     aklog
!   fi
! 
    # verify klog worked correctly:
    echo tokens
    tokens
***************
*** 616,624 ****
    /etc/rc.d/init.d/afs start
    cd /afs
  
!   # klog in as admin
!   echo klog admin -password 
!   klog admin -password $adminPassword
  
    # Wait for Ubik to elect a quorum
    echo Waiting for a quorum election . . .
--- 672,687 ----
    /etc/rc.d/init.d/afs start
    cd /afs
  
!   if [ -z $krb5 ]; then
!     # klog in as admin
!     echo klog admin -password 
!     klog admin -password $adminPassword
!   else
!     kinit -t /etc/krb5.keytab admin
!     aklog
!     kadmin -p admin/admin -w $kadminPassword -q "ktremove -k /etc/krb5.keytab admin all"
!     kadmin -p admin/admin -w $kadminPassword -q "cpw -pw $adminPassword admin"
!   fi
  
    # Wait for Ubik to elect a quorum
    echo Waiting for a quorum election . . .
***************
*** 629,636 ****
    echo fs examine /afs/$cellName
    fs examine /afs/$cellName
  
- #
- #
  fi
  fs checkvolumes
  #
--- 692,697 ----
Index: openafs/src/tools/install/make_rpm_source
diff -c openafs/src/tools/install/make_rpm_source:1.1.2.1 openafs/src/tools/install/make_rpm_source:1.1.2.2
*** openafs/src/tools/install/make_rpm_source:1.1.2.1	Sun Jan 20 04:05:09 2002
--- openafs/src/tools/install/make_rpm_source	Wed Jul 10 16:44:01 2002
***************
*** 28,33 ****
--- 28,35 ----
  cp $mainFileDir/afsinit_server .
  cp $mainFileDir/afs_uninstall .
  cp $mainFileDir/install_afs .
+ cp $mainFileDir/K5_README .
+ cp $mainFileDir/check_udebug.pl .
  cp $mainFileDir/write_fstab.pl .
  cp $mainFileDir/write_pam.pl .
  #
Index: openafs/src/tools/install/openafs-tools-cmd-1.2.5-1.spec
diff -c /dev/null openafs/src/tools/install/openafs-tools-cmd-1.2.5-1.spec:1.1.4.1
*** /dev/null	Fri Aug  2 03:59:57 2002
--- openafs/src/tools/install/openafs-tools-cmd-1.2.5-1.spec	Wed Jul 10 16:44:01 2002
***************
*** 0 ****
--- 1,72 ----
+ Summary: A program that can install and uninstall OpenAFS for Linux (command line only).
+ Name: openafs-tools-cmd
+ Version: 1.2.5
+ Release: 1
+ Copyright: IPL
+ Packager: OpenAFS
+ Group: Applications/File
+ Source: openafs-tools-cmd.tar
+ Conflicts: openafs-tools
+ Requires: openafs, openafs-kernel, openafs-client, openafs-server
+ BuildRoot: /var/tmp/%{name}-buildroot
+ 
+ %description
+ This rpm will extract and install the files needed to install and uninstall
+ OpenAFS on a Linux system. 
+ 
+ %prep
+ %setup -c
+ gunzip afs_linux.tar.gz
+ tar -xf afs_linux.tar
+ 
+ %build
+ chmod 744 unpack_cmd
+ 
+ %install
+ rm -rf $RPM_BUILD_ROOT
+ ./unpack_cmd
+ 
+ %post
+ %ifnos Linux
+   echo -e "WARNING: Operating system is not Linux.\n  openafs-tools has only been tested on Red Hat Linux, so proceed with caution."
+ %endif
+ if [ ! -e /usr/src/redhat ]; then
+   echo -e "WARNING: This operating system may not be Red Hat Linux.\nopenafs-tools has only been tested on Red Hat, so proceed with caution."
+ fi
+ %ifos Linux
+   ver=$(uname -r) 
+   verdash=${ver%%-*}
+   vermaj=${verdash%.*}
+   vermin=${verdash##*.}
+   if [ $vermaj != "2.2" -a $vermaj != "2.4" ]; then 
+     echo -e "WARNING: Kernel version is not 2.2 or 2.4.\n openafs-tools-client has only been tested on kernel versions 2.2 and 2.4, so proceed with caution."
+   fi
+ %endif
+ 
+ %preun
+ rm -f /usr/afs/tools/install/*install_output*
+ rm -rf /usr/afs/tools/install/afs
+ rm -rf /usr/afs/tools/install/vice
+ rm -rf /usr/afs/tools/install/done.txt
+ 
+ %clean
+ rm -rf $RPM_BUILD_ROOT
+ 
+ %files
+ %doc openafs-tools-cmd.README
+ /usr/afs/tools/openafs-tools-cmd.README
+ /usr/afs/tools/install/.afs_state
+ /usr/afs/tools/install/afsinit_both
+ /usr/afs/tools/install/afsinit_client
+ /usr/afs/tools/install/afsinit_server
+ /usr/afs/tools/install/afs_uninstall
+ /usr/afs/tools/install/install_afs
+ /usr/afs/tools/install/K5_README
+ /usr/afs/tools/install/check_udebug.pl
+ /usr/afs/tools/install/write_fstab.pl
+ /usr/afs/tools/install/write_pam.pl
+ %dir /usr/afs/tools/install/
+ 
+ 
+ 
+ 
Index: openafs/src/tools/install/unpack_cmd
diff -c openafs/src/tools/install/unpack_cmd:1.1.2.1 openafs/src/tools/install/unpack_cmd:1.1.2.2
*** openafs/src/tools/install/unpack_cmd:1.1.2.1	Sun Jan 20 04:05:09 2002
--- openafs/src/tools/install/unpack_cmd	Wed Jul 10 16:44:01 2002
***************
*** 26,31 ****
--- 26,32 ----
  cp -f afsinit_server $mainFileDir/
  cp -f afs_uninstall $mainFileDir/
  cp -f install_afs $mainFileDir/
+ cp -f K5_README $mainFileDir/
  cp -f check_udebug.pl $mainFileDir/
  cp -f write_fstab.pl $mainFileDir/
  cp -f write_pam.pl $mainFileDir/
Index: openafs/src/util/dirpath_nt.h
diff -c openafs/src/util/dirpath_nt.h:1.1.4.1 openafs/src/util/dirpath_nt.h:1.1.4.2
*** openafs/src/util/dirpath_nt.h:1.1.4.1	Fri Jun  7 20:20:26 2002
--- openafs/src/util/dirpath_nt.h	Wed Jul 10 15:58:50 2002
***************
*** 96,101 ****
--- 96,104 ----
  /* afs installation dir names */
  #define AFSDIR_ETC_DIR   "etc"
  #define AFSDIR_BIN_DIR   "bin"
+ #define AFSDIR_SERVER_ETC_DIR   "etc"
+ #define AFSDIR_SERVER_BIN_DIR   "bin"
+ #define AFSDIR_CLIENT_ETC_DIR   "etc"
  #define AFSDIR_CORES_DIR "cores"
  #define AFSDIR_DB_DIR    "db"
  #define AFSDIR_LOGS_DIR  "logs"
***************
*** 103,112 ****
--- 106,118 ----
  #define AFSDIR_BACKUP_DIR "backup"
  #define AFSDIR_MIGR_DIR  "local/migrate"
  #define AFSDIR_BIN_FILE_DIR  "local/migrate/bin_files"
+ #define AFSDIR_BOSCONFIG_DIR "local"
+ #define AFSDIR_BOSSERVER_DIR "bin"
  
  /* file names */ 
  #define AFSDIR_THISCELL_FILE    "ThisCell"
  #define AFSDIR_CELLSERVDB_FILE  "CellServDB"
+ #define AFSDIR_CELLALIAS_FILE   "CellAlias"
  #define AFSDIR_KEY_FILE         "KeyFile"
  #define AFSDIR_ULIST_FILE       "UserList"
  #define AFSDIR_NOAUTH_FILE      "NoAuth"
***************
*** 248,253 ****
--- 254,260 ----
        AFSDIR_SERVER_MIGRATE_DIRPATH_ID,
        AFSDIR_SERVER_MIGRATELOG_FILEPATH_ID,
        AFSDIR_SERVER_BIN_FILE_DIRPATH_ID,
+       AFSDIR_CLIENT_CELLALIAS_FILEPATH_ID,
        AFSDIR_PATHSTRING_MAX } afsdir_id_t;
  
  /* getDirPath() returns a pointer to a string from an internal array of path strings 
Index: openafs/src/util/uuid.c
diff -c openafs/src/util/uuid.c:1.7.2.1 openafs/src/util/uuid.c:1.7.2.3
*** openafs/src/util/uuid.c:1.7.2.1	Sat Oct 13 00:22:10 2001
--- openafs/src/util/uuid.c	Thu Jul 11 18:12:50 2002
***************
*** 14,20 ****
  #include <afs/param.h>
  #endif
  
! RCSID("$Header: /data/cvs/openafs/src/util/uuid.c,v 1.7.2.1 2001/10/13 04:22:10 shadow Exp $");
  
  #ifdef KERNEL
  #include "../afs/sysincludes.h"
--- 14,20 ----
  #include <afs/param.h>
  #endif
  
! RCSID("$Header: /data/cvs/openafs/src/util/uuid.c,v 1.7.2.3 2002/07/11 22:12:50 shadow Exp $");
  
  #ifdef KERNEL
  #include "../afs/sysincludes.h"
***************
*** 140,145 ****
--- 140,205 ----
      if (time1->lo > time2->lo) return (1);
      return (0);
  }
+ 
+ #if !defined(KERNEL) && !defined(UKERNEL)
+ /*
+  *    Converts a string UUID to binary representation.
+  */
+ 
+ int
+ afsUUID_from_string(const char *str, afsUUID *uuid)
+ {
+     unsigned int time_low, time_mid, time_hi_and_version;
+     unsigned int clock_seq_hi_and_reserved, clock_seq_low;
+     unsigned int node[6];
+     int i;
+ 
+     i = sscanf(str, "%08x-%04x-%04x-%02x-%02x-%02x%02x%02x%02x%02x%02x",
+                &time_low,
+                &time_mid,
+                &time_hi_and_version,
+                &clock_seq_hi_and_reserved,
+                &clock_seq_low,
+                &node[0], &node[1], &node[2], &node[3], &node[4], &node[5]);
+     if (i != 11)
+         return -1;
+     
+     uuid->time_low = time_low;
+     uuid->time_mid = time_mid;
+     uuid->time_hi_and_version = time_hi_and_version;
+     uuid->clock_seq_hi_and_reserved = clock_seq_hi_and_reserved;
+     uuid->clock_seq_low = clock_seq_low;
+ 
+     for (i = 0; i < 6; i++)
+         uuid->node[i] = node[i];
+ 
+     return 0;
+ }
+ 
+ /*
+  *    Converts a UUID from binary representation to a string representation.
+  */
+ 
+ int
+ afsUUID_to_string(const afsUUID *uuid, char *str, size_t strsz)
+ {
+     snprintf(str, strsz,
+              "%08x-%04x-%04x-%02x-%02x-%02x%02x%02x%02x%02x%02x",
+              uuid->time_low,
+              uuid->time_mid,
+              uuid->time_hi_and_version,
+              (unsigned char)uuid->clock_seq_hi_and_reserved,
+              (unsigned char)uuid->clock_seq_low,
+              (unsigned char)uuid->node[0],
+              (unsigned char)uuid->node[1],
+              (unsigned char)uuid->node[2],
+              (unsigned char)uuid->node[3],
+              (unsigned char)uuid->node[4],
+              (unsigned char)uuid->node[5]);
+ 
+     return 0;
+ }
+ #endif
  
  afs_int32 afs_uuid_create (uuid)
  afsUUID *uuid; {
Index: openafs/src/venus/Makefile.in
diff -c openafs/src/venus/Makefile.in:1.6.2.3 openafs/src/venus/Makefile.in:1.6.2.4
*** openafs/src/venus/Makefile.in:1.6.2.3	Sun Jan 20 03:27:58 2002
--- openafs/src/venus/Makefile.in	Wed Jul 10 15:57:45 2002
***************
*** 105,111 ****
  		for f in kdump.IP??; \
  			do ${INSTALL} -s $$f ${DEST}/etc/$$f || exit $$? ; \
  		done ;; \
! 	sun4x_5[789] ) \
  		${INSTALLex} -f kdump.sh.solaris7 $@; \
  		${INSTALL} -s -f $? ${DEST}/etc/kdump32;; \
  	*linux* ) \
--- 105,111 ----
  		for f in kdump.IP??; \
  			do ${INSTALL} -s $$f ${DEST}/etc/$$f || exit $$? ; \
  		done ;; \
! 	sun*_5[789] ) \
  		${INSTALLex} -f kdump.sh.solaris7 $@; \
  		${INSTALL} -s -f $? ${DEST}/etc/kdump32;; \
  	*linux* ) \
***************
*** 228,234 ****
  	case ${SYS_NAME} in \
  	sun4c_51 | sun4c_52 | sun4m_51 | sun4m_52 | sun4c_53 | sun4m_53 | sun4_53 | sun4_54 | sun4c_54 | sun4m_54 | sunx86_54) \
  		${CC} -g -o kdump kdump.o ${TOP_LIBDIR}/libcmd.a  ${TOP_LIBDIR}/util.a /usr/lib/libkvm.a -lelf ${XLIBS} ;; \
! 	sun4x_5? ) \
  		${CC} -g -o kdump kdump.o ${TOP_LIBDIR}/libcmd.a  ${TOP_LIBDIR}/util.a  ${XLIBELFA} ${XLIBKVM} ${XLIBS} ;; \
  	sgi_6? ) \
  		for f in ../libafs/STATIC.IP*/CPU_KDEFS; \
--- 228,234 ----
  	case ${SYS_NAME} in \
  	sun4c_51 | sun4c_52 | sun4m_51 | sun4m_52 | sun4c_53 | sun4m_53 | sun4_53 | sun4_54 | sun4c_54 | sun4m_54 | sunx86_54) \
  		${CC} -g -o kdump kdump.o ${TOP_LIBDIR}/libcmd.a  ${TOP_LIBDIR}/util.a /usr/lib/libkvm.a -lelf ${XLIBS} ;; \
! 	sun*_5? ) \
  		${CC} -g -o kdump kdump.o ${TOP_LIBDIR}/libcmd.a  ${TOP_LIBDIR}/util.a  ${XLIBELFA} ${XLIBKVM} ${XLIBS} ;; \
  	sgi_6? ) \
  		for f in ../libafs/STATIC.IP*/CPU_KDEFS; \
***************
*** 320,326 ****
  		for f in kdump.IP??; \
  			do ${INSTALL} -s $$f ${DESTDIR}${sbindir}/$$f || exit $$? ; \
  		done ;; \
! 	sun4x_5[789] ) \
  		${INSTALLex} -f kdump.sh.solaris7 $@; \
  		${INSTALL} -s -f $? ${DESTDIR}${sbindir}/kdump32;; \
  	*linux* ) \
--- 320,326 ----
  		for f in kdump.IP??; \
  			do ${INSTALL} -s $$f ${DESTDIR}${sbindir}/$$f || exit $$? ; \
  		done ;; \
! 	sun*_5[789] ) \
  		${INSTALLex} -f kdump.sh.solaris7 $@; \
  		${INSTALL} -s -f $? ${DESTDIR}${sbindir}/kdump32;; \
  	*linux* ) \
Index: openafs/src/venus/kdump.c
diff -c openafs/src/venus/kdump.c:1.14.2.4 openafs/src/venus/kdump.c:1.14.2.5
*** openafs/src/venus/kdump.c:1.14.2.4	Wed Dec 26 15:27:56 2001
--- openafs/src/venus/kdump.c	Wed Jul 31 18:19:52 2002
***************
*** 10,16 ****
  #include <afsconfig.h>
  #include <afs/param.h>
  
! RCSID("$Header: /data/cvs/openafs/src/venus/kdump.c,v 1.14.2.4 2001/12/26 20:27:56 shadow Exp $");
  
  #include <stdio.h>
  #include <stdlib.h>	/* for malloc() */
--- 10,16 ----
  #include <afsconfig.h>
  #include <afs/param.h>
  
! RCSID("$Header: /data/cvs/openafs/src/venus/kdump.c,v 1.14.2.5 2002/07/31 22:19:52 shadow Exp $");
  
  #include <stdio.h>
  #include <stdlib.h>	/* for malloc() */
***************
*** 3931,3936 ****
--- 3931,3937 ----
      printf("\t%10d afs_GetCell\n",         cmp->callInfo.C_afs_GetCell);
      printf("\t%10d afs_GetCellByIndex\n",         cmp->callInfo.C_afs_GetCellByIndex);
      printf("\t%10d afs_GetCellByName\n",         cmp->callInfo.C_afs_GetCellByName);
+     printf("\t%10d afs_GetRealCellByIndex\n",         cmp->callInfo.C_afs_GetRealCellByIndex);
      printf("\t%10d afs_NewCell\n",         cmp->callInfo.C_afs_NewCell);
      printf("\t%10d CheckVLDB\n",         cmp->callInfo.C_CheckVLDB);
      printf("\t%10d afs_GetVolume\n",         cmp->callInfo.C_afs_GetVolume);
Index: openafs/src/vol/fssync.c
diff -c openafs/src/vol/fssync.c:1.5 openafs/src/vol/fssync.c:1.5.2.1
*** openafs/src/vol/fssync.c:1.5	Tue Aug  7 20:04:23 2001
--- openafs/src/vol/fssync.c	Thu Aug  1 23:11:14 2002
***************
*** 38,44 ****
  #include <afsconfig.h>
  #include <afs/param.h>
  
! RCSID("$Header: /data/cvs/openafs/src/vol/fssync.c,v 1.5 2001/08/08 00:04:23 shadow Exp $");
  
  #include <sys/types.h>
  #include <stdio.h>
--- 38,44 ----
  #include <afsconfig.h>
  #include <afs/param.h>
  
! RCSID("$Header: /data/cvs/openafs/src/vol/fssync.c,v 1.5.2.1 2002/08/02 03:11:14 shadow Exp $");
  
  #include <sys/types.h>
  #include <stdio.h>
***************
*** 317,323 ****
      int fd;
  {
      byte rc = FSYNC_OK;
!     int n, i;
      Error error;
      struct command command;
      int leaveonline;
--- 317,323 ----
      int fd;
  {
      byte rc = FSYNC_OK;
!     int n, i, ack = 1;
      Error error;
      struct command command;
      int leaveonline;
***************
*** 503,508 ****
--- 503,514 ----
  		vp->specialStatus = VMOVED;
  		VPutVolume_r(vp);
  	    }
+ #ifdef AFS_NT40_ENV
+ 	    send(fd, &rc, 1, 0);
+ #else
+ 	    write(fd, &rc, 1);
+ #endif
+ 	    ack = 0;
  	    if (V_BreakVolumeCallbacks) {
  		Log("fssync: volume %u moved to %x; breaking all call backs\n",
  		    command.volume, command.reason);
***************
*** 515,520 ****
--- 521,532 ----
  	    break;
  	case FSYNC_RESTOREVOLUME:
  	    /* if the volume is being restored, break all callbacks on it*/
+ #ifdef AFS_NT40_ENV
+ 	    send(fd, &rc, 1, 0);
+ #else
+ 	    write(fd, &rc, 1);
+ #endif
+ 	    ack = 0;
  	    if (V_BreakVolumeCallbacks) {
  		VOL_UNLOCK
  		VATTACH_UNLOCK
***************
*** 529,539 ****
      }
      VOL_UNLOCK
      VATTACH_UNLOCK
  #ifdef AFS_NT40_ENV
!     send(fd, &rc, 1, 0);
  #else
!     write(fd, &rc, 1);
  #endif
  }
  
  static void FSYNC_Drop(fd)
--- 541,553 ----
      }
      VOL_UNLOCK
      VATTACH_UNLOCK
+     if (ack) {
  #ifdef AFS_NT40_ENV
! 	send(fd, &rc, 1, 0);
  #else
! 	write(fd, &rc, 1);
  #endif
+     }
  }
  
  static void FSYNC_Drop(fd)
Index: openafs/src/vol/partition.c
diff -c openafs/src/vol/partition.c:1.11.4.4 openafs/src/vol/partition.c:1.11.4.5
*** openafs/src/vol/partition.c:1.11.4.4	Sun Apr 21 01:04:52 2002
--- openafs/src/vol/partition.c	Wed Jul 10 16:41:45 2002
***************
*** 18,24 ****
  #include <afsconfig.h>
  #include <afs/param.h>
  
! RCSID("$Header: /data/cvs/openafs/src/vol/partition.c,v 1.11.4.4 2002/04/21 05:04:52 zacheiss Exp $");
  
  #include <ctype.h>
  #ifdef AFS_NT40_ENV
--- 18,24 ----
  #include <afsconfig.h>
  #include <afs/param.h>
  
! RCSID("$Header: /data/cvs/openafs/src/vol/partition.c,v 1.11.4.5 2002/07/10 20:41:45 shadow Exp $");
  
  #include <ctype.h>
  #ifdef AFS_NT40_ENV
***************
*** 194,202 ****
      else
  	DiskPartitionList = dp;
      dp->next = 0;
!     strcpy(dp->name, path);
  #if defined(AFS_NAMEI_ENV) && !defined(AFS_NT40_ENV)
      /* Create a lockfile for the partition, of the form /vicepa/Lock/vicepa */
      strcpy(dp->devName, path);
      strcat(dp->devName, "/");
      strcat(dp->devName, "Lock");
--- 194,204 ----
      else
  	DiskPartitionList = dp;
      dp->next = 0;
!     dp->name = (char *)malloc(strlen(path) + 1);
!     strncpy(dp->name, path, strlen(path) + 1);
  #if defined(AFS_NAMEI_ENV) && !defined(AFS_NT40_ENV)
      /* Create a lockfile for the partition, of the form /vicepa/Lock/vicepa */
+     dp->devName = (char *)malloc(2 * strlen(path) + 6);
      strcpy(dp->devName, path);
      strcat(dp->devName, "/");
      strcat(dp->devName, "Lock");
***************
*** 205,211 ****
      close(open(dp->devName, O_RDWR | O_CREAT, 0600));
      dp->device = volutil_GetPartitionID(path);
  #else
!     strcpy(dp->devName, devname);
      dp->device = dev;
  #endif
      dp->lock_fd = -1;
--- 207,214 ----
      close(open(dp->devName, O_RDWR | O_CREAT, 0600));
      dp->device = volutil_GetPartitionID(path);
  #else
!     dp->devName = (char *)malloc(strlen(devname) + 1);
!     strncpy(dp->devName, devname, strlen(devname) + 1);
      dp->device = dev;
  #endif
      dp->lock_fd = -1;
Index: openafs/src/vol/partition.h
diff -c openafs/src/vol/partition.h:1.3.4.1 openafs/src/vol/partition.h:1.3.4.2
*** openafs/src/vol/partition.h:1.3.4.1	Sat Oct 13 00:22:11 2001
--- openafs/src/vol/partition.h	Wed Jul 10 16:41:45 2002
***************
*** 50,57 ****
   */
  struct DiskPartition {
      struct DiskPartition *next;
!     char	name[32];	/* Mounted partition name */
!     char	devName[32];	/* Device mounted on */
      Device	device;		/* device number */
      int		lock_fd;	/* File descriptor of this partition if locked; otherwise -1;
      				   Not used by the file server */
--- 50,57 ----
   */
  struct DiskPartition {
      struct DiskPartition *next;
!     char	*name;		/* Mounted partition name */
!     char	*devName;	/* Device mounted on */
      Device	device;		/* device number */
      int		lock_fd;	/* File descriptor of this partition if locked; otherwise -1;
      				   Not used by the file server */
Index: openafs/src/volser/vos.c
diff -c openafs/src/volser/vos.c:1.8.2.3 openafs/src/volser/vos.c:1.8.2.4
*** openafs/src/volser/vos.c:1.8.2.3	Wed Dec 26 15:12:17 2001
--- openafs/src/volser/vos.c	Wed Jul 10 16:00:01 2002
***************
*** 10,16 ****
  #include <afsconfig.h>
  #include <afs/param.h>
  
! RCSID("$Header: /data/cvs/openafs/src/volser/vos.c,v 1.8.2.3 2001/12/26 20:12:17 shadow Exp $");
  
  #include <sys/types.h>
  #ifdef AFS_NT40_ENV
--- 10,16 ----
  #include <afsconfig.h>
  #include <afs/param.h>
  
! RCSID("$Header: /data/cvs/openafs/src/volser/vos.c,v 1.8.2.4 2002/07/10 20:00:01 shadow Exp $");
  
  #include <sys/types.h>
  #ifdef AFS_NT40_ENV
***************
*** 62,67 ****
--- 62,69 ----
  };
  
  
+ struct hostent *hostutil_GetHostByName(register char *ahost);
+ 
  #define COMMONPARMS     cmd_Seek(ts, 12);\
  cmd_AddParm(ts, "-cell", CMD_SINGLE, CMD_OPTIONAL, "cell name");\
  cmd_AddParm(ts, "-noauth", CMD_FLAG, CMD_OPTIONAL, "don't authenticate");\
***************
*** 3792,3825 ****
      }
      return 0;
  }
- 
- static ListAddrs(as)
- register struct cmd_syndesc *as;
  
  {
    afs_int32 vcode;
    afs_int32 i, j;
    struct VLCallBack    unused;
!   afs_int32                nentries, *addrp;
!   bulkaddrs            addrs, m_addrs;
    ListAddrByAttributes m_attrs;
!   afsUUID              m_uuid;
!   afs_int32                m_unique, m_nentries, *m_addrp;
!   afs_int32                base, index;
! 
!   /* Get the list of non multihomed fileservers */
!   addrs.bulkaddrs_val = 0;
!   addrs.bulkaddrs_len = 0;
!   vcode = ubik_Call_New(VL_GetAddrs, cstruct, 0,
! 			0, 0, &unused, &nentries, &addrs);
!   if (vcode) {
!      fprintf(STDERR,"vos: could not list the server addresses\n");
!      PrintError("",vcode);
!      return( vcode );
    }
  
    /* print out the list of all the server */
!   addrp = (afs_int32 *)addrs.bulkaddrs_val;
    for (i=0; i<nentries; i++, addrp++) {
       /* If it is a multihomed address, then we will need to 
        * get the addresses for this multihomed server from
--- 3794,3820 ----
      }
      return 0;
  }
  
+ static void
+ print_addrs(const bulkaddrs *addrs, const afsUUID *m_uuid, int nentries, int print, int noresolve)
  {
    afs_int32 vcode;
    afs_int32 i, j;
    struct VLCallBack    unused;
!   afs_int32            *addrp;
!   bulkaddrs            m_addrs;
    ListAddrByAttributes m_attrs;
!   afs_int32            m_unique, m_nentries, *m_addrp;
!   afs_int32            base, index;
!   char buf[1024];
! 
!   if (print) {
!       afsUUID_to_string(m_uuid, buf, sizeof(buf));
!       printf("UUID: %s\n", buf);
    }
  
    /* print out the list of all the server */
!   addrp = (afs_int32 *)addrs->bulkaddrs_val;
    for (i=0; i<nentries; i++, addrp++) {
       /* If it is a multihomed address, then we will need to 
        * get the addresses for this multihomed server from
***************
*** 3848,3854 ****
  	   m_addrp = (afs_int32 *)m_addrs.bulkaddrs_val;
  	   for (j=0; j<m_nentries; j++, m_addrp++) {
  	      *m_addrp = htonl(*m_addrp);	
! 	      printf("%s ", hostutil_GetNameByINet(*m_addrp));
  	   }
  	   if (j==0) {
  	      printf("<unknown>\n");
--- 3843,3854 ----
  	   m_addrp = (afs_int32 *)m_addrs.bulkaddrs_val;
  	   for (j=0; j<m_nentries; j++, m_addrp++) {
  	      *m_addrp = htonl(*m_addrp);	
! 	      if (noresolve) {
! 		  char hoststr[16];
! 		  printf("%s ", afs_inet_ntoa_r(*m_addrp,hoststr));
! 	      } else {
! 		  printf("%s ", hostutil_GetNameByINet(*m_addrp));
! 	      }
  	   }
  	   if (j==0) {
  	      printf("<unknown>\n");
***************
*** 3863,3874 ****
       /* Otherwise, it is a non-multihomed entry and contains
        * the IP address of the server - print it.
        */
!      printf ("%s\n", hostutil_GetNameByINet(htonl(*addrp)));
    }
  
!   if (addrs.bulkaddrs_val) {
!      free (addrs.bulkaddrs_val);
    }
    return 0;
  }
  
--- 3863,3954 ----
       /* Otherwise, it is a non-multihomed entry and contains
        * the IP address of the server - print it.
        */
!      *addrp = htonl(*addrp);	
!      if (noresolve) {
! 	 char hoststr[16];
! 	 printf("%s\n", afs_inet_ntoa_r(*addrp,hoststr));
!      } else {
! 	 printf("%s\n", hostutil_GetNameByINet(*addrp));
!      }
!   }
! 
!   if (print) {
!       printf("\n");
!   }
!   return;
! }
! 
! static ListAddrs(as)
! register struct cmd_syndesc *as;
! {
!   afs_int32 vcode;
!   afs_int32 i, j, noresolve=0, printuuid=0;
!   struct VLCallBack    unused;
!   afs_int32                nentries, *addrp;
!   bulkaddrs            addrs, m_addrs;
!   ListAddrByAttributes m_attrs;
!   afsUUID              m_uuid, askuuid;
!   afs_int32                m_unique, m_nentries, *m_addrp;
!   afs_int32                base, index;
! 
!   memset(&m_attrs, 0, sizeof(struct ListAddrByAttributes));
!   m_attrs.Mask = VLADDR_INDEX;
! 
!   memset(&m_addrs, 0, sizeof(bulkaddrs));
!   memset(&askuuid, 0, sizeof(afsUUID));
!   if (as->parms[0].items) {
!       /* -uuid */
!       afsUUID_from_string(as->parms[0].items->data, &askuuid);
!       m_attrs.Mask = VLADDR_UUID;
!       m_attrs.uuid = askuuid;
!   }
!   if (as->parms[1].items) {
!       /* -host */
!       struct hostent       *he; 
!       afs_int32 saddr;
!       he = hostutil_GetHostByName((char*)as->parms[1].items->data);
!       if (he == (struct hostent *)0) {
! 	  fprintf(stderr,
! 		  "Can't get host info for '%s'\n",
! 		  as->parms[1].items->data);
! 	  exit(-1);
!       }
!       memcpy(&saddr, he->h_addr, 4);
!       m_attrs.Mask = VLADDR_IPADDR;
!       m_attrs.ipaddr = ntohl(saddr);
    }
+   if (as->parms[2].items) {
+       noresolve=1;
+   }
+   if (as->parms[3].items) {
+       printuuid=1;
+   }
  
!   m_nentries            = 0;
!   m_addrs.bulkaddrs_val = 0;
!   m_addrs.bulkaddrs_len = 0;
!   i=1;
!   while (1) {
!       m_attrs.index = i;
! 
!       vcode = ubik_Call_New(VL_GetAddrsU, cstruct, 0, &m_attrs, &m_uuid, 
! 			&m_unique, &m_nentries, &m_addrs);
!       if(vcode == VL_NOENT)
! 	  break;
! 
!       if (vcode) {
! 	  fprintf(STDERR,"vos: could not list the server addresses\n");
! 	  PrintError("",vcode);
! 	  return( vcode );
!       }
! 
!       print_addrs(&m_addrs, &m_uuid, m_nentries, printuuid, noresolve);
!       i++;
! 
!       if ((as->parms[1].items)||(as->parms[0].items))
! 	  break;
    }
+     
    return 0;
  }
  
***************
*** 4179,4184 ****
--- 4259,4268 ----
      COMMONPARMS;
  
      ts = cmd_CreateSyntax("listaddrs", ListAddrs, 0, "list the IP address of all file servers registered in the VLDB");
+     cmd_AddParm(ts, "-uuid", CMD_SINGLE, CMD_OPTIONAL, "uuid of server");
+     cmd_AddParm(ts, "-host", CMD_SINGLE, CMD_OPTIONAL, "address of host");
+     cmd_AddParm(ts, "-noresolve", CMD_FLAG, CMD_OPTIONAL, "don't resolve addresses");
+     cmd_AddParm(ts, "-printuuid", CMD_FLAG, CMD_OPTIONAL, "print uuid of hosts");
      COMMONPARMS;
  
      code = cmd_Dispatch(argc, argv);
Index: openafs/src/xstat/xstat_cm_test.c
diff -c openafs/src/xstat/xstat_cm_test.c:1.5 openafs/src/xstat/xstat_cm_test.c:1.5.2.1
*** openafs/src/xstat/xstat_cm_test.c:1.5	Tue Aug  7 20:04:27 2001
--- openafs/src/xstat/xstat_cm_test.c	Wed Jul 31 18:19:53 2002
***************
*** 16,22 ****
  #include <afsconfig.h>
  #include <afs/param.h>
  
! RCSID("$Header: /data/cvs/openafs/src/xstat/xstat_cm_test.c,v 1.5 2001/08/08 00:04:27 shadow Exp $");
  
  #include "xstat_cm.h"		/*Interface for xstat_cm module*/
  #include <cmd.h>		/*Command line interpreter*/
--- 16,22 ----
  #include <afsconfig.h>
  #include <afs/param.h>
  
! RCSID("$Header: /data/cvs/openafs/src/xstat/xstat_cm_test.c,v 1.5.2.1 2002/07/31 22:19:53 shadow Exp $");
  
  #include "xstat_cm.h"		/*Interface for xstat_cm module*/
  #include <cmd.h>		/*Command line interpreter*/
***************
*** 451,456 ****
--- 451,457 ----
      printf("\t%10d afs_GetCell\n",         cmp->callInfo.C_afs_GetCell);
      printf("\t%10d afs_GetCellByIndex\n",         cmp->callInfo.C_afs_GetCellByIndex);
      printf("\t%10d afs_GetCellByName\n",         cmp->callInfo.C_afs_GetCellByName);
+     printf("\t%10d afs_GetRealCellByIndex\n",         cmp->callInfo.C_afs_GetRealCellByIndex);
      printf("\t%10d afs_NewCell\n",         cmp->callInfo.C_afs_NewCell);
      printf("\t%10d CheckVLDB\n",         cmp->callInfo.C_CheckVLDB);
      printf("\t%10d afs_GetVolume\n",         cmp->callInfo.C_afs_GetVolume);
