Index: openafs/src/WINNT/afsd/afsd_init.c
diff -c openafs/src/WINNT/afsd/afsd_init.c:1.40.2.37 openafs/src/WINNT/afsd/afsd_init.c:1.40.2.39
*** openafs/src/WINNT/afsd/afsd_init.c:1.40.2.37	Sun Oct  8 21:50:25 2006
--- openafs/src/WINNT/afsd/afsd_init.c	Fri Jan  5 13:55:20 2007
***************
*** 38,43 ****
--- 38,44 ----
  extern int RXSTATS_ExecuteRequest(struct rx_call *z_call);
  
  extern afs_int32 cryptall;
+ extern int cm_deleteReadOnly;
  
  osi_log_t *afsd_logp;
  
***************
*** 560,565 ****
--- 561,567 ----
      char buf[1024];
      HKEY parmKey;
      DWORD dummyLen;
+     DWORD dwValue;
      DWORD regType;
      long code;
      /*int freelanceEnabled;*/
***************
*** 1022,1027 ****
--- 1024,1037 ----
                             (BYTE *) &HardDeadtimeout, &dummyLen);
      afsi_log("HardDeadTimeout is %d", HardDeadtimeout);
  
+     dummyLen = sizeof(DWORD);
+     code = RegQueryValueEx(parmKey, "DeleteReadOnly", NULL, NULL,
+ 	                  (BYTE *) &dwValue, &dummyLen);
+     if (code == ERROR_SUCCESS) {
+         cm_deleteReadOnly = (unsigned short) dwValue;
+     }
+     afsi_log("CM DeleteReadOnly is %u", cm_deleteReadOnly);
+ 
      RegCloseKey (parmKey);
  
      /* Call lanahelper to get Netbios name, lan adapter number and gateway flag */
Index: openafs/src/WINNT/afsd/afslogon.c
diff -c openafs/src/WINNT/afsd/afslogon.c:1.24.2.24 openafs/src/WINNT/afsd/afslogon.c:1.24.2.27
*** openafs/src/WINNT/afsd/afslogon.c:1.24.2.24	Thu Aug  3 17:50:05 2006
--- openafs/src/WINNT/afsd/afslogon.c	Fri Jan  5 13:55:20 2007
***************
*** 74,93 ****
  
  BOOLEAN APIENTRY DllEntryPoint(HANDLE dll, DWORD reason, PVOID reserved)
  {
      hDLL = dll;
      switch (reason) {
      case DLL_PROCESS_ATTACH:
          /* Initialization Mutex */
! 	if (!bInit) {
! 	    hInitMutex = CreateMutex(NULL, FALSE, NULL);
! 	    SetEnvironmentVariable(DO_NOT_REGISTER_VARNAME, "");
! 	}
          break;
  
      case DLL_PROCESS_DETACH:
  	/* do nothing on unload because we might 
  	 * be reloaded.
  	 */
  	CloseHandle(hInitMutex);
  	hInitMutex = NULL;
  	bInit = FALSE;
--- 74,95 ----
  
  BOOLEAN APIENTRY DllEntryPoint(HANDLE dll, DWORD reason, PVOID reserved)
  {
+     WSADATA wsaData;
      hDLL = dll;
+     
      switch (reason) {
      case DLL_PROCESS_ATTACH:
          /* Initialization Mutex */
! 	hInitMutex = CreateMutex(NULL, FALSE, NULL);
! 
! 	WSAStartup( MAKEWORD(2,2), &wsaData );
          break;
  
      case DLL_PROCESS_DETACH:
  	/* do nothing on unload because we might 
  	 * be reloaded.
  	 */
+         WSACleanup();
  	CloseHandle(hInitMutex);
  	hInitMutex = NULL;
  	bInit = FALSE;
***************
*** 839,845 ****
--- 841,849 ----
  	    if (ISLOGONINTEGRATED(opt.LogonOption))
  	    {			
  		if ( KFW_is_available() ) {
+ 		    SetEnvironmentVariable(DO_NOT_REGISTER_VARNAME, "");
  		    code = KFW_AFS_get_cred(uname, cell, password, 0, opt.smbName, &reason);
+ 		    SetEnvironmentVariable(DO_NOT_REGISTER_VARNAME, NULL);
  		    DebugEvent("KFW_AFS_get_cred  uname=[%s] smbname=[%s] cell=[%s] code=[%d]",
  				uname,opt.smbName,cell,code);
  		    if (code == 0 && opt.theseCells) { 
***************
*** 864,870 ****
--- 868,876 ----
  
  			    p = opt.theseCells;
  			    while ( *p ) {
+ 				SetEnvironmentVariable(DO_NOT_REGISTER_VARNAME, "");
  				code2 = KFW_AFS_get_cred(principal, p, 0, 0, opt.smbName, &reason);
+ 				SetEnvironmentVariable(DO_NOT_REGISTER_VARNAME, NULL);
  				DebugEvent("KFW_AFS_get_cred  uname=[%s] smbname=[%s] cell=[%s] code=[%d]",
  					    principal,opt.smbName,p,code2);
  				p += strlen(p) + 1;
Index: openafs/src/WINNT/afsd/cm_access.c
diff -c openafs/src/WINNT/afsd/cm_access.c:1.4.2.6 openafs/src/WINNT/afsd/cm_access.c:1.4.2.8
*** openafs/src/WINNT/afsd/cm_access.c:1.4.2.6	Fri Oct  6 12:53:23 2006
--- openafs/src/WINNT/afsd/cm_access.c	Fri Jan  5 12:21:30 2007
***************
*** 24,29 ****
--- 24,31 ----
  
  #include "afsd.h"
  
+ int cm_deleteReadOnly = 0;
+ 
  /* called with scp write-locked, check to see if we have the ACL info we need
   * and can get it w/o blocking for any locks.
   *
***************
*** 93,100 ****
      /* check mode bits */
      if (!(scp->unixModeBits & 0400))
          *outRightsp &= ~PRSFS_READ;
!     if (!(scp->unixModeBits & 0200))
          *outRightsp &= ~PRSFS_WRITE;
  
      code = 1;
      /* fall through */
--- 95,108 ----
      /* check mode bits */
      if (!(scp->unixModeBits & 0400))
          *outRightsp &= ~PRSFS_READ;
!     if (!(scp->unixModeBits & 0200) && !(rights == (PRSFS_WRITE | PRSFS_LOCK)))
          *outRightsp &= ~PRSFS_WRITE;
+     if (!(scp->unixModeBits & 0200) && !cm_deleteReadOnly)
+         *outRightsp &= ~PRSFS_DELETE;
+ 
+     /* if the user can obtain a write-lock, read-locks are implied */
+     if (*outRightsp & PRSFS_WRITE)
+ 	*outRightsp |= PRSFS_LOCK;
  
      code = 1;
      /* fall through */
Index: openafs/src/WINNT/afsd/cm_conn.c
diff -c openafs/src/WINNT/afsd/cm_conn.c:1.25.2.23 openafs/src/WINNT/afsd/cm_conn.c:1.25.2.24
*** openafs/src/WINNT/afsd/cm_conn.c:1.25.2.23	Mon Oct  2 22:28:43 2006
--- openafs/src/WINNT/afsd/cm_conn.c	Tue Nov 28 04:06:34 2006
***************
*** 465,472 ****
          if ( timeLeft > 2 )
              retry = 1;
      }
!     else if (errorCode == RXKADEXPIRED || 
!              errorCode == RXKADBADTICKET) {
          if (!dead_session) {
              lock_ObtainMutex(&userp->mx);
              ucellp = cm_GetUCell(userp, serverp->cellp);
--- 465,471 ----
          if ( timeLeft > 2 )
              retry = 1;
      }
!     else if (errorCode == RXKADEXPIRED || errorCode == RXKADBADTICKET) {
          if (!dead_session) {
              lock_ObtainMutex(&userp->mx);
              ucellp = cm_GetUCell(userp, serverp->cellp);
***************
*** 480,485 ****
--- 479,488 ----
              if ( timeLeft > 2 )
                  retry = 1;
          }
+     } else if (errorCode == VICECONNBAD || errorCode == VICETOKENDEAD) {
+ 	cm_ForceNewConnections(serverp);
+         if ( timeLeft > 2 )
+             retry = 1;
      } else {
          if (errorCode) {
              char * s = "unknown error";
Index: openafs/src/WINNT/afsd/cm_ioctl.c
diff -c openafs/src/WINNT/afsd/cm_ioctl.c:1.33.2.29 openafs/src/WINNT/afsd/cm_ioctl.c:1.33.2.30
*** openafs/src/WINNT/afsd/cm_ioctl.c:1.33.2.29	Sun Oct  8 16:35:53 2006
--- openafs/src/WINNT/afsd/cm_ioctl.c	Mon Oct 16 20:30:23 2006
***************
*** 263,268 ****
--- 263,269 ----
  
              code = cm_NameI(substRootp, p, CM_FLAG_CASEFOLD | CM_FLAG_FOLLOW,
                               userp, NULL, reqp, scpp);
+ 	    cm_ReleaseSCache(substRootp);
              if (code) {
  		osi_Log1(afsd_logp,"cm_ParseIoctlPath [2] code 0x%x", code);
                  return code;
***************
*** 391,397 ****
      long code;
      char tbuffer[1024];
      char *tp, *jp;
!     cm_scache_t *substRootp;
  
      StringCbCopyA(tbuffer, sizeof(tbuffer), ioctlp->inDatap);
      tp = strrchr(tbuffer, '\\');
--- 392,398 ----
      long code;
      char tbuffer[1024];
      char *tp, *jp;
!     cm_scache_t *substRootp = NULL;
  
      StringCbCopyA(tbuffer, sizeof(tbuffer), ioctlp->inDatap);
      tp = strrchr(tbuffer, '\\');
***************
*** 446,451 ****
--- 447,453 ----
  
              code = cm_NameI(substRootp, p, CM_FLAG_CASEFOLD | CM_FLAG_FOLLOW,
                               userp, NULL, reqp, scpp);
+ 	    cm_ReleaseSCache(substRootp);
              if (code) return code;
          } else {
              /* otherwise, treat the name as a cellname mounted off the afs root.
***************
*** 471,476 ****
--- 473,479 ----
  
              code = cm_NameI(substRootp, p, CM_FLAG_CASEFOLD | CM_FLAG_FOLLOW,
                              userp, NULL, reqp, scpp);
+ 	    cm_ReleaseSCache(substRootp);
              if (code) return code;
          }
      } else {
***************
*** 481,486 ****
--- 484,490 ----
  
          code = cm_NameI(substRootp, tbuffer, CM_FLAG_CASEFOLD | CM_FLAG_FOLLOW,
                          userp, NULL, reqp, scpp);
+ 	cm_ReleaseSCache(substRootp);
          if (code) return code;
      }
  
***************
*** 1656,1661 ****
--- 1660,1666 ----
          osi_Log0(afsd_logp,"IoctlCreateMountPoint within Freelance root dir");
          code = cm_FreelanceAddMount(leaf, fullCell, volume, 
                                      *ioctlp->inDatap == '%', NULL);
+ 	cm_ReleaseSCache(dscp);
          return code;
      }
  #endif
***************
*** 1714,1719 ****
--- 1719,1725 ----
          }
          osi_Log0(afsd_logp,"IoctlCreateSymlink within Freelance root dir");
          code = cm_FreelanceAddSymlink(leaf, cp, NULL);
+ 	cm_ReleaseSCache(dscp);
          return code;
      }
  #endif
***************
*** 1847,1852 ****
--- 1853,1859 ----
           * the freelance code to do the add. */
          osi_Log0(afsd_logp,"IoctlDeletelink from Freelance root dir");
          code = cm_FreelanceRemoveSymlink(cp);
+ 	cm_ReleaseSCache(dscp);
          return code;
      }
  #endif
Index: openafs/src/WINNT/afsd/cm_vnodeops.c
diff -c openafs/src/WINNT/afsd/cm_vnodeops.c:1.19.2.43 openafs/src/WINNT/afsd/cm_vnodeops.c:1.19.2.45
*** openafs/src/WINNT/afsd/cm_vnodeops.c:1.19.2.43	Wed Oct  4 01:30:45 2006
--- openafs/src/WINNT/afsd/cm_vnodeops.c	Mon Jan 15 14:54:46 2007
***************
*** 186,192 ****
      int vnode = ntohl(dep->fid.vnode);
      char *lastDot;
      int validExtension = 0;
!     char tc, *temp, *name;
  
      /* Unparse the file's vnode number to get a "uniquifier" */
      do {
--- 186,193 ----
      int vnode = ntohl(dep->fid.vnode);
      char *lastDot;
      int validExtension = 0;
!     char tc, *temp;
!     const char *name;
  
      /* Unparse the file's vnode number to get a "uniquifier" */
      do {
***************
*** 258,265 ****
      long code;
  
      rights = 0;
!     if (openMode != 1) rights |= PRSFS_READ;
!     if (openMode == 1 || openMode == 2 || trunc) rights |= PRSFS_WRITE;
          
      lock_ObtainMutex(&scp->mx);
  
--- 259,268 ----
      long code;
  
      rights = 0;
!     if (openMode != 1) 
! 	rights |= PRSFS_READ;
!     if (openMode == 1 || openMode == 2 || trunc) 
! 	rights |= PRSFS_WRITE;
          
      lock_ObtainMutex(&scp->mx);
  
***************
*** 344,350 ****
      rights = 0;
  
      if (desiredAccess & AFS_ACCESS_READ)
!         rights |= PRSFS_READ;
  
      if ((desiredAccess & AFS_ACCESS_WRITE)
           || createDisp == 4)
--- 347,353 ----
      rights = 0;
  
      if (desiredAccess & AFS_ACCESS_READ)
!         rights |= (scp->fileType == CM_SCACHETYPE_DIRECTORY ? PRSFS_LOOKUP : PRSFS_READ);
  
      if ((desiredAccess & AFS_ACCESS_WRITE)
           || createDisp == 4)
Index: openafs/src/WINNT/afsd/smb.c
diff -c openafs/src/WINNT/afsd/smb.c:1.55.2.62 openafs/src/WINNT/afsd/smb.c:1.55.2.63
*** openafs/src/WINNT/afsd/smb.c:1.55.2.62	Thu Aug  3 19:29:43 2006
--- openafs/src/WINNT/afsd/smb.c	Sat Nov 11 02:15:25 2006
***************
*** 5124,5129 ****
--- 5124,5130 ----
      char *maskp;		/* pointer to star pattern of old file name */
      int flags;		    /* tilde, casefold, etc */
      char *newNamep;		/* ptr to the new file's name */
+     int any;
  } smb_renameRock_t;
  
  int smb_RenameProc(cm_scache_t *dscp, cm_dirEntry_t *dep, void *vrockp, osi_hyper_t *offp)
***************
*** 5132,5138 ****
      smb_renameRock_t *rockp;
      int caseFold;
      int match;
!     char shortName[13];
  
      rockp = (smb_renameRock_t *) vrockp;
  
--- 5133,5139 ----
      smb_renameRock_t *rockp;
      int caseFold;
      int match;
!     char shortName[13]="";
  
      rockp = (smb_renameRock_t *) vrockp;
  
***************
*** 5148,5163 ****
          match = smb_V3MatchMask(shortName, rockp->maskp, caseFold);
      }
      if (match) {
!         code = cm_Rename(rockp->odscp, dep->name,
                           rockp->ndscp, rockp->newNamep, rockp->userp,
                           rockp->reqp);	
          /* if the call worked, stop doing the search now, since we
           * really only want to rename one file.
           */
          if (code == 0) 
              code = CM_ERROR_STOPNOW;
      }       
!     else code = 0;
  
      return code;
  }
--- 5149,5168 ----
          match = smb_V3MatchMask(shortName, rockp->maskp, caseFold);
      }
      if (match) {
! 	rockp->any = 1;
! 
! 	code = cm_Rename(rockp->odscp, dep->name,
                           rockp->ndscp, rockp->newNamep, rockp->userp,
                           rockp->reqp);	
          /* if the call worked, stop doing the search now, since we
           * really only want to rename one file.
           */
+ 	osi_Log1(smb_logp, "cm_Rename returns %ld", code);
          if (code == 0) 
              code = CM_ERROR_STOPNOW;
      }       
!     else 
! 	code = 0;
  
      return code;
  }
***************
*** 5262,5267 ****
--- 5267,5273 ----
      rock.maskp = oldLastNamep;
      rock.flags = ((strchr(oldLastNamep, '~') != NULL) ? SMB_MASKFLAG_TILDE : 0);
      rock.newNamep = newLastNamep;
+     rock.any = 0;
  
      /* Check if the file already exists; if so return error */
      code = cm_Lookup(newDscp,newLastNamep,CM_FLAG_CHECKPATH,userp,&req,&tmpscp);
***************
*** 5305,5310 ****
--- 5311,5322 ----
      thyper.HighPart = 0;
  
      code = cm_ApplyDir(oldDscp, smb_RenameProc, &rock, &thyper, userp, &req, NULL);
+     if (code == 0 && !rock.any) {
+ 	thyper.LowPart = 0;
+ 	thyper.HighPart = 0;
+         rock.flags |= SMB_MASKFLAG_CASEFOLD;
+ 	code = cm_ApplyDir(oldDscp, smb_RenameProc, &rock, &thyper, userp, &req, NULL);
+     }
      osi_Log1(smb_logp, "smb_RenameProc returns %ld", code);
  
      if (code == CM_ERROR_STOPNOW)
***************
*** 5500,5505 ****
--- 5512,5518 ----
      char *oldPathp;
      char *newPathp;
      char *tp;
+     long code;
  
      tp = smb_GetSMBData(inp, NULL);
      oldPathp = smb_ParseASCIIBlock(tp, &tp);
***************
*** 5510,5519 ****
          OemToChar(newPathp,newPathp);
  
      osi_Log2(smb_logp, "smb rename [%s] to [%s]",
!               osi_LogSaveString(smb_logp, oldPathp),
!               osi_LogSaveString(smb_logp, newPathp));
  
!     return smb_Rename(vcp,inp,oldPathp,newPathp,0);
  }
  
  
--- 5523,5535 ----
          OemToChar(newPathp,newPathp);
  
      osi_Log2(smb_logp, "smb rename [%s] to [%s]",
!              osi_LogSaveString(smb_logp, oldPathp),
!              osi_LogSaveString(smb_logp, newPathp));
  
!     code = smb_Rename(vcp,inp,oldPathp,newPathp,0);
! 
!     osi_Log1(smb_logp, "smb rename returns 0x%x", code);
!     return code;
  }
  
  
***************
*** 5633,5638 ****
--- 5649,5655 ----
      rock.userp = userp;
      rock.reqp = &req;
      rock.dscp = dscp;
+ 
      /* First do a case sensitive match, and if that fails, do a case insensitive match */
      code = cm_ApplyDir(dscp, smb_RmdirProc, &rock, &thyper, userp, &req, NULL);
      if (code == 0 && !rock.any) {
Index: openafs/src/WINNT/client_config/tab_advanced.cpp
diff -c openafs/src/WINNT/client_config/tab_advanced.cpp:1.3.2.1 openafs/src/WINNT/client_config/tab_advanced.cpp:1.3.2.2
*** openafs/src/WINNT/client_config/tab_advanced.cpp:1.3.2.1	Wed Jul  6 20:29:12 2005
--- openafs/src/WINNT/client_config/tab_advanced.cpp	Fri Nov  3 02:55:42 2006
***************
*** 31,37 ****
  #define ckCHUNK_MAX           1048576L
  
  #define cSTATS_MIN            256L
! #define cSTATS_MAX            10000L
  
  
  /*
--- 31,37 ----
  #define ckCHUNK_MAX           1048576L
  
  #define cSTATS_MIN            256L
! #define cSTATS_MAX            262144L
  
  
  /*
Index: openafs/src/WINNT/doc/install/Documentation/en_US/html/index.htm
diff -c openafs/src/WINNT/doc/install/Documentation/en_US/html/index.htm:1.1.24.5 openafs/src/WINNT/doc/install/Documentation/en_US/html/index.htm:1.1.24.6
*** openafs/src/WINNT/doc/install/Documentation/en_US/html/index.htm:1.1.24.5	Mon Aug 21 01:00:49 2006
--- openafs/src/WINNT/doc/install/Documentation/en_US/html/index.htm	Fri Jan  5 15:15:41 2007
***************
*** 198,204 ****
  
  <h1>OpenAFS for Windows</h1>
  
! <h2>Version 1.4.2</h2>
  
  <p class=MsoNormal><span style='mso-fareast-font-family:"MS Mincho"'>&nbsp; <o:p></o:p></span></p>
  
--- 198,204 ----
  
  <h1>OpenAFS for Windows</h1>
  
! <h2>Version 1.4.3</h2>
  
  <p class=MsoNormal><span style='mso-fareast-font-family:"MS Mincho"'>&nbsp; <o:p></o:p></span></p>
  
Index: openafs/src/WINNT/doc/install/Documentation/en_US/html/ReleaseNotes/logo.htm
diff -c openafs/src/WINNT/doc/install/Documentation/en_US/html/ReleaseNotes/logo.htm:1.1.2.6 openafs/src/WINNT/doc/install/Documentation/en_US/html/ReleaseNotes/logo.htm:1.1.2.7
*** openafs/src/WINNT/doc/install/Documentation/en_US/html/ReleaseNotes/logo.htm:1.1.2.6	Thu Jul  6 21:15:30 2006
--- openafs/src/WINNT/doc/install/Documentation/en_US/html/ReleaseNotes/logo.htm	Fri Jan  5 15:15:45 2007
***************
*** 3,9 ****
  <head>
  <meta http-equiv=Content-Type content="text/html; charset=windows-1252">
  <meta name=Generator content="Microsoft Word 11 (filtered)">
! <title>OpenAFS for Windows 1.4.2 Release Notes</title>
  <style>
  <!--
   /* Font Definitions */
--- 3,9 ----
  <head>
  <meta http-equiv=Content-Type content="text/html; charset=windows-1252">
  <meta name=Generator content="Microsoft Word 11 (filtered)">
! <title>OpenAFS for Windows 1.4.3 Release Notes</title>
  <style>
  <!--
   /* Font Definitions */
Index: openafs/src/WINNT/doc/install/Documentation/en_US/html/ReleaseNotes/relnotes-frames.htm
diff -c openafs/src/WINNT/doc/install/Documentation/en_US/html/ReleaseNotes/relnotes-frames.htm:1.1.2.1 openafs/src/WINNT/doc/install/Documentation/en_US/html/ReleaseNotes/relnotes-frames.htm:1.1.2.2
*** openafs/src/WINNT/doc/install/Documentation/en_US/html/ReleaseNotes/relnotes-frames.htm:1.1.2.1	Thu Jul  6 21:15:30 2006
--- openafs/src/WINNT/doc/install/Documentation/en_US/html/ReleaseNotes/relnotes-frames.htm	Fri Jan  5 15:15:45 2007
***************
*** 3,9 ****
  <head>
  <meta http-equiv=Content-Type content="text/html; charset=windows-1252">
  <meta name=Generator content="Microsoft Word 11 (filtered)">
! <title>OpenAFS for Windows 1.4.2 Release Notes</title>
  <style>
  <!--
   /* Font Definitions */
--- 3,9 ----
  <head>
  <meta http-equiv=Content-Type content="text/html; charset=windows-1252">
  <meta name=Generator content="Microsoft Word 11 (filtered)">
! <title>OpenAFS for Windows 1.4.3 Release Notes</title>
  <style>
  <!--
   /* Font Definitions */
Index: openafs/src/WINNT/doc/install/Documentation/en_US/html/ReleaseNotes/relnotes.htm
diff -c openafs/src/WINNT/doc/install/Documentation/en_US/html/ReleaseNotes/relnotes.htm:1.2.2.11 openafs/src/WINNT/doc/install/Documentation/en_US/html/ReleaseNotes/relnotes.htm:1.2.2.12
*** openafs/src/WINNT/doc/install/Documentation/en_US/html/ReleaseNotes/relnotes.htm:1.2.2.11	Mon Aug 21 01:00:55 2006
--- openafs/src/WINNT/doc/install/Documentation/en_US/html/ReleaseNotes/relnotes.htm	Fri Jan  5 15:15:45 2007
***************
*** 3,9 ****
  <head>
  <meta http-equiv=Content-Type content="text/html; charset=windows-1252">
  <meta name=Generator content="Microsoft Word 11 (filtered)">
! <title>OpenAFS for Windows 1.4.2 Release Notes</title>
  
  <style>
  <!--
--- 3,9 ----
  <head>
  <meta http-equiv=Content-Type content="text/html; charset=windows-1252">
  <meta name=Generator content="Microsoft Word 11 (filtered)">
! <title>OpenAFS for Windows 1.4.3 Release Notes</title>
  
  <style>
  <!--
***************
*** 306,312 ****
  
  <div class=Section1>
  
! <p class=MsoTitle>OpenAFS for Windows 1.4.2<br>
  Release Notes</p>
  
  <p class=MsoBodyText>The Andrew File System (AFS) is a location-independent
--- 306,312 ----
  
  <div class=Section1>
  
! <p class=MsoTitle>OpenAFS for Windows 1.4.3<br>
  Release Notes</p>
  
  <p class=MsoBodyText>The Andrew File System (AFS) is a location-independent
Index: openafs/src/WINNT/install/NSIS/OpenAFS.nsi
diff -c openafs/src/WINNT/install/NSIS/OpenAFS.nsi:1.69.2.19 openafs/src/WINNT/install/NSIS/OpenAFS.nsi:1.69.2.20
*** openafs/src/WINNT/install/NSIS/OpenAFS.nsi:1.69.2.19	Wed Sep  6 02:24:55 2006
--- openafs/src/WINNT/install/NSIS/OpenAFS.nsi	Mon Jan 15 18:34:34 2007
***************
*** 50,56 ****
  VIAddVersionKey "ProductVersion" ${AFS_VERSION}
  VIAddVersionKey "FileVersion" ${AFS_VERSION}
  VIAddVersionKey "FileDescription" "OpenAFS for Windows Installer"
! VIAddVersionKey "LegalCopyright" "(C)2000-2004"
  !ifdef DEBUG
  VIAddVersionKey "PrivateBuild" "Checked/Debug"
  !endif               ; End DEBUG
--- 50,56 ----
  VIAddVersionKey "ProductVersion" ${AFS_VERSION}
  VIAddVersionKey "FileVersion" ${AFS_VERSION}
  VIAddVersionKey "FileDescription" "OpenAFS for Windows Installer"
! VIAddVersionKey "LegalCopyright" "(C)2000-2007"
  !ifdef DEBUG
  VIAddVersionKey "PrivateBuild" "Checked/Debug"
  !endif               ; End DEBUG
***************
*** 1205,1218 ****
    ; Set the default install options
    	Push $0
  
     Call IsUserAdmin
     Pop $R0
!    StrCmp $R0 "true" contInstall
  
     MessageBox MB_OK|MB_ICONSTOP|MB_TOPMOST "You must be an administrator of this machine to install this software."
     Abort
     
! contInstall:
  
     ; Set Install Type text
     InstTypeSetText 0 "AFS Client"
--- 1205,1225 ----
    ; Set the default install options
    	Push $0
  
+    Call GetWindowsVersion
+    Pop $R0
+    StrCmp $R0 "Vista" +1 contInstall1
+    MessageBox MB_OK|MB_ICONSTOP|MB_TOPMOST "This version of OpenAFS for Windows is not compatible with Microsoft Vista.  Please install OpenAFS for Windows version 1.5.14 or higher."
+    Abort
+ 
+ contInstall1:
     Call IsUserAdmin
     Pop $R0
!    StrCmp $R0 "true" contInstall2
  
     MessageBox MB_OK|MB_ICONSTOP|MB_TOPMOST "You must be an administrator of this machine to install this software."
     Abort
     
! contInstall2:
  
     ; Set Install Type text
     InstTypeSetText 0 "AFS Client"
***************
*** 1236,1254 ****
     ; Check that RPC functions are installed (I believe any one of these can be present for
     ; OpenAFS to work)
     ReadRegStr $R0 HKLM "SOFTWARE\Microsoft\RPC\ClientProtocols" "ncacn_np"
!    StrCmp $R0 "rpcrt4.dll" contInstall2
     ReadRegStr $R0 HKLM "SOFTWARE\Microsoft\RPC\ClientProtocols" "ncacn_ip_tcp"
!    StrCmp $R0 "rpcrt4.dll" contInstall2
     ReadRegStr $R0 HKLM "SOFTWARE\Microsoft\RPC\ClientProtocols" "ncadg_ip_udp"
!    StrCmp $R0 "rpcrt4.dll" contInstall2
     ReadRegStr $R0 HKLM "SOFTWARE\Microsoft\RPC\ClientProtocols" "ncacn_http"
!    StrCmp $R0 "rpcrt4.dll" contInstall2
     
     MessageBox MB_OK|MB_ICONSTOP|MB_TOPMOST "An error was detected with your Windows RPC installation. Please make sure Windows RPC is installed before installing OpenAFS."
     Abort
  
! 
! contInstall2:
     ; If the Loopback is already installed, we mark the option OFF and Read Only
     ; so the user can not select it.
     Call afs.isLoopbackInstalled
--- 1243,1260 ----
     ; Check that RPC functions are installed (I believe any one of these can be present for
     ; OpenAFS to work)
     ReadRegStr $R0 HKLM "SOFTWARE\Microsoft\RPC\ClientProtocols" "ncacn_np"
!    StrCmp $R0 "rpcrt4.dll" +1 contInstall3
     ReadRegStr $R0 HKLM "SOFTWARE\Microsoft\RPC\ClientProtocols" "ncacn_ip_tcp"
!    StrCmp $R0 "rpcrt4.dll" +1 contInstall3
     ReadRegStr $R0 HKLM "SOFTWARE\Microsoft\RPC\ClientProtocols" "ncadg_ip_udp"
!    StrCmp $R0 "rpcrt4.dll" +1 contInstall3
     ReadRegStr $R0 HKLM "SOFTWARE\Microsoft\RPC\ClientProtocols" "ncacn_http"
!    StrCmp $R0 "rpcrt4.dll" +1 contInstall3
     
     MessageBox MB_OK|MB_ICONSTOP|MB_TOPMOST "An error was detected with your Windows RPC installation. Please make sure Windows RPC is installed before installing OpenAFS."
     Abort
  
! contInstall3:
     ; If the Loopback is already installed, we mark the option OFF and Read Only
     ; so the user can not select it.
     Call afs.isLoopbackInstalled
***************
*** 3584,3590 ****
  ;
  ; Returns on top of stack
  ;
! ; Windows Version (95, 98, ME, NT x.x, 2000, XP, 2003)
  ; or
  ; '' (Unknown Windows Version)
  ;
--- 3590,3596 ----
  ;
  ; Returns on top of stack
  ;
! ; Windows Version (95, 98, ME, NT x.x, 2000, XP, 2003, Vista)
  ; or
  ; '' (Unknown Windows Version)
  ;
***************
*** 3640,3646 ****
  
    StrCmp $R1 '5.0' lbl_winnt_2000
    StrCmp $R1 '5.1' lbl_winnt_XP
!   StrCmp $R1 '5.2' lbl_winnt_2003 lbl_error
  
    lbl_winnt_x:
      StrCpy $R0 "NT $R0" 6
--- 3646,3653 ----
  
    StrCmp $R1 '5.0' lbl_winnt_2000
    StrCmp $R1 '5.1' lbl_winnt_XP
!   StrCmp $R1 '5.2' lbl_winnt_2003
!   StrCmp $R1 '6.0' lbl_winnt_vista lbl_error
  
    lbl_winnt_x:
      StrCpy $R0 "NT $R0" 6
***************
*** 3658,3663 ****
--- 3665,3674 ----
      Strcpy $R0 '2003'
    Goto lbl_done
  
+   lbl_winnt_vista:
+     Strcpy $R0 'Vista'
+   Goto lbl_done
+ 
    lbl_error:
      Strcpy $R0 ''
    lbl_done:
Index: openafs/src/WINNT/install/wix/openafs.wxs
diff -c openafs/src/WINNT/install/wix/openafs.wxs:1.6.2.5 openafs/src/WINNT/install/wix/openafs.wxs:1.6.2.6
*** openafs/src/WINNT/install/wix/openafs.wxs:1.6.2.5	Fri Dec 30 17:41:49 2005
--- openafs/src/WINNT/install/wix/openafs.wxs	Mon Jan 15 16:05:24 2007
***************
*** 47,52 ****
--- 47,55 ----
          <Condition Message="$(loc.StrLaunchCond)">
           <![CDATA[VersionNT >= 500]]>
          </Condition>
+         <Condition Message="$(loc.StrLaunchNoVista)">
+          <![CDATA[VersionNT < 600]]>
+         </Condition>
          <Condition Message="$(loc.AdminRequired)">Privileged</Condition>
          
          
Index: openafs/src/WINNT/install/wix/lang/en_US/strings.wxl
diff -c openafs/src/WINNT/install/wix/lang/en_US/strings.wxl:1.1.2.3 openafs/src/WINNT/install/wix/lang/en_US/strings.wxl:1.1.2.4
*** openafs/src/WINNT/install/wix/lang/en_US/strings.wxl:1.1.2.3	Sun Jun 12 07:23:16 2005
--- openafs/src/WINNT/install/wix/lang/en_US/strings.wxl	Mon Jan 15 16:05:28 2007
***************
*** 35,40 ****
--- 35,41 ----
      <String Id="StrCfgWzdDesc">Server Configuration Wizard</String>
  
      <String Id="StrLaunchCond">OpenAFS for Windows is currently only packaged for Windows 2000,XP and 2003</String>
+     <String Id="StrLaunchNoVista">This version of OpenAFS for Windows is not compatible with Microsoft Vista.  Please install OpenAFS for Windows version 1.5.14 or higher.</String>
      <String Id="AdminRequired">Installation of OpenAFS for Windows requires administrative privileges</String>
  
  	<String Id="ErrNPIFailed">Installation of Network Provider failed.  System error [2]</String>
Index: openafs/src/afs/afs.h
diff -c openafs/src/afs/afs.h:1.48.2.28 openafs/src/afs/afs.h:1.48.2.29
*** openafs/src/afs/afs.h:1.48.2.28	Fri Feb 17 16:58:33 2006
--- openafs/src/afs/afs.h	Thu Nov  9 19:08:52 2006
***************
*** 86,91 ****
--- 86,93 ----
  #define	AFS_NRXPACKETS	80
  #define	AFS_RXDEADTIME	50
  #define AFS_HARDDEADTIME	120
+ #define AFS_BLKBITS	12
+ #define AFS_BLKSIZE	(1 << AFS_BLKBITS)
  
  extern afs_int32 afs_rx_deadtime;
  extern afs_int32 afs_rx_harddead;
Index: openafs/src/afs/afs_analyze.c
diff -c openafs/src/afs/afs_analyze.c:1.22 openafs/src/afs/afs_analyze.c:1.22.2.2
*** openafs/src/afs/afs_analyze.c:1.22	Wed Aug 27 17:43:16 2003
--- openafs/src/afs/afs_analyze.c	Tue Jan  9 10:28:19 2007
***************
*** 14,20 ****
  #include "afs/param.h"
  
  RCSID
!     ("$Header: /cvs/openafs/src/afs/afs_analyze.c,v 1.22 2003/08/27 21:43:16 rees Exp $");
  
  #include "afs/stds.h"
  #include "afs/sysincludes.h"	/* Standard vendor system headers */
--- 14,20 ----
  #include "afs/param.h"
  
  RCSID
!     ("$Header: /cvs/openafs/src/afs/afs_analyze.c,v 1.22.2.2 2007/01/09 15:28:19 jaltman Exp $");
  
  #include "afs/stds.h"
  #include "afs/sysincludes.h"	/* Standard vendor system headers */
***************
*** 636,663 ****
  
  	tu = afs_FindUser(areq->uid, tsp->cell->cellNum, READ_LOCK);
  	if (tu) {
! 	    if ((acode == VICETOKENDEAD) || (acode == RXKADEXPIRED))
  		afs_warnuser
  		    ("afs: Tokens for user of AFS id %d for cell %s have expired\n",
  		     tu->vid, aconn->srvr->server->cell->cellName);
! 	    else
  		afs_warnuser
  		    ("afs: Tokens for user of AFS id %d for cell %s are discarded (rxkad error=%d)\n",
  		     tu->vid, aconn->srvr->server->cell->cellName, acode);
  	    afs_PutUser(tu, READ_LOCK);
  	} else {
  	    /* The else case shouldn't be possible and should probably be replaced by a panic? */
! 	    if ((acode == VICETOKENDEAD) || (acode == RXKADEXPIRED))
  		afs_warnuser
  		    ("afs: Tokens for user %d for cell %s have expired\n",
  		     areq->uid, aconn->srvr->server->cell->cellName);
! 	    else
  		afs_warnuser
  		    ("afs: Tokens for user %d for cell %s are discarded (rxkad error = %d)\n",
  		     areq->uid, aconn->srvr->server->cell->cellName, acode);
  	}
- 	aconn->forceConnectFS = 0;	/* don't check until new tokens set */
- 	aconn->user->states |= UTokensBad;
  	shouldRetry = 1;	/* Try again (as root). */
      }
      /* Check for access violation. */
--- 636,675 ----
  
  	tu = afs_FindUser(areq->uid, tsp->cell->cellNum, READ_LOCK);
  	if (tu) {
! 	    if (acode == VICETOKENDEAD) {
! 		aconn->forceConnectFS = 1;
! 	    } else if (acode == RXKADEXPIRED) {
! 		aconn->forceConnectFS = 0;	/* don't check until new tokens set */
! 		aconn->user->states |= UTokensBad;
  		afs_warnuser
  		    ("afs: Tokens for user of AFS id %d for cell %s have expired\n",
  		     tu->vid, aconn->srvr->server->cell->cellName);
! 	    } else {
! 		aconn->forceConnectFS = 0;	/* don't check until new tokens set */
! 		aconn->user->states |= UTokensBad;
  		afs_warnuser
  		    ("afs: Tokens for user of AFS id %d for cell %s are discarded (rxkad error=%d)\n",
  		     tu->vid, aconn->srvr->server->cell->cellName, acode);
+ 	    }
  	    afs_PutUser(tu, READ_LOCK);
  	} else {
  	    /* The else case shouldn't be possible and should probably be replaced by a panic? */
! 	    if (acode == VICETOKENDEAD) {
! 		aconn->forceConnectFS = 1;
! 	    } else if (acode == RXKADEXPIRED) {
! 		aconn->forceConnectFS = 0;	/* don't check until new tokens set */
! 		aconn->user->states |= UTokensBad;
  		afs_warnuser
  		    ("afs: Tokens for user %d for cell %s have expired\n",
  		     areq->uid, aconn->srvr->server->cell->cellName);
! 	    } else {
! 		aconn->forceConnectFS = 0;	/* don't check until new tokens set */
! 		aconn->user->states |= UTokensBad;
  		afs_warnuser
  		    ("afs: Tokens for user %d for cell %s are discarded (rxkad error = %d)\n",
  		     areq->uid, aconn->srvr->server->cell->cellName, acode);
+ 	    }
  	}
  	shouldRetry = 1;	/* Try again (as root). */
      }
      /* Check for access violation. */
Index: openafs/src/afs/afs_call.c
diff -c openafs/src/afs/afs_call.c:1.74.2.15 openafs/src/afs/afs_call.c:1.74.2.16
*** openafs/src/afs/afs_call.c:1.74.2.15	Wed Oct 11 09:24:39 2006
--- openafs/src/afs/afs_call.c	Thu Dec 28 16:32:08 2006
***************
*** 11,17 ****
  #include "afs/param.h"
  
  RCSID
!     ("$Header: /cvs/openafs/src/afs/afs_call.c,v 1.74.2.15 2006/10/11 13:24:39 shadow Exp $");
  
  #include "afs/sysincludes.h"	/* Standard vendor system headers */
  #include "afsincludes.h"	/* Afs-based standard headers */
--- 11,17 ----
  #include "afs/param.h"
  
  RCSID
!     ("$Header: /cvs/openafs/src/afs/afs_call.c,v 1.74.2.16 2006/12/28 21:32:08 shadow Exp $");
  
  #include "afs/sysincludes.h"	/* Standard vendor system headers */
  #include "afsincludes.h"	/* Afs-based standard headers */
***************
*** 279,284 ****
--- 279,287 ----
  
  #if defined(AFS_LINUX24_ENV) && defined(COMPLETION_H_EXISTS)
  struct afsd_thread_info {
+ #if !defined(INIT_WORK_HAS_DATA)
+     struct work_struct tq;
+ #endif
      unsigned long parm;
      struct completion *complete;
  };
***************
*** 411,419 ****
  }
  
  void
  afsd_launcher(void *rock)
  {
!     if (!kernel_thread(afsd_thread, rock, CLONE_VFORK | SIGCHLD))
  	printf("kernel_thread failed. afs startup will not complete\n");
  }
  
--- 414,430 ----
  }
  
  void
+ #if !defined(INIT_WORK_HAS_DATA)
+ afsd_launcher(struct work_struct *work)
+ #else
  afsd_launcher(void *rock)
+ #endif
  {
! #if !defined(INIT_WORK_HAS_DATA)
!     struct afsd_thread_info *rock = container_of(work, struct afsd_thread_info, tq);
! #endif
! 
!     if (!kernel_thread(afsd_thread, (void *)rock, CLONE_VFORK | SIGCHLD))
  	printf("kernel_thread failed. afs startup will not complete\n");
  }
  
***************
*** 452,459 ****
--- 463,475 ----
      info.complete = &c;
      info.parm = parm;
  #if defined(AFS_LINUX26_ENV)
+ #if !defined(INIT_WORK_HAS_DATA)
+     INIT_WORK(&info.tq, afsd_launcher);
+     schedule_work(&info.tq);
+ #else
      INIT_WORK(&tq, afsd_launcher, &info);
      schedule_work(&tq);
+ #endif
  #else
      tq.sync = 0;
      INIT_LIST_HEAD(&tq.list);
Index: openafs/src/afs/afs_callback.c
diff -c openafs/src/afs/afs_callback.c:1.27.2.6 openafs/src/afs/afs_callback.c:1.27.2.7
*** openafs/src/afs/afs_callback.c:1.27.2.6	Thu Mar  2 01:44:05 2006
--- openafs/src/afs/afs_callback.c	Thu Jan 11 22:29:44 2007
***************
*** 17,23 ****
  #include "afs/param.h"
  
  RCSID
!     ("$Header: /cvs/openafs/src/afs/afs_callback.c,v 1.27.2.6 2006/03/02 06:44:05 shadow Exp $");
  
  #include "afs/sysincludes.h"	/*Standard vendor system headers */
  #include "afsincludes.h"	/*AFS-based standard headers */
--- 17,23 ----
  #include "afs/param.h"
  
  RCSID
!     ("$Header: /cvs/openafs/src/afs/afs_callback.c,v 1.27.2.7 2007/01/12 03:29:44 shadow Exp $");
  
  #include "afs/sysincludes.h"	/*Standard vendor system headers */
  #include "afsincludes.h"	/*AFS-based standard headers */
***************
*** 328,336 ****
  	    ((struct afs_lock *)(tl->addr))->num_waiting;
  #ifdef INSTRUMENT_LOCKS
  	a_result->lock.pid_last_reader =
! 	    ((struct afs_lock *)(tl->addr))->pid_last_reader;
  	a_result->lock.pid_writer =
! 	    ((struct afs_lock *)(tl->addr))->pid_writer;
  	a_result->lock.src_indicator =
  	    ((struct afs_lock *)(tl->addr))->src_indicator;
  #else
--- 328,336 ----
  	    ((struct afs_lock *)(tl->addr))->num_waiting;
  #ifdef INSTRUMENT_LOCKS
  	a_result->lock.pid_last_reader =
! 	    MyPidxx2Pid(((struct afs_lock *)(tl->addr))->pid_last_reader);
  	a_result->lock.pid_writer =
! 	    MyPidxx2Pid(((struct afs_lock *)(tl->addr))->pid_writer);
  	a_result->lock.src_indicator =
  	    ((struct afs_lock *)(tl->addr))->src_indicator;
  #else
Index: openafs/src/afs/afs_dcache.c
diff -c openafs/src/afs/afs_dcache.c:1.42.2.19 openafs/src/afs/afs_dcache.c:1.42.2.20
*** openafs/src/afs/afs_dcache.c:1.42.2.19	Thu Oct 13 14:42:27 2005
--- openafs/src/afs/afs_dcache.c	Thu Nov  9 19:16:29 2006
***************
*** 14,20 ****
  #include "afs/param.h"
  
  RCSID
!     ("$Header: /cvs/openafs/src/afs/afs_dcache.c,v 1.42.2.19 2005/10/13 18:42:27 shadow Exp $");
  
  #include "afs/sysincludes.h"	/*Standard vendor system headers */
  #include "afsincludes.h"	/*AFS-based standard headers */
--- 14,20 ----
  #include "afs/param.h"
  
  RCSID
!     ("$Header: /cvs/openafs/src/afs/afs_dcache.c,v 1.42.2.20 2006/11/10 00:16:29 shadow Exp $");
  
  #include "afs/sysincludes.h"	/*Standard vendor system headers */
  #include "afsincludes.h"	/*AFS-based standard headers */
***************
*** 2736,2742 ****
      if (CheckLock(&afs_xdcache) != -1)
  	osi_Panic("getdslot nolock");
      if (aslot < 0 || aslot >= afs_cacheFiles)
! 	osi_Panic("getdslot slot");
      tdc = afs_indexTable[aslot];
      if (tdc) {
  	QRemove(&tdc->lruq);	/* move to queue head */
--- 2736,2742 ----
      if (CheckLock(&afs_xdcache) != -1)
  	osi_Panic("getdslot nolock");
      if (aslot < 0 || aslot >= afs_cacheFiles)
! 	osi_Panic("getdslot slot %d (of %d)", aslot, afs_cacheFiles);
      tdc = afs_indexTable[aslot];
      if (tdc) {
  	QRemove(&tdc->lruq);	/* move to queue head */
Index: openafs/src/afs/afs_dynroot.c
diff -c openafs/src/afs/afs_dynroot.c:1.11.2.1 openafs/src/afs/afs_dynroot.c:1.11.2.2
*** openafs/src/afs/afs_dynroot.c:1.11.2.1	Sun Mar 20 15:09:13 2005
--- openafs/src/afs/afs_dynroot.c	Wed Dec 20 15:09:06 2006
***************
*** 639,645 ****
--- 639,649 ----
      struct afs_dynSymlink *tps;
      int found = 0;
  
+ #if defined(AFS_SUN510_ENV)
+     if (crgetruid(acred))
+ #else
      if (acred->cr_uid)
+ #endif
  	return EPERM;
  
      ObtainWriteLock(&afs_dynSymlinkLock, 97);
Index: openafs/src/afs/afs_nfsclnt.c
diff -c openafs/src/afs/afs_nfsclnt.c:1.12.2.1 openafs/src/afs/afs_nfsclnt.c:1.12.2.2
*** openafs/src/afs/afs_nfsclnt.c:1.12.2.1	Sun Apr  3 14:15:36 2005
--- openafs/src/afs/afs_nfsclnt.c	Wed Dec 20 15:09:06 2006
***************
*** 11,17 ****
  #include "afs/param.h"
  
  RCSID
!     ("$Header: /cvs/openafs/src/afs/afs_nfsclnt.c,v 1.12.2.1 2005/04/03 18:15:36 shadow Exp $");
  
  #if !defined(AFS_NONFSTRANS) || defined(AFS_AIX_IAUTH_ENV)
  #include "afs/sysincludes.h"	/* Standard vendor system headers */
--- 11,17 ----
  #include "afs/param.h"
  
  RCSID
!     ("$Header: /cvs/openafs/src/afs/afs_nfsclnt.c,v 1.12.2.2 2006/12/20 20:09:06 shadow Exp $");
  
  #if !defined(AFS_NONFSTRANS) || defined(AFS_AIX_IAUTH_ENV)
  #include "afs/sysincludes.h"	/* Standard vendor system headers */
***************
*** 176,181 ****
--- 176,182 ----
      extern struct unixuser *afs_FindUser(), *afs_GetUser();
      register struct unixuser *au = 0;
      afs_int32 pag, code = 0;
+     uid_t uid;
  
      AFS_ASSERT_GLOCK();
      AFS_STATCNT(afs_nfsclient_reqhandler);
***************
*** 206,214 ****
  		pag = NOPAG;	/*  No unixuser struct so pag not trusted  */
  	}
      }
!     np = afs_FindNfsClientPag((*cred)->cr_uid, host, 0);
      afs_Trace4(afs_iclSetp, CM_TRACE_NFSREQH, ICL_TYPE_INT32, pag,
! 	       ICL_TYPE_LONG, (*cred)->cr_uid, ICL_TYPE_INT32, host,
  	       ICL_TYPE_POINTER, np);
      if (!np) {
  	/* Even if there is a "good" pag coming in we don't accept it if no nfsclientpag struct exists for the user since that would mean that the translator rebooted and therefore we ignore all older pag values */
--- 207,220 ----
  		pag = NOPAG;	/*  No unixuser struct so pag not trusted  */
  	}
      }
! #if defined(AFS_SUN510_ENV)
!     uid = crgetuid(*cred);
! #else
!     uid = (*cred)->cr_uid;
! #endif
!     np = afs_FindNfsClientPag(uid, host, 0);
      afs_Trace4(afs_iclSetp, CM_TRACE_NFSREQH, ICL_TYPE_INT32, pag,
! 	       ICL_TYPE_LONG, uid, ICL_TYPE_INT32, host,
  	       ICL_TYPE_POINTER, np);
      if (!np) {
  	/* Even if there is a "good" pag coming in we don't accept it if no nfsclientpag struct exists for the user since that would mean that the translator rebooted and therefore we ignore all older pag values */
Index: openafs/src/afs/afs_osi.c
diff -c openafs/src/afs/afs_osi.c:1.48.2.9 openafs/src/afs/afs_osi.c:1.48.2.10
*** openafs/src/afs/afs_osi.c:1.48.2.9	Wed Sep 27 17:14:27 2006
--- openafs/src/afs/afs_osi.c	Thu Dec 28 16:50:58 2006
***************
*** 11,17 ****
  #include "afs/param.h"
  
  RCSID
!     ("$Header: /cvs/openafs/src/afs/afs_osi.c,v 1.48.2.9 2006/09/27 21:14:27 shadow Exp $");
  
  #include "afs/sysincludes.h"	/* Standard vendor system headers */
  #include "afsincludes.h"	/* Afs-based standard headers */
--- 11,17 ----
  #include "afs/param.h"
  
  RCSID
!     ("$Header: /cvs/openafs/src/afs/afs_osi.c,v 1.48.2.10 2006/12/28 21:50:58 shadow Exp $");
  
  #include "afs/sysincludes.h"	/* Standard vendor system headers */
  #include "afsincludes.h"	/* Afs-based standard headers */
***************
*** 589,598 ****
  
  #ifndef AFS_OBSD_ENV
  int
! afs_osi_suser(void *credp)
  {
! #if defined(AFS_SUN5_ENV)
!     return afs_suser(credp);
  #else
      return afs_suser(NULL);
  #endif
--- 589,600 ----
  
  #ifndef AFS_OBSD_ENV
  int
! afs_osi_suser(void *cr)
  {
! #if defined(AFS_SUN510_ENV)
!     return (priv_policy(cr, PRIV_SYS_SUSER_COMPAT, B_FALSE, EPERM, NULL) == 0);
! #elif defined(AFS_SUN5_ENV)
!     return afs_suser(cr);
  #else
      return afs_suser(NULL);
  #endif
Index: openafs/src/afs/afs_osi.h
diff -c openafs/src/afs/afs_osi.h:1.22.2.17 openafs/src/afs/afs_osi.h:1.22.2.18
*** openafs/src/afs/afs_osi.h:1.22.2.17	Thu Aug 31 00:54:52 2006
--- openafs/src/afs/afs_osi.h	Thu Nov  9 18:26:25 2006
***************
*** 41,47 ****
  
  struct osi_stat {
      afs_int32 size;		/* file size in bytes */
-     afs_int32 blksize;		/* optimal transfer size in bytes */
      afs_int32 mtime;		/* modification date */
      afs_int32 atime;		/* access time */
  };
--- 41,46 ----
Index: openafs/src/afs/afs_osi_pag.c
diff -c openafs/src/afs/afs_osi_pag.c:1.21.2.7 openafs/src/afs/afs_osi_pag.c:1.21.2.9
*** openafs/src/afs/afs_osi_pag.c:1.21.2.7	Thu Aug 17 09:56:29 2006
--- openafs/src/afs/afs_osi_pag.c	Mon Jan 15 10:52:45 2007
***************
*** 23,29 ****
  #include "afs/param.h"
  
  RCSID
!     ("$Header: /cvs/openafs/src/afs/afs_osi_pag.c,v 1.21.2.7 2006/08/17 13:56:29 shadow Exp $");
  
  #include "afs/sysincludes.h"	/* Standard vendor system headers */
  #include "afsincludes.h"	/* Afs-based standard headers */
--- 23,29 ----
  #include "afs/param.h"
  
  RCSID
!     ("$Header: /cvs/openafs/src/afs/afs_osi_pag.c,v 1.21.2.9 2007/01/15 15:52:45 shadow Exp $");
  
  #include "afs/sysincludes.h"	/* Standard vendor system headers */
  #include "afsincludes.h"	/* Afs-based standard headers */
***************
*** 44,49 ****
--- 44,54 ----
  afs_uint32 pagCounter = 0;
  #endif /* UKERNEL && AFS_WEB_ENHANCEMENTS */
  
+ #ifdef AFS_LINUX26_ONEGROUP_ENV
+ #define NUMPAGGROUPS 1
+ #else
+ #define NUMPAGGROUPS 2
+ #endif
  /* Local variables */
  
  /*
***************
*** 363,380 ****
      return (code);
  }
  
  int
  afs_getpag_val()
  {
      int pagvalue;
      struct AFS_UCRED *credp = u.u_cred;
!     int gidset0, gidset1;
! 
      gidset0 = credp->cr_groups[0];
      gidset1 = credp->cr_groups[1];
      pagvalue = afs_get_pag_from_groups(gidset0, gidset1);
      return pagvalue;
  }
  #endif /* UKERNEL && AFS_WEB_ENHANCEMENTS */
  
  
--- 368,394 ----
      return (code);
  }
  
+ #ifndef AFS_LINUX26_ONEGROUP_ENV
  int
  afs_getpag_val()
  {
      int pagvalue;
      struct AFS_UCRED *credp = u.u_cred;
!     gid_t gidset0, gidset1;
! #ifdef AFS_SUN510_ENV
!     const gid_t *gids;
! 
!     gids = crgetgroups(*credp);
!     gidset0 = gids[0];
!     gidset1 = gids[1];
! #else
      gidset0 = credp->cr_groups[0];
      gidset1 = credp->cr_groups[1];
+ #endif
      pagvalue = afs_get_pag_from_groups(gidset0, gidset1);
      return pagvalue;
  }
+ #endif
  #endif /* UKERNEL && AFS_WEB_ENHANCEMENTS */
  
  
***************
*** 422,427 ****
--- 436,443 ----
  	    av->uid = -2;	/* XXX nobody... ? */
  	else
  	    av->uid = acred->cr_uid;	/* bsd creds don't have ruid */
+ #elif defined(AFS_SUN510_ENV)
+         av->uid = crgetruid(acred);
  #else
  	av->uid = acred->cr_ruid;	/* default when no pag is set */
  #endif
***************
*** 431,437 ****
--- 447,468 ----
  }
  
  
+ #ifdef AFS_LINUX26_ONEGROUP_ENV
+ afs_uint32
+ afs_get_pag_from_groups(struct group_info *group_info)
+ {
+     afs_uint32 g0 = 0;
+     afs_uint32 i;
  
+     AFS_STATCNT(afs_get_pag_from_groups);
+     for (i = 0; (i < group_info->ngroups && 
+ 		 (g0 = GROUP_AT(group_info, i)) != (gid_t) NOGROUP); i++) {
+ 	if (((g0 >> 24) & 0xff) == 'A')
+ 	    return g0;
+     }
+     return NOPAG;
+ }
+ #else
  afs_uint32
  afs_get_pag_from_groups(gid_t g0a, gid_t g1a)
  {
***************
*** 440,445 ****
--- 471,477 ----
      afs_uint32 h, l, ret;
  
      AFS_STATCNT(afs_get_pag_from_groups);
+ 
      g0 -= 0x3f00;
      g1 -= 0x3f00;
      if (g0 < 0xc000 && g1 < 0xc000) {
***************
*** 457,463 ****
      }
      return NOPAG;
  }
! 
  
  void
  afs_get_groups_from_pag(afs_uint32 pag, gid_t * g0p, gid_t * g1p)
--- 489,495 ----
      }
      return NOPAG;
  }
! #endif
  
  void
  afs_get_groups_from_pag(afs_uint32 pag, gid_t * g0p, gid_t * g1p)
***************
*** 466,471 ****
--- 498,507 ----
  
  
      AFS_STATCNT(afs_get_groups_from_pag);
+ #ifdef AFS_LINUX26_ONEGROUP_ENV
+     *g0p = pag;
+     *g1p = 0;
+ #else
  #if !defined(UKERNEL) || !defined(AFS_WEB_ENHANCEMENTS)
      pag &= 0x7fffffff;
  #endif /* UKERNEL && AFS_WEB_ENHANCEMENTS */
***************
*** 475,480 ****
--- 511,517 ----
      g1 |= ((pag >> 28) % 3) << 14;
      *g0p = g0 + 0x3f00;
      *g1p = g1 + 0x3f00;
+ #endif
  }
  
  
***************
*** 483,493 ****
--- 520,538 ----
  {
      afs_int32 pag;
      gid_t g0, g1;
+ #if defined(AFS_SUN510_ENV)
+     const gid_t *gids;
+     int ngroups;
+ #endif
  
      AFS_STATCNT(PagInCred);
      if (cred == NULL || cred == afs_osi_credp) {
  	return NOPAG;
      }
+ #if defined(AFS_SUN510_ENV)
+     gids = crgetgroups(cred);
+     ngroups = crgetngroups(cred);
+ #endif
  #if defined(AFS_DARWIN_ENV) || defined(AFS_XBSD_ENV)
      if (cred == NOCRED || cred == FSCRED) {
  	return NOPAG;
***************
*** 507,518 ****
  	return NOPAG;
      }
  #elif defined(AFS_LINUX26_ENV)
!     if (cred->cr_group_info->ngroups < 2) {
  	pag = NOPAG;
  	goto out;
      }
  #elif defined(AFS_SGI_ENV) || defined(AFS_SUN5_ENV) || defined(AFS_DUX40_ENV) || defined(AFS_LINUX20_ENV) || defined(AFS_XBSD_ENV)
      if (cred->cr_ngroups < 2) {
  	pag = NOPAG;
  	goto out;
      }
--- 552,567 ----
  	return NOPAG;
      }
  #elif defined(AFS_LINUX26_ENV)
!     if (cred->cr_group_info->ngroups < NUMPAGGROUPS) {
  	pag = NOPAG;
  	goto out;
      }
  #elif defined(AFS_SGI_ENV) || defined(AFS_SUN5_ENV) || defined(AFS_DUX40_ENV) || defined(AFS_LINUX20_ENV) || defined(AFS_XBSD_ENV)
+ #if defined(AFS_SUN510_ENV)
+     if (ngroups < 2) {
+ #else
      if (cred->cr_ngroups < 2) {
+ #endif
  	pag = NOPAG;
  	goto out;
      }
***************
*** 520,534 ****
--- 569,591 ----
  #if defined(AFS_AIX51_ENV)
      g0 = cred->cr_groupset.gs_union.un_groups[0];
      g1 = cred->cr_groupset.gs_union.un_groups[1];
+ #elif defined(AFS_LINUX26_ONEGROUP_ENV)
  #elif defined(AFS_LINUX26_ENV)
      g0 = GROUP_AT(cred->cr_group_info, 0);
      g1 = GROUP_AT(cred->cr_group_info, 1);
+ #elif defined(AFS_SUN510_ENV)
+     g0 = gids[0];
+     g1 = gids[1];
  #else
      g0 = cred->cr_groups[0];
      g1 = cred->cr_groups[1];
  #endif
  #endif
+ #if defined(AFS_LINUX26_ONEGROUP_ENV)
+     pag = (afs_int32) afs_get_pag_from_groups(cred->cr_group_info);
+ #else
      pag = (afs_int32) afs_get_pag_from_groups(g0, g1);
+ #endif
  out:
  #if defined(AFS_LINUX26_ENV) && defined(LINUX_KEYRING_SUPPORT)
      if (pag == NOPAG) {
Index: openafs/src/afs/afs_prototypes.h
diff -c openafs/src/afs/afs_prototypes.h:1.53.2.17 openafs/src/afs/afs_prototypes.h:1.53.2.19
*** openafs/src/afs/afs_prototypes.h:1.53.2.17	Mon Aug 14 18:12:22 2006
--- openafs/src/afs/afs_prototypes.h	Mon Jan 15 15:51:57 2007
***************
*** 508,514 ****
--- 508,520 ----
  extern int AddPag(afs_int32 aval, struct AFS_UCRED **credpp);
  #endif
  extern int afs_InitReq(register struct vrequest *av, struct AFS_UCRED *acred);
+ #if defined(UKERNEL) && defined(AFS_WEB_ENHANCEMENTS)
  extern afs_uint32 afs_get_pag_from_groups(gid_t g0a, gid_t g1a);
+ #else
+ #ifdef AFS_LINUX26_ONEGROUP_ENV
+ extern afs_uint32 afs_get_pag_from_groups(struct group_info *gi);
+ #endif
+ #endif
  extern void afs_get_groups_from_pag(afs_uint32 pag, gid_t * g0p, gid_t * g1p);
  extern afs_int32 PagInCred(const struct AFS_UCRED *cred);
  
Index: openafs/src/afs/afs_server.c
diff -c openafs/src/afs/afs_server.c:1.33.2.7 openafs/src/afs/afs_server.c:1.33.2.8
*** openafs/src/afs/afs_server.c:1.33.2.7	Wed Oct  5 01:58:27 2005
--- openafs/src/afs/afs_server.c	Thu Nov  9 19:16:29 2006
***************
*** 33,39 ****
  #include "afs/param.h"
  
  RCSID
!     ("$Header: /cvs/openafs/src/afs/afs_server.c,v 1.33.2.7 2005/10/05 05:58:27 shadow Exp $");
  
  #include "afs/stds.h"
  #include "afs/sysincludes.h"	/* Standard vendor system headers */
--- 33,39 ----
  #include "afs/param.h"
  
  RCSID
!     ("$Header: /cvs/openafs/src/afs/afs_server.c,v 1.33.2.8 2006/11/10 00:16:29 shadow Exp $");
  
  #include "afs/stds.h"
  #include "afs/sysincludes.h"	/* Standard vendor system headers */
***************
*** 1383,1397 ****
  #elif defined(AFS_DARWIN80_ENV)
      {
  	errno_t t;
! 	int cnt=0;
! 	ifaddr_t *addresses, address;
! 	t = ifnet_get_address_list_family(NULL, &addresses, AF_INET);
! 	if (t == 0) {
! 	    while(addresses[cnt] != NULL) {
! 		afsi_SetServerIPRank(sa, address);
! 		cnt++;
  	    }
! 	    ifnet_free_address_list(addresses);
  	}
      }
  #elif defined(AFS_DARWIN60_ENV)
--- 1383,1404 ----
  #elif defined(AFS_DARWIN80_ENV)
      {
  	errno_t t;
! 	unsigned int count;
! 	int cnt=0, m, j;
! 	ifaddr_t *ifads;
! 	ifnet_t *ifn;
! 
! 	if (!ifnet_list_get(AF_INET, &ifn, &count)) {
! 	    for (m = 0; m < count; m++) {
! 		if (!ifnet_get_address_list(ifn[m], &ifads)) {
! 		    for (j = 0; ifads[j] != NULL && cnt < ADDRSPERSITE; j++) {
! 			afsi_SetServerIPRank(sa, ifads[j]);
! 			cnt++;
! 		    }
! 		    ifnet_free_address_list(ifads);
! 		}
  	    }
! 	    ifnet_list_free(ifn);
  	}
      }
  #elif defined(AFS_DARWIN60_ENV)
Index: openafs/src/afs/afs_user.c
diff -c openafs/src/afs/afs_user.c:1.15 openafs/src/afs/afs_user.c:1.15.2.1
*** openafs/src/afs/afs_user.c:1.15	Tue Jul 15 19:14:13 2003
--- openafs/src/afs/afs_user.c	Wed Dec 20 15:09:06 2006
***************
*** 14,20 ****
  #include "afs/param.h"
  
  RCSID
!     ("$Header: /cvs/openafs/src/afs/afs_user.c,v 1.15 2003/07/15 23:14:13 shadow Exp $");
  
  #include "afs/stds.h"
  #include "afs/sysincludes.h"	/* Standard vendor system headers */
--- 14,20 ----
  #include "afs/param.h"
  
  RCSID
!     ("$Header: /cvs/openafs/src/afs/afs_user.c,v 1.15.2.1 2006/12/20 20:09:06 shadow Exp $");
  
  #include "afs/stds.h"
  #include "afs/sysincludes.h"	/* Standard vendor system headers */
***************
*** 598,603 ****
--- 598,605 ----
      pag = PagInCred(pcred);
  #if defined(AFS_DARWIN_ENV) || defined(AFS_FBSD40_ENV) || defined(AFS_LINUX22_ENV)
      uid = (pag != NOPAG ? pag : pcred->cr_uid);
+ #elif defined(AFS_SUN510_ENV)
+     uid = (pag != NOPAG ? pag : crgetruid(pcred));
  #else
      uid = (pag != NOPAG ? pag : pcred->cr_ruid);
  #endif
Index: openafs/src/afs/afs_vcache.c
diff -c openafs/src/afs/afs_vcache.c:1.65.2.44 openafs/src/afs/afs_vcache.c:1.65.2.46
*** openafs/src/afs/afs_vcache.c:1.65.2.44	Fri Feb 17 23:54:50 2006
--- openafs/src/afs/afs_vcache.c	Thu Nov  9 23:35:13 2006
***************
*** 39,45 ****
  #include "afs/param.h"
  
  RCSID
!     ("$Header: /cvs/openafs/src/afs/afs_vcache.c,v 1.65.2.44 2006/02/18 04:54:50 shadow Exp $");
  
  #include "afs/sysincludes.h"	/*Standard vendor system headers */
  #include "afsincludes.h"	/*AFS-based standard headers */
--- 39,45 ----
  #include "afs/param.h"
  
  RCSID
!     ("$Header: /cvs/openafs/src/afs/afs_vcache.c,v 1.65.2.46 2006/11/10 04:35:13 shadow Exp $");
  
  #include "afs/sysincludes.h"	/*Standard vendor system headers */
  #include "afsincludes.h"	/*AFS-based standard headers */
Index: openafs/src/afs/afs_volume.c
diff -c openafs/src/afs/afs_volume.c:1.26.2.5 openafs/src/afs/afs_volume.c:1.26.2.6
*** openafs/src/afs/afs_volume.c:1.26.2.5	Fri Feb 17 23:09:34 2006
--- openafs/src/afs/afs_volume.c	Mon Dec 18 21:35:27 2006
***************
*** 19,25 ****
  #include "afs/param.h"
  
  RCSID
!     ("$Header: /cvs/openafs/src/afs/afs_volume.c,v 1.26.2.5 2006/02/18 04:09:34 shadow Exp $");
  
  #include "afs/stds.h"
  #include "afs/sysincludes.h"	/* Standard vendor system headers */
--- 19,25 ----
  #include "afs/param.h"
  
  RCSID
!     ("$Header: /cvs/openafs/src/afs/afs_volume.c,v 1.26.2.6 2006/12/19 02:35:27 shadow Exp $");
  
  #include "afs/stds.h"
  #include "afs/sysincludes.h"	/* Standard vendor system headers */
***************
*** 682,687 ****
--- 682,689 ----
      } while (afs_Analyze(tconn, code, NULL, &treq, -1,	/* no op code for this */
  			 SHARED_LOCK, tcell));
  
+     /* RT 48959 - unclear if this should really go */
+ #if 0
      if (code) {
  	/* If the client has yet to contact this cell and contact failed due
  	 * to network errors, mark the VLDB servers as back up.
***************
*** 704,709 ****
--- 706,712 ----
  	afs_PutCell(tcell, READ_LOCK);
  	return NULL;
      }
+ #endif
      /*
       * Check to see if this cell has not yet referenced a volume.  If
       * it hasn't, it's just about to change its status, and we need to mark
Index: openafs/src/afs/lock.h
diff -c openafs/src/afs/lock.h:1.13.2.2 openafs/src/afs/lock.h:1.13.2.6
*** openafs/src/afs/lock.h:1.13.2.2	Wed Oct  5 01:58:27 2005
--- openafs/src/afs/lock.h	Fri Jan 12 11:31:40 2007
***************
*** 86,122 ****
  #define BEGINMAC do {
  #define ENDMAC   } while (0)
  
! #if defined(AFS_SUN5_ENV) || defined(AFS_OBSD_ENV)
  #define MyPidxx (curproc->p_pid)
  #else
  #if defined(AFS_AIX41_ENV)
  extern tid_t thread_self();
! #define MyPidxx thread_self()
  #else /* AFS_AIX41_ENV */
  #if defined(AFS_HPUX101_ENV)
! #define MyPidxx ((int)p_pid(u.u_procp))
  #else
  #if defined(AFS_SGI64_ENV)
  #if defined(AFS_SGI65_ENV)
  #define MyPidxx proc_pid(curproc())
  #else
  #define MyPidxx current_pid()
  #endif
  #else /* AFS_SGI64_ENV */
  #ifdef AFS_LINUX20_ENV
! #define MyPidxx current->pid
  #else
  #if defined(AFS_DARWIN_ENV)
  #if defined(AFS_DARWIN80_ENV)
  #define MyPidxx (proc_selfpid())
  #else
  #define MyPidxx (current_proc()->p_pid )
  #endif
  #else
  #if defined(AFS_FBSD_ENV)
  #define MyPidxx (curproc->p_pid )
  #else
  #define MyPidxx (u.u_procp->p_pid )
  #endif /* AFS_FBSD_ENV */
  #endif /* AFS_DARWIN_ENV */
  #endif /* AFS_LINUX20_ENV */
--- 86,146 ----
  #define BEGINMAC do {
  #define ENDMAC   } while (0)
  
! #if defined(AFS_SUN57_ENV)
! typedef kthread_t * afs_lock_tracker_t;
! #define MyPidxx (curthread)
! #define MyPidxx2Pid(x) (ttoproc(x)->p_pid)
! #elif defined(AFS_SUN5_ENV) || defined(AFS_OBSD_ENV)
! typedef unsigned int afs_lock_tracker_t;
  #define MyPidxx (curproc->p_pid)
+ #define MyPidxx2Pid(x) (x)
  #else
  #if defined(AFS_AIX41_ENV)
+ typedef tid_t afs_lock_tracker_t;
  extern tid_t thread_self();
! #define MyPidxx (thread_self())
! #define MyPidxx2Pid(x) ((afs_int32)(x))
  #else /* AFS_AIX41_ENV */
  #if defined(AFS_HPUX101_ENV)
! typedef struct proc * afs_lock_tracker_t;
! #define MyPidxx (u.u_procp)
! #define MyPidxx2Pid(x) ((afs_int32)p_pid(x))
  #else
  #if defined(AFS_SGI64_ENV)
  #if defined(AFS_SGI65_ENV)
+ typedef unsigned int afs_lock_tracker_t;
  #define MyPidxx proc_pid(curproc())
+ #define MyPidxx2Pid(x) (x)
  #else
+ typedef unsigned int afs_lock_tracker_t;
  #define MyPidxx current_pid()
+ #define MyPidxx2Pid(x) (x)
  #endif
  #else /* AFS_SGI64_ENV */
  #ifdef AFS_LINUX20_ENV
! typedef struct task_struct * afs_lock_tracker_t;
! #define MyPidxx (current)
! #define MyPidxx2Pid(x) ((x)->pid)
  #else
  #if defined(AFS_DARWIN_ENV)
  #if defined(AFS_DARWIN80_ENV)
+ typedef unsigned int afs_lock_tracker_t;
  #define MyPidxx (proc_selfpid())
+ #define MyPidxx2Pid(x) (x)
  #else
+ typedef unsigned int afs_lock_tracker_t;
  #define MyPidxx (current_proc()->p_pid )
+ #define MyPidxx2Pid(x) (x)
  #endif
  #else
  #if defined(AFS_FBSD_ENV)
+ typedef unsigned int afs_lock_tracker_t;
  #define MyPidxx (curproc->p_pid )
+ #define MyPidxx2Pid(x) (x)
  #else
+ typedef unsigned int afs_lock_tracker_t;
  #define MyPidxx (u.u_procp->p_pid )
+ #define MyPidxx2Pid(x) (x)
  #endif /* AFS_FBSD_ENV */
  #endif /* AFS_DARWIN_ENV */
  #endif /* AFS_LINUX20_ENV */
***************
*** 139,146 ****
       ** only for writes/shared  locks. Hence, it indictes where in the
       ** source code the shared/write lock was set.
       */
!     unsigned int pid_last_reader;	/* proceess id of last reader */
!     unsigned int pid_writer;	/* process id of writer, else 0 */
      unsigned int src_indicator;	/* third param to ObtainLock() */
  #endif				/* INSTRUMENT_LOCKS */
  };
--- 163,170 ----
       ** only for writes/shared  locks. Hence, it indictes where in the
       ** source code the shared/write lock was set.
       */
!     afs_lock_tracker_t pid_last_reader;	/* proceess id of last reader */
!     afs_lock_tracker_t pid_writer;	/* process id of writer, else 0 */
      unsigned int src_indicator;	/* third param to ObtainLock() */
  #endif				/* INSTRUMENT_LOCKS */
  };
Index: openafs/src/afs/sysincludes.h
diff -c openafs/src/afs/sysincludes.h:1.28.2.12 openafs/src/afs/sysincludes.h:1.28.2.14
*** openafs/src/afs/sysincludes.h:1.28.2.12	Wed Sep  6 16:57:17 2006
--- openafs/src/afs/sysincludes.h	Thu Dec 28 16:50:58 2006
***************
*** 53,59 ****
--- 53,61 ----
  #else /* AFS_OBSD_ENV */
  #ifdef AFS_LINUX22_ENV
  #include <linux/version.h>
+ #ifdef CONFIG_H_EXISTS
  #include <linux/config.h>
+ #endif
  #include <linux/linkage.h>
  #include <linux/limits.h>
  #include <linux/wait.h>
***************
*** 213,218 ****
--- 215,221 ----
  
  #ifdef AFS_SUN510_ENV
  #include <sys/cred_impl.h>
+ #include <sys/policy.h>
  #endif
  
  #include "h/socket.h"
Index: openafs/src/afs/AIX/osi_file.c
diff -c openafs/src/afs/AIX/osi_file.c:1.9 openafs/src/afs/AIX/osi_file.c:1.9.2.1
*** openafs/src/afs/AIX/osi_file.c:1.9	Tue Jul 15 19:14:16 2003
--- openafs/src/afs/AIX/osi_file.c	Thu Nov  9 18:26:25 2006
***************
*** 11,17 ****
  #include "afs/param.h"
  
  RCSID
!     ("$Header: /cvs/openafs/src/afs/AIX/osi_file.c,v 1.9 2003/07/15 23:14:16 shadow Exp $");
  
  #include "afs/sysincludes.h"	/* Standard vendor system headers */
  #include "afsincludes.h"	/* Afs-based standard headers */
--- 11,17 ----
  #include "afs/param.h"
  
  RCSID
!     ("$Header: /cvs/openafs/src/afs/AIX/osi_file.c,v 1.9.2.1 2006/11/09 23:26:25 shadow Exp $");
  
  #include "afs/sysincludes.h"	/* Standard vendor system headers */
  #include "afsincludes.h"	/* Afs-based standard headers */
***************
*** 75,81 ****
      AFS_GLOCK();
      if (code == 0) {
  	astat->size = tvattr.va_size;
- 	astat->blksize = tvattr.va_blocksize;
  	astat->mtime = tvattr.va_mtime.tv_sec;
  	astat->atime = tvattr.va_atime.tv_sec;
      }
--- 75,80 ----
Index: openafs/src/afs/DARWIN/osi_file.c
diff -c openafs/src/afs/DARWIN/osi_file.c:1.8.2.5 openafs/src/afs/DARWIN/osi_file.c:1.8.2.6
*** openafs/src/afs/DARWIN/osi_file.c:1.8.2.5	Sun Aug 20 18:16:47 2006
--- openafs/src/afs/DARWIN/osi_file.c	Thu Nov  9 18:26:25 2006
***************
*** 11,17 ****
  #include "afs/param.h"
  
  RCSID
!     ("$Header: /cvs/openafs/src/afs/DARWIN/osi_file.c,v 1.8.2.5 2006/08/20 22:16:47 shadow Exp $");
  
  #include "afs/sysincludes.h"	/* Standard vendor system headers */
  #include "afsincludes.h"	/* Afs-based standard headers */
--- 11,17 ----
  #include "afs/param.h"
  
  RCSID
!     ("$Header: /cvs/openafs/src/afs/DARWIN/osi_file.c,v 1.8.2.6 2006/11/09 23:26:25 shadow Exp $");
  
  #include "afs/sysincludes.h"	/* Standard vendor system headers */
  #include "afsincludes.h"	/* Afs-based standard headers */
***************
*** 202,208 ****
      AFS_GLOCK();
      if (code == 0) {
  	astat->size = tvattr.va_size;
- 	astat->blksize = tvattr.va_blocksize;
  	astat->mtime = tvattr.va_mtime.tv_sec;
  	astat->atime = tvattr.va_atime.tv_sec;
      }
--- 202,207 ----
Index: openafs/src/afs/DARWIN/osi_machdep.h
diff -c openafs/src/afs/DARWIN/osi_machdep.h:1.3.2.7 openafs/src/afs/DARWIN/osi_machdep.h:1.3.2.8
*** openafs/src/afs/DARWIN/osi_machdep.h:1.3.2.7	Thu Dec  1 02:37:21 2005
--- openafs/src/afs/DARWIN/osi_machdep.h	Thu Nov  9 19:08:53 2006
***************
*** 128,135 ****
  extern int hz;
  #endif
  
- #define PAGESIZE 8192
- 
  #define AFS_UCRED       ucred
  
  #define AFS_PROC        struct proc
--- 128,133 ----
Index: openafs/src/afs/DARWIN/osi_vfsops.c
diff -c openafs/src/afs/DARWIN/osi_vfsops.c:1.11.2.4 openafs/src/afs/DARWIN/osi_vfsops.c:1.11.2.5
*** openafs/src/afs/DARWIN/osi_vfsops.c:1.11.2.4	Tue Jan 17 11:08:20 2006
--- openafs/src/afs/DARWIN/osi_vfsops.c	Thu Jan  4 17:09:50 2007
***************
*** 5,11 ****
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/afs/DARWIN/osi_vfsops.c,v 1.11.2.4 2006/01/17 16:08:20 shadow Exp $");
  
  #include <afs/sysincludes.h>	/* Standard vendor system headers */
  #include <afsincludes.h>	/* Afs-based standard headers */
--- 5,11 ----
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/afs/DARWIN/osi_vfsops.c,v 1.11.2.5 2007/01/04 22:09:50 shadow Exp $");
  
  #include <afs/sysincludes.h>	/* Standard vendor system headers */
  #include <afsincludes.h>	/* Afs-based standard headers */
***************
*** 381,387 ****
       * storing something there.
       */
      abp->f_blocks = abp->f_bfree = abp->f_bavail = abp->f_files =
! 	abp->f_ffree = 2000000;
  
      if (abp != sysstat) {
          abp->f_fsid.val[0] = sysstat->f_fsid.val[0];
--- 381,393 ----
       * storing something there.
       */
      abp->f_blocks = abp->f_bfree = abp->f_bavail = abp->f_files =
! 	abp->f_ffree = 
! #ifdef AFS_DARWIN80_ENV
! 	2147483648
! #else
! 	2000000
! #endif
! 	;
  
      if (abp != sysstat) {
          abp->f_fsid.val[0] = sysstat->f_fsid.val[0];
Index: openafs/src/afs/FBSD/osi_file.c
diff -c openafs/src/afs/FBSD/osi_file.c:1.13 openafs/src/afs/FBSD/osi_file.c:1.13.2.1
*** openafs/src/afs/FBSD/osi_file.c:1.13	Wed Mar 10 18:01:51 2004
--- openafs/src/afs/FBSD/osi_file.c	Thu Nov  9 18:26:25 2006
***************
*** 11,17 ****
  #include "afs/param.h"
  
  RCSID
!     ("$Header: /cvs/openafs/src/afs/FBSD/osi_file.c,v 1.13 2004/03/10 23:01:51 rees Exp $");
  
  #include "afs/sysincludes.h"	/* Standard vendor system headers */
  #include "afsincludes.h"	/* Afs-based standard headers */
--- 11,17 ----
  #include "afs/param.h"
  
  RCSID
!     ("$Header: /cvs/openafs/src/afs/FBSD/osi_file.c,v 1.13.2.1 2006/11/09 23:26:25 shadow Exp $");
  
  #include "afs/sysincludes.h"	/* Standard vendor system headers */
  #include "afsincludes.h"	/* Afs-based standard headers */
***************
*** 81,87 ****
      AFS_GLOCK();
      if (code == 0) {
  	astat->size = tvattr.va_size;
- 	astat->blksize = tvattr.va_blocksize;
  	astat->mtime = tvattr.va_mtime.tv_sec;
  	astat->atime = tvattr.va_atime.tv_sec;
      }
--- 81,86 ----
Index: openafs/src/afs/FBSD/osi_machdep.h
diff -c openafs/src/afs/FBSD/osi_machdep.h:1.9.2.5 openafs/src/afs/FBSD/osi_machdep.h:1.9.2.6
*** openafs/src/afs/FBSD/osi_machdep.h:1.9.2.5	Mon Jul 31 12:16:18 2006
--- openafs/src/afs/FBSD/osi_machdep.h	Thu Nov  9 19:08:53 2006
***************
*** 31,38 ****
  #define osi_Time()	time_second
  #define	afs_hz		hz
  
- #define PAGESIZE 8192
- 
  #define	AFS_UCRED	ucred
  #define	AFS_PROC	struct proc
  
--- 31,36 ----
Index: openafs/src/afs/HPUX/osi_file.c
diff -c openafs/src/afs/HPUX/osi_file.c:1.8 openafs/src/afs/HPUX/osi_file.c:1.8.2.1
*** openafs/src/afs/HPUX/osi_file.c:1.8	Tue Jul 15 19:14:21 2003
--- openafs/src/afs/HPUX/osi_file.c	Thu Nov  9 18:26:26 2006
***************
*** 11,17 ****
  #include "afs/param.h"
  
  RCSID
!     ("$Header: /cvs/openafs/src/afs/HPUX/osi_file.c,v 1.8 2003/07/15 23:14:21 shadow Exp $");
  
  #include "afs/sysincludes.h"	/* Standard vendor system headers */
  #include "afsincludes.h"	/* Afs-based standard headers */
--- 11,17 ----
  #include "afs/param.h"
  
  RCSID
!     ("$Header: /cvs/openafs/src/afs/HPUX/osi_file.c,v 1.8.2.1 2006/11/09 23:26:26 shadow Exp $");
  
  #include "afs/sysincludes.h"	/* Standard vendor system headers */
  #include "afsincludes.h"	/* Afs-based standard headers */
***************
*** 75,81 ****
      AFS_GLOCK();
      if (code == 0) {
  	astat->size = tvattr.va_size;
- 	astat->blksize = tvattr.va_blocksize;
  	astat->mtime = tvattr.va_mtime.tv_sec;
  	astat->atime = tvattr.va_atime.tv_sec;
      }
--- 75,80 ----
Index: openafs/src/afs/HPUX/osi_machdep.h
diff -c openafs/src/afs/HPUX/osi_machdep.h:1.12.2.2 openafs/src/afs/HPUX/osi_machdep.h:1.12.2.3
*** openafs/src/afs/HPUX/osi_machdep.h:1.12.2.2	Fri Oct 14 22:05:03 2005
--- openafs/src/afs/HPUX/osi_machdep.h	Thu Nov  9 19:08:54 2006
***************
*** 24,34 ****
  extern struct timeval time;
  #define osi_Time() (time.tv_sec)
  
- #ifdef PAGESIZE
- #undef PAGESIZE
- #endif
- #define PAGESIZE 8192
- 
  #define	AFS_UCRED	ucred
  #define	AFS_PROC	proc_t
  
--- 24,29 ----
Index: openafs/src/afs/IRIX/osi_file.c
diff -c openafs/src/afs/IRIX/osi_file.c:1.11 openafs/src/afs/IRIX/osi_file.c:1.11.2.1
*** openafs/src/afs/IRIX/osi_file.c:1.11	Sun Aug  8 23:25:45 2004
--- openafs/src/afs/IRIX/osi_file.c	Thu Nov  9 18:26:26 2006
***************
*** 11,17 ****
  #include "afs/param.h"
  
  RCSID
!     ("$Header: /cvs/openafs/src/afs/IRIX/osi_file.c,v 1.11 2004/08/09 03:25:45 shadow Exp $");
  
  #include "afs/sysincludes.h"	/* Standard vendor system headers */
  #include "afsincludes.h"	/* Afs-based standard headers */
--- 11,17 ----
  #include "afs/param.h"
  
  RCSID
!     ("$Header: /cvs/openafs/src/afs/IRIX/osi_file.c,v 1.11.2.1 2006/11/09 23:26:26 shadow Exp $");
  
  #include "afs/sysincludes.h"	/* Standard vendor system headers */
  #include "afsincludes.h"	/* Afs-based standard headers */
***************
*** 106,112 ****
      AFS_GLOCK();
      if (code == 0) {
  	astat->size = tvattr.va_size;
- 	astat->blksize = tvattr.va_blocksize;
  	astat->mtime = tvattr.va_mtime.tv_sec;
  	astat->atime = tvattr.va_atime.tv_sec;
      }
--- 106,111 ----
Index: openafs/src/afs/IRIX/osi_machdep.h
diff -c openafs/src/afs/IRIX/osi_machdep.h:1.7.2.4 openafs/src/afs/IRIX/osi_machdep.h:1.7.2.5
*** openafs/src/afs/IRIX/osi_machdep.h:1.7.2.4	Tue Oct 10 18:21:44 2006
--- openafs/src/afs/IRIX/osi_machdep.h	Thu Nov  9 19:08:54 2006
***************
*** 207,217 ****
  
  #define afs_hz HZ
  
- #ifdef PAGESIZE
- #undef PAGESIZE
- #endif
- #define PAGESIZE 4096
- 
  #ifdef AFS_SGI64_ENV
  #undef setuerror
  #undef getuerror
--- 207,212 ----
Index: openafs/src/afs/LINUX/osi_cred.c
diff -c openafs/src/afs/LINUX/osi_cred.c:1.10.2.2 openafs/src/afs/LINUX/osi_cred.c:1.10.2.3
*** openafs/src/afs/LINUX/osi_cred.c:1.10.2.2	Sun Apr  3 15:49:21 2005
--- openafs/src/afs/LINUX/osi_cred.c	Mon Dec 18 21:29:56 2006
***************
*** 15,68 ****
  #include "afs/param.h"
  
  RCSID
!     ("$Header: /cvs/openafs/src/afs/LINUX/osi_cred.c,v 1.10.2.2 2005/04/03 19:49:21 shadow Exp $");
  
  #include "afs/sysincludes.h"
  #include "afsincludes.h"
  
- /* Setup a pool for creds. Allocate several at a time. */
- #define CRED_ALLOC_STEP 29	/* at 140 bytes/cred = 4060 bytes. */
- 
- 
- static cred_t *cred_pool = NULL;
- int cred_allocs = 0;
- int ncreds_inuse = 0;
- 
- /* Cred locking assumes current single threaded non-preemptive kernel.
-  * Also assuming a fast path through both down and up if no waiters. Otherwise,
-  * test if no creds in pool before grabbing lock in crfree().
-  */
- #if defined(AFS_LINUX24_ENV)
- static DECLARE_MUTEX(linux_cred_pool_lock);
- #else
- static struct semaphore linux_cred_pool_lock = MUTEX;
- #endif
- #define CRED_LOCK() down(&linux_cred_pool_lock)
- #define CRED_UNLOCK() up(&linux_cred_pool_lock)
- 
  cred_t *
  crget(void)
  {
      cred_t *tmp;
-     int i;
  
!     CRED_LOCK();
!     if (!cred_pool) {
! 	cred_allocs++;
! 	cred_pool = (cred_t *) osi_Alloc(CRED_ALLOC_STEP * sizeof(cred_t));
! 	if (!cred_pool)
  	    osi_Panic("crget: No more memory for creds!\n");
  
- 	for (i = 0; i < CRED_ALLOC_STEP - 1; i++)
- 	    cred_pool[i].cr_next = (cred_t *) &cred_pool[i + 1];
- 	cred_pool[i].cr_next = NULL;
-     }
-     tmp = cred_pool;
-     cred_pool = (cred_t *) tmp->cr_next;
-     ncreds_inuse++;
-     CRED_UNLOCK();
- 
-     memset(tmp, 0, sizeof(cred_t));
      tmp->cr_ref = 1;
      return tmp;
  }
--- 15,37 ----
  #include "afs/param.h"
  
  RCSID
!     ("$Header: /cvs/openafs/src/afs/LINUX/osi_cred.c,v 1.10.2.3 2006/12/19 02:29:56 shadow Exp $");
  
  #include "afs/sysincludes.h"
  #include "afsincludes.h"
  
  cred_t *
  crget(void)
  {
      cred_t *tmp;
  
! #if !defined(GFP_NOFS)
! #define GFP_NOFS GFP_KERNEL
! #endif
!     tmp = kmalloc(sizeof(cred_t), GFP_NOFS);
!     if (!tmp)
  	    osi_Panic("crget: No more memory for creds!\n");
  
      tmp->cr_ref = 1;
      return tmp;
  }
***************
*** 78,88 ****
  #if defined(AFS_LINUX26_ENV)
      put_group_info(cr->cr_group_info);
  #endif
!     CRED_LOCK();
!     cr->cr_next = (cred_t *) cred_pool;
!     cred_pool = cr;
!     CRED_UNLOCK();
!     ncreds_inuse--;
  }
  
  
--- 47,54 ----
  #if defined(AFS_LINUX26_ENV)
      put_group_info(cr->cr_group_info);
  #endif
! 
!     kfree(cr);
  }
  
  
***************
*** 95,100 ****
--- 61,67 ----
      tmp->cr_uid = cr->cr_uid;
      tmp->cr_ruid = cr->cr_ruid;
      tmp->cr_gid = cr->cr_gid;
+     tmp->cr_rgid = cr->cr_rgid;
  
  #if defined(AFS_LINUX26_ENV)
      get_group_info(cr->cr_group_info);
***************
*** 104,110 ****
      tmp->cr_ngroups = cr->cr_ngroups;
  #endif
  
-     tmp->cr_ref = 1;
      return tmp;
  }
  
--- 71,76 ----
Index: openafs/src/afs/LINUX/osi_file.c
diff -c openafs/src/afs/LINUX/osi_file.c:1.19.2.10 openafs/src/afs/LINUX/osi_file.c:1.19.2.11
*** openafs/src/afs/LINUX/osi_file.c:1.19.2.10	Fri Aug 11 17:43:38 2006
--- openafs/src/afs/LINUX/osi_file.c	Thu Nov  9 18:26:26 2006
***************
*** 11,17 ****
  #include "afs/param.h"
  
  RCSID
!     ("$Header: /cvs/openafs/src/afs/LINUX/osi_file.c,v 1.19.2.10 2006/08/11 21:43:38 shadow Exp $");
  
  #ifdef AFS_LINUX24_ENV
  #include "h/module.h" /* early to avoid printf->printk mapping */
--- 11,17 ----
  #include "afs/param.h"
  
  RCSID
!     ("$Header: /cvs/openafs/src/afs/LINUX/osi_file.c,v 1.19.2.11 2006/11/09 23:26:26 shadow Exp $");
  
  #ifdef AFS_LINUX24_ENV
  #include "h/module.h" /* early to avoid printf->printk mapping */
***************
*** 137,145 ****
      AFS_STATCNT(osi_Stat);
      MObtainWriteLock(&afs_xosi, 320);
      astat->size = OSIFILE_INODE(afile)->i_size;
- #ifdef STRUCT_INODE_HAS_I_BLKSIZE
-     astat->blksize = OSIFILE_INODE(afile)->i_blksize;
- #endif
  #if defined(AFS_LINUX26_ENV)
      astat->mtime = OSIFILE_INODE(afile)->i_mtime.tv_sec;
      astat->atime = OSIFILE_INODE(afile)->i_atime.tv_sec;
--- 137,142 ----
Index: openafs/src/afs/LINUX/osi_groups.c
diff -c openafs/src/afs/LINUX/osi_groups.c:1.25.2.7 openafs/src/afs/LINUX/osi_groups.c:1.25.2.8
*** openafs/src/afs/LINUX/osi_groups.c:1.25.2.7	Wed Sep 27 17:14:28 2006
--- openafs/src/afs/LINUX/osi_groups.c	Mon Jan 15 10:52:46 2007
***************
*** 20,26 ****
  #endif
  
  RCSID
!     ("$Header: /cvs/openafs/src/afs/LINUX/osi_groups.c,v 1.25.2.7 2006/09/27 21:14:28 shadow Exp $");
  
  #include "afs/sysincludes.h"
  #include "afsincludes.h"
--- 20,26 ----
  #endif
  
  RCSID
!     ("$Header: /cvs/openafs/src/afs/LINUX/osi_groups.c,v 1.25.2.8 2007/01/15 15:52:46 shadow Exp $");
  
  #include "afs/sysincludes.h"
  #include "afsincludes.h"
***************
*** 29,34 ****
--- 29,40 ----
  #include "h/smp_lock.h"
  #endif
  
+ #ifdef AFS_LINUX26_ONEGROUP_ENV
+ #define NUMPAGGROUPS 1
+ #else
+ #define NUMPAGGROUPS 2
+ #endif
+ 
  #if defined(AFS_LINUX26_ENV)
  static int
  afs_setgroups(cred_t **cr, struct group_info *group_info, int change_parent)
***************
*** 160,185 ****
      gid_t g0, g1;
      struct group_info *tmp;
      int i;
      int need_space = 0;
  
      group_info = afs_getgroups(*cr);
!     if (group_info->ngroups < 2
! 	||  afs_get_pag_from_groups(GROUP_AT(group_info, 0),
! 				    GROUP_AT(group_info, 1)) == NOPAG) 
  	/* We will have to make sure group_info is big enough for pag */
!       need_space = 2;
  
      tmp = groups_alloc(group_info->ngroups + need_space);
      
      for (i = 0; i < group_info->ngroups; ++i)
        GROUP_AT(tmp, i + need_space) = GROUP_AT(group_info, i);
      put_group_info(group_info);
      group_info = tmp;
  
!     *newpag = (pagvalue == -1 ? genpag() : pagvalue);
      afs_get_groups_from_pag(*newpag, &g0, &g1);
      GROUP_AT(group_info, 0) = g0;
      GROUP_AT(group_info, 1) = g1;
  
      afs_setgroups(cr, group_info, change_parent);
  
--- 166,218 ----
      gid_t g0, g1;
      struct group_info *tmp;
      int i;
+ #ifdef AFS_LINUX26_ONEGROUP_ENV
+     int j;
+ #endif
      int need_space = 0;
  
      group_info = afs_getgroups(*cr);
!     if (group_info->ngroups < NUMPAGGROUPS
! 	||  afs_get_pag_from_groups(
! #ifdef AFS_LINUX26_ONEGROUP_ENV
! 	    group_info
! #else
! 	    GROUP_AT(group_info, 0) ,GROUP_AT(group_info, 1)
! #endif
! 				    ) == NOPAG) 
  	/* We will have to make sure group_info is big enough for pag */
! 	need_space = NUMPAGGROUPS;
  
      tmp = groups_alloc(group_info->ngroups + need_space);
      
+     *newpag = (pagvalue == -1 ? genpag() : pagvalue);
+ #ifdef AFS_LINUX26_ONEGROUP_ENV
+     for (i = 0, j = 0; i < group_info->ngroups; ++i) {
+ 	int ths = GROUP_AT(group_info, i);
+ 	int last = i > 0 ? GROUP_AT(group_info, i-1) : 0;
+ 	if ((ths >> 24) == 'A')
+ 	    continue;
+ 	if (last <= *newpag && ths > *newpag) {
+ 	   GROUP_AT(tmp, j) = *newpag;
+ 	   j++;
+ 	}
+ 	GROUP_AT(tmp, j) = ths;
+ 	j++;
+     }
+     if (j != i + need_space)
+         GROUP_AT(tmp, j) = *newpag;
+ #else
      for (i = 0; i < group_info->ngroups; ++i)
        GROUP_AT(tmp, i + need_space) = GROUP_AT(group_info, i);
+ #endif
      put_group_info(group_info);
      group_info = tmp;
  
! #ifndef AFS_LINUX26_ONEGROUP_ENV
      afs_get_groups_from_pag(*newpag, &g0, &g1);
      GROUP_AT(group_info, 0) = g0;
      GROUP_AT(group_info, 1) = g1;
+ #endif
  
      afs_setgroups(cr, group_info, change_parent);
  
***************
*** 524,538 ****
      if (datalen != sizeof(afs_uint32) || !data)
  	goto error;
  
!     if (current->group_info->ngroups < 2)
  	goto error;
  
      /* ensure key being set matches current pag */
! 
      g0 = GROUP_AT(current->group_info, 0);
      g1 = GROUP_AT(current->group_info, 1);
  
      pag = afs_get_pag_from_groups(g0, g1);
      if (pag == NOPAG)
  	goto error;
  
--- 557,574 ----
      if (datalen != sizeof(afs_uint32) || !data)
  	goto error;
  
!     if (current->group_info->ngroups < NUMPAGGROUPS)
  	goto error;
  
      /* ensure key being set matches current pag */
! #ifdef AFS_LINUX26_ONEGROUP_ENV
!     pag = afs_get_pag_from_groups(current->group_info);
! #else
      g0 = GROUP_AT(current->group_info, 0);
      g1 = GROUP_AT(current->group_info, 1);
  
      pag = afs_get_pag_from_groups(g0, g1);
+ #endif
      if (pag == NOPAG)
  	goto error;
  
Index: openafs/src/afs/LINUX/osi_machdep.h
diff -c openafs/src/afs/LINUX/osi_machdep.h:1.22.2.14 openafs/src/afs/LINUX/osi_machdep.h:1.22.2.16
*** openafs/src/afs/LINUX/osi_machdep.h:1.22.2.14	Sat Sep 16 15:12:15 2006
--- openafs/src/afs/LINUX/osi_machdep.h	Mon Jan 15 10:52:46 2007
***************
*** 15,20 ****
--- 15,25 ----
  #ifndef OSI_MACHDEP_H_
  #define OSI_MACHDEP_H_
  
+ #include <linux/version.h>
+ #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,4)
+ #define AFS_LINUX26_ONEGROUP_ENV 1
+ #endif
+ 
  /* Only needed for xdr.h in glibc 2.1.x */
  #ifndef quad_t
  #define quad_t __quad_t
***************
*** 123,129 ****
  #define uprintf printk
  
  
- #define PAGESIZE PAGE_SIZE
  #ifndef NGROUPS
  #define NGROUPS NGROUPS_SMALL
  #endif
--- 128,133 ----
Index: openafs/src/afs/LINUX/osi_probe.c
diff -c openafs/src/afs/LINUX/osi_probe.c:1.1.2.14 openafs/src/afs/LINUX/osi_probe.c:1.1.2.16
*** openafs/src/afs/LINUX/osi_probe.c:1.1.2.14	Fri Oct  6 10:01:19 2006
--- openafs/src/afs/LINUX/osi_probe.c	Thu Nov  9 18:14:29 2006
***************
*** 59,65 ****
--- 59,67 ----
  #include "afsincludes.h"
  #endif
  #include <linux/version.h>
+ #ifdef CONFIG_H_EXISTS
  #include <linux/config.h>
+ #endif
  #include <linux/linkage.h>
  #include <linux/init.h>
  #include <linux/unistd.h>
***************
*** 1010,1016 ****
  	ptr = aptr;
  #endif
  	if ((unsigned long)ptr < init_mm.start_code ||
! 		(unsigned long)ptr > init_mm.end_data) {
  /*	     printk("address 0x%lx (from 0x%lx %d) is out of range in check_table. wtf?\n", (unsigned long)x, (unsigned long)ptr, i);*/
  	     continue;
  	}
--- 1012,1023 ----
  	ptr = aptr;
  #endif
  	if ((unsigned long)ptr < init_mm.start_code ||
! #if defined(AFS_AMD64_LINUX20_ENV)
! 		(unsigned long)ptr > init_mm.brk)
! #else
! 		(unsigned long)ptr > init_mm.end_data)
! #endif
! 	{
  /*	     printk("address 0x%lx (from 0x%lx %d) is out of range in check_table. wtf?\n", (unsigned long)x, (unsigned long)ptr, i);*/
  	     continue;
  	}
***************
*** 1119,1126 ****
  	printk("<7>osi_probe: %s                      try_harder\n", P->symbol);
  #endif
      for (offset = 0; offset < datalen; offset++, ptr++) {
! 	if ((unsigned long)ptr < init_mm.start_code ||
! 		(unsigned long)ptr > init_mm.end_data) {
  /*	     printk("address 0x%lx (from 0x%lx %d) is out of range in check_table. wtf?\n", (unsigned long)x, (unsigned long)ptr, i);*/
  	     continue;
  	}
--- 1126,1138 ----
  	printk("<7>osi_probe: %s                      try_harder\n", P->symbol);
  #endif
      for (offset = 0; offset < datalen; offset++, ptr++) {
! 	 if ((unsigned long)ptr < init_mm.start_code ||
! #if defined(AFS_AMD64_LINUX20_ENV)
! 		(unsigned long)ptr > init_mm.brk)
! #else
! 		(unsigned long)ptr > init_mm.end_data)
! #endif
! 	{
  /*	     printk("address 0x%lx (from 0x%lx %d) is out of range in check_table. wtf?\n", (unsigned long)x, (unsigned long)ptr, i);*/
  	     continue;
  	}
Index: openafs/src/afs/LINUX/osi_sleep.c
diff -c openafs/src/afs/LINUX/osi_sleep.c:1.22.2.8 openafs/src/afs/LINUX/osi_sleep.c:1.22.2.10
*** openafs/src/afs/LINUX/osi_sleep.c:1.22.2.8	Sun Sep 18 23:41:31 2005
--- openafs/src/afs/LINUX/osi_sleep.c	Thu Jan  4 16:26:34 2007
***************
*** 11,22 ****
  #include "afs/param.h"
  
  RCSID
!     ("$Header: /cvs/openafs/src/afs/LINUX/osi_sleep.c,v 1.22.2.8 2005/09/19 03:41:31 shadow Exp $");
  
  #include "afs/sysincludes.h"	/* Standard vendor system headers */
  #include "afsincludes.h"	/* Afs-based standard headers */
  #include "afs/afs_stats.h"	/* afs statistics */
  
  static int osi_TimedSleep(char *event, afs_int32 ams, int aintok);
  
  static char waitV, dummyV;
--- 11,26 ----
  #include "afs/param.h"
  
  RCSID
!     ("$Header: /cvs/openafs/src/afs/LINUX/osi_sleep.c,v 1.22.2.10 2007/01/04 21:26:34 shadow Exp $");
  
  #include "afs/sysincludes.h"	/* Standard vendor system headers */
  #include "afsincludes.h"	/* Afs-based standard headers */
  #include "afs/afs_stats.h"	/* afs statistics */
  
+ #if defined(FREEZER_H_EXISTS)
+ #include <linux/freezer.h>
+ #endif
+ 
  static int osi_TimedSleep(char *event, afs_int32 ams, int aintok);
  
  static char waitV, dummyV;
***************
*** 198,204 ****
--- 202,212 ----
  #ifdef PF_FREEZE
  	    current->flags & PF_FREEZE
  #else
+ #if defined(STRUCT_TASK_STRUCT_HAS_TODO)
  	    !current->todo
+ #else
+             test_ti_thread_flag(current->thread_info, TIF_FREEZE)
+ #endif
  #endif
  	    )
  #ifdef LINUX_REFRIGERATOR_TAKES_PF_FREEZE
***************
*** 292,298 ****
--- 300,310 ----
  #ifdef PF_FREEZE
  	    current->flags & PF_FREEZE
  #else
+ #if defined(STRUCT_TASK_STRUCT_HAS_TODO)
  	    !current->todo
+ #else
+             test_ti_thread_flag(current->thread_info, TIF_FREEZE)
+ #endif
  #endif
  	    )
  #ifdef LINUX_REFRIGERATOR_TAKES_PF_FREEZE
Index: openafs/src/afs/LINUX/osi_syscall.c
diff -c openafs/src/afs/LINUX/osi_syscall.c:1.1.2.7 openafs/src/afs/LINUX/osi_syscall.c:1.1.2.8
*** openafs/src/afs/LINUX/osi_syscall.c:1.1.2.7	Tue Nov  1 19:28:17 2005
--- openafs/src/afs/LINUX/osi_syscall.c	Fri Dec  1 13:49:28 2006
***************
*** 15,21 ****
  #include "afs/param.h"
  
  RCSID
!     ("$Header: /cvs/openafs/src/afs/LINUX/osi_syscall.c,v 1.1.2.7 2005/11/02 00:28:17 shadow Exp $");
  
  #ifdef AFS_LINUX24_ENV
  #include <linux/module.h> /* early to avoid printf->printk mapping */
--- 15,21 ----
  #include "afs/param.h"
  
  RCSID
!     ("$Header: /cvs/openafs/src/afs/LINUX/osi_syscall.c,v 1.1.2.8 2006/12/01 18:49:28 shadow Exp $");
  
  #ifdef AFS_LINUX24_ENV
  #include <linux/module.h> /* early to avoid printf->printk mapping */
***************
*** 54,59 ****
--- 54,77 ----
  #define SYSCALL2POINTER (void *)
  #endif
  
+ #if defined(AFS_S390X_LINUX24_ENV) 
+ #define INSERT_SYSCALL(SLOT, TMPPAGE, FUNC) \
+ 	if (POINTER2SYSCALL FUNC > 0x7fffffff) { \
+ 	    TMPPAGE = kmalloc ( PAGE_SIZE, GFP_DMA|GFP_KERNEL );	\
+ 	    if (POINTER2SYSCALL TMPPAGE > 0x7fffffff) { \
+ 		printf("Cannot allocate page for FUNC syscall jump vector\n"); \
+ 		return EINVAL; \
+ 	    } \
+ 	    memcpy(TMPPAGE, syscall_jump_code, sizeof(syscall_jump_code)); \
+ 	    *(void **)(TMPPAGE + 0x0c) = &FUNC; \
+ 	    afs_sys_call_table[_S(SLOT)] = POINTER2SYSCALL TMPPAGE; \
+ 	} else \
+ 	    afs_sys_call_table[_S(SLOT)] = POINTER2SYSCALL FUNC;
+ #else
+ #define INSERT_SYSCALL(SLOT, TMPPAGE, FUNC) \
+     afs_sys_call_table[_S(SLOT)] = POINTER2SYSCALL FUNC;
+ #endif 
+ 
  #if defined(AFS_S390X_LINUX24_ENV) && !defined(AFS_LINUX26_ENV)
  #define _S(x) ((x)<<1)
  #elif defined(AFS_IA64_LINUX20_ENV)
***************
*** 70,75 ****
--- 88,110 ----
  static SYSCALLTYPE *afs_sys_call_table;
  static SYSCALLTYPE afs_ni_syscall = 0;
  
+ #ifdef AFS_S390X_LINUX24_ENV
+ static void *afs_sys_setgroups_page = 0;
+ static void *afs_sys_setgroups32_page = 0;
+ static void *afs_syscall_page = 0;
+ 
+ /* Because of how the syscall table is handled, we need to ensure our 
+    syscalls are within the first 2gb of address space. This means we need
+    self-modifying code we can inject to call our handlers if the module 
+    is loaded high. If keyrings had advanced as fast as false protection
+    this would be unnecessary. */
+ 
+ uint32_t syscall_jump_code[] = {
+   0xe3d0f030, 0x00240dd0, 0xa7f40006, 0xffffffff, 0xffffffff, 0xe310d004, 
+   0x0004e3d0, 0xf0300004, 0x07f10000, 
+ };
+ #endif
+ 
  extern long afs_xsetgroups();
  asmlinkage long (*sys_setgroupsp) (int gidsetsize, gid_t * grouplist);
  
***************
*** 483,498 ****
  
  	/* setup AFS entry point */
  	afs_ni_syscall = afs_sys_call_table[_S(__NR_afs_syscall)];
! 	afs_sys_call_table[_S(__NR_afs_syscall)] = POINTER2SYSCALL afs_syscall;
  
  	/* setup setgroups */
  	sys_setgroupsp = SYSCALL2POINTER afs_sys_call_table[_S(__NR_setgroups)];
! 	afs_sys_call_table[_S(__NR_setgroups)] = POINTER2SYSCALL afs_xsetgroups;
  
  #if defined(__NR_setgroups32)
  	/* setup setgroups32 */
  	sys_setgroups32p = SYSCALL2POINTER afs_sys_call_table[__NR_setgroups32];
! 	afs_sys_call_table[__NR_setgroups32] = POINTER2SYSCALL afs_xsetgroups32;
  #endif
      }
  #endif /* !AFS_IA64_LINUX20_ENV */
--- 518,534 ----
  
  	/* setup AFS entry point */
  	afs_ni_syscall = afs_sys_call_table[_S(__NR_afs_syscall)];
! 
! 	INSERT_SYSCALL(__NR_afs_syscall, afs_syscall_page, afs_syscall)
  
  	/* setup setgroups */
  	sys_setgroupsp = SYSCALL2POINTER afs_sys_call_table[_S(__NR_setgroups)];
! 	INSERT_SYSCALL(__NR_setgroups, afs_sys_setgroups_page, afs_xsetgroups)
  
  #if defined(__NR_setgroups32)
  	/* setup setgroups32 */
  	sys_setgroups32p = SYSCALL2POINTER afs_sys_call_table[__NR_setgroups32];
! 	INSERT_SYSCALL(__NR_setgroups32, afs_sys_setgroups32_page, afs_xsetgroups32)
  #endif
      }
  #endif /* !AFS_IA64_LINUX20_ENV */
***************
*** 580,585 ****
--- 616,631 ----
  	/* put back setgroups32 */
  	afs_sys_call_table[__NR_setgroups32] = POINTER2SYSCALL sys_setgroups32p;
  #endif
+ #if defined(AFS_S390X_LINUX24_ENV)
+ #if defined(__NR_setgroups32) && !defined(AFS_IA64_LINUX20_ENV)
+ 	if (afs_sys_setgroups32_page)
+ 	    kfree(afs_sys_setgroups32_page);
+ #endif
+ 	if (afs_sys_setgroups_page)
+ 	    kfree(afs_sys_setgroups_page);
+ 	if (afs_syscall_page)
+ 	    kfree(afs_syscall_page);
+ #endif
      }
  
  
Index: openafs/src/afs/LINUX/osi_sysctl.c
diff -c openafs/src/afs/LINUX/osi_sysctl.c:1.7.2.2 openafs/src/afs/LINUX/osi_sysctl.c:1.7.2.3
*** openafs/src/afs/LINUX/osi_sysctl.c:1.7.2.2	Tue Jun 21 16:13:50 2005
--- openafs/src/afs/LINUX/osi_sysctl.c	Thu Nov  9 18:14:29 2006
***************
*** 1,7 ****
  /*
   * osi_sysctl.c: Linux sysctl interface to OpenAFS
   *
!  * $Id: osi_sysctl.c,v 1.7.2.2 2005/06/21 20:13:50 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.7.2.3 2006/11/09 23:14:29 shadow Exp $
   *
   * Written Jan 30, 2002 by Kris Van Hees (Sine Nomine Associates)
   */
***************
*** 14,20 ****
--- 14,22 ----
  #include "afs/afs_stats.h"	/* afs statistics */
  
  #include <linux/sysctl.h>
+ #ifdef CONFIG_H_EXISTS
  #include <linux/config.h>
+ #endif
  
  /* From afs_analyze.c */
  extern afs_int32 hm_retry_RO;
Index: openafs/src/afs/LINUX/osi_vfsops.c
diff -c openafs/src/afs/LINUX/osi_vfsops.c:1.29.2.18 openafs/src/afs/LINUX/osi_vfsops.c:1.29.2.22
*** openafs/src/afs/LINUX/osi_vfsops.c:1.29.2.18	Fri Oct  6 09:30:56 2006
--- openafs/src/afs/LINUX/osi_vfsops.c	Thu Dec 28 16:32:08 2006
***************
*** 16,22 ****
  #include "afs/param.h"
  
  RCSID
!     ("$Header: /cvs/openafs/src/afs/LINUX/osi_vfsops.c,v 1.29.2.18 2006/10/06 13:30:56 shadow Exp $");
  
  #define __NO_VERSION__		/* don't define kernel_version in module.h */
  #include <linux/module.h> /* early to avoid printf->printk mapping */
--- 16,22 ----
  #include "afs/param.h"
  
  RCSID
!     ("$Header: /cvs/openafs/src/afs/LINUX/osi_vfsops.c,v 1.29.2.22 2006/12/28 21:32:08 shadow Exp $");
  
  #define __NO_VERSION__		/* don't define kernel_version in module.h */
  #include <linux/module.h> /* early to avoid printf->printk mapping */
***************
*** 64,74 ****
   * dev, covered, s_rd_only, s_dirt, and s_type will be set by read_super.
   */
  #if defined(AFS_LINUX26_ENV)
- static struct super_block *
  #ifdef GET_SB_HAS_STRUCT_VFSMOUNT
  afs_get_sb(struct file_system_type *fs_type, int flags,
  	   const char *dev_name, void *data, struct vfsmount *mnt)
  #else
  afs_get_sb(struct file_system_type *fs_type, int flags,
  	   const char *dev_name, void *data)
  #endif
--- 64,75 ----
   * dev, covered, s_rd_only, s_dirt, and s_type will be set by read_super.
   */
  #if defined(AFS_LINUX26_ENV)
  #ifdef GET_SB_HAS_STRUCT_VFSMOUNT
+ int
  afs_get_sb(struct file_system_type *fs_type, int flags,
  	   const char *dev_name, void *data, struct vfsmount *mnt)
  #else
+ static struct superblock *
  afs_get_sb(struct file_system_type *fs_type, int flags,
  	   const char *dev_name, void *data)
  #endif
***************
*** 102,109 ****
  
  #if defined(AFS_LINUX26_ENV)
  struct backing_dev_info afs_backing_dev_info = {
! 	.ra_pages	= (VM_MAX_READAHEAD * 1024) / PAGE_CACHE_SIZE,
! 	.state		= 0,
  };
  
  int
--- 103,109 ----
  
  #if defined(AFS_LINUX26_ENV)
  struct backing_dev_info afs_backing_dev_info = {
!     .ra_pages		= 0, /* disable readahead, afs does prefetch */
  };
  
  int
***************
*** 270,276 ****
--- 270,280 ----
  {
      struct vcache *vcp;
  
+ #if defined(SLAB_KERNEL)
      vcp = (struct vcache *) kmem_cache_alloc(afs_inode_cachep, SLAB_KERNEL);
+ #else
+     vcp = (struct vcache *) kmem_cache_alloc(afs_inode_cachep, GFP_KERNEL);
+ #endif
      if (!vcp)
  	return NULL;
  
***************
*** 385,391 ****
--- 389,399 ----
   */
  #if defined(AFS_LINUX26_ENV)
  int
+ #if defined(STATFS_TAKES_DENTRY)
+ afs_statfs(struct dentry *dentry, struct kstatfs *statp)
+ #else
  afs_statfs(struct super_block *sbp, struct kstatfs *statp)
+ #endif
  #elif defined(AFS_LINUX24_ENV)
  int
  afs_statfs(struct super_block *sbp, struct statfs *statp)
***************
*** 409,415 ****
--- 417,427 ----
      AFS_STATCNT(afs_statfs);
  
      statp->f_type = 0;		/* Can we get a real type sometime? */
+ #if defined(STATFS_TAKES_DENTRY)
+     statp->f_bsize = dentry->d_sb->s_blocksize;
+ #else
      statp->f_bsize = sbp->s_blocksize;
+ #endif
      statp->f_blocks = statp->f_bfree = statp->f_bavail = statp->f_files =
  	statp->f_ffree = 9000000;
      statp->f_fsid.val[0] = AFS_VFSMAGIC;
***************
*** 487,492 ****
--- 499,507 ----
      ip->i_ino = vp->va_nodeid;
      ip->i_nlink = vp->va_nlink;
      ip->i_blocks = vp->va_blocks;
+ #ifdef STRUCT_INODE_HAS_I_BLKBITS
+     ip->i_blkbits = AFS_BLKBITS;
+ #endif
  #ifdef STRUCT_INODE_HAS_I_BLKSIZE
      ip->i_blksize = vp->va_blocksize;
  #endif
Index: openafs/src/afs/LINUX/osi_vnodeops.c
diff -c openafs/src/afs/LINUX/osi_vnodeops.c:1.81.2.46 openafs/src/afs/LINUX/osi_vnodeops.c:1.81.2.47
*** openafs/src/afs/LINUX/osi_vnodeops.c:1.81.2.46	Tue Oct 10 18:01:04 2006
--- openafs/src/afs/LINUX/osi_vnodeops.c	Thu Nov  9 19:08:55 2006
***************
*** 22,28 ****
  #include "afs/param.h"
  
  RCSID
!     ("$Header: /cvs/openafs/src/afs/LINUX/osi_vnodeops.c,v 1.81.2.46 2006/10/10 22:01:04 shadow Exp $");
  
  #include "afs/sysincludes.h"
  #include "afsincludes.h"
--- 22,28 ----
  #include "afs/param.h"
  
  RCSID
!     ("$Header: /cvs/openafs/src/afs/LINUX/osi_vnodeops.c,v 1.81.2.47 2006/11/10 00:08:55 shadow Exp $");
  
  #include "afs/sysincludes.h"
  #include "afsincludes.h"
***************
*** 1313,1319 ****
      clear_bit(PG_error, &pp->flags);
  #endif
  
!     setup_uio(&tuio, &iovec, (char *)address, offset, PAGESIZE, UIO_READ,
  	      AFS_UIOSYS);
  #ifdef AFS_LINUX24_ENV
      lock_kernel();
--- 1313,1319 ----
      clear_bit(PG_error, &pp->flags);
  #endif
  
!     setup_uio(&tuio, &iovec, (char *)address, offset, PAGE_SIZE, UIO_READ,
  	      AFS_UIOSYS);
  #ifdef AFS_LINUX24_ENV
      lock_kernel();
***************
*** 1331,1337 ****
  
      if (!code) {
  	if (tuio.uio_resid)	/* zero remainder of page */
! 	    memset((void *)(address + (PAGESIZE - tuio.uio_resid)), 0,
  		   tuio.uio_resid);
  #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,4,0)
  	flush_dcache_page(pp);
--- 1331,1337 ----
  
      if (!code) {
  	if (tuio.uio_resid)	/* zero remainder of page */
! 	    memset((void *)(address + (PAGE_SIZE - tuio.uio_resid)), 0,
  		   tuio.uio_resid);
  #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,4,0)
  	flush_dcache_page(pp);
Index: openafs/src/afs/NBSD/osi_file.c
diff -c openafs/src/afs/NBSD/osi_file.c:1.5 openafs/src/afs/NBSD/osi_file.c:1.5.2.1
*** openafs/src/afs/NBSD/osi_file.c:1.5	Wed Aug 27 17:43:18 2003
--- openafs/src/afs/NBSD/osi_file.c	Thu Nov  9 18:26:26 2006
***************
*** 11,17 ****
  #include "afs/param.h"
  
  RCSID
!     ("$Header: /cvs/openafs/src/afs/NBSD/osi_file.c,v 1.5 2003/08/27 21:43:18 rees Exp $");
  
  #include "afs/sysincludes.h"	/* Standard vendor system headers */
  #include "afsincludes.h"	/* Afs-based standard headers */
--- 11,17 ----
  #include "afs/param.h"
  
  RCSID
!     ("$Header: /cvs/openafs/src/afs/NBSD/osi_file.c,v 1.5.2.1 2006/11/09 23:26:26 shadow Exp $");
  
  #include "afs/sysincludes.h"	/* Standard vendor system headers */
  #include "afsincludes.h"	/* Afs-based standard headers */
***************
*** 67,73 ****
      AFS_GLOCK();
      if (code == 0) {
  	astat->size = tvattr.va_size;
- 	astat->blksize = tvattr.va_blocksize;
  	astat->mtime = tvattr.va_mtime.tv_sec;
  	astat->atime = tvattr.va_atime.tv_sec;
      }
--- 67,72 ----
Index: openafs/src/afs/NBSD/osi_machdep.h
diff -c openafs/src/afs/NBSD/osi_machdep.h:1.1.8.2 openafs/src/afs/NBSD/osi_machdep.h:1.1.8.3
*** openafs/src/afs/NBSD/osi_machdep.h:1.1.8.2	Mon May 22 15:08:46 2006
--- openafs/src/afs/NBSD/osi_machdep.h	Thu Nov  9 19:08:56 2006
***************
*** 32,39 ****
  #define osi_Time() (time.tv_sec)
  #define	afs_hz	    hz
  
- #define PAGESIZE 8192
- 
  #define	AFS_UCRED	ucred
  #define	AFS_PROC	struct proc
  
--- 32,37 ----
Index: openafs/src/afs/OBSD/osi_file.c
diff -c openafs/src/afs/OBSD/osi_file.c:1.10.2.1 openafs/src/afs/OBSD/osi_file.c:1.10.2.2
*** openafs/src/afs/OBSD/osi_file.c:1.10.2.1	Fri Jun 23 10:21:12 2006
--- openafs/src/afs/OBSD/osi_file.c	Thu Nov  9 18:26:26 2006
***************
*** 11,17 ****
  #include "afs/param.h"
  
  RCSID
!     ("$Header: /cvs/openafs/src/afs/OBSD/osi_file.c,v 1.10.2.1 2006/06/23 14:21:12 rees Exp $");
  
  #include "afs/sysincludes.h"	/* Standard vendor system headers */
  #include "afs/afsincludes.h"	/* Afs-based standard headers */
--- 11,17 ----
  #include "afs/param.h"
  
  RCSID
!     ("$Header: /cvs/openafs/src/afs/OBSD/osi_file.c,v 1.10.2.2 2006/11/09 23:26:26 shadow Exp $");
  
  #include "afs/sysincludes.h"	/* Standard vendor system headers */
  #include "afs/afsincludes.h"	/* Afs-based standard headers */
***************
*** 72,78 ****
      AFS_GLOCK();
      if (code == 0) {
  	astat->size = afile->size = tvattr.va_size;
- 	astat->blksize = tvattr.va_blocksize;
  	astat->mtime = tvattr.va_mtime.tv_sec;
  	astat->atime = tvattr.va_atime.tv_sec;
      }
--- 72,77 ----
Index: openafs/src/afs/OBSD/osi_machdep.h
diff -c openafs/src/afs/OBSD/osi_machdep.h:1.16.2.7 openafs/src/afs/OBSD/osi_machdep.h:1.16.2.8
*** openafs/src/afs/OBSD/osi_machdep.h:1.16.2.7	Fri Jun 23 10:21:12 2006
--- openafs/src/afs/OBSD/osi_machdep.h	Thu Nov  9 19:08:56 2006
***************
*** 16,22 ****
   * afs_osi.h.
   */
  
! /* $Id: osi_machdep.h,v 1.16.2.7 2006/06/23 14:21:12 rees Exp $ */
  
  #ifndef _OSI_MACHDEP_H_
  #define _OSI_MACHDEP_H_
--- 16,22 ----
   * afs_osi.h.
   */
  
! /* $Id: osi_machdep.h,v 1.16.2.8 2006/11/10 00:08:56 shadow Exp $ */
  
  #ifndef _OSI_MACHDEP_H_
  #define _OSI_MACHDEP_H_
***************
*** 85,91 ****
  #ifndef iodone
  #define iodone biodone
  #endif
- #define PAGESIZE	8192
  #define printk		printf	/* for RX version of xdr_* */
  #define setgroups	sys_setgroups
  #define UVM
--- 85,90 ----
Index: openafs/src/afs/SOLARIS/osi_file.c
diff -c openafs/src/afs/SOLARIS/osi_file.c:1.13 openafs/src/afs/SOLARIS/osi_file.c:1.13.2.1
*** openafs/src/afs/SOLARIS/osi_file.c:1.13	Thu Jun 24 13:38:24 2004
--- openafs/src/afs/SOLARIS/osi_file.c	Thu Nov  9 18:26:27 2006
***************
*** 11,17 ****
  #include "afs/param.h"
  
  RCSID
!     ("$Header: /cvs/openafs/src/afs/SOLARIS/osi_file.c,v 1.13 2004/06/24 17:38:24 shadow Exp $");
  
  #include "afs/sysincludes.h"	/* Standard vendor system headers */
  #include "afsincludes.h"	/* Afs-based standard headers */
--- 11,17 ----
  #include "afs/param.h"
  
  RCSID
!     ("$Header: /cvs/openafs/src/afs/SOLARIS/osi_file.c,v 1.13.2.1 2006/11/09 23:26:27 shadow Exp $");
  
  #include "afs/sysincludes.h"	/* Standard vendor system headers */
  #include "afsincludes.h"	/* Afs-based standard headers */
***************
*** 228,234 ****
      AFS_GLOCK();
      if (code == 0) {
  	astat->size = tvattr.va_size;
- 	astat->blksize = tvattr.va_blksize;
  	astat->mtime = tvattr.va_mtime.tv_sec;
  	astat->atime = tvattr.va_atime.tv_sec;
      }
--- 228,233 ----
Index: openafs/src/afs/SOLARIS/osi_groups.c
diff -c openafs/src/afs/SOLARIS/osi_groups.c:1.7 openafs/src/afs/SOLARIS/osi_groups.c:1.7.2.1
*** openafs/src/afs/SOLARIS/osi_groups.c:1.7	Tue Jul 15 19:14:26 2003
--- openafs/src/afs/SOLARIS/osi_groups.c	Wed Dec 20 15:09:09 2006
***************
*** 13,23 ****
   * setpag
   *
   */
  #include <afsconfig.h>
  #include "afs/param.h"
  
  RCSID
!     ("$Header: /cvs/openafs/src/afs/SOLARIS/osi_groups.c,v 1.7 2003/07/15 23:14:26 shadow Exp $");
  
  #include "afs/sysincludes.h"
  #include "afsincludes.h"
--- 13,29 ----
   * setpag
   *
   */
+ 
+ #include <unistd.h>
+ #ifdef AFS_SUN510_ENV
+ #include <sys/cred.h>
+ #endif
+ 
  #include <afsconfig.h>
  #include "afs/param.h"
  
  RCSID
!     ("$Header: /cvs/openafs/src/afs/SOLARIS/osi_groups.c,v 1.7.2.1 2006/12/20 20:09:09 shadow Exp $");
  
  #include "afs/sysincludes.h"
  #include "afsincludes.h"
***************
*** 124,131 ****
--- 130,142 ----
      AFS_STATCNT(afs_getgroups);
  
      gidset[0] = gidset[1] = 0;
+ #if defined(AFS_SUN510_ENV)
+     savengrps = ngrps = crgetngroups(cred);
+     gp = crgetgroups(cred);
+ #else
      savengrps = ngrps = cred->cr_ngroups;
      gp = cred->cr_groups;
+ #endif
      while (ngrps--)
  	*gidset++ = *gp++;
      return savengrps;
***************
*** 137,144 ****
  afs_setgroups(struct cred **cred, int ngroups, gid_t * gidset,
  	      int change_parent)
  {
-     int ngrps;
-     int i;
      gid_t *gp;
  
      AFS_STATCNT(afs_setgroups);
--- 148,153 ----
***************
*** 149,156 ****
--- 158,170 ----
      }
      if (!change_parent)
  	*cred = (struct cred *)crcopy(*cred);
+ #if defined(AFS_SUN510_ENV)
+     crsetgroups(*cred, ngroups, gidset);
+     gp = crgetgroups(*cred);
+ #else
      (*cred)->cr_ngroups = ngroups;
      gp = (*cred)->cr_groups;
+ #endif
      while (ngroups--)
  	*gp++ = *gidset++;
      mutex_exit(&curproc->p_crlock);
Index: openafs/src/afs/SOLARIS/osi_inode.c
diff -c openafs/src/afs/SOLARIS/osi_inode.c:1.15 openafs/src/afs/SOLARIS/osi_inode.c:1.15.2.1
*** openafs/src/afs/SOLARIS/osi_inode.c:1.15	Thu Jun 24 13:38:24 2004
--- openafs/src/afs/SOLARIS/osi_inode.c	Tue Jan  2 02:36:10 2007
***************
*** 17,23 ****
  #include "afs/param.h"
  
  RCSID
!     ("$Header: /cvs/openafs/src/afs/SOLARIS/osi_inode.c,v 1.15 2004/06/24 17:38:24 shadow Exp $");
  
  #include "afs/sysincludes.h"	/* Standard vendor system headers */
  #include "afsincludes.h"	/* Afs-based standard headers */
--- 17,23 ----
  #include "afs/param.h"
  
  RCSID
!     ("$Header: /cvs/openafs/src/afs/SOLARIS/osi_inode.c,v 1.15.2.1 2007/01/02 07:36:10 shadow Exp $");
  
  #include "afs/sysincludes.h"	/* Standard vendor system headers */
  #include "afsincludes.h"	/* Afs-based standard headers */
***************
*** 158,164 ****
  
      AFS_STATCNT(afs_syscall_icreate);
  
!     if (!afs_suser(credp))
  	return (EPERM);
  
      /** Code to convert a 32 bit dev_t into a 64 bit dev_t
--- 158,164 ----
  
      AFS_STATCNT(afs_syscall_icreate);
  
!     if (!afs_osi_suser(credp))
  	return (EPERM);
  
      /** Code to convert a 32 bit dev_t into a 64 bit dev_t
***************
*** 254,260 ****
  
      AFS_STATCNT(afs_syscall_iopen);
  
!     if (!afs_suser(credp))
  	return (EPERM);
  
      /** Code to convert a 32 bit dev_t into a 64 bit dev_t
--- 254,260 ----
  
      AFS_STATCNT(afs_syscall_iopen);
  
!     if (!afs_osi_suser(credp))
  	return (EPERM);
  
      /** Code to convert a 32 bit dev_t into a 64 bit dev_t
***************
*** 319,325 ****
      register afs_int32 code;
      dev_t newdev;
  
!     if (!afs_suser(credp))
  	return (EPERM);
  
  	/** Code to convert a 32 bit dev_t into a 64 bit dev_t
--- 319,325 ----
      register afs_int32 code;
      dev_t newdev;
  
!     if (!afs_osi_suser(credp))
  	return (EPERM);
  
  	/** Code to convert a 32 bit dev_t into a 64 bit dev_t
Index: openafs/src/afs/SOLARIS/osi_machdep.h
diff -c openafs/src/afs/SOLARIS/osi_machdep.h:1.7.2.2 openafs/src/afs/SOLARIS/osi_machdep.h:1.7.2.4
*** openafs/src/afs/SOLARIS/osi_machdep.h:1.7.2.2	Mon May 22 15:08:47 2006
--- openafs/src/afs/SOLARIS/osi_machdep.h	Tue Jan  2 02:36:10 2007
***************
*** 60,67 ****
  #define gop_rdwr(rw,gp,base,len,offset,segflg,ioflag,ulimit,cr,aresid) \
    vn_rdwr((rw),(gp),(base),(len),(offset),(segflg),(ioflag),(ulimit),(cr),(aresid))
  
- #define	afs_suser(x)	    suser(x)
  
  
  #ifdef KERNEL
  /*
--- 60,71 ----
  #define gop_rdwr(rw,gp,base,len,offset,segflg,ioflag,ulimit,cr,aresid) \
    vn_rdwr((rw),(gp),(base),(len),(offset),(segflg),(ioflag),(ulimit),(cr),(aresid))
  
  
+ #if defined(AFS_SUN510_ENV)
+ #define afs_suser(x)        afs_osi_suser(x)
+ #else
+ #define afs_suser(x)        suser(x)
+ #endif
  
  #ifdef KERNEL
  /*
Index: openafs/src/afs/SOLARIS/osi_vfsops.c
diff -c openafs/src/afs/SOLARIS/osi_vfsops.c:1.18.2.1 openafs/src/afs/SOLARIS/osi_vfsops.c:1.18.2.3
*** openafs/src/afs/SOLARIS/osi_vfsops.c:1.18.2.1	Fri Jun 30 10:06:11 2006
--- openafs/src/afs/SOLARIS/osi_vfsops.c	Tue Jan  2 02:36:10 2007
***************
*** 14,20 ****
  #include "afs/param.h"
  
  RCSID
!     ("$Header: /cvs/openafs/src/afs/SOLARIS/osi_vfsops.c,v 1.18.2.1 2006/06/30 14:06:11 shadow Exp $");
  
  #include "afs/sysincludes.h"	/* Standard vendor system headers */
  #include "afsincludes.h"	/* Afs-based standard headers */
--- 14,20 ----
  #include "afs/param.h"
  
  RCSID
!     ("$Header: /cvs/openafs/src/afs/SOLARIS/osi_vfsops.c,v 1.18.2.3 2007/01/02 07:36:10 shadow Exp $");
  
  #include "afs/sysincludes.h"	/* Standard vendor system headers */
  #include "afsincludes.h"	/* Afs-based standard headers */
***************
*** 43,57 ****
  
      AFS_STATCNT(afs_mount);
  
!     if (!suser(credp)) {
  	AFS_GUNLOCK();
! 	return EPERM;
      }
      afsp->vfs_fstype = afsfstype;
  
      if (afs_globalVFS) {	/* Don't allow remounts. */
  	AFS_GUNLOCK();
! 	return EBUSY;
      }
  
      afs_globalVFS = afsp;
--- 43,61 ----
  
      AFS_STATCNT(afs_mount);
  
! #if defined(AFS_SUN510_ENV)
!     if (secpolicy_fs_mount(credp, amvp, afsp) != 0) {
! #else
!     if (!afs_osi_suser(credp)) {
! #endif
  	AFS_GUNLOCK();
! 	return (EPERM);
      }
      afsp->vfs_fstype = afsfstype;
  
      if (afs_globalVFS) {	/* Don't allow remounts. */
  	AFS_GUNLOCK();
! 	return (EBUSY);
      }
  
      afs_globalVFS = afsp;
***************
*** 75,83 ****
      AFS_GLOCK();
      AFS_STATCNT(afs_unmount);
  
!     if (!suser(credp)) {
! 	AFS_GUNLOCK();
! 	return EPERM;
      }
      afs_globalVFS = 0;
      afs_shutdown();
--- 79,91 ----
      AFS_GLOCK();
      AFS_STATCNT(afs_unmount);
  
! #if defined(AFS_SUN510_ENV)
!     if (secpolicy_fs_unmount(credp, afsp) != 0) {
! #else
!     if (!afs_osi_suser(credp)) {
! #endif
!         AFS_GUNLOCK();
!         return (EPERM);
      }
      afs_globalVFS = 0;
      afs_shutdown();
***************
*** 238,252 ****
  
  
  #ifdef AFS_SUN510_ENV
! struct fs_operation_def afs_vfsops_template[] = {
!     { VFSNAME_MOUNT,		afs_mount },
!     { VFSNAME_UNMOUNT,		afs_unmount },
!     { VFSNAME_ROOT,		afs_root },
!     { VFSNAME_STATVFS,		afs_statvfs },
!     { VFSNAME_SYNC,		afs_sync },
!     { VFSNAME_VGET,		afs_vget },
!     { VFSNAME_MOUNTROOT,	afs_mountroot },
!     { VFSNAME_FREEVFS,		fs_freevfs },
  };
  struct vfsops *afs_vfsopsp;
  #else
--- 246,262 ----
  
  
  #ifdef AFS_SUN510_ENV
! /* The following list must always be NULL-terminated */
! const fs_operation_def_t afs_vfsops_template[] = {
!     VFSNAME_MOUNT,		afs_mount,
!     VFSNAME_UNMOUNT,		afs_unmount,
!     VFSNAME_ROOT,		afs_root,
!     VFSNAME_STATVFS,		afs_statvfs,
!     VFSNAME_SYNC,		afs_sync,
!     VFSNAME_VGET,		afs_vget,
!     VFSNAME_MOUNTROOT,  	afs_mountroot,
!     VFSNAME_FREEVFS,		fs_freevfs,
!     NULL,                     NULL
  };
  struct vfsops *afs_vfsopsp;
  #else
Index: openafs/src/afs/SOLARIS/osi_vnodeops.c
diff -c openafs/src/afs/SOLARIS/osi_vnodeops.c:1.20.2.9 openafs/src/afs/SOLARIS/osi_vnodeops.c:1.20.2.10
*** openafs/src/afs/SOLARIS/osi_vnodeops.c:1.20.2.9	Mon Jul  3 14:43:39 2006
--- openafs/src/afs/SOLARIS/osi_vnodeops.c	Thu Dec 28 17:26:48 2006
***************
*** 11,17 ****
  #include "afs/param.h"
  
  RCSID
!     ("$Header: /cvs/openafs/src/afs/SOLARIS/osi_vnodeops.c,v 1.20.2.9 2006/07/03 18:43:39 jaltman Exp $");
  
  /*
   * SOLARIS/osi_vnodeops.c
--- 11,17 ----
  #include "afs/param.h"
  
  RCSID
!     ("$Header: /cvs/openafs/src/afs/SOLARIS/osi_vnodeops.c,v 1.20.2.10 2006/12/28 22:26:48 shadow Exp $");
  
  /*
   * SOLARIS/osi_vnodeops.c
***************
*** 1442,1492 ****
  extern void gafs_inactive();
  
  #ifdef AFS_SUN510_ENV
! struct fs_operation_def afs_vnodeops_template[] = {
!     { VOPNAME_OPEN,		gafs_open },
!     { VOPNAME_CLOSE,		gafs_close },
!     { VOPNAME_READ,		afs_vmread },
!     { VOPNAME_WRITE,		afs_vmwrite },
!     { VOPNAME_IOCTL,		afs_ioctl },
!     { VOPNAME_SETFL,		fs_setfl },
!     { VOPNAME_GETATTR,		gafs_getattr },
!     { VOPNAME_SETATTR,		gafs_setattr },
!     { VOPNAME_ACCESS,		gafs_access },
!     { VOPNAME_LOOKUP,		gafs_lookup },
!     { VOPNAME_CREATE,		gafs_create },
!     { VOPNAME_REMOVE,		gafs_remove },
!     { VOPNAME_LINK,		gafs_link },
!     { VOPNAME_RENAME,		gafs_rename },
!     { VOPNAME_MKDIR,		gafs_mkdir },
!     { VOPNAME_RMDIR,		gafs_rmdir },
!     { VOPNAME_READDIR,		gafs_readdir },
!     { VOPNAME_SYMLINK,		gafs_symlink },   
!     { VOPNAME_READLINK,		gafs_readlink },
!     { VOPNAME_FSYNC,		gafs_fsync },
!     { VOPNAME_INACTIVE,		gafs_inactive },
!     { VOPNAME_FID,		gafs_fid },
!     { VOPNAME_RWLOCK,		afs_rwlock },
!     { VOPNAME_RWUNLOCK,		afs_rwunlock },
!     { VOPNAME_SEEK,		afs_seek },
!     { VOPNAME_CMP,		afs_cmp },
!     { VOPNAME_FRLOCK,		afs_frlock },
!     { VOPNAME_SPACE,		afs_space },
!     { VOPNAME_REALVP,		afs_realvp },
!     { VOPNAME_GETPAGE,		afs_getpage },
!     { VOPNAME_PUTPAGE,		afs_putpage },
!     { VOPNAME_MAP,		afs_map },
!     { VOPNAME_ADDMAP,		afs_addmap },
!     { VOPNAME_DELMAP,		afs_delmap },
!     { VOPNAME_POLL,		fs_poll },
!     { VOPNAME_DUMP,		afs_dump },
!     { VOPNAME_PATHCONF,		afs_pathconf },
!     { VOPNAME_PAGEIO,		afs_pageio },
!     { VOPNAME_DUMPCTL,		afs_dumpctl },   
!     { VOPNAME_DISPOSE,		afs_dispose },
!     { VOPNAME_GETSECATTR,	afs_getsecattr },
!     { VOPNAME_SETSECATTR,	afs_setsecattr },
!     { VOPNAME_SHRLOCK,		fs_shrlock },
!     NULL,
  };
  struct vnodeops *afs_ops;
  #else
--- 1442,1493 ----
  extern void gafs_inactive();
  
  #ifdef AFS_SUN510_ENV
! /* The following list must always be NULL-terminated */
! const fs_operation_def_t afs_vnodeops_template[] = {
!     VOPNAME_OPEN,		gafs_open,
!     VOPNAME_CLOSE,		gafs_close,
!     VOPNAME_READ,		afs_vmread,
!     VOPNAME_WRITE,		afs_vmwrite,
!     VOPNAME_IOCTL,		afs_ioctl,
!     VOPNAME_SETFL,		fs_setfl,
!     VOPNAME_GETATTR,		gafs_getattr,
!     VOPNAME_SETATTR,		gafs_setattr,
!     VOPNAME_ACCESS,		gafs_access,
!     VOPNAME_LOOKUP,		gafs_lookup,
!     VOPNAME_CREATE,		gafs_create,
!     VOPNAME_REMOVE,		gafs_remove,
!     VOPNAME_LINK,		gafs_link,
!     VOPNAME_RENAME,		gafs_rename,
!     VOPNAME_MKDIR,		gafs_mkdir,
!     VOPNAME_RMDIR,		gafs_rmdir,
!     VOPNAME_READDIR,		gafs_readdir,
!     VOPNAME_SYMLINK,		gafs_symlink,   
!     VOPNAME_READLINK,		gafs_readlink,
!     VOPNAME_FSYNC,		gafs_fsync,
!     VOPNAME_INACTIVE,		gafs_inactive,
!     VOPNAME_FID,		gafs_fid,
!     VOPNAME_RWLOCK,		afs_rwlock,
!     VOPNAME_RWUNLOCK,		afs_rwunlock,
!     VOPNAME_SEEK,		afs_seek,
!     VOPNAME_CMP,		afs_cmp,
!     VOPNAME_FRLOCK,		afs_frlock,
!     VOPNAME_SPACE,		afs_space,
!     VOPNAME_REALVP,		afs_realvp,
!     VOPNAME_GETPAGE,		afs_getpage,
!     VOPNAME_PUTPAGE,		afs_putpage,
!     VOPNAME_MAP,		afs_map,
!     VOPNAME_ADDMAP,		afs_addmap,
!     VOPNAME_DELMAP,		afs_delmap,
!     VOPNAME_POLL,		fs_poll,
!     VOPNAME_DUMP,		afs_dump,
!     VOPNAME_PATHCONF,		afs_pathconf,
!     VOPNAME_PAGEIO,		afs_pageio,
!     VOPNAME_DUMPCTL,		afs_dumpctl,   
!     VOPNAME_DISPOSE,		afs_dispose,
!     VOPNAME_GETSECATTR,       afs_getsecattr,
!     VOPNAME_SETSECATTR, 	afs_setsecattr,
!     VOPNAME_SHRLOCK,		fs_shrlock,
!     NULL,                     NULL
  };
  struct vnodeops *afs_ops;
  #else
Index: openafs/src/afs/UKERNEL/afs_usrops.c
diff -c openafs/src/afs/UKERNEL/afs_usrops.c:1.27.2.3 openafs/src/afs/UKERNEL/afs_usrops.c:1.27.2.4
*** openafs/src/afs/UKERNEL/afs_usrops.c:1.27.2.3	Wed Apr 13 22:31:42 2005
--- openafs/src/afs/UKERNEL/afs_usrops.c	Thu Nov  9 23:03:38 2006
***************
*** 15,21 ****
  #include "afs/param.h"
  
  RCSID
!     ("$Header: /cvs/openafs/src/afs/UKERNEL/afs_usrops.c,v 1.27.2.3 2005/04/14 02:31:42 shadow Exp $");
  
  
  #ifdef	UKERNEL
--- 15,21 ----
  #include "afs/param.h"
  
  RCSID
!     ("$Header: /cvs/openafs/src/afs/UKERNEL/afs_usrops.c,v 1.27.2.4 2006/11/10 04:03:38 shadow Exp $");
  
  
  #ifdef	UKERNEL
***************
*** 854,860 ****
  	return -1;
      }
      stp->size = st.st_size;
-     stp->blksize = st.st_blksize;
      stp->mtime = st.st_mtime;
      stp->atime = st.st_atime;
      AFS_GLOCK();
--- 854,859 ----
Index: openafs/src/afs/UKERNEL/sysincludes.h
diff -c openafs/src/afs/UKERNEL/sysincludes.h:1.15.2.1 openafs/src/afs/UKERNEL/sysincludes.h:1.15.2.2
*** openafs/src/afs/UKERNEL/sysincludes.h:1.15.2.1	Wed Sep 27 17:14:28 2006
--- openafs/src/afs/UKERNEL/sysincludes.h	Thu Nov  9 19:08:56 2006
***************
*** 175,184 ****
  #define MAXNAMLEN		512
  #endif
  
- #ifndef PAGESIZE
- #define PAGESIZE		4096
- #endif
- 
  /*
   * This file contains data types and definitions for running
   * the AFS client in user space. Kernel data structures
--- 175,180 ----
Index: openafs/src/afs/VNOPS/afs_vnop_attrs.c
diff -c openafs/src/afs/VNOPS/afs_vnop_attrs.c:1.27.2.10 openafs/src/afs/VNOPS/afs_vnop_attrs.c:1.27.2.11
*** openafs/src/afs/VNOPS/afs_vnop_attrs.c:1.27.2.10	Sun Oct 23 02:31:23 2005
--- openafs/src/afs/VNOPS/afs_vnop_attrs.c	Thu Nov  9 19:08:57 2006
***************
*** 24,30 ****
  #include "afs/param.h"
  
  RCSID
!     ("$Header: /cvs/openafs/src/afs/VNOPS/afs_vnop_attrs.c,v 1.27.2.10 2005/10/23 06:31:23 shadow Exp $");
  
  #include "afs/sysincludes.h"	/* Standard vendor system headers */
  #include "afsincludes.h"	/* Afs-based standard headers */
--- 24,30 ----
  #include "afs/param.h"
  
  RCSID
!     ("$Header: /cvs/openafs/src/afs/VNOPS/afs_vnop_attrs.c,v 1.27.2.11 2006/11/10 00:08:57 shadow Exp $");
  
  #include "afs/sysincludes.h"	/* Standard vendor system headers */
  #include "afsincludes.h"	/* Afs-based standard headers */
***************
*** 144,152 ****
      attrs->va_flags = 0;
  #endif
  #if defined(AFS_SGI_ENV) || defined(AFS_SUN5_ENV)
!     attrs->va_blksize = PAGESIZE;	/* XXX Was 8192 XXX */
  #else
!     attrs->va_blocksize = PAGESIZE;	/* XXX Was 8192 XXX */
  #endif
      attrs->va_rdev = 1;
  #if defined(AFS_HPUX110_ENV)
--- 144,152 ----
      attrs->va_flags = 0;
  #endif
  #if defined(AFS_SGI_ENV) || defined(AFS_SUN5_ENV)
!     attrs->va_blksize = AFS_BLKSIZE;	/* XXX Was 8192 XXX */
  #else
!     attrs->va_blocksize = AFS_BLKSIZE;	/* XXX Was 8192 XXX */
  #endif
      attrs->va_rdev = 1;
  #if defined(AFS_HPUX110_ENV)
Index: openafs/src/afs/VNOPS/afs_vnop_flock.c
diff -c openafs/src/afs/VNOPS/afs_vnop_flock.c:1.24.2.6 openafs/src/afs/VNOPS/afs_vnop_flock.c:1.24.2.7
*** openafs/src/afs/VNOPS/afs_vnop_flock.c:1.24.2.6	Fri Jun  2 17:23:52 2006
--- openafs/src/afs/VNOPS/afs_vnop_flock.c	Tue Oct 24 09:42:16 2006
***************
*** 16,22 ****
  #include "afs/param.h"
  
  RCSID
!     ("$Header: /cvs/openafs/src/afs/VNOPS/afs_vnop_flock.c,v 1.24.2.6 2006/06/02 21:23:52 shadow Exp $");
  
  #include "afs/sysincludes.h"	/* Standard vendor system headers */
  #include "afsincludes.h"	/* Afs-based standard headers */
--- 16,22 ----
  #include "afs/param.h"
  
  RCSID
!     ("$Header: /cvs/openafs/src/afs/VNOPS/afs_vnop_flock.c,v 1.24.2.7 2006/10/24 13:42:16 rees Exp $");
  
  #include "afs/sysincludes.h"	/* Standard vendor system headers */
  #include "afsincludes.h"	/* Afs-based standard headers */
***************
*** 571,577 ****
  #endif
  	) && code != LOCK_UN)
  	code |= LOCK_NB;	/* non-blocking, s.v.p. */
! #if	defined(AFS_OSF_ENV) || defined(AFS_DARWIN_ENV) || defined(AFS_XBSD_ENV)
      code = HandleFlock(avc, code, &treq, clid, 0 /*!onlymine */ );
  #elif defined(AFS_SGI_ENV)
      AFS_RWLOCK((vnode_t *) avc, VRWLOCK_WRITE);
--- 571,577 ----
  #endif
  	) && code != LOCK_UN)
  	code |= LOCK_NB;	/* non-blocking, s.v.p. */
! #if	defined(AFS_OSF_ENV) || defined(AFS_DARWIN_ENV)
      code = HandleFlock(avc, code, &treq, clid, 0 /*!onlymine */ );
  #elif defined(AFS_SGI_ENV)
      AFS_RWLOCK((vnode_t *) avc, VRWLOCK_WRITE);
Index: openafs/src/aklog/Makefile.in
diff -c openafs/src/aklog/Makefile.in:1.1.2.7 openafs/src/aklog/Makefile.in:1.1.2.8
*** openafs/src/aklog/Makefile.in:1.1.2.7	Tue Apr  4 20:13:44 2006
--- openafs/src/aklog/Makefile.in	Thu Jan  4 22:22:00 2007
***************
*** 16,22 ****
  SRCS=	aklog.c aklog_main.c  krb_util.c linked_list.c
  OBJS=   aklog.o aklog_main.o krb_util.o linked_list.o
  
! all: aklog @ASETKEY@
  
  aklog:	${OBJS} ${AFSLIBS}
  	${CC} -o $@ ${CFLAGS} ${OBJS} ${AKLIBS} ${AFSLIBS} ${XLIBS}
--- 16,22 ----
  SRCS=	aklog.c aklog_main.c  krb_util.c linked_list.c
  OBJS=   aklog.o aklog_main.o krb_util.o linked_list.o
  
! all: aklog asetkey
  
  aklog:	${OBJS} ${AFSLIBS}
  	${CC} -o $@ ${CFLAGS} ${OBJS} ${AKLIBS} ${AFSLIBS} ${XLIBS}
***************
*** 33,40 ****
  ${DESTDIR}${bindir}/aklog: aklog
  	${INSTALL} $? $@
  
! ${DESTDIR}${afssrvbindir}/asetkey: @ASETKEY@
! 	if test "x@ASETKEY@" != "x"; then ${INSTALL} $? $@; fi
  
  dest: \
  	${DEST}/bin/aklog ${DEST}/root.server/usr/afs/bin/asetkey
--- 33,40 ----
  ${DESTDIR}${bindir}/aklog: aklog
  	${INSTALL} $? $@
  
! ${DESTDIR}${afssrvbindir}/asetkey: asetkey
! 	${INSTALL} $? $@
  
  dest: \
  	${DEST}/bin/aklog ${DEST}/root.server/usr/afs/bin/asetkey
***************
*** 42,49 ****
  ${DEST}/bin/aklog: aklog
  	${INSTALL} $? $@
  
! ${DEST}/root.server/usr/afs/bin/asetkey: @ASETKEY@
! 	if test "x@ASETKEY@" != "x"; then ${INSTALL} $? $@; fi
  
  #
  # Misc. targets
--- 42,49 ----
  ${DEST}/bin/aklog: aklog
  	${INSTALL} $? $@
  
! ${DEST}/root.server/usr/afs/bin/asetkey: asetkey
! 	${INSTALL} $? $@
  
  #
  # Misc. targets
Index: openafs/src/aklog/asetkey.c
diff -c openafs/src/aklog/asetkey.c:1.4.2.5 openafs/src/aklog/asetkey.c:1.4.2.6
*** openafs/src/aklog/asetkey.c:1.4.2.5	Wed Aug  2 15:53:20 2006
--- openafs/src/aklog/asetkey.c	Thu Jan  4 22:22:00 2007
***************
*** 1,5 ****
  /*
!  * $Id: asetkey.c,v 1.4.2.5 2006/08/02 19:53:20 shadow Exp $
   *
   * asetkey - Manipulates an AFS KeyFile
   *
--- 1,5 ----
  /*
!  * $Id: asetkey.c,v 1.4.2.6 2007/01/05 03:22:00 shadow Exp $
   *
   * asetkey - Manipulates an AFS KeyFile
   *
***************
*** 11,16 ****
--- 11,22 ----
  #include <sys/types.h>
  #include <netinet/in.h>
  #include <netdb.h>
+ #ifdef HAVE_UNISTD_H
+ #include <unistd.h>
+ #endif
+ #ifdef HAVE_STDLIB_H
+ #include <stdlib.h>
+ #endif
  #ifdef HAVE_MEMORY_H
  #include <memory.h>
  #endif /* HAVE_MEMORY_H */
***************
*** 30,35 ****
--- 36,48 ----
  #include <afs/keys.h>
  #include <afs/dirpath.h>
  
+ #ifdef HAVE_KRB5_CREDS_KEYBLOCK
+ #define USING_MIT 1
+ #endif
+ #ifdef HAVE_KRB5_CREDS_SESSION
+ #define USING_HEIMDAL 1
+ #endif
+ 
  int
  main(int argc, char *argv[])
  {
***************
*** 82,94 ****
  		exit(1);
  	}
  
! 	if (key->length != 8) {
  		fprintf(stderr, "Key length should be 8, but is really %d!\n",
! 		       key->length);
  		exit(1);
  	}
  
! 	code = afsconf_AddKey(tdir, kvno, (char *) key->contents, 1);
  	if (code) {
  	    fprintf(stderr, "%s: failed to set key, code %d.\n", argv[0], code);
  	    exit(1);
--- 95,120 ----
  		exit(1);
  	}
  
! #ifdef USING_HEIMDAL
! #define deref_key_length(key) \
! 	  key->keyvalue.length
! 
! #define deref_key_contents(key) \
! 	key->keyvalue.data
! #else
! #define deref_key_length(key) \
! 	  key->length
! 
! #define deref_key_contents(key) \
! 	key->contents
! #endif
! 	if (deref_key_length(key) != 8) {
  		fprintf(stderr, "Key length should be 8, but is really %d!\n",
! 			deref_key_length(key));
  		exit(1);
  	}
  
! 	code = afsconf_AddKey(tdir, kvno, (char *) deref_key_contents(key), 1);
  	if (code) {
  	    fprintf(stderr, "%s: failed to set key, code %d.\n", argv[0], code);
  	    exit(1);
Index: openafs/src/auth/cellconfig.c
diff -c openafs/src/auth/cellconfig.c:1.40.2.11 openafs/src/auth/cellconfig.c:1.40.2.14
*** openafs/src/auth/cellconfig.c:1.40.2.11	Tue Oct 10 16:29:18 2006
--- openafs/src/auth/cellconfig.c	Sat Dec 30 11:56:39 2006
***************
*** 11,17 ****
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/auth/cellconfig.c,v 1.40.2.11 2006/10/10 20:29:18 shadow Exp $");
  
  #include <afs/stds.h>
  #include <afs/pthread_glock.h>
--- 11,17 ----
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/auth/cellconfig.c,v 1.40.2.14 2006/12/30 16:56:39 jaltman Exp $");
  
  #include <afs/stds.h>
  #include <afs/pthread_glock.h>
***************
*** 478,484 ****
  {
      char *rc;
      char tbuffer[256];
!     char *p;
      afsconf_FILE *fp;
      
      strcompose(tbuffer, 256, adir->name, "/", AFSDIR_THISCELL_FILE, NULL);
--- 478,484 ----
  {
      char *rc;
      char tbuffer[256];
!     char *start, *p;
      afsconf_FILE *fp;
      
      strcompose(tbuffer, 256, adir->name, "/", AFSDIR_THISCELL_FILE, NULL);
***************
*** 488,499 ****
      }
      rc = fgets(tbuffer, 256, fp);
      fclose(fp);
  
!     p = strchr(tbuffer, '\n');
!     if (p)
! 	*p = '\0';
  
!     adir->cellName = strdup(tbuffer);
      return 0;
  }
  
--- 488,507 ----
      }
      rc = fgets(tbuffer, 256, fp);
      fclose(fp);
+     if (rc == NULL)
+         return -1;
  
!     start = tbuffer;
!     while (*start != '\0' && isspace(*start))
!         start++;
!     p = start;
!     while (*p != '\0' && !isspace(*p))
!         p++;
!     *p = '\0';
!     if (*start == '\0')
!         return -1;
  
!     adir->cellName = strdup(start);
      return 0;
  }
  
***************
*** 852,863 ****
--- 860,873 ----
      char host[256];
      int server_num = 0;
      int minttl = 0;
+     int try_init = 0;
  
      /* The resolver isn't always MT-safe.. Perhaps this ought to be
       * replaced with a more fine-grained lock just for the resolver
       * operations.
       */
  
+  retryafsdb:
      if ( ! strchr(acellName,'.') ) {
         cellnamelength=strlen(acellName);
         dotcellname=malloc(cellnamelength+2);
***************
*** 865,871 ****
         dotcellname[cellnamelength]='.';
         dotcellname[cellnamelength+1]=0;
         LOCK_GLOBAL_MUTEX;
! 	    len = res_search(dotcellname, C_IN, T_AFSDB, answer, sizeof(answer));
         if ( len < 0 ) {
            len = res_search(acellName, C_IN, T_AFSDB, answer, sizeof(answer));
         }
--- 875,881 ----
         dotcellname[cellnamelength]='.';
         dotcellname[cellnamelength+1]=0;
         LOCK_GLOBAL_MUTEX;
!        len = res_search(dotcellname, C_IN, T_AFSDB, answer, sizeof(answer));
         if ( len < 0 ) {
            len = res_search(acellName, C_IN, T_AFSDB, answer, sizeof(answer));
         }
***************
*** 873,883 ****
         free(dotcellname);
      } else {
         LOCK_GLOBAL_MUTEX;
! 	    len = res_search(acellName, C_IN, T_AFSDB, answer, sizeof(answer));
         UNLOCK_GLOBAL_MUTEX;
      }
!     if (len < 0)
  	return AFSCONF_NOTFOUND;
  
      p = answer + sizeof(HEADER);	/* Skip header */
      code = dn_expand(answer, answer + len, p, host, sizeof(host));
--- 883,899 ----
         free(dotcellname);
      } else {
         LOCK_GLOBAL_MUTEX;
!        len = res_search(acellName, C_IN, T_AFSDB, answer, sizeof(answer));
         UNLOCK_GLOBAL_MUTEX;
      }
!     if (len < 0) {
! 	if (try_init < 1) {
! 	    try_init++;
! 	    res_init();
! 	    goto retryafsdb;
! 	}
  	return AFSCONF_NOTFOUND;
+     }
  
      p = answer + sizeof(HEADER);	/* Skip header */
      code = dn_expand(answer, answer + len, p, host, sizeof(host));
Index: openafs/src/bozo/bnode.c
diff -c openafs/src/bozo/bnode.c:1.17.2.3 openafs/src/bozo/bnode.c:1.17.2.5
*** openafs/src/bozo/bnode.c:1.17.2.3	Sun Aug 13 16:19:57 2006
--- openafs/src/bozo/bnode.c	Thu Dec 21 18:15:34 2006
***************
*** 11,17 ****
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/bozo/bnode.c,v 1.17.2.3 2006/08/13 20:19:57 shadow Exp $");
  
  #include <stddef.h>
  #include <stdlib.h>
--- 11,17 ----
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/bozo/bnode.c,v 1.17.2.5 2006/12/21 23:15:34 shadow Exp $");
  
  #include <stddef.h>
  #include <stdlib.h>
***************
*** 317,323 ****
  afs_int32
  bnode_Create(char *atype, char *ainstance, struct bnode ** abp, char *ap1,
  	     char *ap2, char *ap3, char *ap4, char *ap5, char *notifier,
! 	     int fileGoal)
  {
      struct bnode_type *type;
      struct bnode *tb;
--- 317,323 ----
  afs_int32
  bnode_Create(char *atype, char *ainstance, struct bnode ** abp, char *ap1,
  	     char *ap2, char *ap3, char *ap4, char *ap5, char *notifier,
! 	     int fileGoal, int rewritefile)
  {
      struct bnode_type *type;
      struct bnode *tb;
***************
*** 360,366 ****
      tb->fileGoal = fileGoal;
  
      bnode_SetStat(tb, tb->goal);	/* nudge it once */
!     WriteBozoFile(0);
      return 0;
  }
  
--- 360,369 ----
      tb->fileGoal = fileGoal;
  
      bnode_SetStat(tb, tb->goal);	/* nudge it once */
! 
!     if (rewritefile != 0)
! 	WriteBozoFile(0);
! 
      return 0;
  }
  
***************
*** 740,746 ****
  	ec = setsid();
  #elif defined(AFS_DARWIN90_ENV)
  	ec = setpgid(0, 0);
! #elif defined(AFS_LINUX20_ENV) || defined(AFS_AIX_ENV) 
  	ec = setpgrp();
  #else
  	ec = setpgrp(0, 0);
--- 743,749 ----
  	ec = setsid();
  #elif defined(AFS_DARWIN90_ENV)
  	ec = setpgid(0, 0);
! #elif defined(AFS_LINUX20_ENV) || defined(AFS_AIX_ENV)  
  	ec = setpgrp();
  #else
  	ec = setpgrp(0, 0);
***************
*** 912,919 ****
      tp = (struct bnode_proc *)malloc(sizeof(struct bnode_proc));
      memset(tp, 0, sizeof(struct bnode_proc));
      tp->next = allProcs;
-     allProcs = tp;
-     *aproc = tp;
      tp->bnode = abnode;
      tp->comLine = aexecString;
      tp->coreName = coreName;	/* may be null */
--- 915,920 ----
***************
*** 937,942 ****
--- 938,945 ----
      }
  
      bnode_FreeTokens(tlist);
+     allProcs = tp;
+     *aproc = tp;
      tp->pid = cpid;
      tp->flags = BPROC_STARTED;
      tp->flags &= ~BPROC_EXITED;
Index: openafs/src/bozo/bnode.p.h
diff -c openafs/src/bozo/bnode.p.h:1.4 openafs/src/bozo/bnode.p.h:1.4.2.2
*** openafs/src/bozo/bnode.p.h:1.4	Sun Dec  7 17:49:18 2003
--- openafs/src/bozo/bnode.p.h	Fri Dec 22 01:47:17 2006
***************
*** 126,139 ****
  /* max time to wait for fileserver shutdown */
  #define	FSSDTIME	(30 * 60)	/* seconds */
  
- 
  /* calls back up to the generic bnode layer */
! extern int bnode_SetTimeout( /* bnode, timeout */ );
! extern int bnode_Init( /* bnode, bnodeops */ );
! extern int bnode_Activate( /* bnode */ );
! extern int bnode_NewProc( /* bnode, execstring, corename, procaddr */ );
! extern int bnode_Init( /* no parms */ );
! extern afs_int32 bnode_Create();
! extern struct bnode *bnode_FindInstance();
  extern int bnode_WaitStatus(register struct bnode *abnode, int astatus);
  extern int bnode_SetStat(register struct bnode *abnode, register int agoal);
--- 126,137 ----
  /* max time to wait for fileserver shutdown */
  #define	FSSDTIME	(30 * 60)	/* seconds */
  
  /* calls back up to the generic bnode layer */
! extern int bnode_SetTimeout(register struct bnode *abnode, afs_int32 atimeout);
! extern int bnode_Init(void);
! extern int bnode_NewProc(struct bnode *abnode, char *aexecString, char *coreName, struct bnode_proc **aproc);
! extern int bnode_InitBnode(register struct bnode *abnode, struct bnode_ops *abnodeops, char *aname);
! extern afs_int32 bnode_Create(char *atype, char *ainstance, struct bnode ** abp, char *ap1, char *ap2, char *ap3, char *ap4, char *ap5, char *notifier, int fileGoal, int rewritefile);
! extern struct bnode *bnode_FindInstance(register char *aname);
  extern int bnode_WaitStatus(register struct bnode *abnode, int astatus);
  extern int bnode_SetStat(register struct bnode *abnode, register int agoal);
Index: openafs/src/bozo/bosoprocs.c
diff -c openafs/src/bozo/bosoprocs.c:1.19 openafs/src/bozo/bosoprocs.c:1.19.2.1
*** openafs/src/bozo/bosoprocs.c:1.19	Sun Dec  7 17:49:18 2003
--- openafs/src/bozo/bosoprocs.c	Thu Dec 21 18:15:35 2006
***************
*** 11,17 ****
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/bozo/bosoprocs.c,v 1.19 2003/12/07 22:49:18 jaltman Exp $");
  
  #include <afs/stds.h>
  #include <sys/types.h>
--- 11,17 ----
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/bozo/bosoprocs.c,v 1.19.2.1 2006/12/21 23:15:35 shadow Exp $");
  
  #include <afs/stds.h>
  #include <sys/types.h>
***************
*** 853,859 ****
  
      code =
  	bnode_Create(atype, ainstance, &tb, ap1, ap2, ap3, ap4, ap5, notifier,
! 		     BSTAT_NORMAL);
      if (!code)
  	bnode_SetStat(tb, BSTAT_NORMAL);
  
--- 853,859 ----
  
      code =
  	bnode_Create(atype, ainstance, &tb, ap1, ap2, ap3, ap4, ap5, notifier,
! 		     BSTAT_NORMAL, 1);
      if (!code)
  	bnode_SetStat(tb, BSTAT_NORMAL);
  
Index: openafs/src/bozo/bosserver.c
diff -c openafs/src/bozo/bosserver.c:1.23.2.9 openafs/src/bozo/bosserver.c:1.23.2.10
*** openafs/src/bozo/bosserver.c:1.23.2.9	Tue Jun 20 16:34:59 2006
--- openafs/src/bozo/bosserver.c	Thu Dec 21 18:15:35 2006
***************
*** 11,17 ****
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/bozo/bosserver.c,v 1.23.2.9 2006/06/20 20:34:59 jaltman Exp $");
  
  #include <afs/stds.h>
  #include <sys/types.h>
--- 11,17 ----
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/bozo/bosserver.c,v 1.23.2.10 2006/12/21 23:15:35 shadow Exp $");
  
  #include <afs/stds.h>
  #include <sys/types.h>
***************
*** 419,425 ****
  	code =
  	    bnode_Create(typep, instp, &tb, parms[0], parms[1], parms[2],
  			 parms[3], parms[4], notifier,
! 			 goal ? BSTAT_NORMAL : BSTAT_SHUTDOWN);
  	if (code)
  	    goto fail;
  
--- 419,425 ----
  	code =
  	    bnode_Create(typep, instp, &tb, parms[0], parms[1], parms[2],
  			 parms[3], parms[4], notifier,
! 			 goal ? BSTAT_NORMAL : BSTAT_SHUTDOWN, 0);
  	if (code)
  	    goto fail;
  
Index: openafs/src/bucoord/bc.p.h
diff -c openafs/src/bucoord/bc.p.h:1.3 openafs/src/bucoord/bc.p.h:1.3.2.3
*** openafs/src/bucoord/bc.p.h:1.3	Tue Jul 15 19:14:45 2003
--- openafs/src/bucoord/bc.p.h	Fri Jan  5 01:08:24 2007
***************
*** 10,15 ****
--- 10,24 ----
  #include <afs/budb_client.h>
  #include <afs/afsutil.h>
  
+ #ifdef HAVE_STDIO_H
+ #include <stdio.h>
+ #endif /* HAVE_STDIO_H */
+ #if defined(HAVE_STRING_H)
+ # include <string.h>
+ #elif defined(HAVE_STRINGS_H)
+ # include <strings.h>
+ #endif /* HAVE_STRING_H */
+ 
  /*
   * Represents a host in the config database.
   */
Index: openafs/src/bucoord/bc_status.c
diff -c openafs/src/bucoord/bc_status.c:1.11 openafs/src/bucoord/bc_status.c:1.11.2.1
*** openafs/src/bucoord/bc_status.c:1.11	Sun Dec  7 17:49:18 2003
--- openafs/src/bucoord/bc_status.c	Thu Jan  4 22:34:08 2007
***************
*** 8,25 ****
   */
  
  #include <afsconfig.h>
! #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/bucoord/bc_status.c,v 1.11 2003/12/07 22:49:18 jaltman Exp $");
  
  #include <afs/stds.h>
  #include <sys/types.h>
- #include <stdio.h>
  #ifdef AFS_NT40_ENV
  #include <winsock2.h>
  #else
- #include <strings.h>
  #include <sys/socket.h>
  #include <netinet/in.h>
  #include <netdb.h>
--- 8,23 ----
   */
  
  #include <afsconfig.h>
! #include <afs/stds.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/bucoord/bc_status.c,v 1.11.2.1 2007/01/05 03:34:08 shadow Exp $");
  
  #include <afs/stds.h>
  #include <sys/types.h>
  #ifdef AFS_NT40_ENV
  #include <winsock2.h>
  #else
  #include <sys/socket.h>
  #include <netinet/in.h>
  #include <netdb.h>
Index: openafs/src/bucoord/commands.c
diff -c openafs/src/bucoord/commands.c:1.14.2.6 openafs/src/bucoord/commands.c:1.14.2.7
*** openafs/src/bucoord/commands.c:1.14.2.6	Mon Jul 31 12:36:32 2006
--- openafs/src/bucoord/commands.c	Thu Jan  4 22:34:08 2007
***************
*** 11,17 ****
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/bucoord/commands.c,v 1.14.2.6 2006/07/31 16:36:32 shadow Exp $");
  
  #include <afs/stds.h>
  #if defined(AFS_LINUX24_ENV)
--- 11,17 ----
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/bucoord/commands.c,v 1.14.2.7 2007/01/05 03:34:08 shadow Exp $");
  
  #include <afs/stds.h>
  #if defined(AFS_LINUX24_ENV)
***************
*** 28,34 ****
  #include <sys/socket.h>
  #include <netinet/in.h>
  #include <netdb.h>
- #include <strings.h>
  #endif
  #include <errno.h>
  #include <afs/com_err.h>
--- 28,33 ----
***************
*** 41,47 ****
  #include <afs/ktime.h>		/* PA */
  #include <time.h>
  
- #include <string.h>
  #include <lock.h>
  #include <afs/butc.h>
  #include <afs/tcdata.h>
--- 40,45 ----
Index: openafs/src/bucoord/config.c
diff -c openafs/src/bucoord/config.c:1.8 openafs/src/bucoord/config.c:1.8.2.1
*** openafs/src/bucoord/config.c:1.8	Sat Nov 22 23:53:30 2003
--- openafs/src/bucoord/config.c	Thu Jan  4 22:34:09 2007
***************
*** 11,17 ****
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/bucoord/config.c,v 1.8 2003/11/23 04:53:30 jaltman Exp $");
  
  #include <sys/types.h>
  #ifdef AFS_NT40_ENV
--- 11,17 ----
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/bucoord/config.c,v 1.8.2.1 2007/01/05 03:34:09 shadow Exp $");
  
  #include <sys/types.h>
  #ifdef AFS_NT40_ENV
***************
*** 21,27 ****
  #include <netinet/in.h>
  #include <netdb.h>
  #endif
- #include <stdio.h>
  #include <errno.h>
  
  #include "bc.h"
--- 21,26 ----
Index: openafs/src/bucoord/dlq.c
diff -c openafs/src/bucoord/dlq.c:1.9 openafs/src/bucoord/dlq.c:1.9.2.1
*** openafs/src/bucoord/dlq.c:1.9	Fri Dec 12 18:29:49 2003
--- openafs/src/bucoord/dlq.c	Thu Jan  4 22:34:09 2007
***************
*** 8,23 ****
   */
  
  #include <afsconfig.h>
! #include <afs/param.h>
  #ifdef HAVE_STDLIB_H
  #include <stdlib.h>
  #endif
  
  RCSID
!     ("$Header: /cvs/openafs/src/bucoord/dlq.c,v 1.9 2003/12/12 23:29:49 shadow Exp $");
  
  #include <afs/bubasics.h>
  
  #define	DLQ_ASSERT_HEAD(headptr)				\
          if ( (headptr)->dlq_type != DLQ_HEAD )			\
  	{							\
--- 8,37 ----
   */
  
  #include <afsconfig.h>
! #include <afs/stds.h>
  #ifdef HAVE_STDLIB_H
  #include <stdlib.h>
  #endif
  
  RCSID
!     ("$Header: /cvs/openafs/src/bucoord/dlq.c,v 1.9.2.1 2007/01/05 03:34:09 shadow Exp $");
  
+ #include "bc.h"
  #include <afs/bubasics.h>
  
+ /* protos */
+ int dlqEmpty(dlqlinkP );
+ int dlqInit(dlqlinkP headptr);
+ int dlqLinkf(dlqlinkP, dlqlinkP );
+ int dlqLinkb(dlqlinkP, dlqlinkP );
+ void dlqUnlink( dlqlinkP );
+ int dlqTraverseQueue(dlqlinkP,  int *(), int *());
+ int dlqCount(dlqlinkP );
+ void dlqMoveb( dlqlinkP, dlqlinkP);
+ dlqlinkP dlqUnlinkb(dlqlinkP );
+ dlqlinkP dlqUnlinkf(dlqlinkP );
+ dlqlinkP dlqFront(dlqlinkP headptr);
+ 
  #define	DLQ_ASSERT_HEAD(headptr)				\
          if ( (headptr)->dlq_type != DLQ_HEAD )			\
  	{							\
***************
*** 33,40 ****
   *	0 - items on queue
   */
  
! dlqEmpty(headptr)
!      dlqlinkP headptr;
  {
      DLQ_ASSERT_HEAD(headptr);
      if (headptr->dlq_next == headptr)
--- 47,53 ----
   *	0 - items on queue
   */
  
! int dlqEmpty(dlqlinkP headptr )
  {
      DLQ_ASSERT_HEAD(headptr);
      if (headptr->dlq_next == headptr)
***************
*** 42,49 ****
      return (0);
  }
  
! dlqInit(headptr)
!      dlqlinkP headptr;
  {
      headptr->dlq_next = headptr;
      headptr->dlq_prev = headptr;
--- 55,61 ----
      return (0);
  }
  
! int dlqInit(dlqlinkP headptr)
  {
      headptr->dlq_next = headptr;
      headptr->dlq_prev = headptr;
***************
*** 55,63 ****
  /* dlqLinkf
   *	link item to front of chain
   */
! dlqLinkf(headptr, entryptr)
!      dlqlinkP headptr;
!      dlqlinkP entryptr;
  {
      DLQ_ASSERT_HEAD(headptr);
      /* link in as first item in chain */
--- 67,73 ----
  /* dlqLinkf
   *	link item to front of chain
   */
! int dlqLinkf(dlqlinkP headptr, dlqlinkP entryptr)
  {
      DLQ_ASSERT_HEAD(headptr);
      /* link in as first item in chain */
***************
*** 72,80 ****
   *	link item to end of chain
   */
  
! dlqLinkb(headptr, entryptr)
!      dlqlinkP headptr;
!      dlqlinkP entryptr;
  {
      DLQ_ASSERT_HEAD(headptr);
      entryptr->dlq_next = headptr;
--- 82,88 ----
   *	link item to end of chain
   */
  
! int dlqLinkb(dlqlinkP headptr, dlqlinkP entryptr)
  {
      DLQ_ASSERT_HEAD(headptr);
      entryptr->dlq_next = headptr;
***************
*** 89,98 ****
   *	move all the items on the fromptr and append to the toptr's list
   */
  
! void
! dlqMoveb(fromptr, toptr)
!      dlqlinkP fromptr;
!      dlqlinkP toptr;
  {
      dlqlinkP tailptr;
  
--- 97,103 ----
   *	move all the items on the fromptr and append to the toptr's list
   */
  
! void dlqMoveb( dlqlinkP fromptr, dlqlinkP toptr)
  {
      dlqlinkP tailptr;
  
***************
*** 122,130 ****
   *	unlink the last item on the queue
   */
  
! dlqlinkP
! dlqUnlinkb(headptr)
!      dlqlinkP headptr;
  {
      dlqlinkP ptr;
      DLQ_ASSERT_HEAD(headptr);
--- 127,133 ----
   *	unlink the last item on the queue
   */
  
! dlqlinkP dlqUnlinkb(dlqlinkP headptr)
  {
      dlqlinkP ptr;
      DLQ_ASSERT_HEAD(headptr);
***************
*** 145,153 ****
   *	unlink the item on the front of the queue
   */
  
! dlqlinkP
! dlqUnlinkf(headptr)
!      dlqlinkP headptr;
  {
      dlqlinkP ptr;
      DLQ_ASSERT_HEAD(headptr);
--- 148,154 ----
   *	unlink the item on the front of the queue
   */
  
! dlqlinkP dlqUnlinkf(dlqlinkP headptr) 
  {
      dlqlinkP ptr;
      DLQ_ASSERT_HEAD(headptr);
***************
*** 169,176 ****
   *	unlink the specified item from the queue.
   */
  
! dlqUnlink(ptr)
!      dlqlinkP ptr;
  {
      /* must not be the queue head */
      if (ptr->dlq_type == DLQ_HEAD) {
--- 170,176 ----
   *	unlink the specified item from the queue.
   */
  
! void dlqUnlink( dlqlinkP ptr)
  {
      /* must not be the queue head */
      if (ptr->dlq_type == DLQ_HEAD) {
***************
*** 189,197 ****
   *	return point to item at front of queuen
   */
  
! dlqlinkP
! dlqFront(headptr)
!      dlqlinkP headptr;
  {
      DLQ_ASSERT_HEAD(headptr);
  
--- 189,195 ----
   *	return point to item at front of queuen
   */
  
! dlqlinkP dlqFront(dlqlinkP headptr)
  {
      DLQ_ASSERT_HEAD(headptr);
  
***************
*** 201,209 ****
      return (headptr->dlq_next);
  }
  
! int
! dlqCount(headptr)
!      dlqlinkP headptr;
  {
      dlqlinkP ptr;
      int count = 0;
--- 199,205 ----
      return (headptr->dlq_next);
  }
  
! int dlqCount(dlqlinkP headptr)
  {
      dlqlinkP ptr;
      int count = 0;
***************
*** 218,227 ****
      return (count);
  }
  
! dlqTraverseQueue(headptr, fn1, fn2)
!      dlqlinkP headptr;
!      int (*fn1) ();
!      int (*fn2) ();
  {
      dlqlinkP ptr, oldPtr;
  
--- 214,220 ----
      return (count);
  }
  
! int dlqTraverseQueue(dlqlinkP headptr, int (*fn1()), int (*fn2()))
  {
      dlqlinkP ptr, oldPtr;
  
Index: openafs/src/bucoord/dsstub.c
diff -c openafs/src/bucoord/dsstub.c:1.6.2.1 openafs/src/bucoord/dsstub.c:1.6.2.2
*** openafs/src/bucoord/dsstub.c:1.6.2.1	Sun Apr  3 14:48:29 2005
--- openafs/src/bucoord/dsstub.c	Thu Jan  4 22:34:09 2007
***************
*** 15,40 ****
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/bucoord/dsstub.c,v 1.6.2.1 2005/04/03 18:48:29 shadow Exp $");
  
  #include <sys/types.h>
  #include <afs/cmd.h>
  #ifdef AFS_NT40_ENV
  #include <winsock2.h>
  #else
- #include <strings.h>
  #include <sys/socket.h>
  #include <netinet/in.h>
  #include <netdb.h>
  #endif
- #include <stdio.h>
  #include <dirent.h>
  #include <afs/afsutil.h>
  #include <afs/budb.h>
  #include <afs/bubasics.h>
  #include <afs/volser.h>
  
- #define	dprintf			/* debug */
  
  /* basic format of a tape file is a file, whose name is "T<tapename>.db", and
   * which contains the fields
--- 15,56 ----
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/bucoord/dsstub.c,v 1.6.2.2 2007/01/05 03:34:09 shadow Exp $");
  
  #include <sys/types.h>
  #include <afs/cmd.h>
  #ifdef AFS_NT40_ENV
  #include <winsock2.h>
  #else
  #include <sys/socket.h>
  #include <netinet/in.h>
  #include <netdb.h>
  #endif
  #include <dirent.h>
  #include <afs/afsutil.h>
  #include <afs/budb.h>
  #include <afs/bubasics.h>
  #include <afs/volser.h>
+ #include "bc.h"
+ 
+ /* protos */
+ 
+ static char * TapeName(register char *);
+ static char * DumpName(register afs_int32 adumpID);
+ static FILE * OpenDump(afs_int32 , char * );
+ FILE * OpenTape(char * , char * );
+ static afs_int32 ScanForChildren(afs_int32 );
+ static afs_int32 DeleteDump(afs_int32 );
+ static afs_int32 DeleteTape(char * );
+ char * tailCompPtr(char *);
+ afs_int32 ScanDumpHdr(register FILE *, char *, char *, afs_int32 *, afs_int32 *,
+   afs_int32 *, afs_int32 *);
+ static afs_int32 ScanTapeHdr(register FILE *, afs_int32 *, afs_int32 *, afs_int32 *);
+ afs_int32 ScanTapeVolume(FILE *, char *, afs_int32 *, char *, afs_int32 *, afs_int32 *,
+    afs_int32 *, afs_int32 *);
+ afs_int32 ScanVolClone(FILE *, char *, afs_int32 *);
+ static int SeekDump(register FILE *afile, afs_int32 apos);
  
  
  /* basic format of a tape file is a file, whose name is "T<tapename>.db", and
   * which contains the fields
***************
*** 57,65 ****
  afs_int32 ScanDumpHdr();
  
  /* return the tape file name corresponding to a particular tape */
! static char *
! TapeName(atapeName)
!      register char *atapeName;
  {
      static char tbuffer[AFSDIR_PATH_MAX];
  
--- 73,80 ----
  afs_int32 ScanDumpHdr();
  
  /* return the tape file name corresponding to a particular tape */
! 
! static char * TapeName(register char *atapeName)
  {
      static char tbuffer[AFSDIR_PATH_MAX];
  
***************
*** 72,80 ****
  }
  
  /* return the dump file name corresponding to a particular dump ID */
! static char *
! DumpName(adumpID)
!      register afs_int32 adumpID;
  {
      static char tbuffer[AFSDIR_PATH_MAX];
      char buf[AFSDIR_PATH_MAX];
--- 87,94 ----
  }
  
  /* return the dump file name corresponding to a particular dump ID */
! 
! static char * DumpName(register afs_int32 adumpID)
  {
      static char tbuffer[AFSDIR_PATH_MAX];
      char buf[AFSDIR_PATH_MAX];
***************
*** 86,95 ****
      return tbuffer;
  }
  
! static FILE *
! OpenDump(adumpID, awrite)
!      char *awrite;
!      afs_int32 adumpID;
  {
      register char *tp;
      register FILE *tfile;
--- 100,106 ----
      return tbuffer;
  }
  
! static FILE * OpenDump(afs_int32 adumpID, char * awrite)
  {
      register char *tp;
      register FILE *tfile;
***************
*** 104,113 ****
   * 	non-static for recoverDB
   */
  
! FILE *
! OpenTape(atapeName, awrite)
!      char *awrite;
!      char *atapeName;
  {
      register char *tp;
      register FILE *tfile;
--- 115,121 ----
   * 	non-static for recoverDB
   */
  
! FILE * OpenTape(char * atapeName, char * awrite)
  {
      register char *tp;
      register FILE *tfile;
***************
*** 117,125 ****
  }
  
  /* scan for, and delete, all dumps whose parent dump ID is aparentID */
! static afs_int32
! ScanForChildren(aparentID)
!      afs_int32 aparentID;
  {
      DIR *tdir;
      register struct dirent *tde;
--- 125,132 ----
  }
  
  /* scan for, and delete, all dumps whose parent dump ID is aparentID */
! 
! static afs_int32 ScanForChildren(afs_int32 aparentID)
  {
      DIR *tdir;
      register struct dirent *tde;
***************
*** 162,170 ****
      return 0;
  }
  
! static afs_int32
! DeleteDump(adumpID)
!      afs_int32 adumpID;
  {
      register char *tp;
      register afs_int32 code;
--- 169,175 ----
      return 0;
  }
  
! static afs_int32 DeleteDump(afs_int32 adumpID)
  {
      register char *tp;
      register afs_int32 code;
***************
*** 176,184 ****
      return code;
  }
  
! static afs_int32
! DeleteTape(atapeName)
!      char *atapeName;
  {
      register char *tp;
      register afs_int32 code;
--- 181,187 ----
      return code;
  }
  
! static afs_int32 DeleteTape(char * atapeName)
  {
      register char *tp;
      register afs_int32 code;
***************
*** 192,200 ****
   *	pointer to it
   */
  
! char *
! tailCompPtr(pathNamePtr)
!      char *pathNamePtr;
  {
      char *ptr;
      ptr = strrchr(pathNamePtr, '/');
--- 195,201 ----
   *	pointer to it
   */
  
! char * tailCompPtr(char *pathNamePtr)
  {
      char *ptr;
      ptr = strrchr(pathNamePtr, '/');
***************
*** 222,235 ****
   *	alevel - level of dump (0 = full, 1+ are incrementals)
   */
  afs_int32
! ScanDumpHdr(afile, aname, dumpName, aparent, aincTime, acreateTime, alevel)
!      register FILE *afile;
!      char *aname;
!      char *dumpName;
!      afs_int32 *aparent;
!      afs_int32 *acreateTime;
!      afs_int32 *aincTime;
!      afs_int32 *alevel;
  {
      char tbuffer[256];
      char *tp;
--- 223,229 ----
   *	alevel - level of dump (0 = full, 1+ are incrementals)
   */
  afs_int32
! ScanDumpHdr(register FILE *afile, char *aname, char *dumpName, afs_int32 *aparent, afs_int32 *aincTime, afs_int32 *acreateTime, afs_int32 *alevel)
  {
      char tbuffer[256];
      char *tp;
***************
*** 253,264 ****
  }
  
  /* scan a tape header out of a tape file, leaving the file ptr positioned just past the header */
! static afs_int32
! ScanTapeHdr(afile, adumpID, aseq, adamage)
!      register FILE *afile;
!      afs_int32 *adumpID;
!      afs_int32 *aseq;
!      afs_int32 *adamage;
  {
      char tbuffer[256];
      char *tp;
--- 247,253 ----
  }
  
  /* scan a tape header out of a tape file, leaving the file ptr positioned just past the header */
! static afs_int32 ScanTapeHdr(register FILE *afile, afs_int32 *adumpID, afs_int32 *aseq, afs_int32 *adamage)
  {
      char tbuffer[256];
      char *tp;
***************
*** 282,295 ****
   *	-1 for error
   */
  
! afs_int32
! ScanTapeVolume(afile, avolName, avolID, atapeName, apos, aseq, alastp,
! 	       cloneTime)
!      FILE *afile;
!      char *avolName;
!      afs_int32 *avolID;
!      char *atapeName;
!      afs_int32 *apos, *aseq, *alastp, *cloneTime;
  {
      char tbuffer[256];
      register afs_int32 code;
--- 271,277 ----
   *	-1 for error
   */
  
! afs_int32 ScanTapeVolume(FILE *afile, char *avolName, afs_int32 *avolID, char *atapeName, afs_int32 *apos, afs_int32 *aseq, afs_int32 *alastp, afs_int32 *cloneTime)
  {
      char tbuffer[256];
      register afs_int32 code;
***************
*** 318,328 ****
   *	-1 - volume with volName not found
   */
  
! afs_int32
! ScanVolClone(tdump, volName, cloneTime)
!      FILE *tdump;
!      char *volName;
!      afs_int32 *cloneTime;
  {
      char avolName[256], atapeName[256];
      afs_int32 retval, avolID, apos, aseq, alastp;
--- 300,306 ----
   *	-1 - volume with volName not found
   */
  
! afs_int32 ScanVolClone(FILE *tdump, char *volName, afs_int32 *cloneTime)
  {
      char avolName[256], atapeName[256];
      afs_int32 retval, avolID, apos, aseq, alastp;
***************
*** 341,350 ****
  }
  
  /* seek a dump file (after a header scan has been done) to position apos */
! static
! SeekDump(afile, apos)
!      register FILE *afile;
!      afs_int32 apos;
  {
      register afs_int32 i;
      register char *tp;
--- 319,325 ----
  }
  
  /* seek a dump file (after a header scan has been done) to position apos */
! static int SeekDump(register FILE *afile, afs_int32 apos)
  {
      register afs_int32 i;
      register char *tp;
Index: openafs/src/bucoord/dsvs.c
diff -c openafs/src/bucoord/dsvs.c:1.9.2.1 openafs/src/bucoord/dsvs.c:1.9.2.2
*** openafs/src/bucoord/dsvs.c:1.9.2.1	Sun Apr  3 14:48:29 2005
--- openafs/src/bucoord/dsvs.c	Thu Jan  4 22:34:09 2007
***************
*** 19,38 ****
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/bucoord/dsvs.c,v 1.9.2.1 2005/04/03 18:48:29 shadow Exp $");
  
  #include <sys/types.h>
  #include <afs/cmd.h>
  #ifdef AFS_NT40_ENV
  #include <winsock2.h>
  #else
- #include <strings.h>
  #include <sys/socket.h>
  #include <netinet/in.h>
  #include <netdb.h>
  #include <sys/param.h>
  #endif
- #include <stdio.h>
  #include <afs/com_err.h>
  
  #include <afs/bubasics.h>
--- 19,36 ----
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/bucoord/dsvs.c,v 1.9.2.2 2007/01/05 03:34:09 shadow Exp $");
  
  #include <sys/types.h>
  #include <afs/cmd.h>
  #ifdef AFS_NT40_ENV
  #include <winsock2.h>
  #else
  #include <sys/socket.h>
  #include <netinet/in.h>
  #include <netdb.h>
  #include <sys/param.h>
  #endif
  #include <afs/com_err.h>
  
  #include <afs/bubasics.h>
Index: openafs/src/bucoord/dump.c
diff -c openafs/src/bucoord/dump.c:1.12.2.1 openafs/src/bucoord/dump.c:1.12.2.2
*** openafs/src/bucoord/dump.c:1.12.2.1	Sun Apr  3 14:15:43 2005
--- openafs/src/bucoord/dump.c	Thu Jan  4 22:34:09 2007
***************
*** 15,21 ****
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/bucoord/dump.c,v 1.12.2.1 2005/04/03 18:15:43 shadow Exp $");
  
  #include <sys/types.h>
  #include <afs/cmd.h>
--- 15,21 ----
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/bucoord/dump.c,v 1.12.2.2 2007/01/05 03:34:09 shadow Exp $");
  
  #include <sys/types.h>
  #include <afs/cmd.h>
***************
*** 23,29 ****
  #include <winsock2.h>
  #else
  #include <sys/param.h>
- #include <strings.h>
  #include <sys/socket.h>
  #include <netinet/in.h>
  #include <netdb.h>
--- 23,28 ----
Index: openafs/src/bucoord/dump_sched.c
diff -c openafs/src/bucoord/dump_sched.c:1.7.2.3 openafs/src/bucoord/dump_sched.c:1.7.2.4
*** openafs/src/bucoord/dump_sched.c:1.7.2.3	Mon Jul 31 13:07:49 2006
--- openafs/src/bucoord/dump_sched.c	Thu Jan  4 22:34:09 2007
***************
*** 12,28 ****
   */
  
  #include <sys/types.h>
- #include <stdio.h>
  #include <afsconfig.h>
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/bucoord/dump_sched.c,v 1.7.2.3 2006/07/31 17:07:49 shadow Exp $");
  
  #ifdef AFS_NT40_ENV
  #include <winsock2.h>
  #else
- #include <strings.h>
  #include <sys/socket.h>
  #include <netinet/in.h>
  #include <netdb.h>
--- 12,26 ----
   */
  
  #include <sys/types.h>
  #include <afsconfig.h>
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/bucoord/dump_sched.c,v 1.7.2.4 2007/01/05 03:34:09 shadow Exp $");
  
  #ifdef AFS_NT40_ENV
  #include <winsock2.h>
  #else
  #include <sys/socket.h>
  #include <netinet/in.h>
  #include <netdb.h>
Index: openafs/src/bucoord/expire.c
diff -c openafs/src/bucoord/expire.c:1.6 openafs/src/bucoord/expire.c:1.6.2.1
*** openafs/src/bucoord/expire.c:1.6	Tue Jul 15 19:14:47 2003
--- openafs/src/bucoord/expire.c	Thu Jan  4 22:34:09 2007
***************
*** 11,17 ****
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/bucoord/expire.c,v 1.6 2003/07/15 23:14:47 shadow Exp $");
  
  #include <afs/stds.h>
  #include <sys/types.h>
--- 11,17 ----
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/bucoord/expire.c,v 1.6.2.1 2007/01/05 03:34:09 shadow Exp $");
  
  #include <afs/stds.h>
  #include <sys/types.h>
***************
*** 21,27 ****
  #include <afs/cmd.h>
  #include <ctype.h>
  #include "bc.h"
- #include <strings.h>
  
  
  #define	MAX_YEAR_VALUE	0
--- 21,26 ----
Index: openafs/src/bucoord/main.c
diff -c openafs/src/bucoord/main.c:1.16 openafs/src/bucoord/main.c:1.16.2.1
*** openafs/src/bucoord/main.c:1.16	Sun Dec  7 20:45:28 2003
--- openafs/src/bucoord/main.c	Thu Jan  4 22:34:09 2007
***************
*** 11,21 ****
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/bucoord/main.c,v 1.16 2003/12/08 01:45:28 jaltman Exp $");
  
  #include <afs/stds.h>
  #include <sys/types.h>
- #include <stdio.h>
  #ifdef	AFS_AIX32_ENV
  #include <signal.h>
  #endif
--- 11,20 ----
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/bucoord/main.c,v 1.16.2.1 2007/01/05 03:34:09 shadow Exp $");
  
  #include <afs/stds.h>
  #include <sys/types.h>
  #ifdef	AFS_AIX32_ENV
  #include <signal.h>
  #endif
Index: openafs/src/bucoord/restore.c
diff -c openafs/src/bucoord/restore.c:1.8.2.2 openafs/src/bucoord/restore.c:1.8.2.3
*** openafs/src/bucoord/restore.c:1.8.2.2	Sun Apr  3 14:15:43 2005
--- openafs/src/bucoord/restore.c	Thu Jan  4 22:34:09 2007
***************
*** 15,21 ****
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/bucoord/restore.c,v 1.8.2.2 2005/04/03 18:15:43 shadow Exp $");
  
  #include <afs/stds.h>
  #include <sys/types.h>
--- 15,21 ----
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/bucoord/restore.c,v 1.8.2.3 2007/01/05 03:34:09 shadow Exp $");
  
  #include <afs/stds.h>
  #include <sys/types.h>
***************
*** 23,29 ****
  #ifdef AFS_NT40_ENV
  #include <winsock2.h>
  #else
- #include <strings.h>
  #include <sys/socket.h>
  #include <netinet/in.h>
  #include <netdb.h>
--- 23,28 ----
Index: openafs/src/bucoord/status.c
diff -c openafs/src/bucoord/status.c:1.7 openafs/src/bucoord/status.c:1.7.2.1
*** openafs/src/bucoord/status.c:1.7	Sat Nov 22 23:53:30 2003
--- openafs/src/bucoord/status.c	Thu Jan  4 22:34:09 2007
***************
*** 11,25 ****
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/bucoord/status.c,v 1.7 2003/11/23 04:53:30 jaltman Exp $");
  
  #include <afs/stds.h>
  #include <sys/types.h>
- #include <stdio.h>
  #ifdef AFS_NT40_ENV
  #include <winsock2.h>
  #else
- #include <strings.h>
  #include <sys/socket.h>
  #include <netinet/in.h>
  #include <netdb.h>
--- 11,23 ----
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/bucoord/status.c,v 1.7.2.1 2007/01/05 03:34:09 shadow Exp $");
  
  #include <afs/stds.h>
  #include <sys/types.h>
  #ifdef AFS_NT40_ENV
  #include <winsock2.h>
  #else
  #include <sys/socket.h>
  #include <netinet/in.h>
  #include <netdb.h>
Index: openafs/src/bucoord/tape_hosts.c
diff -c openafs/src/bucoord/tape_hosts.c:1.7.2.1 openafs/src/bucoord/tape_hosts.c:1.7.2.2
*** openafs/src/bucoord/tape_hosts.c:1.7.2.1	Mon Jul 31 13:07:49 2006
--- openafs/src/bucoord/tape_hosts.c	Thu Jan  4 22:34:09 2007
***************
*** 11,21 ****
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/bucoord/tape_hosts.c,v 1.7.2.1 2006/07/31 17:07:49 shadow Exp $");
  
  #include <afs/stds.h>
  #include <sys/types.h>
- #include <stdio.h>
  #ifdef AFS_NT40_ENV
  #include <winsock2.h>
  #else
--- 11,20 ----
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/bucoord/tape_hosts.c,v 1.7.2.2 2007/01/05 03:34:09 shadow Exp $");
  
  #include <afs/stds.h>
  #include <sys/types.h>
  #ifdef AFS_NT40_ENV
  #include <winsock2.h>
  #else
Index: openafs/src/bucoord/ttest.c
diff -c openafs/src/bucoord/ttest.c:1.5 openafs/src/bucoord/ttest.c:1.5.2.1
*** openafs/src/bucoord/ttest.c:1.5	Tue Jul 15 19:14:47 2003
--- openafs/src/bucoord/ttest.c	Thu Jan  4 22:34:09 2007
***************
*** 8,14 ****
   */
  
  #include <sys/types.h>
- #include <stdio.h>
  #include <sys/socket.h>
  #include <netinet/in.h>
  #include <netdb.h>
--- 8,13 ----
Index: openafs/src/bucoord/ubik_db_if.c
diff -c openafs/src/bucoord/ubik_db_if.c:1.10 openafs/src/bucoord/ubik_db_if.c:1.10.2.1
*** openafs/src/bucoord/ubik_db_if.c:1.10	Sat Apr  3 14:43:15 2004
--- openafs/src/bucoord/ubik_db_if.c	Thu Jan  4 22:34:09 2007
***************
*** 10,21 ****
  /* Interface and supporting routines for the backup system's ubik database */
  
  #include <afsconfig.h>
! #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/bucoord/ubik_db_if.c,v 1.10 2004/04/03 19:43:15 jaltman Exp $");
  
- #include <stdio.h>
  #include <sys/types.h>
  #include <fcntl.h>
  #ifdef AFS_NT40_ENV
--- 10,20 ----
  /* Interface and supporting routines for the backup system's ubik database */
  
  #include <afsconfig.h>
! #include <afs/stds.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/bucoord/ubik_db_if.c,v 1.10.2.1 2007/01/05 03:34:09 shadow Exp $");
  
  #include <sys/types.h>
  #include <fcntl.h>
  #ifdef AFS_NT40_ENV
***************
*** 38,43 ****
--- 37,53 ----
  #include "bc.h"
  #include "error_macros.h"
  
+ /* protos */
+ afs_int32 bcdb_AddVolume(register struct budb_volumeEntry *);
+ afs_int32 bcdb_AddVolumes(register struct budb_volumeEntry *, afs_int32 );
+ afs_int32 bcdb_CreateDump(register struct budb_dumpEntry *) ;
+ afs_int32 bcdb_deleteDump(afs_int32, afs_int32, afs_int32, budb_dumpsList *);
+ /*note the pinter to the function comes from ubik/ubikclient ubik_Call function.*/
+ afs_int32 bcdb_listDumps (int (), afs_int32,afs_int32,afs_int32, budb_dumpsList *,
+  budb_dumpsList *);
+ afs_int32 bcdb_DeleteVDP(char *, char *, afs_int32 );
+ afs_int32 bcdb_FindClone(afs_int32, char *, afs_int32 *);
+ 
  extern char *whoami;
  
  /* -------------------------------------
***************
*** 52,59 ****
   * -------------------------------------
   */
  
! bcdb_AddVolume(veptr)
!      register struct budb_volumeEntry *veptr;
  {
      afs_int32 code;
  
--- 62,68 ----
   * -------------------------------------
   */
  
! afs_int32 bcdb_AddVolume(register struct budb_volumeEntry *veptr)
  {
      afs_int32 code;
  
***************
*** 61,69 ****
      return (code);
  }
  
! bcdb_AddVolumes(veptr, count)
!      register struct budb_volumeEntry *veptr;
!      afs_int32 count;
  {
      struct budb_volumeList volumeList;
      afs_int32 code;
--- 70,76 ----
      return (code);
  }
  
! afs_int32 bcdb_AddVolumes(register struct budb_volumeEntry *veptr, afs_int32 count)
  {
      struct budb_volumeList volumeList;
      afs_int32 code;
***************
*** 75,82 ****
  }
  
  
! bcdb_CreateDump(deptr)
!      register struct budb_dumpEntry *deptr;
  {
      afs_int32 code;
  
--- 82,88 ----
  }
  
  
! afs_int32 bcdb_CreateDump(register struct budb_dumpEntry *deptr)
  {
      afs_int32 code;
  
***************
*** 84,94 ****
      return (code);
  }
  
! bcdb_deleteDump(dumpID, fromTime, toTime, dumps)
!      afs_int32 dumpID;
!      afs_int32 fromTime;
!      afs_int32 toTime;
!      budb_dumpsList *dumps;
  {
      afs_int32 code;
      budb_dumpsList dumpsList, *dumpsPtr;
--- 90,97 ----
      return (code);
  }
  
! afs_int32 bcdb_deleteDump(afs_int32 dumpID, afs_int32 fromTime, afs_int32 toTime, 
!   budb_dumpsList *dumps)
  {
      afs_int32 code;
      budb_dumpsList dumpsList, *dumpsPtr;
***************
*** 105,116 ****
      return (code);
  }
  
! bcdb_listDumps(sflags, groupId, fromTime, toTime, dumps, flags)
!      afs_int32 groupId;
!      afs_int32 fromTime;
!      afs_int32 toTime;
!      budb_dumpsList *dumps;
!      budb_dumpsList *flags;
  {
      afs_int32 code, sflag = 0;
      budb_dumpsList dumpsList, *dumpsPtr;
--- 108,114 ----
      return (code);
  }
  
! afs_int32 bcdb_listDumps (int (*sflags) (), afs_int32 groupId,afs_int32 fromTime, afs_int32 toTime,budb_dumpsList *dumps, budb_dumpsList *flags)
  {
      afs_int32 code, sflag = 0;
      budb_dumpsList dumpsList, *dumpsPtr;
***************
*** 136,145 ****
  }
  
  
! bcdb_DeleteVDP(dumpSetName, dumpPath, dumpID)
!      char *dumpSetName;
!      char *dumpPath;
!      afs_int32 dumpID;
  {
      afs_int32 code;
  
--- 134,140 ----
  }
  
  
! afs_int32 bcdb_DeleteVDP(char *dumpSetName, char *dumpPath, afs_int32 dumpID)
  {
      afs_int32 code;
  
***************
*** 163,173 ****
   *      -2 - no clone times found, clone time set to 0
   */
  
! afs_int32
! bcdb_FindClone(dumpID, volName, clonetime)
!      afs_int32 dumpID;
!      char *volName;
!      afs_int32 *clonetime;
  {
      afs_int32 code;
      code =
--- 158,164 ----
   *      -2 - no clone times found, clone time set to 0
   */
  
! afs_int32 bcdb_FindClone(afs_int32 dumpID, char *volName, afs_int32 *clonetime)
  {
      afs_int32 code;
      code =
Index: openafs/src/bucoord/vol_sets.c
diff -c openafs/src/bucoord/vol_sets.c:1.10.2.2 openafs/src/bucoord/vol_sets.c:1.10.2.3
*** openafs/src/bucoord/vol_sets.c:1.10.2.2	Mon Jul 31 13:07:49 2006
--- openafs/src/bucoord/vol_sets.c	Thu Jan  4 22:34:09 2007
***************
*** 11,21 ****
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/bucoord/vol_sets.c,v 1.10.2.2 2006/07/31 17:07:49 shadow Exp $");
  
  #include <afs/stds.h>
  #include <sys/types.h>
- #include <stdio.h>
  #ifdef AFS_NT40_ENV
  #include <winsock2.h>
  #else
--- 11,20 ----
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/bucoord/vol_sets.c,v 1.10.2.3 2007/01/05 03:34:09 shadow Exp $");
  
  #include <afs/stds.h>
  #include <sys/types.h>
  #ifdef AFS_NT40_ENV
  #include <winsock2.h>
  #else
Index: openafs/src/bucoord/volstub.c
diff -c openafs/src/bucoord/volstub.c:1.6.2.1 openafs/src/bucoord/volstub.c:1.6.2.2
*** openafs/src/bucoord/volstub.c:1.6.2.1	Mon Jul 31 13:07:49 2006
--- openafs/src/bucoord/volstub.c	Thu Jan  4 22:34:09 2007
***************
*** 11,20 ****
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/bucoord/volstub.c,v 1.6.2.1 2006/07/31 17:07:49 shadow Exp $");
  
  #include <sys/types.h>
- #include <stdio.h>
  #ifdef AFS_NT40_ENV
  #include <winsock2.h>
  #else
--- 11,19 ----
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/bucoord/volstub.c,v 1.6.2.2 2007/01/05 03:34:09 shadow Exp $");
  
  #include <sys/types.h>
  #ifdef AFS_NT40_ENV
  #include <winsock2.h>
  #else
Index: openafs/src/cf/kerberos.m4
diff -c openafs/src/cf/kerberos.m4:1.1.2.9 openafs/src/cf/kerberos.m4:1.1.2.10
*** openafs/src/cf/kerberos.m4:1.1.2.9	Sat Jun 24 12:22:13 2006
--- openafs/src/cf/kerberos.m4	Thu Jan  4 22:22:01 2007
***************
*** 1,5 ****
  dnl
! dnl $Id: kerberos.m4,v 1.1.2.9 2006/06/24 16:22:13 rra Exp $
  dnl
  dnl Kerberos autoconf glue
  dnl
--- 1,5 ----
  dnl
! dnl $Id: kerberos.m4,v 1.1.2.10 2007/01/05 03:22:01 shadow Exp $
  dnl
  dnl Kerberos autoconf glue
  dnl
***************
*** 103,117 ****
  	LIBS="$save_LIBS"
  fi
  
- if test "$ac_cv_header_kerberosV_heim_err_h" = "yes"; then
-     ASETKEY=
- else
-     ASETKEY=asetkey
- fi
- 
  AC_SUBST(BUILD_KRB5)
  AC_SUBST(KRB5CFLAGS)
  AC_SUBST(KRB5LIBS)
- AC_SUBST(ASETKEY)
  
  ])dnl
--- 103,110 ----
Index: openafs/src/cf/linux-test1.m4
diff -c openafs/src/cf/linux-test1.m4:1.3.2.5 openafs/src/cf/linux-test1.m4:1.3.2.6
*** openafs/src/cf/linux-test1.m4:1.3.2.5	Mon Aug 14 18:14:00 2006
--- openafs/src/cf/linux-test1.m4	Thu Jan  4 17:25:58 2007
***************
*** 1,16 ****
  # AC_TRY_KBUILD26([INCLUDES], [FUNCTION-BODY],
  #                 [ACTION-IF-SUCCESS], [ACTION-IF-FAILURE])
  #
! AC_DEFUN([AC_TRY_KBUILD26], [
!   rm -fr conftest.dir
!   if mkdir conftest.dir; then
!   cd conftest.dir
!     cat >Makefile <<_ACEOF
  CFLAGS += $CPPFLAGS
  
  obj-m += conftest.o
  _ACEOF
!     cat >conftest.c <<\_ACEOF
  #include <linux/module.h>
  $1
  
--- 1,14 ----
  # AC_TRY_KBUILD26([INCLUDES], [FUNCTION-BODY],
  #                 [ACTION-IF-SUCCESS], [ACTION-IF-FAILURE])
  #
! AC_DEFUN([AC_TRY_KBUILD26],[  rm -fr conftest.dir
!   if mkdir conftest.dir &&
!     cat >conftest.dir/Makefile <<_ACEOF &&
  CFLAGS += $CPPFLAGS
  
  obj-m += conftest.o
  _ACEOF
!     cat >conftest.dir/conftest.c <<\_ACEOF &&
  #include <linux/module.h>
  $1
  
***************
*** 21,31 ****
  
  MODULE_LICENSE("http://www.openafs.org/dl/license10.html");
  _ACEOF
!     cd ..
!   fi
!   AS_IF(AC_RUN_LOG([make -C $LINUX_KERNEL_PATH M=`pwd`/conftest.dir modules > /dev/null]),
!       [$3], [$4])
!   rm -fr conftest.dir])
  
    
  # AC_TRY_KBUILD24([INCLUDES], [FUNCTION-BODY],
--- 19,35 ----
  
  MODULE_LICENSE("http://www.openafs.org/dl/license10.html");
  _ACEOF
!     echo make -C $LINUX_KERNEL_PATH M=$SRCDIR_PARENT/conftest.dir modules KBUILD_VERBOSE=1 >&AS_MESSAGE_LOG_FD
!     make -C $LINUX_KERNEL_PATH M=$SRCDIR_PARENT/conftest.dir modules KBUILD_VERBOSE=1 >&AS_MESSAGE_LOG_FD 2>conftest.err
!     then [$3]
!     else
!       sed '/^ *+/d' conftest.err >&AS_MESSAGE_LOG_FD
!       echo "$as_me: failed using Makefile:" >&AS_MESSAGE_LOG_FD
!       sed 's/^/| /' conftest.dir/Makefile >&AS_MESSAGE_LOG_FD
!       echo "$as_me: and program was:" >&AS_MESSAGE_LOG_FD
!       sed 's/^/| /' conftest.dir/conftest.c >&AS_MESSAGE_LOG_FD
!       [$4]
!   fi; rm -fr conftest.err conftest.dir])
  
    
  # AC_TRY_KBUILD24([INCLUDES], [FUNCTION-BODY],
***************
*** 47,49 ****
--- 51,59 ----
    else
      AC_TRY_KBUILD24([$1], [$2], [$3], [$4])
    fi])
+ 
+ AC_DEFUN([LINUX_KERNEL_COMPILE_WORKS], [
+   AC_MSG_CHECKING([for linux kernel module build works])
+   AC_TRY_KBUILD([],[],:,AC_MSG_RESULT(no)
+     AC_MSG_FAILURE([Fix problem or use --disable-kernel-module...]))
+   AC_MSG_RESULT(yes)])
Index: openafs/src/cf/linux-test3.m4
diff -c openafs/src/cf/linux-test3.m4:1.8.2.10 openafs/src/cf/linux-test3.m4:1.8.2.11
*** openafs/src/cf/linux-test3.m4:1.8.2.10	Mon Aug 14 18:04:41 2006
--- openafs/src/cf/linux-test3.m4	Thu Nov  9 18:14:30 2006
***************
*** 33,38 ****
--- 33,41 ----
  AC_SUBST(RHCONFIG_MP)
  ])
  
+ 
+ dnl This depends on LINUX_CONFIG_H_EXISTS running first!
+ 
  AC_DEFUN([LINUX_WHICH_MODULES],[
  if test "x$enable_redhat_buildsys" = "xyes"; then
    MPS=Default
***************
*** 40,51 ****
    save_CPPFLAGS="$CPPFLAGS"
    CPPFLAGS="-I${LINUX_KERNEL_PATH}/include -D__KERNEL__ $RHCONFIG_SP $CPPFLAGS"
    AC_MSG_CHECKING(which kernel modules to build)
    if test "x$ac_linux_rhconfig" = "xyes"; then
        MPS="MP SP"
    else
    AC_CACHE_VAL(ac_cv_linux_config_smp, [
!   AC_TRY_COMPILE(
! [#include <linux/config.h>
  ],
  [#ifndef CONFIG_SMP
  lose;
--- 43,59 ----
    save_CPPFLAGS="$CPPFLAGS"
    CPPFLAGS="-I${LINUX_KERNEL_PATH}/include -D__KERNEL__ $RHCONFIG_SP $CPPFLAGS"
    AC_MSG_CHECKING(which kernel modules to build)
+   if test "x$ac_cv_linux_config_h_exists" = "xyes"; then
+     CPPFLAGS="-DCONFIG_H_EXISTS $CPPFLAGS"
+   fi
    if test "x$ac_linux_rhconfig" = "xyes"; then
        MPS="MP SP"
    else
    AC_CACHE_VAL(ac_cv_linux_config_smp, [
!   AC_TRY_KBUILD(
! [#ifdef CONFIG_H_EXISTS
! #include <linux/config.h>
! #endif
  ],
  [#ifndef CONFIG_SMP
  lose;
Index: openafs/src/cf/linux-test4.m4
diff -c openafs/src/cf/linux-test4.m4:1.20.2.16 openafs/src/cf/linux-test4.m4:1.20.2.23
*** openafs/src/cf/linux-test4.m4:1.20.2.16	Thu Oct 12 08:23:59 2006
--- openafs/src/cf/linux-test4.m4	Thu Jan  4 16:43:54 2007
***************
*** 1,3 ****
--- 1,17 ----
+ AC_DEFUN([LINUX_CONFIG_H_EXISTS], [
+   AC_MSG_CHECKING([for linux/config.h existance])
+   AC_CACHE_VAL([ac_cv_linux_config_h_exists], [
+     AC_TRY_KBUILD(
+ [#include <linux/config.h>],
+ [return;],
+       ac_cv_linux_config_h_exists=yes,
+       ac_cv_linux_config_h_exists=no)])
+   AC_MSG_RESULT($ac_cv_linux_config_h_exists)
+   if test "x$ac_cv_linux_config_h_exists" = "xyes"; then
+     AC_DEFINE([CONFIG_H_EXISTS], 1, [define if linux/config.h exists])
+   fi])
+ 
+ 
  AC_DEFUN([LINUX_COMPLETION_H_EXISTS], [
    AC_MSG_CHECKING([for linux/completion.h existance])
    AC_CACHE_VAL([ac_cv_linux_completion_h_exists], [
***************
*** 162,167 ****
--- 176,196 ----
        ac_cv_linux_fs_struct_inode_has_i_blksize=no)])
    AC_MSG_RESULT($ac_cv_linux_fs_struct_inode_has_i_blksize)])
  
+ AC_DEFUN([LINUX_FS_STRUCT_INODE_HAS_I_BLKBITS], [
+   AC_MSG_CHECKING([for i_blkbits in struct inode])
+   AC_CACHE_VAL([ac_cv_linux_fs_struct_inode_has_i_blkbits], [
+     AC_TRY_KBUILD(
+ [#include <linux/fs.h>],
+ [struct inode _inode;
+ printk("%d\n", _inode.i_blkbits);],
+       ac_cv_linux_fs_struct_inode_has_i_blkbits=yes,
+       ac_cv_linux_fs_struct_inode_has_i_blkbits=no)])
+   AC_MSG_RESULT($ac_cv_linux_fs_struct_inode_has_i_blkbits)
+   if test "x$ac_cv_linux_fs_struct_inode_has_i_blkbits" = "xyes"; then
+     AC_DEFINE(STRUCT_INODE_HAS_I_BLKBITS, 1, [define if your struct inode has i_blkbits])
+   fi])
+ 
+ 
  AC_DEFUN([LINUX_FS_STRUCT_INODE_HAS_I_CDEV], [
    AC_MSG_CHECKING([for i_cdev in struct inode])
    AC_CACHE_VAL([ac_cv_linux_fs_struct_inode_has_i_cdev], [
***************
*** 608,613 ****
--- 637,655 ----
        ac_cv_linux_get_sb_has_struct_vfsmount=no)])
    AC_MSG_RESULT($ac_cv_linux_get_sb_has_struct_vfsmount)])
  
+ AC_DEFUN([LINUX_STATFS_TAKES_DENTRY], [
+   AC_MSG_CHECKING([for dentry in statfs])
+   AC_CACHE_VAL([ac_cv_linux_statfs_takes_dentry], [
+     AC_TRY_KBUILD(
+ [#include <linux/fs.h>
+ #include <linux/statfs.h>],
+ [
+ extern int vfs_statfs(struct dentry *, struct kstatfs *);
+ ],
+       ac_cv_linux_statfs_takes_dentry=yes,
+       ac_cv_linux_statfs_takes_dentry=no)])
+   AC_MSG_RESULT($ac_cv_linux_statfs_takes_dentry)])
+ 
  AC_DEFUN([LINUX_LINUX_KEYRING_SUPPORT], [
    AC_MSG_CHECKING([for linux kernel keyring support])
    AC_CACHE_VAL([ac_cv_linux_keyring_support], [
***************
*** 617,624 ****
  #include <linux/keyctl.h>],
  [#ifdef CONFIG_KEYS
  request_key(NULL, NULL, NULL);
! #if !defined(KEY_POS_VIEW) || !defined(KEY_POS_SEARCH)
! #error "Your linux/key.h does not contain KEY_POS_VIEW or KEY_POS_SEARCH"
  #endif
  #else
  #error rebuild your kernel with CONFIG_KEYS
--- 659,666 ----
  #include <linux/keyctl.h>],
  [#ifdef CONFIG_KEYS
  request_key(NULL, NULL, NULL);
! #if !defined(KEY_POS_VIEW) || !defined(KEY_POS_SEARCH) || !defined(KEY_POS_SETATTR) 
! #error "Your linux/key.h does not contain KEY_POS_VIEW or KEY_POS_SEARCH or KEY_POS_SETATTR"
  #endif
  #else
  #error rebuild your kernel with CONFIG_KEYS
***************
*** 677,679 ****
--- 719,760 ----
      AC_DEFINE([GENERIC_FILE_AIO_READ], 1, [define if your kernel has generic_file_aio_read()])
    fi])
  
+ AC_DEFUN([LINUX_FREEZER_H_EXISTS], [
+   AC_MSG_CHECKING([for linux/freezer.h existance])
+   AC_CACHE_VAL([ac_cv_linux_freezer_h_exists], [
+     AC_TRY_KBUILD(
+ [#include <linux/freezer.h>],
+ [return;],
+       ac_cv_linux_freezer_h_exists=yes,
+       ac_cv_linux_freezer_h_exists=no)])
+   AC_MSG_RESULT($ac_cv_linux_freezer_h_exists)
+   if test "x$ac_cv_linux_freezer_h_exists" = "xyes"; then
+     AC_DEFINE([FREEZER_H_EXISTS], 1, [define if linux/freezer.h exists])
+   fi])
+ 
+ AC_DEFUN([LINUX_SCHED_STRUCT_TASK_STRUCT_HAS_TODO], [
+   AC_MSG_CHECKING([for todo in struct task_struct])
+   AC_CACHE_VAL([ac_cv_linux_sched_struct_task_struct_has_todo], [
+     AC_TRY_KBUILD(
+ [#include <linux/sched.h>],
+ [struct task_struct _tsk;
+ printk("%d\n", _tsk.todo);],
+       ac_cv_linux_sched_struct_task_struct_has_todo=yes,
+       ac_cv_linux_sched_struct_task_struct_has_todo=no)])
+   AC_MSG_RESULT($ac_cv_linux_sched_struct_task_struct_has_todo)])
+ 
+ AC_DEFUN([LINUX_INIT_WORK_HAS_DATA], [
+   AC_MSG_CHECKING([whether INIT_WORK has a _data argument])
+   AC_CACHE_VAL([ac_cv_linux_init_work_has_data], [
+     AC_TRY_KBUILD(
+ [#include <linux/kernel.h>
+ #include <linux/workqueue.h>],
+ [ 
+ void f(struct work_struct *w) {}
+ struct work_struct *w;
+ int *i;
+ INIT_WORK(w,f,i);],
+       ac_cv_linux_init_work_has_data=yes,
+       ac_cv_linux_init_work_has_data=no)])
+   AC_MSG_RESULT($ac_cv_linux_init_work_has_data)])
+ 
Index: openafs/src/cf/osconf.m4
diff -c openafs/src/cf/osconf.m4:1.51.2.27 openafs/src/cf/osconf.m4:1.51.2.28
*** openafs/src/cf/osconf.m4:1.51.2.27	Fri Oct  6 10:57:12 2006
--- openafs/src/cf/osconf.m4	Thu Dec 28 16:59:45 2006
***************
*** 836,841 ****
--- 836,863 ----
  		LWP_OPTMZ="-g"
  		;;
  
+ 	sun4x_511)
+ 		CC="/opt/SUNWspro/bin/cc"
+ 		CCOBJ="/opt/SUNWspro/bin/cc"
+ 		LEX="lex"
+ 		LD="/usr/ccs/bin/ld"
+ 		MT_CC="/opt/SUNWspro/bin/cc"
+ 		MT_CFLAGS='-mt -DAFS_PTHREAD_ENV ${XCFLAGS}'
+ 		MT_LIBS="-lpthread -lsocket"
+ 		PAM_CFLAGS="-KPIC"
+ 		PAM_LIBS="-lc -lpam -lsocket -lnsl -lm"
+ 		SHLIB_CFLAGS="-KPIC"
+ 		SHLIB_LDFLAGS="-G -Bsymbolic"
+ 		TXLIBS="-lcurses"
+ 		XCFLAGS64='${XCFLAGS} -xarch=v9'
+ 		XCFLAGS="-dy -Bdynamic"
+ 		XLIBELFA="-lelf"
+ 		XLIBKVM="-lkvm"
+ 		XLIBS="${LIB_AFSDB} -lsocket -lnsl -lintl -ldl"
+ 		SHLIB_LINKER="${CC} -G -dy -Bsymbolic -z text"
+ 		LWP_OPTMZ="-g"
+ 		;;
+ 
  	sunx86_57)
  		CC="/opt/SUNWspro/bin/cc"
  		CCOBJ="/opt/SUNWspro/bin/cc"
***************
*** 919,924 ****
--- 941,967 ----
  		XLIBS="${LIB_AFSDB} -lsocket -lnsl -lintl -ldl"
  		SHLIB_LINKER="${CC} -G -dy -Wl,-M\$(srcdir)/mapfile -Bsymbolic -z text"
  		;;
+ 
+ 	sunx86_511)
+ 		CC="/opt/SUNWspro/bin/cc"
+ 		CCOBJ="/opt/SUNWspro/bin/cc"
+ 		LEX="lex"
+ 		LD="/usr/ccs/bin/ld"
+ 		MT_CC="/opt/SUNWspro/bin/cc"
+ 		MT_CFLAGS='-mt -DAFS_PTHREAD_ENV ${XCFLAGS}'
+ 		MT_LIBS="-lpthread -lsocket"
+ 		PAM_CFLAGS="-KPIC"
+ 		PAM_LIBS="-lc -lpam -lsocket -lnsl -lm"
+ 		SHLIB_CFLAGS="-KPIC"
+ 		SHLIB_LDFLAGS="-G -Bsymbolic"
+ 		TXLIBS="-lcurses"
+ 		XCFLAGS64='${XCFLAGS} -xarch=amd64'
+ 		XCFLAGS="-dy -Bdynamic"
+ 		XLIBELFA="-lelf"
+ 		XLIBKVM="-lkvm"
+ 		XLIBS="${LIB_AFSDB} -lsocket -lnsl -lintl -ldl"
+ 		SHLIB_LINKER="${CC} -G -dy -Bsymbolic -z text"
+ 		;;
  esac
  
  #
Index: openafs/src/config/Makefile.in
diff -c openafs/src/config/Makefile.in:1.14.2.1 openafs/src/config/Makefile.in:1.14.2.2
*** openafs/src/config/Makefile.in:1.14.2.1	Thu Mar  9 01:41:42 2006
--- openafs/src/config/Makefile.in	Mon Dec 18 23:21:47 2006
***************
*** 23,28 ****
--- 23,29 ----
  
  Makefile.version: ${srcdir}/Makefile.version-CML Makefile.version-NOCML
  	$(RM) -f Makefile.version
+ 	$(CP) Makefile.version-NOCML.in Makefile.version.in
  	if	[ -r SRC/../CML/state ] ; \
  	then	$(CP) ${srcdir}/Makefile.version-CML Makefile.version ; \
  	else	$(CP) Makefile.version-NOCML Makefile.version ; \
Index: openafs/src/config/NTMakefile.amd64_w2k
diff -c openafs/src/config/NTMakefile.amd64_w2k:1.1.2.43 openafs/src/config/NTMakefile.amd64_w2k:1.1.2.45
*** openafs/src/config/NTMakefile.amd64_w2k:1.1.2.43	Fri Oct  6 13:13:20 2006
--- openafs/src/config/NTMakefile.amd64_w2k	Fri Jan  5 15:18:07 2007
***************
*** 80,86 ****
  #define used in WinNT/2000 installation and program version display
  AFSPRODUCT_VER_MAJOR=1
  AFSPRODUCT_VER_MINOR=4
! AFSPRODUCT_VER_PATCH=205
  AFSPRODUCT_VER_BUILD=0
  
  AFSPRODUCT_VERSION=$(AFSPRODUCT_VER_MAJOR).$(AFSPRODUCT_VER_MINOR).$(AFSPRODUCT_VER_PATCH)
--- 80,86 ----
  #define used in WinNT/2000 installation and program version display
  AFSPRODUCT_VER_MAJOR=1
  AFSPRODUCT_VER_MINOR=4
! AFSPRODUCT_VER_PATCH=300
  AFSPRODUCT_VER_BUILD=0
  
  AFSPRODUCT_VERSION=$(AFSPRODUCT_VER_MAJOR).$(AFSPRODUCT_VER_MINOR).$(AFSPRODUCT_VER_PATCH)
Index: openafs/src/config/NTMakefile.i386_nt40
diff -c openafs/src/config/NTMakefile.i386_nt40:1.46.2.58 openafs/src/config/NTMakefile.i386_nt40:1.46.2.60
*** openafs/src/config/NTMakefile.i386_nt40:1.46.2.58	Fri Oct  6 13:13:20 2006
--- openafs/src/config/NTMakefile.i386_nt40	Fri Jan  5 15:18:07 2007
***************
*** 80,86 ****
  #define used in WinNT/2000 installation and program version display
  AFSPRODUCT_VER_MAJOR=1
  AFSPRODUCT_VER_MINOR=4
! AFSPRODUCT_VER_PATCH=205
  AFSPRODUCT_VER_BUILD=0
  
  AFSPRODUCT_VERSION=$(AFSPRODUCT_VER_MAJOR).$(AFSPRODUCT_VER_MINOR).$(AFSPRODUCT_VER_PATCH)
--- 80,86 ----
  #define used in WinNT/2000 installation and program version display
  AFSPRODUCT_VER_MAJOR=1
  AFSPRODUCT_VER_MINOR=4
! AFSPRODUCT_VER_PATCH=300
  AFSPRODUCT_VER_BUILD=0
  
  AFSPRODUCT_VERSION=$(AFSPRODUCT_VER_MAJOR).$(AFSPRODUCT_VER_MINOR).$(AFSPRODUCT_VER_PATCH)
Index: openafs/src/config/NTMakefile.i386_w2k
diff -c openafs/src/config/NTMakefile.i386_w2k:1.1.2.45 openafs/src/config/NTMakefile.i386_w2k:1.1.2.47
*** openafs/src/config/NTMakefile.i386_w2k:1.1.2.45	Fri Oct  6 13:13:20 2006
--- openafs/src/config/NTMakefile.i386_w2k	Fri Jan  5 15:18:07 2007
***************
*** 80,86 ****
  #define used in WinNT/2000 installation and program version display
  AFSPRODUCT_VER_MAJOR=1
  AFSPRODUCT_VER_MINOR=4
! AFSPRODUCT_VER_PATCH=205
  AFSPRODUCT_VER_BUILD=0
  
  AFSPRODUCT_VERSION=$(AFSPRODUCT_VER_MAJOR).$(AFSPRODUCT_VER_MINOR).$(AFSPRODUCT_VER_PATCH)
--- 80,86 ----
  #define used in WinNT/2000 installation and program version display
  AFSPRODUCT_VER_MAJOR=1
  AFSPRODUCT_VER_MINOR=4
! AFSPRODUCT_VER_PATCH=300
  AFSPRODUCT_VER_BUILD=0
  
  AFSPRODUCT_VERSION=$(AFSPRODUCT_VER_MAJOR).$(AFSPRODUCT_VER_MINOR).$(AFSPRODUCT_VER_PATCH)
Index: openafs/src/config/afs_sysnames.h
diff -c openafs/src/config/afs_sysnames.h:1.50.2.25 openafs/src/config/afs_sysnames.h:1.50.2.26
*** openafs/src/config/afs_sysnames.h:1.50.2.25	Sun Oct  8 23:34:50 2006
--- openafs/src/config/afs_sysnames.h	Thu Dec 28 16:59:45 2006
***************
*** 99,104 ****
--- 99,105 ----
  #define SYS_NAME_ID_sun4x_58		 939
  #define SYS_NAME_ID_sun4x_59		 940
  #define SYS_NAME_ID_sun4x_510		 941
+ #define SYS_NAME_ID_sun4x_511		 942
  
  /* Sigh. If I leave a gap here IBM will do this sequentially. If I don't
     they won't allocate sunx86 IDs at all. So leave a gap and pray. */
***************
*** 106,111 ****
--- 107,113 ----
  #define SYS_NAME_ID_sunx86_58		 951
  #define SYS_NAME_ID_sunx86_59		 952
  #define SYS_NAME_ID_sunx86_510		 953
+ #define SYS_NAME_ID_sunx86_511		 954
  
  #define SYS_NAME_ID_vax_ul4		1003
  #define SYS_NAME_ID_vax_ul40		1004
Index: openafs/src/config/libafsdep
diff -c openafs/src/config/libafsdep:1.1 openafs/src/config/libafsdep:1.1.2.1
*** openafs/src/config/libafsdep:1.1	Tue Oct 15 23:58:31 2002
--- openafs/src/config/libafsdep	Mon Dec 18 23:21:47 2006
***************
*** 1,4 ****
  make_vnode.pl
  Makefile.config.in
! Makefile.version
  afsconfig.h.in
--- 1,4 ----
  make_vnode.pl
  Makefile.config.in
! Makefile.version.in
  afsconfig.h.in
Index: openafs/src/config/param.alpha_linux_22.h
diff -c openafs/src/config/param.alpha_linux_22.h:1.5.2.2 openafs/src/config/param.alpha_linux_22.h:1.5.2.3
*** openafs/src/config/param.alpha_linux_22.h:1.5.2.2	Wed Apr 27 17:56:13 2005
--- openafs/src/config/param.alpha_linux_22.h	Thu Nov  9 18:18:31 2006
***************
*** 30,36 ****
  #define AFS_64BITPOINTER_ENV   1	/* pointers are 64 bits. */
  
  #if defined(__KERNEL__) && !defined(KDUMP_KERNEL)
- #include <linux/config.h>
  #ifdef CONFIG_SMP
  #undef CONFIG_SMP
  #endif
--- 30,35 ----
Index: openafs/src/config/param.alpha_linux_24.h
diff -c openafs/src/config/param.alpha_linux_24.h:1.5.2.3 openafs/src/config/param.alpha_linux_24.h:1.5.2.4
*** openafs/src/config/param.alpha_linux_24.h:1.5.2.3	Mon Jun 12 12:20:53 2006
--- openafs/src/config/param.alpha_linux_24.h	Thu Nov  9 18:18:31 2006
***************
*** 32,38 ****
  #define AFS_64BITPOINTER_ENV   1	/* pointers are 64 bits. */
  
  #if defined(__KERNEL__) && !defined(KDUMP_KERNEL)
- #include <linux/config.h>
  #ifdef CONFIG_SMP
  #undef CONFIG_SMP
  #endif
--- 32,37 ----
Index: openafs/src/config/param.alpha_linux_26.h
diff -c openafs/src/config/param.alpha_linux_26.h:1.1.2.4 openafs/src/config/param.alpha_linux_26.h:1.1.2.5
*** openafs/src/config/param.alpha_linux_26.h:1.1.2.4	Mon Jun 12 12:20:53 2006
--- openafs/src/config/param.alpha_linux_26.h	Thu Nov  9 18:18:31 2006
***************
*** 36,44 ****
  
  
  #if defined(__KERNEL__) && !defined(KDUMP_KERNEL)
- #include <linux/threads.h>
  
- #include <linux/config.h>
  #ifdef CONFIG_SMP
  #ifndef AFS_SMP
  #define AFS_SMP 1
--- 36,42 ----
Index: openafs/src/config/param.amd64_linux24.h
diff -c openafs/src/config/param.amd64_linux24.h:1.3.2.3 openafs/src/config/param.amd64_linux24.h:1.3.2.4
*** openafs/src/config/param.amd64_linux24.h:1.3.2.3	Mon Jun 12 12:20:53 2006
--- openafs/src/config/param.amd64_linux24.h	Thu Nov  9 18:18:31 2006
***************
*** 41,49 ****
  #define AFS_64BITPOINTER_ENV	1	/* pointers are 64 bits. */
  
  #if defined(__KERNEL__) && !defined(KDUMP_KERNEL)
- #include <linux/threads.h>
  
- #include <linux/config.h>
  #ifdef CONFIG_SMP
  #undef CONFIG_SMP
  #endif
--- 41,47 ----
***************
*** 89,95 ****
  #endif
  #endif /* KERNEL */
  
- #define USE_UCONTEXT		/* should be in afsconfig.h */
  
  #endif /* _PARAM_AMD64_LINUX20_H_ */
  
--- 87,92 ----
***************
*** 160,166 ****
  #define CMSERVERPREF
  #endif
  
- #define USE_UCONTEXT		/* should be in afsconfig.h */
  
  #endif /* AFS_PARAM_H */
  
--- 157,162 ----
Index: openafs/src/config/param.amd64_linux26.h
diff -c openafs/src/config/param.amd64_linux26.h:1.1.2.5 openafs/src/config/param.amd64_linux26.h:1.1.2.6
*** openafs/src/config/param.amd64_linux26.h:1.1.2.5	Mon Jun 12 12:20:53 2006
--- openafs/src/config/param.amd64_linux26.h	Thu Nov  9 18:18:31 2006
***************
*** 31,39 ****
  #define AFS_64BITPOINTER_ENV	1	/* pointers are 64 bits */
  
  #if defined(__KERNEL__) && !defined(KDUMP_KERNEL)
- #include <linux/threads.h>
  
- #include <linux/config.h>
  #ifdef CONFIG_SMP
  #ifndef AFS_SMP
  #define AFS_SMP 1
--- 31,37 ----
Index: openafs/src/config/param.i386_linux22.h
diff -c openafs/src/config/param.i386_linux22.h:1.15.2.2 openafs/src/config/param.i386_linux22.h:1.15.2.3
*** openafs/src/config/param.i386_linux22.h:1.15.2.2	Wed Apr 27 17:56:13 2005
--- openafs/src/config/param.i386_linux22.h	Thu Nov  9 18:18:31 2006
***************
*** 32,38 ****
  #define AFS_NAMEI_ENV     1	/* User space interface to file system */
  
  #if defined(__KERNEL__) && !defined(KDUMP_KERNEL)
- #include <linux/config.h>
  #ifdef CONFIG_SMP
  #undef CONFIG_SMP
  #endif
--- 32,37 ----
Index: openafs/src/config/param.i386_linux24.h
diff -c openafs/src/config/param.i386_linux24.h:1.19.2.3 openafs/src/config/param.i386_linux24.h:1.19.2.4
*** openafs/src/config/param.i386_linux24.h:1.19.2.3	Mon Jun 12 12:20:53 2006
--- openafs/src/config/param.i386_linux24.h	Thu Nov  9 18:18:31 2006
***************
*** 27,35 ****
  #define AFS_64BIT_CLIENT	1
  
  #if defined(__KERNEL__) && !defined(KDUMP_KERNEL)
- #include <linux/threads.h>
  
- #include <linux/config.h>
  #ifdef CONFIG_SMP
  #undef CONFIG_SMP
  #endif
--- 27,33 ----
Index: openafs/src/config/param.i386_linux26.h
diff -c openafs/src/config/param.i386_linux26.h:1.3.2.4 openafs/src/config/param.i386_linux26.h:1.3.2.5
*** openafs/src/config/param.i386_linux26.h:1.3.2.4	Mon Jun 12 12:20:53 2006
--- openafs/src/config/param.i386_linux26.h	Thu Nov  9 18:18:31 2006
***************
*** 29,37 ****
  #define AFS_64BIT_CLIENT	1
  
  #if defined(__KERNEL__) && !defined(KDUMP_KERNEL)
- #include <linux/threads.h>
  
- #include <linux/config.h>
  #ifdef CONFIG_SMP
  #ifndef AFS_SMP
  #define AFS_SMP 1
--- 29,35 ----
Index: openafs/src/config/param.i386_umlinux22.h
diff -c openafs/src/config/param.i386_umlinux22.h:1.2.2.2 openafs/src/config/param.i386_umlinux22.h:1.2.2.3
*** openafs/src/config/param.i386_umlinux22.h:1.2.2.2	Wed Apr 27 17:56:13 2005
--- openafs/src/config/param.i386_umlinux22.h	Thu Nov  9 18:18:31 2006
***************
*** 34,40 ****
  #define AFS_NAMEI_ENV     1	/* User space interface to file system */
  
  #if defined(__KERNEL__) && !defined(KDUMP_KERNEL)
- #include <linux/config.h>
  #ifdef CONFIG_SMP
  #undef CONFIG_SMP
  #endif
--- 34,39 ----
Index: openafs/src/config/param.i386_umlinux24.h
diff -c openafs/src/config/param.i386_umlinux24.h:1.2.2.3 openafs/src/config/param.i386_umlinux24.h:1.2.2.4
*** openafs/src/config/param.i386_umlinux24.h:1.2.2.3	Mon Jun 12 12:20:54 2006
--- openafs/src/config/param.i386_umlinux24.h	Thu Nov  9 18:18:31 2006
***************
*** 35,43 ****
  
  
  #if defined(__KERNEL__) && !defined(KDUMP_KERNEL)
- #include <linux/threads.h>
  
- #include <linux/config.h>
  #ifdef CONFIG_SMP
  #undef CONFIG_SMP
  #endif
--- 35,41 ----
Index: openafs/src/config/param.i386_umlinux26.h
diff -c openafs/src/config/param.i386_umlinux26.h:1.1.2.4 openafs/src/config/param.i386_umlinux26.h:1.1.2.5
*** openafs/src/config/param.i386_umlinux26.h:1.1.2.4	Mon Jun 12 12:20:54 2006
--- openafs/src/config/param.i386_umlinux26.h	Thu Nov  9 18:18:31 2006
***************
*** 29,37 ****
  #define AFS_64BIT_CLIENT	1
  
  #if defined(__KERNEL__) && !defined(KDUMP_KERNEL)
- #include <linux/threads.h>
  
- #include <linux/config.h>
  #ifdef CONFIG_SMP
  #ifndef AFS_SMP
  #define AFS_SMP 1
--- 29,35 ----
Index: openafs/src/config/param.ia64_linux24.h
diff -c openafs/src/config/param.ia64_linux24.h:1.9.2.3 openafs/src/config/param.ia64_linux24.h:1.9.2.4
*** openafs/src/config/param.ia64_linux24.h:1.9.2.3	Mon Jun 12 12:20:54 2006
--- openafs/src/config/param.ia64_linux24.h	Thu Nov  9 18:18:31 2006
***************
*** 41,49 ****
  #define AFS_64BITPOINTER_ENV	1	/* pointers are 64 bits. */
  
  #if defined(__KERNEL__) && !defined(KDUMP_KERNEL)
- #include <linux/threads.h>
  
- #include <linux/config.h>
  #ifdef CONFIG_SMP
  #undef CONFIG_SMP
  #endif
--- 41,47 ----
***************
*** 89,95 ****
  #endif
  #endif /* KERNEL */
  
- #define USE_UCONTEXT		/* should be in afsconfig.h */
  
  #endif /* _PARAM_IA64_LINUX20_H_ */
  
--- 87,92 ----
***************
*** 160,166 ****
  #define CMSERVERPREF
  #endif
  
- #define USE_UCONTEXT		/* should be in afsconfig.h */
  
  #endif /* AFS_PARAM_H */
  
--- 157,162 ----
Index: openafs/src/config/param.ia64_linux26.h
diff -c openafs/src/config/param.ia64_linux26.h:1.1.2.5 openafs/src/config/param.ia64_linux26.h:1.1.2.6
*** openafs/src/config/param.ia64_linux26.h:1.1.2.5	Mon Jun 12 12:20:54 2006
--- openafs/src/config/param.ia64_linux26.h	Thu Nov  9 18:18:31 2006
***************
*** 46,54 ****
  #include <linux/init.h>
  #include <linux/module.h>
  #include <linux/kernel.h>
- #include <linux/threads.h>
  
- #include <linux/config.h>
  #ifdef CONFIG_SMP
  #ifndef AFS_SMP
  #define AFS_SMP 1
--- 46,52 ----
***************
*** 98,104 ****
  #endif
  #endif /* KERNEL */
  
- #define USE_UCONTEXT		/* should be in afsconfig.h */
  
  #endif /* _PARAM_IA64_LINUX20_H_ */
  
--- 96,101 ----
***************
*** 170,176 ****
  #define CMSERVERPREF
  #endif
  
- #define USE_UCONTEXT		/* should be in afsconfig.h */
  
  #endif /* AFS_PARAM_H */
  
--- 167,172 ----
Index: openafs/src/config/param.parisc_linux24.h
diff -c openafs/src/config/param.parisc_linux24.h:1.7.2.3 openafs/src/config/param.parisc_linux24.h:1.7.2.4
*** openafs/src/config/param.parisc_linux24.h:1.7.2.3	Mon Jun 12 12:20:54 2006
--- openafs/src/config/param.parisc_linux24.h	Thu Nov  9 18:18:31 2006
***************
*** 25,33 ****
  #define AFS_NAMEI_ENV     1	/* User space interface to file system */
  
  #if defined(__KERNEL__) && !defined(KDUMP_KERNEL)
- #include <linux/threads.h>
  
- #include <linux/config.h>
  #ifdef CONFIG_SMP
  #undef CONFIG_SMP
  #endif
--- 25,31 ----
Index: openafs/src/config/param.ppc64_linux24.h
diff -c openafs/src/config/param.ppc64_linux24.h:1.2.2.3 openafs/src/config/param.ppc64_linux24.h:1.2.2.4
*** openafs/src/config/param.ppc64_linux24.h:1.2.2.3	Mon Jun 12 12:20:54 2006
--- openafs/src/config/param.ppc64_linux24.h	Thu Nov  9 18:18:31 2006
***************
*** 29,37 ****
  #define AFS_64BITPOINTER_ENV   1     /* pointers are 64 bits. */
  
  #if defined(__KERNEL__) && !defined(KDUMP_KERNEL)
- #include <linux/threads.h>
  
- #include <linux/config.h>
  #ifdef CONFIG_SMP
  #undef CONFIG_SMP
  #endif
--- 29,35 ----
Index: openafs/src/config/param.ppc64_linux26.h
diff -c openafs/src/config/param.ppc64_linux26.h:1.1.2.4 openafs/src/config/param.ppc64_linux26.h:1.1.2.5
*** openafs/src/config/param.ppc64_linux26.h:1.1.2.4	Mon Jun 12 12:20:54 2006
--- openafs/src/config/param.ppc64_linux26.h	Thu Nov  9 18:18:31 2006
***************
*** 31,39 ****
  #define AFS_64BITPOINTER_ENV   1     /* pointers are 64 bits. */
  
  #if defined(__KERNEL__) && !defined(KDUMP_KERNEL)
- #include <linux/threads.h>
  
- #include <linux/config.h>
  #ifdef CONFIG_SMP
  #ifndef AFS_SMP
  #define AFS_SMP 1
--- 31,37 ----
Index: openafs/src/config/param.ppc_linux22.h
diff -c openafs/src/config/param.ppc_linux22.h:1.8.2.2 openafs/src/config/param.ppc_linux22.h:1.8.2.3
*** openafs/src/config/param.ppc_linux22.h:1.8.2.2	Wed Apr 27 17:56:13 2005
--- openafs/src/config/param.ppc_linux22.h	Thu Nov  9 18:18:31 2006
***************
*** 23,29 ****
  #define AFS_NAMEI_ENV     1	/* User space interface to file system */
  
  #if defined(__KERNEL__) && !defined(KDUMP_KERNEL)
- #include <linux/config.h>
  #ifdef CONFIG_SMP
  #undef CONFIG_SMP
  #endif
--- 23,28 ----
Index: openafs/src/config/param.ppc_linux24.h
diff -c openafs/src/config/param.ppc_linux24.h:1.10.2.3 openafs/src/config/param.ppc_linux24.h:1.10.2.4
*** openafs/src/config/param.ppc_linux24.h:1.10.2.3	Mon Jun 12 12:20:54 2006
--- openafs/src/config/param.ppc_linux24.h	Thu Nov  9 18:18:31 2006
***************
*** 27,35 ****
  #define AFS_NAMEI_ENV     1	/* User space interface to file system */
  
  #if defined(__KERNEL__) && !defined(KDUMP_KERNEL)
- #include <linux/threads.h>
  
- #include <linux/config.h>
  #ifdef CONFIG_SMP
  #undef CONFIG_SMP
  #endif
--- 27,33 ----
Index: openafs/src/config/param.ppc_linux26.h
diff -c openafs/src/config/param.ppc_linux26.h:1.1.2.4 openafs/src/config/param.ppc_linux26.h:1.1.2.5
*** openafs/src/config/param.ppc_linux26.h:1.1.2.4	Mon Jun 12 12:20:54 2006
--- openafs/src/config/param.ppc_linux26.h	Thu Nov  9 18:18:31 2006
***************
*** 29,37 ****
  #define AFS_NAMEI_ENV     1	/* User space interface to file system */
  
  #if defined(__KERNEL__) && !defined(KDUMP_KERNEL)
- #include <linux/threads.h>
  
- #include <linux/config.h>
  #ifdef CONFIG_SMP
  #ifndef AFS_SMP
  #define AFS_SMP 1
--- 29,35 ----
Index: openafs/src/config/param.s390_linux22.h
diff -c openafs/src/config/param.s390_linux22.h:1.10.2.2 openafs/src/config/param.s390_linux22.h:1.10.2.3
*** openafs/src/config/param.s390_linux22.h:1.10.2.2	Wed Apr 27 17:56:13 2005
--- openafs/src/config/param.s390_linux22.h	Thu Nov  9 18:18:31 2006
***************
*** 33,39 ****
  #define AFS_NAMEI_ENV     1	/* User space interface to file system */
  
  #if defined(__KERNEL__) && !defined(KDUMP_KERNEL)
- #include <linux/config.h>
  #ifdef CONFIG_SMP
  #undef CONFIG_SMP
  #endif
--- 33,38 ----
Index: openafs/src/config/param.s390_linux24.h
diff -c openafs/src/config/param.s390_linux24.h:1.12.2.3 openafs/src/config/param.s390_linux24.h:1.12.2.4
*** openafs/src/config/param.s390_linux24.h:1.12.2.3	Mon Jun 12 12:20:54 2006
--- openafs/src/config/param.s390_linux24.h	Thu Nov  9 18:18:31 2006
***************
*** 37,45 ****
  #define AFS_NAMEI_ENV     1	/* User space interface to file system */
  
  #if defined(__KERNEL__) && !defined(KDUMP_KERNEL)
- #include <linux/threads.h>
  
- #include <linux/config.h>
  #ifdef CONFIG_SMP
  #undef CONFIG_SMP
  #endif
--- 37,43 ----
Index: openafs/src/config/param.s390_linux26.h
diff -c openafs/src/config/param.s390_linux26.h:1.1.2.3 openafs/src/config/param.s390_linux26.h:1.1.2.4
*** openafs/src/config/param.s390_linux26.h:1.1.2.3	Mon Jun 12 12:20:54 2006
--- openafs/src/config/param.s390_linux26.h	Thu Nov  9 18:18:31 2006
***************
*** 39,47 ****
  #define AFS_NAMEI_ENV     1	/* User space interface to file system */
  
  #if defined(__KERNEL__) && !defined(KDUMP_KERNEL)
- #include <linux/threads.h>
  
- #include <linux/config.h>
  #ifdef CONFIG_SMP
  #undef CONFIG_SMP
  #endif
--- 39,45 ----
Index: openafs/src/config/param.s390x_linux24.h
diff -c openafs/src/config/param.s390x_linux24.h:1.1.2.4 openafs/src/config/param.s390x_linux24.h:1.1.2.5
*** openafs/src/config/param.s390x_linux24.h:1.1.2.4	Mon Jun 12 12:20:54 2006
--- openafs/src/config/param.s390x_linux24.h	Thu Nov  9 18:18:31 2006
***************
*** 42,50 ****
  #define AFS_NAMEI_ENV     1	/* User space interface to file system */
  
  #if defined(__KERNEL__) && !defined(KDUMP_KERNEL)
- #include <linux/threads.h>
  
- #include <linux/config.h>
  #ifdef CONFIG_SMP
  #undef CONFIG_SMP
  #endif
--- 42,48 ----
Index: openafs/src/config/param.s390x_linux26.h
diff -c openafs/src/config/param.s390x_linux26.h:1.1.2.5 openafs/src/config/param.s390x_linux26.h:1.1.2.6
*** openafs/src/config/param.s390x_linux26.h:1.1.2.5	Mon Jun 12 12:20:54 2006
--- openafs/src/config/param.s390x_linux26.h	Thu Nov  9 18:18:31 2006
***************
*** 45,53 ****
  #define AFS_NAMEI_ENV     1	/* User space interface to file system */
  
  #if defined(__KERNEL__) && !defined(KDUMP_KERNEL)
- #include <linux/threads.h>
  
- #include <linux/config.h>
  #ifdef CONFIG_SMP
  #ifndef AFS_SMP
  #define AFS_SMP 1
--- 45,51 ----
Index: openafs/src/config/param.sparc64_linux22.h
diff -c openafs/src/config/param.sparc64_linux22.h:1.8.2.2 openafs/src/config/param.sparc64_linux22.h:1.8.2.3
*** openafs/src/config/param.sparc64_linux22.h:1.8.2.2	Wed Apr 27 17:56:13 2005
--- openafs/src/config/param.sparc64_linux22.h	Thu Nov  9 18:18:31 2006
***************
*** 38,44 ****
  #define AFS_64BITPOINTER_ENV	1	/* pointers are 64 bits. */
  
  #if defined(__KERNEL__) && !defined(KDUMP_KERNEL)
- #include <linux/config.h>
  #ifdef CONFIG_SMP
  #undef CONFIG_SMP
  #endif
--- 38,43 ----
Index: openafs/src/config/param.sparc64_linux24.h
diff -c openafs/src/config/param.sparc64_linux24.h:1.7.2.3 openafs/src/config/param.sparc64_linux24.h:1.7.2.4
*** openafs/src/config/param.sparc64_linux24.h:1.7.2.3	Mon Jun 12 12:20:54 2006
--- openafs/src/config/param.sparc64_linux24.h	Thu Nov  9 18:18:31 2006
***************
*** 41,49 ****
  #define AFS_64BITPOINTER_ENV	1	/* pointers are 64 bits. */
  
  #if defined(__KERNEL__) && !defined(KDUMP_KERNEL)
- #include <linux/threads.h>
  
- #include <linux/config.h>
  #if defined(MODULE) && defined(CONFIG_MODVERSIONS)
  #define MODVERSIONS
  #include <linux/modversions.h>
--- 41,47 ----
Index: openafs/src/config/param.sparc64_linux26.h
diff -c openafs/src/config/param.sparc64_linux26.h:1.1.4.4 openafs/src/config/param.sparc64_linux26.h:1.1.4.5
*** openafs/src/config/param.sparc64_linux26.h:1.1.4.4	Mon Jun 12 12:20:54 2006
--- openafs/src/config/param.sparc64_linux26.h	Thu Nov  9 18:18:31 2006
***************
*** 43,51 ****
  #define AFS_64BITPOINTER_ENV	1	/* pointers are 64 bits. */
  
  #if defined(__KERNEL__) && !defined(KDUMP_KERNEL)
- #include <linux/threads.h>
  
- #include <linux/config.h>
  #ifdef CONFIG_SMP
  #ifndef AFS_SMP
  #define AFS_SMP 1
--- 43,49 ----
Index: openafs/src/config/param.sparc_linux22.h
diff -c openafs/src/config/param.sparc_linux22.h:1.9.2.2 openafs/src/config/param.sparc_linux22.h:1.9.2.3
*** openafs/src/config/param.sparc_linux22.h:1.9.2.2	Wed Apr 27 17:56:13 2005
--- openafs/src/config/param.sparc_linux22.h	Thu Nov  9 18:18:31 2006
***************
*** 33,39 ****
  #define AFS_NAMEI_ENV     1	/* User space interface to file system */
  
  #if defined(__KERNEL__) && !defined(KDUMP_KERNEL)
- #include <linux/config.h>
  #ifdef CONFIG_SMP
  #undef CONFIG_SMP
  #endif
--- 33,38 ----
Index: openafs/src/config/param.sparc_linux24.h
diff -c openafs/src/config/param.sparc_linux24.h:1.8.2.3 openafs/src/config/param.sparc_linux24.h:1.8.2.4
*** openafs/src/config/param.sparc_linux24.h:1.8.2.3	Mon Jun 12 12:20:54 2006
--- openafs/src/config/param.sparc_linux24.h	Thu Nov  9 18:18:31 2006
***************
*** 36,44 ****
  #define AFS_NAMEI_ENV     1	/* User space interface to file system */
  
  #if defined(__KERNEL__) && !defined(KDUMP_KERNEL)
- #include <linux/threads.h>
  
- #include <linux/config.h>
  #ifdef CONFIG_SMP
  #undef CONFIG_SMP
  #endif
--- 36,42 ----
Index: openafs/src/config/param.sun4x_511.h
diff -c /dev/null openafs/src/config/param.sun4x_511.h:1.1.2.2
*** /dev/null	Mon Jan 15 23:38:34 2007
--- openafs/src/config/param.sun4x_511.h	Thu Dec 28 16:59:45 2006
***************
*** 0 ****
--- 1,179 ----
+ #ifndef UKERNEL
+ /* This section for kernel libafs compiles only */
+ 
+ #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_SUN59_ENV		1
+ #define AFS_SUN510_ENV		1
+ #define AFS_SUN511_ENV		1
+ #define AFS_BOZONLOCK_ENV       1
+ 
+ #define AFS_64BIT_ENV		1	/* Defines afs_int32 as int, not long. */
+ #define AFS_64BIT_CLIENT	1	
+ 
+ #define AFS_HAVE_FLOCK_SYSID	1
+ 
+ #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 */
+ 
+ #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_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_sun4x_511		1
+ #define SYS_NAME		"sun4x_511"
+ #define SYS_NAME_ID		SYS_NAME_ID_sun4x_511
+ #define AFSBIG_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_loffset
+ #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)		uniqtime32(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
+ 
+ #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
+ #endif /* KERNEL */
+ #define	AFS_DIRENT
+ #ifndef CMSERVERPREF
+ #define CMSERVERPREF
+ #endif
+ #define	ROOTINO			UFSROOTINO
+ 
+ #endif /* AFS_PARAM_H */
+ 
+ #else /* !defined(UKERNEL) */
+ 
+ /* This section for user space compiles only */
+ 
+ #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
+ #define AFS_USR_SUN7_ENV	1
+ #define AFS_USR_SUN8_ENV	1
+ #define AFS_USR_SUN9_ENV	1
+ 
+ #define AFS_64BIT_ENV		1
+ 
+ #include <afs/afs_sysnames.h>
+ 
+ #if 0
+ #define AFS_GLOBAL_SUNLOCK	1	/* For global locking */
+ #endif
+ 
+ #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_511		1
+ #define SYS_NAME		"sun4x_511"
+ #define SYS_NAME_ID		SYS_NAME_ID_sun4x_511
+ #define AFSBIG_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 */
+ 
+ #endif /* !defined(UKERNEL) */
Index: openafs/src/config/param.sunx86_511.h
diff -c /dev/null openafs/src/config/param.sunx86_511.h:1.1.2.2
*** /dev/null	Mon Jan 15 23:38:35 2007
--- openafs/src/config/param.sunx86_511.h	Thu Dec 28 16:59:45 2006
***************
*** 0 ****
--- 1,189 ----
+ #ifndef UKERNEL
+ /* This section for kernel libafs compiles only */
+ 
+ /*
+  * 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_SUN59_ENV		1
+ #define AFS_SUN510_ENV		1
+ #define AFS_SUN511_ENV		1
+ #define AFS_BOZONLOCK_ENV       1
+ #define AFS_X86_ENV		1
+ 
+ #define AFS_64BIT_ENV		1	/* Defines afs_int32 as int, not long. */
+ #define AFS_64BIT_CLIENT	1	
+ 
+ #define AFS_HAVE_FLOCK_SYSID    1
+ 
+ #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_511		1
+ #define SYS_NAME		"sunx86_511"
+ #define SYS_NAME_ID		SYS_NAME_ID_sunx86_511
+ #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_loffset
+ #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)		uniqtime32(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(__amd64)
+ #define	AFS_SUN57_64BIT_ENV	1
+ #define AFS_64BIT_INO   	1
+ #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
+ #endif /* KERNEL */
+ #define	AFS_DIRENT
+ #ifndef CMSERVERPREF
+ #define CMSERVERPREF
+ #endif
+ #define	ROOTINO			UFSROOTINO
+ 
+ #endif /* AFS_PARAM_H */
+ 
+ #else /* !defined(UKERNEL) */
+ 
+ /* This section for user space compiles only */
+ 
+ #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
+ #define AFS_USR_SUN7_ENV        1
+ #define AFS_USR_SUN8_ENV        1
+ #define AFS_USR_SUN9_ENV        1
+ 
+ #define AFS_64BIT_ENV           1
+ 
+ #include <afs/afs_sysnames.h>
+ 
+ #if 0
+ #define AFS_GLOBAL_SUNLOCK	1	/* For global locking */
+ #endif
+ 
+ #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_sunx86_511         1
+ #define SYS_NAME                "sunx86_511"
+ #define SYS_NAME_ID             SYS_NAME_ID_sunx86_511
+ #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 */
+ 
+ #endif /* !defined(UKERNEL) */
Index: openafs/src/dauth/dpass.c
diff -c openafs/src/dauth/dpass.c:1.7 openafs/src/dauth/dpass.c:1.7.2.1
*** openafs/src/dauth/dpass.c:1.7	Tue Jul 15 19:14:59 2003
--- openafs/src/dauth/dpass.c	Sat Oct 21 22:08:33 2006
***************
*** 19,25 ****
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/dauth/Attic/dpass.c,v 1.7 2003/07/15 23:14:59 shadow Exp $");
  
  #include <afs/stds.h>
  #include <sys/types.h>
--- 19,25 ----
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/dauth/Attic/dpass.c,v 1.7.2.1 2006/10/22 02:08:33 jaltman Exp $");
  
  #include <afs/stds.h>
  #include <sys/types.h>
***************
*** 109,115 ****
  		    cell_p);
  	} else {
  	    strncpy(cell, cellinfo.name, sizeof(cell) - 1);
! 	    cell[sizeof(cell)] = '\0';
  	    cell_p = cell;
  	}
      } else {
--- 109,115 ----
  		    cell_p);
  	} else {
  	    strncpy(cell, cellinfo.name, sizeof(cell) - 1);
! 	    cell[sizeof(cell)-1] = '\0';
  	    cell_p = cell;
  	}
      } else {
Index: openafs/src/kauth/kaserver.c
diff -c openafs/src/kauth/kaserver.c:1.17.2.4 openafs/src/kauth/kaserver.c:1.17.2.5
*** openafs/src/kauth/kaserver.c:1.17.2.4	Tue Jun 20 16:35:01 2006
--- openafs/src/kauth/kaserver.c	Sat Dec 30 12:02:35 2006
***************
*** 11,17 ****
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/kauth/kaserver.c,v 1.17.2.4 2006/06/20 20:35:01 jaltman Exp $");
  
  #include <afs/stds.h>
  #include <sys/types.h>
--- 11,17 ----
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/kauth/kaserver.c,v 1.17.2.5 2006/12/30 17:02:35 jaltman Exp $");
  
  #include <afs/stds.h>
  #include <sys/types.h>
***************
*** 343,348 ****
--- 343,356 ----
      OpenLog(AFSDIR_SERVER_KALOG_FILEPATH);
      SetupLogSignals();
  #endif
+ 
+     fprintf(stderr, "%s: WARNING: kaserver is deprecated due to its weak security "
+ 	    "properties.  Migrating to a Kerberos 5 KDC is advised.  "
+ 	    "http://www.openafs.org/no-more-des.html\n", whoami);
+     ViceLog(0, ("WARNING: kaserver is deprecated due to its weak security properties.  "
+ 	    "Migrating to a Kerberos 5 KDC is advised.  "
+ 	    "http://www.openafs.org/no-more-des.html\n"));
+ 
      code =
  	afsconf_GetExtendedCellInfo(KA_conf, cell, AFSCONF_KAUTHSERVICE,
  				    &cellinfo, &clones);
Index: openafs/src/libafs/MakefileProto.SOLARIS.in
diff -c openafs/src/libafs/MakefileProto.SOLARIS.in:1.24.2.2 openafs/src/libafs/MakefileProto.SOLARIS.in:1.24.2.3
*** openafs/src/libafs/MakefileProto.SOLARIS.in:1.24.2.2	Mon Jul  3 14:43:39 2006
--- openafs/src/libafs/MakefileProto.SOLARIS.in	Thu Dec 28 16:59:45 2006
***************
*** 32,42 ****
  #CC = /opt/SUNWspro/bin/cc
  KDEFS= -D_KERNEL -DSYSV -dn ${ARCH_DEFS}
  
! <sun4x_57 sun4x_58 sun4x_59 sun4x_510>
  KDEFS_32 = 
  KDEFS_64 = -xarch=v9 
  
! <sunx86_57 sunx86_58 sunx86_59 sunx86_510>
  KDEFS_32 = 
  KDEFS_64 = -xarch=amd64 -xmodel=kernel
  
--- 32,42 ----
  #CC = /opt/SUNWspro/bin/cc
  KDEFS= -D_KERNEL -DSYSV -dn ${ARCH_DEFS}
  
! <sun4x_57 sun4x_58 sun4x_59 sun4x_510 sun4x_511>
  KDEFS_32 = 
  KDEFS_64 = -xarch=v9 
  
! <sunx86_57 sunx86_58 sunx86_59 sunx86_510 sunx86_511>
  KDEFS_32 = 
  KDEFS_64 = -xarch=amd64 -xmodel=kernel
  
***************
*** 44,63 ****
  CFLAGS=-I. -I.. -I${TOP_OBJDIR}/src/config ${FSINCLUDES} $(DEFINES) $(KDEFS) $(KOPTS) ${DBUG}
  
  # Name of directory to hold object files and libraries.
! <all -sun4x_57 -sun4x_58 -sun4x_59 -sun4x_510 -sunx86_57 -sunx86_58 -sunx86_59 -sunx86_510>
  KOBJ = MODLOAD
! <sun4x_57 sun4x_58 sun4x_59 sunx86_57 sunx86_58 sunx86_59 sunx86_510>
  KOBJ = MODLOAD32 MODLOAD64
! <sun4x_510>
  KOBJ = MODLOAD64
  
  # This tells Makefile.common to use it's single directory build target.
! <all -sun4x_57 -sun4x_58 -sun4x_59 -sun4x_510 -sunx86_57 -sunx86_58 -sunx86_59 -sunx86_510>
  COMPDIRS = single_compdir
  INSTDIRS = single_instdir
  DESTDIRS = single_destdir
  
! <sun4x_57 sun4x_58 sun4x_59 sun4x_510 sunx86_57 sunx86_58 sunx86_59 sunx86_510>
  COMPDIRS = solaris_compdirs
  INSTDIRS = solaris_instdirs
  DESTDIRS = solaris_destdirs
--- 44,63 ----
  CFLAGS=-I. -I.. -I${TOP_OBJDIR}/src/config ${FSINCLUDES} $(DEFINES) $(KDEFS) $(KOPTS) ${DBUG}
  
  # Name of directory to hold object files and libraries.
! <all -sun4x_57 -sun4x_58 -sun4x_59 -sun4x_510 -sun4x_511 -sunx86_57 -sunx86_58 -sunx86_59 -sunx86_510 -sunx86_511>
  KOBJ = MODLOAD
! <sun4x_57 sun4x_58 sun4x_59 sunx86_57 sunx86_58 sunx86_59 sunx86_510 sunx86_511>
  KOBJ = MODLOAD32 MODLOAD64
! <sun4x_510 sun4x_511>
  KOBJ = MODLOAD64
  
  # This tells Makefile.common to use it's single directory build target.
! <all -sun4x_57 -sun4x_58 -sun4x_59 -sun4x_510 -sun4x_511 -sunx86_57 -sunx86_58 -sunx86_59 -sunx86_510 -sunx86_511>
  COMPDIRS = single_compdir
  INSTDIRS = single_instdir
  DESTDIRS = single_destdir
  
! <sun4x_57 sun4x_58 sun4x_59 sun4x_510 sun4x_511 sunx86_57 sunx86_58 sunx86_59 sunx86_510 sunx86_511>
  COMPDIRS = solaris_compdirs
  INSTDIRS = solaris_instdirs
  DESTDIRS = solaris_destdirs
***************
*** 89,95 ****
  ## This is the target for a Solaris 7. Here we build both the 32 bit and
  ## the 64 bit libafs in MODLOAD32 and MODLOAD64 directories respectively
  
! <sun4x_57 sun4x_58 sun4x_59 sun4x_510 sunx86_57 sunx86_58 sunx86_59 sunx86_510>
  ${COMPDIRS} ${INSTDIRS} ${DESTDIRS}:
  	for t in ${KOBJ} ; do \
  		echo Building directory: $$t ; \
--- 89,95 ----
  ## This is the target for a Solaris 7. Here we build both the 32 bit and
  ## the 64 bit libafs in MODLOAD32 and MODLOAD64 directories respectively
  
! <sun4x_57 sun4x_58 sun4x_59 sun4x_510 sun4x_511 sunx86_57 sunx86_58 sunx86_59 sunx86_510 sunx86_511>
  ${COMPDIRS} ${INSTDIRS} ${DESTDIRS}:
  	for t in ${KOBJ} ; do \
  		echo Building directory: $$t ; \
***************
*** 125,131 ****
  DEST_LIBAFS = ${DEST}/root.client/usr/vice/etc/modload/${LIBAFS}
  DEST_LIBAFSNONFS = ${DEST}/root.client/usr/vice/etc/modload/${LIBAFSNONFS}
  
! <sun4x_57 sun4x_58 sun4x_59 sun4x_510 sunx86_57 sunx86_58 sunx86_59 sunx86_510>
  INST_LIBAFSNONFS = ${DESTDIR}${afskerneldir}/libafs${BITS}.nonfs.o
  INST_LIBAFS = ${DESTDIR}${afskerneldir}/libafs${BITS}.o
  
--- 125,131 ----
  DEST_LIBAFS = ${DEST}/root.client/usr/vice/etc/modload/${LIBAFS}
  DEST_LIBAFSNONFS = ${DEST}/root.client/usr/vice/etc/modload/${LIBAFSNONFS}
  
! <sun4x_57 sun4x_58 sun4x_59 sun4x_510 sun4x_511 sunx86_57 sunx86_58 sunx86_59 sunx86_510 sunx86_511>
  INST_LIBAFSNONFS = ${DESTDIR}${afskerneldir}/libafs${BITS}.nonfs.o
  INST_LIBAFS = ${DESTDIR}${afskerneldir}/libafs${BITS}.o
  
Index: openafs/src/libafs/afs.ppc_darwin_70.plist.in
diff -c openafs/src/libafs/afs.ppc_darwin_70.plist.in:1.2.2.16 openafs/src/libafs/afs.ppc_darwin_70.plist.in:1.2.2.17
*** openafs/src/libafs/afs.ppc_darwin_70.plist.in:1.2.2.16	Mon Oct  9 22:47:39 2006
--- openafs/src/libafs/afs.ppc_darwin_70.plist.in	Mon Jan 15 23:16:19 2007
***************
*** 15,25 ****
  	<key>CFBundlePackageType</key>
  	<string>KEXT</string>
  	<key>CFBundleShortVersionString</key>
! 	<string>1.4.2</string>
  	<key>CFBundleSignature</key>
  	<string>????</string>
  	<key>CFBundleVersion</key>
! 	<string>1.4.2</string>
  	<key>OSBundleLibraries</key>
  	<dict>
  		<key>com.apple.kernel.bsd</key>
--- 15,25 ----
  	<key>CFBundlePackageType</key>
  	<string>KEXT</string>
  	<key>CFBundleShortVersionString</key>
! 	<string>1.4.3fc1</string>
  	<key>CFBundleSignature</key>
  	<string>????</string>
  	<key>CFBundleVersion</key>
! 	<string>1.4.3fc1</string>
  	<key>OSBundleLibraries</key>
  	<dict>
  		<key>com.apple.kernel.bsd</key>
Index: openafs/src/libafs/afs.ppc_darwin_80.plist.in
diff -c openafs/src/libafs/afs.ppc_darwin_80.plist.in:1.1.2.11 openafs/src/libafs/afs.ppc_darwin_80.plist.in:1.1.2.12
*** openafs/src/libafs/afs.ppc_darwin_80.plist.in:1.1.2.11	Mon Oct  9 22:47:39 2006
--- openafs/src/libafs/afs.ppc_darwin_80.plist.in	Mon Jan 15 23:16:19 2007
***************
*** 15,25 ****
  	<key>CFBundlePackageType</key>
  	<string>KEXT</string>
  	<key>CFBundleShortVersionString</key>
! 	<string>1.4.2</string>
  	<key>CFBundleSignature</key>
  	<string>????</string>
  	<key>CFBundleVersion</key>
! 	<string>1.4.2</string>
  	<key>OSBundleLibraries</key>
  	<dict>
  		<key>com.apple.kpi.bsd</key>
--- 15,25 ----
  	<key>CFBundlePackageType</key>
  	<string>KEXT</string>
  	<key>CFBundleShortVersionString</key>
! 	<string>1.4.3fc1</string>
  	<key>CFBundleSignature</key>
  	<string>????</string>
  	<key>CFBundleVersion</key>
! 	<string>1.4.3fc1</string>
  	<key>OSBundleLibraries</key>
  	<dict>
  		<key>com.apple.kpi.bsd</key>
Index: openafs/src/libafs/afs.ppc_darwin_90.plist.in
diff -c openafs/src/libafs/afs.ppc_darwin_90.plist.in:1.1.2.10 openafs/src/libafs/afs.ppc_darwin_90.plist.in:1.1.2.11
*** openafs/src/libafs/afs.ppc_darwin_90.plist.in:1.1.2.10	Mon Oct  9 22:47:39 2006
--- openafs/src/libafs/afs.ppc_darwin_90.plist.in	Mon Jan 15 23:16:19 2007
***************
*** 15,25 ****
  	<key>CFBundlePackageType</key>
  	<string>KEXT</string>
  	<key>CFBundleShortVersionString</key>
! 	<string>1.4.2</string>
  	<key>CFBundleSignature</key>
  	<string>????</string>
  	<key>CFBundleVersion</key>
! 	<string>1.4.2</string>
  	<key>OSBundleLibraries</key>
  	<dict>
  		<key>com.apple.kpi.bsd</key>
--- 15,25 ----
  	<key>CFBundlePackageType</key>
  	<string>KEXT</string>
  	<key>CFBundleShortVersionString</key>
! 	<string>1.4.3fc1</string>
  	<key>CFBundleSignature</key>
  	<string>????</string>
  	<key>CFBundleVersion</key>
! 	<string>1.4.3fc1</string>
  	<key>OSBundleLibraries</key>
  	<dict>
  		<key>com.apple.kpi.bsd</key>
Index: openafs/src/libafs/afs.x86_darwin_80.plist.in
diff -c openafs/src/libafs/afs.x86_darwin_80.plist.in:1.1.2.10 openafs/src/libafs/afs.x86_darwin_80.plist.in:1.1.2.11
*** openafs/src/libafs/afs.x86_darwin_80.plist.in:1.1.2.10	Mon Oct  9 22:47:39 2006
--- openafs/src/libafs/afs.x86_darwin_80.plist.in	Mon Jan 15 23:16:19 2007
***************
*** 15,25 ****
  	<key>CFBundlePackageType</key>
  	<string>KEXT</string>
  	<key>CFBundleShortVersionString</key>
! 	<string>1.4.2</string>
  	<key>CFBundleSignature</key>
  	<string>????</string>
  	<key>CFBundleVersion</key>
! 	<string>1.4.2</string>
  	<key>OSBundleLibraries</key>
  	<dict>
  		<key>com.apple.kpi.bsd</key>
--- 15,25 ----
  	<key>CFBundlePackageType</key>
  	<string>KEXT</string>
  	<key>CFBundleShortVersionString</key>
! 	<string>1.4.3fc1</string>
  	<key>CFBundleSignature</key>
  	<string>????</string>
  	<key>CFBundleVersion</key>
! 	<string>1.4.3fc1</string>
  	<key>OSBundleLibraries</key>
  	<dict>
  		<key>com.apple.kpi.bsd</key>
Index: openafs/src/libafs/afs.x86_darwin_90.plist.in
diff -c openafs/src/libafs/afs.x86_darwin_90.plist.in:1.1.2.10 openafs/src/libafs/afs.x86_darwin_90.plist.in:1.1.2.11
*** openafs/src/libafs/afs.x86_darwin_90.plist.in:1.1.2.10	Mon Oct  9 22:47:39 2006
--- openafs/src/libafs/afs.x86_darwin_90.plist.in	Mon Jan 15 23:16:19 2007
***************
*** 15,25 ****
  	<key>CFBundlePackageType</key>
  	<string>KEXT</string>
  	<key>CFBundleShortVersionString</key>
! 	<string>1.4.2</string>
  	<key>CFBundleSignature</key>
  	<string>????</string>
  	<key>CFBundleVersion</key>
! 	<string>1.4.2</string>
  	<key>OSBundleLibraries</key>
  	<dict>
  		<key>com.apple.kpi.bsd</key>
--- 15,25 ----
  	<key>CFBundlePackageType</key>
  	<string>KEXT</string>
  	<key>CFBundleShortVersionString</key>
! 	<string>1.4.3fc1</string>
  	<key>CFBundleSignature</key>
  	<string>????</string>
  	<key>CFBundleVersion</key>
! 	<string>1.4.3fc1</string>
  	<key>OSBundleLibraries</key>
  	<dict>
  		<key>com.apple.kpi.bsd</key>
Index: openafs/src/packaging/MacOS/InstallationCheck
diff -c openafs/src/packaging/MacOS/InstallationCheck:1.1.4.2 openafs/src/packaging/MacOS/InstallationCheck:removed
*** openafs/src/packaging/MacOS/InstallationCheck:1.1.4.2	Sat Oct  8 16:54:03 2005
--- openafs/src/packaging/MacOS/InstallationCheck	Mon Jan 15 23:38:37 2007
***************
*** 1,10 ****
- #!/bin/sh
- majorvers=`uname -r | sed 's/\..*//'`
- echo "InstallationCheck: os release is $majorvers"
- if [ $majorvers -ne 8 ]; then
- echo "InstallationCheck: not ok"
-    exit 112
- fi
- 
- echo "InstallationCheck: ok"
- exit 0
--- 0 ----
Index: openafs/src/packaging/MacOS/InstallationCheck.8
diff -c /dev/null openafs/src/packaging/MacOS/InstallationCheck.8:1.1.2.2
*** /dev/null	Mon Jan 15 23:38:37 2007
--- openafs/src/packaging/MacOS/InstallationCheck.8	Thu Nov  9 19:16:29 2006
***************
*** 0 ****
--- 1,10 ----
+ #!/bin/sh
+ majorvers=`uname -r | sed 's/\..*//'`
+ echo "InstallationCheck: os release is $majorvers"
+ if [ $majorvers -ne 8 ]; then
+ echo "InstallationCheck: not ok"
+ 	exit 112
+ fi
+ 
+ echo "InstallationCheck: ok"
+ exit 0
Index: openafs/src/packaging/MacOS/InstallationCheck.9
diff -c /dev/null openafs/src/packaging/MacOS/InstallationCheck.9:1.1.2.2
*** /dev/null	Mon Jan 15 23:38:37 2007
--- openafs/src/packaging/MacOS/InstallationCheck.9	Thu Nov  9 19:16:29 2006
***************
*** 0 ****
--- 1,10 ----
+ #!/bin/sh
+ majorvers=`uname -r | sed 's/\..*//'`
+ echo "InstallationCheck: os release is $majorvers"
+ if [ $majorvers -ne 9 ]; then
+ echo "InstallationCheck: not ok"
+ 	exit 112
+ fi
+ 
+ echo "InstallationCheck: ok"
+ exit 0
Index: openafs/src/packaging/MacOS/OpenAFS.Info.plist
diff -c openafs/src/packaging/MacOS/OpenAFS.Info.plist:1.2.2.26 openafs/src/packaging/MacOS/OpenAFS.Info.plist:1.2.2.27
*** openafs/src/packaging/MacOS/OpenAFS.Info.plist:1.2.2.26	Mon Oct  9 22:47:41 2006
--- openafs/src/packaging/MacOS/OpenAFS.Info.plist	Mon Jan 15 23:16:21 2007
***************
*** 3,15 ****
  <plist version="1.0">
  <dict>
  	<key>CFBundleGetInfoString</key>
! 	<string>OpenAFS 1.4.2</string>
  	<key>CFBundleIdentifier</key>
  	<string>org.openafs.OpenAFS.pkg</string>
  	<key>CFBundleName</key>
  	<string>OpenAFS</string>
  	<key>CFBundleShortVersionString</key>
! 	<string>1.4.2</string>
  	<key>IFMajorVersion</key>
  	<integer>1</integer>
  	<key>IFMinorVersion</key>
--- 3,15 ----
  <plist version="1.0">
  <dict>
  	<key>CFBundleGetInfoString</key>
! 	<string>OpenAFS 1.4.3fc1</string>
  	<key>CFBundleIdentifier</key>
  	<string>org.openafs.OpenAFS.pkg</string>
  	<key>CFBundleName</key>
  	<string>OpenAFS</string>
  	<key>CFBundleShortVersionString</key>
! 	<string>1.4.3fc1</string>
  	<key>IFMajorVersion</key>
  	<integer>1</integer>
  	<key>IFMinorVersion</key>
Index: openafs/src/packaging/MacOS/OpenAFS.info
diff -c openafs/src/packaging/MacOS/OpenAFS.info:1.1.4.39 openafs/src/packaging/MacOS/OpenAFS.info:1.1.4.40
*** openafs/src/packaging/MacOS/OpenAFS.info:1.1.4.39	Mon Oct  9 22:47:41 2006
--- openafs/src/packaging/MacOS/OpenAFS.info	Mon Jan 15 23:16:21 2007
***************
*** 1,5 ****
  Title OpenAFS
! Version 1.4.2
  Description The OpenAFS distributed filesystem. This package installs an almost-ready-to-run client for OpenAFS. see http://www.openafs.org for more information.
  DefaultLocation /
  Diskname (null)
--- 1,5 ----
  Title OpenAFS
! Version 1.4.3fc1
  Description The OpenAFS distributed filesystem. This package installs an almost-ready-to-run client for OpenAFS. see http://www.openafs.org for more information.
  DefaultLocation /
  Diskname (null)
Index: openafs/src/packaging/MacOS/OpenAFS.pre_upgrade
diff -c openafs/src/packaging/MacOS/OpenAFS.pre_upgrade:1.1.4.1 openafs/src/packaging/MacOS/OpenAFS.pre_upgrade:1.1.4.2
*** openafs/src/packaging/MacOS/OpenAFS.pre_upgrade:1.1.4.1	Thu Mar 23 11:08:34 2006
--- openafs/src/packaging/MacOS/OpenAFS.pre_upgrade	Thu Nov  9 23:10:13 2006
***************
*** 23,26 ****
    fi
  fi
  
! /Library/StartupItems/OpenAFS/OpenAFS stop
--- 23,28 ----
    fi
  fi
  
! if [ -f /Library/StartupItems/OpenAFS/OpenAFS ]; then
!   /Library/StartupItems/OpenAFS/OpenAFS stop
! fi
Index: openafs/src/packaging/MacOS/afslogo.jpg
Index: openafs/src/packaging/MacOS/background.jpg
Index: openafs/src/packaging/MacOS/buildpkg.sh
diff -c openafs/src/packaging/MacOS/buildpkg.sh:1.4.2.14 openafs/src/packaging/MacOS/buildpkg.sh:1.4.2.18
*** openafs/src/packaging/MacOS/buildpkg.sh:1.4.2.14	Thu Aug 10 13:07:33 2006
--- openafs/src/packaging/MacOS/buildpkg.sh	Fri Jan  5 18:34:01 2007
***************
*** 114,120 ****
      mkdir -p $PKGROOT/private/var/db/openafs/cache
      mkdir -p $PKGROOT/private/var/db/openafs/etc/config
      cp $CURDIR/CellServDB $PKGROOT/private/var/db/openafs/etc/CellServDB.master
!     echo openafs.org > $PKGROOT/private/var/db/openafs/etc/ThisCell.sample
      if [ $majorvers -ge 7 ]; then
  	echo /afs:/var/db/openafs/cache:30000 > $PKGROOT/private/var/db/openafs/etc/cacheinfo.sample
          cp -RP $PKGROOT/Library/OpenAFS/Tools/etc/afssettings $PKGROOT/private/var/db/openafs/etc/config
--- 114,120 ----
      mkdir -p $PKGROOT/private/var/db/openafs/cache
      mkdir -p $PKGROOT/private/var/db/openafs/etc/config
      cp $CURDIR/CellServDB $PKGROOT/private/var/db/openafs/etc/CellServDB.master
!     echo grand.central.org > $PKGROOT/private/var/db/openafs/etc/ThisCell.sample
      if [ $majorvers -ge 7 ]; then
  	echo /afs:/var/db/openafs/cache:30000 > $PKGROOT/private/var/db/openafs/etc/cacheinfo.sample
          cp -RP $PKGROOT/Library/OpenAFS/Tools/etc/afssettings $PKGROOT/private/var/db/openafs/etc/config
***************
*** 122,128 ****
      else
  	echo /Network/afs:/var/db/openafs/cache:30000 > $PKGROOT/private/var/db/openafs/etc/cacheinfo.sample
      fi
!     echo '-afsdb -stat 2000 -dcache 800 -daemons 3 -volumes 70 -dynroot -fakestat-all' > $PKGROOT/private/var/db/openafs/etc/config/afsd.options.sample
  
      strip -X -S $PKGROOT/Library/OpenAFS/Tools/root.client/usr/vice/etc/afs.kext/Contents/MacOS/afs
  
--- 122,128 ----
      else
  	echo /Network/afs:/var/db/openafs/cache:30000 > $PKGROOT/private/var/db/openafs/etc/cacheinfo.sample
      fi
!     echo '-memcache -afsdb -stat 2000 -dcache 800 -daemons 3 -volumes 70 -dynroot -fakestat-all' > $PKGROOT/private/var/db/openafs/etc/config/afsd.options.sample
  
      strip -X -S $PKGROOT/Library/OpenAFS/Tools/root.client/usr/vice/etc/afs.kext/Contents/MacOS/afs
  
***************
*** 171,179 ****
  	cp OpenAFS.post_install $PKGRES/postupgrade
  	cp background.jpg $PKGRES/background.jpg
  	if [ $majorvers -ge 8 ]; then
! 	    cp InstallationCheck $PKGRES
  	    mkdir -p $PKGRES/English.lproj
! 	    cp InstallationCheck $PKGRES/English.lproj
  	    chmod a+x $PKGRES/InstallationCheck
  	fi
  	chmod a+x $PKGRES/postinstall $PKGRES/postupgrade $PKGRES/preupgrade
--- 171,179 ----
  	cp OpenAFS.post_install $PKGRES/postupgrade
  	cp background.jpg $PKGRES/background.jpg
  	if [ $majorvers -ge 8 ]; then
! 	    cp InstallationCheck.$majorvers $PKGRES/InstallationCheck
  	    mkdir -p $PKGRES/English.lproj
! 	    cp InstallationCheck.$majorvers $PKGRES/English.lproj/InstallationCheck
  	    chmod a+x $PKGRES/InstallationCheck
  	fi
  	chmod a+x $PKGRES/postinstall $PKGRES/postupgrade $PKGRES/preupgrade
***************
*** 216,222 ****
      cp afslogo.jpg $CURDIR/dmg/.background
  #    hdiutil create -srcfolder $CURDIR/dmg -volname OpenAFS -anyowners $CURDIR/OpenAFS.dmg
      hdiutil makehybrid -hfs -hfs-volume-name OpenAFS -hfs-openfolder $CURDIR/dmg $CURDIR/dmg -o $CURDIR/TMP.dmg
!     hdiutil convert -format UDZO TMP.dmg -o $CURDIR/OpenAFS.dmg
      rm $CURDIR/TMP.dmg
      rm -rf $CURDIR/dmg
      # Unfortunately, sudo sets $USER to root, so I can't chown the 
--- 216,222 ----
      cp afslogo.jpg $CURDIR/dmg/.background
  #    hdiutil create -srcfolder $CURDIR/dmg -volname OpenAFS -anyowners $CURDIR/OpenAFS.dmg
      hdiutil makehybrid -hfs -hfs-volume-name OpenAFS -hfs-openfolder $CURDIR/dmg $CURDIR/dmg -o $CURDIR/TMP.dmg
!     hdiutil convert -format UDZO $CURDIR/TMP.dmg -o $CURDIR/OpenAFS.dmg
      rm $CURDIR/TMP.dmg
      rm -rf $CURDIR/dmg
      # Unfortunately, sudo sets $USER to root, so I can't chown the 
Index: openafs/src/packaging/RedHat/openafs-README
diff -c openafs/src/packaging/RedHat/openafs-README:1.1 openafs/src/packaging/RedHat/openafs-README:1.1.2.1
*** openafs/src/packaging/RedHat/openafs-README:1.1	Mon Aug 26 16:46:51 2002
--- openafs/src/packaging/RedHat/openafs-README	Fri Dec  1 13:34:13 2006
***************
*** 2,29 ****
  and the SUN ONC RPC license, with are included in the files
  LICENSE.IBM and LICENSE.Sun in the same directory as this README.
  
  To build the AFS kernel module on a local system, run:
  
      ./configure
      make
  
  When it's done, the binary module will be src/MODLOAD-XXX/libafs-XXX.o
! and must be manually installed for your kernel.  To do this you
! generally copy the file to /usr/vice/etc/modload:
  
!     cp src/MODLOAD-XXX/libafs-XXX.o /usr/vice/etc/modload/
  
! Then you need to add this module to your SymTable by using "afsmodname"
! to generate a new SymTable:
  
!     cd /usr/vice/etc/modload
!     ../afsmodname -f SymTable.local -g libafs-XXX.o
! 
! NOTE: This only works if you have your kernel compiled with symbol
! version support.  Without symbol version support you will not be able
! to choose kernel modules.  If you compile without kernel module
! support then you need to remove the SymTable file from
! /usr/vice/etc/modload to allow the init scripts to choose a module
! based on 'uname -r' instead of /proc/ksyms.  Keep in mind that using
! /proc/ksyms is MUCH better, so it is NOT recommended to use this
! method!
--- 2,53 ----
  and the SUN ONC RPC license, with are included in the files
  LICENSE.IBM and LICENSE.Sun in the same directory as this README.
  
+ There are two ways to build the AFS kernel module on the local system:
+ Building an RPM and Building Manually
+ 
+ 
+   REBUILDING FROM SOURCE RPM
+   --------------------------
+ 
+ The first (and preferred) way to build a kernel module is to build an
+ openafs-kernel RPM from the OpenAFS Source RPM.  To do this you can
+ just use "rpm --rebuild" from the Source RPM (SRPM) and specify that
+ you want to build a module and the target CPU.  For example:
+ 
+   rpmbuild --rebuild --define "build_modules 1" --target=i686
+ 
+ You MUST specify the target CPU or it will not build the correct
+ module for your system.
+ 
+ For more information on all the various options for rebuilding your
+ kernel module via RPM, run:
+ 
+   rpm -qi openafs
+ 
+ This will explain all your options for controlling your build.
+ 
+ 
+   REBUILDING MANUALLY
+   -------------------
+ 
+ The second method to build a kernel module is to build it manually
+ from source.  You really should just build the RPM, but if you really
+ don't want to you can do it this way instead.
+ 
  To build the AFS kernel module on a local system, run:
  
      ./configure
      make
  
  When it's done, the binary module will be src/MODLOAD-XXX/libafs-XXX.o
! (or .ko), where "XXX" is your linux kernel version.  Note that it may
! also compile as src/MODLOAD-XXX/openafs.ko.
  
! You must manually install this module on your system.  To do this you
! generally copy the file to /lib/modules/XXX/openafs.o:
  
!     cp src/MODLOAD-XXX/libafs-XXX.o /lib/modules/XXX/openafs.o
  
! Then you need to tell your system about the new kernel module by
! running "depmod -ae XXX" to run the module dependencies for kernel
! version "XXX".
Index: openafs/src/packaging/RedHat/openafs-buildall.sh
diff -c openafs/src/packaging/RedHat/openafs-buildall.sh:1.1.2.1 openafs/src/packaging/RedHat/openafs-buildall.sh:1.1.2.2
*** openafs/src/packaging/RedHat/openafs-buildall.sh:1.1.2.1	Mon Aug 21 15:58:18 2006
--- openafs/src/packaging/RedHat/openafs-buildall.sh	Fri Dec  1 13:34:13 2006
***************
*** 4,10 ****
  #
  # Written by:  Derek Atkins <warlord@MIT.EDU>
  #
! # $Revision: 1.1.2.1 $
  #
  
  # Define where the Specfile is located.
--- 4,10 ----
  #
  # Written by:  Derek Atkins <warlord@MIT.EDU>
  #
! # $Revision: 1.1.2.2 $
  #
  
  # Define where the Specfile is located.
***************
*** 15,33 ****
  
  ############################################################################
  #  Figure out the release version
! rhrel=`cat /etc/redhat-release`
  if [ `echo $rhrel | grep -c 'Fedora Core'` = 1 ] ; then
    ostype='fc'
  elif [ `echo $rhrel | grep -c 'Red Hat Enterprise Linux'` = 1 ] ; then
    ostype='rhel'
    excludearch=i586
  elif [ `echo $rhrel | grep -c 'Red Hat Linux'` = 1 ] ; then
    ostype='rh'
  else
    echo "Unknown Linux Release: $rhrel"
    exit 1
  fi
- osrel=`echo $rhrel | sed -e 's/^.*release \([^ ]*\).*$/\1/' -e 's/\.//g'`
  osvers="$ostype$osrel"
  
  ############################################################################
--- 15,41 ----
  
  ############################################################################
  #  Figure out the release version
! [ -f /etc/redhat-release ] && rhrel=`cat /etc/redhat-release`
! [ -f /etc/SuSE-release ] && rhrel=`head -1  /etc/SuSE-release`
! 
  if [ `echo $rhrel | grep -c 'Fedora Core'` = 1 ] ; then
    ostype='fc'
+   osrel=`echo $rhrel | sed -e 's/^.*release \([^ ]*\).*$/\1/' -e 's/\.//g'`
  elif [ `echo $rhrel | grep -c 'Red Hat Enterprise Linux'` = 1 ] ; then
    ostype='rhel'
    excludearch=i586
+   osrel=`echo $rhrel | sed -e 's/^.*release \([^ ]*\).*$/\1/' -e 's/\.//g'`
  elif [ `echo $rhrel | grep -c 'Red Hat Linux'` = 1 ] ; then
    ostype='rh'
+   osrel=`echo $rhrel | sed -e 's/^.*release \([^ ]*\).*$/\1/' -e 's/\.//g'`
+ elif [ `echo $rhrel | grep -c 'SUSE LINUX'` = 1 ] ; then
+   ostype='suse'
+   specdir=/usr/src/packages/SPECS 
+   osrel=`grep VERSION /etc/SuSE-release|awk '{print $3}'`
  else
    echo "Unknown Linux Release: $rhrel"
    exit 1
  fi
  osvers="$ostype$osrel"
  
  ############################################################################
***************
*** 35,47 ****
  # kernel version is "close enough" to tell us whether it's a
  # 2.4 or 2.6 kernel.
  kvers=`uname -r`
  case $kvers in
    2.4.*)
-     kbase=/usr/src/linux-
      kv=2.4.
      ;;
    2.6.*)
!     kbase=/usr/src/kernels/
      kv=2.6.
      ;;
    *)
--- 43,56 ----
  # kernel version is "close enough" to tell us whether it's a
  # 2.4 or 2.6 kernel.
  kvers=`uname -r`
+ kbase=/usr/src/linux-
+ 
  case $kvers in
    2.4.*)
      kv=2.4.
      ;;
    2.6.*)
!     [ -d /usr/src/kernels ] && kbase=/usr/src/kernels/
      kv=2.6.
      ;;
    *)
***************
*** 49,55 ****
      exit 1
      ;;
  esac
- 
  ############################################################################
  # Now build the packages and all the kernel modules
  
--- 58,63 ----
Index: openafs/src/packaging/RedHat/openafs-client.init
diff -c openafs/src/packaging/RedHat/openafs-client.init:1.1.2.1 openafs/src/packaging/RedHat/openafs-client.init:1.1.2.3
*** openafs/src/packaging/RedHat/openafs-client.init:1.1.2.1	Mon Aug 21 15:58:18 2006
--- openafs/src/packaging/RedHat/openafs-client.init	Fri Dec  1 13:34:13 2006
***************
*** 5,17 ****
  # chkconfig: 2345 50 50
  # description: OpenAFS is a distributed filesystem.
  #
! # $Revision: 1.1.2.1 $
  
! . /etc/init.d/functions
  [ -f /etc/sysconfig/openafs ] && . /etc/sysconfig/openafs
  
  
  start() {
  	echo -n $"Starting openafs-client: "
  	if [ -e /var/lock/subsys/openafs-client ] ; then
  		echo -n $"cannot start openafs-client: already running"
--- 5,27 ----
  # chkconfig: 2345 50 50
  # description: OpenAFS is a distributed filesystem.
  #
! # $Revision: 1.1.2.3 $
  
! [ -f /etc/init.d/functions ] && . /etc/init.d/functions
  [ -f /etc/sysconfig/openafs ] && . /etc/sysconfig/openafs
  
  
  start() {
+         echo -n $"Updating CellServDB: "
+         cat /usr/vice/etc/CellServDB.local /usr/vice/etc/CellServDB.dist > \
+                /usr/vice/etc/CellServDB
+         chmod 644 /usr/vice/etc/CellServDB
+         echo
+         echo -n $"Updating SuidCells: "
+         cat /usr/vice/etc/SuidCells.local /usr/vice/etc/SuidCells.dist > \
+                /usr/vice/etc/SuidCells
+         chmod 644 /usr/vice/etc/SuidCells
+         echo
  	echo -n $"Starting openafs-client: "
  	if [ -e /var/lock/subsys/openafs-client ] ; then
  		echo -n $"cannot start openafs-client: already running"
Index: openafs/src/packaging/RedHat/openafs-kvers-is.sh
diff -c openafs/src/packaging/RedHat/openafs-kvers-is.sh:1.1.2.1 openafs/src/packaging/RedHat/openafs-kvers-is.sh:1.1.2.2
*** openafs/src/packaging/RedHat/openafs-kvers-is.sh:1.1.2.1	Mon Aug 21 15:58:18 2006
--- openafs/src/packaging/RedHat/openafs-kvers-is.sh	Fri Dec  1 13:34:13 2006
***************
*** 1,6 ****
  #!/bin/sh
  # Small helper script for parsing kernel versions and types
! # $Revision: 1.1.2.1 $
  
  if [ "$1" = "parsev" ] ; then
    #logger "parsing version from $2"
--- 1,6 ----
  #!/bin/sh
  # Small helper script for parsing kernel versions and types
! # $Revision: 1.1.2.2 $
  
  if [ "$1" = "parsev" ] ; then
    #logger "parsing version from $2"
***************
*** 10,22 ****
  
  if [ "$1" = "parset" ] ; then
    #logger "parsing type from $2"
!   echo "$2" | /bin/sed -e 's/^.*[0-9L]\([^0-9L]*\)/\1/'
    exit 0
  fi
  
  if [ "$1" = "kvers" ] ; then
    #logger "parsing type from $2"
!   echo "$2" | /bin/sed -e 's/^\(.*[0-9L]\)[^0-9L]*$/\1/'
    exit 0
  fi
  
--- 10,25 ----
  
  if [ "$1" = "parset" ] ; then
    #logger "parsing type from $2"
!   case "$2" in
!     *smp) echo 'smp' ;;
!     *hugemem) echo 'hugemem' ;;
!   esac
    exit 0
  fi
  
  if [ "$1" = "kvers" ] ; then
    #logger "parsing type from $2"
!   echo "$2" | /bin/sed -re 's/smp$//; s/hugemem$//;'
    exit 0
  fi
  
***************
*** 31,36 ****
--- 34,52 ----
    fi
  fi
  
+ # provideskernelarch ksrcdir targetcpu
+ if [ "$1" = "provideskernelarch" ]; then
+   kernelrpm=`rpm -qf "$2"`
+   if [ -n "$kernelrpm" ]; then
+     if rpm -q --provides "$kernelrpm" |egrep -q "^kernel(|-devel)-$3 "; then
+       echo 1
+       exit 1
+     fi
+   fi
+   echo 0
+   exit 0
+ fi
+ 
  #logger "comparing $1 to $2"
  if [ "$1" = "$2" ] ; then
    #logger "yes"
Index: openafs/src/packaging/RedHat/openafs-server.init
diff -c openafs/src/packaging/RedHat/openafs-server.init:1.1.2.1 openafs/src/packaging/RedHat/openafs-server.init:1.1.2.2
*** openafs/src/packaging/RedHat/openafs-server.init:1.1.2.1	Mon Aug 21 15:58:18 2006
--- openafs/src/packaging/RedHat/openafs-server.init	Fri Dec  1 07:59:08 2006
***************
*** 5,13 ****
  # chkconfig: 2345 49 51
  # description: OpenAFS is a distributed filesystem.
  #
! # $Revision: 1.1.2.1 $
  
! . /etc/init.d/functions
  [ -f /etc/sysconfig/openafs ] && . /etc/sysconfig/openafs
  
  
--- 5,13 ----
  # chkconfig: 2345 49 51
  # description: OpenAFS is a distributed filesystem.
  #
! # $Revision: 1.1.2.2 $
  
! [ -f /etc/init.d/functions ] && . /etc/init.d/functions
  [ -f /etc/sysconfig/openafs ] && . /etc/sysconfig/openafs
  
  
Index: openafs/src/packaging/RedHat/openafs.spec.in
diff -c openafs/src/packaging/RedHat/openafs.spec.in:1.1.2.1 openafs/src/packaging/RedHat/openafs.spec.in:1.1.2.2
*** openafs/src/packaging/RedHat/openafs.spec.in:1.1.2.1	Mon Aug 21 15:58:18 2006
--- openafs/src/packaging/RedHat/openafs.spec.in	Fri Dec  1 13:34:13 2006
***************
*** 1,7 ****
! # Openafs Spec $Revision: 1.1.2.1 $
  
  %define afsvers 1.4.2
  %define pkgvers 1.4.2
  %define pkgrel 1
  
  %if %{?osvers:0}%{!?osvers:1}
--- 1,10 ----
! # Openafs Spec $Revision: 1.1.2.2 $
  
  %define afsvers 1.4.2
  %define pkgvers 1.4.2
+ # for beta/rc releases make pkgrel 0.X.<tag>
+ # for real releases make pkgrel 1 (or more for extra releases)
+ #%define pkgrel 0.1.rc1
  %define pkgrel 1
  
  %if %{?osvers:0}%{!?osvers:1}
***************
*** 65,70 ****
--- 68,76 ----
  # Define the location of your init.d directory
  %define initdir /etc/init.d
  
+ #determine if the kernel provides an arch-specific Provides
+ %define kprovidesarch %(%{kversis} provideskernelarch %{ksrcdir} %{_target_cpu})
+ 
  # Define the location of the PAM security module directory
  %define pamdir /%{_lib}/security
  
***************
*** 88,96 ****
  %define kdepend kernel-source
  %define up_package 1
  %define smp_package 1
- %define largesmp_package 1
  %define smp_ext smp
- %define largesmp_ext largesmp
  
  %define bigmem_package %(%{kversis} find %{ksrcdir} %{_target_cpu} bigmem) 
  %if %{bigmem_package}
--- 94,100 ----
***************
*** 102,118 ****
  %define hugemem_ext hugemem
  %endif
  
! %define kvariations up smp largesmp %{?bigmem_ext:%{bigmem_ext}} %{?hugemem_ext:%{hugemem_ext}}
  
  #######################################################################
  # 2.6
  %else
  %if %{kvers_is_26}
  %define kvariations up
  %define up_package %(%{kversis} "%{ktype}" "")
  %define smp_package %(%{kversis} "%{ktype}" "smp")
- %define largesmp_package %(%{kversis} "%{ktype}" "largesmp")
  %define hugemem_package %(%{kversis} "%{ktype}" "hugemem")
  
  %if !%{up_package} && !%{smp_package} && !%{hugemem_package} && !%{largesmp_package}
  %error "unknown kernel type: %{ktype}"
--- 106,127 ----
  %define hugemem_ext hugemem
  %endif
  
! %define kvariations up smp %{?bigmem_ext:%{bigmem_ext}} %{?hugemem_ext:%{hugemem_ext}}
  
  #######################################################################
  # 2.6
  %else
  %if %{kvers_is_26}
  %define kvariations up
+ %ifarch s390x
+ %define ktype "smp"
+ %define up_package 1
+ %else
  %define up_package %(%{kversis} "%{ktype}" "")
  %define smp_package %(%{kversis} "%{ktype}" "smp")
  %define hugemem_package %(%{kversis} "%{ktype}" "hugemem")
+ %define largesmp_package %(%{kversis} "%{ktype}" "largesmp")
+ %endif
  
  %if !%{up_package} && !%{smp_package} && !%{hugemem_package} && !%{largesmp_package}
  %error "unknown kernel type: %{ktype}"
***************
*** 140,158 ****
  # you'll need to tweak that last bit.
  %if !%{build_userspace_on_cmdline} && !%{build_modules_on_cmdline}
  
! %ifarch x86_64 ia64
  %define build_userspace 1
  %define build_modules 1
  %endif
  
  %ifarch %{ix86}
  %define build_userspace 0
  %define build_modules 1
  %endif
  
  %ifarch i386
  %define build_userspace 1
  %define build_modules 0
  %endif
  
  %endif
--- 149,174 ----
  # you'll need to tweak that last bit.
  %if !%{build_userspace_on_cmdline} && !%{build_modules_on_cmdline}
  
! %ifarch x86_64 ia64 s390 s390x
  %define build_userspace 1
  %define build_modules 1
+ %ifarch x86_64 ia64
+ %define build_authlibs 1
+ %else
+ %define build_authlibs 0
+ %endif
  %endif
  
  %ifarch %{ix86}
  %define build_userspace 0
  %define build_modules 1
+ %define build_authlibs 1
  %endif
  
  %ifarch i386
  %define build_userspace 1
  %define build_modules 0
+ %define build_authlibs 1
  %endif
  
  %endif
***************
*** 179,185 ****
  BuildRoot: %{_tmppath}/%{name}-%{version}-root
  Packager: Derek Atkins <warlord@MIT.EDU>
  Group: Networking/Filesystems
! BuildRequires: %{?kdepend:%{kdepend}, } pam-devel
  ExclusiveArch: %{ix86} x86_64 ia64
  
  #    http://dl.openafs.org/dl/openafs/candidate/%{afsvers}/...
--- 195,204 ----
  BuildRoot: %{_tmppath}/%{name}-%{version}-root
  Packager: Derek Atkins <warlord@MIT.EDU>
  Group: Networking/Filesystems
! BuildRequires: %{?kdepend:%{kdepend}, } pam-devel, ncurses-devel
! %if %{build_userspace}
! BuildRequires: autoconf
! %endif
  ExclusiveArch: %{ix86} x86_64 ia64
  
  #    http://dl.openafs.org/dl/openafs/candidate/%{afsvers}/...
***************
*** 299,304 ****
--- 318,324 ----
  This package provides basic server support to host files in an AFS
  Cell.
  
+ %if %{build_authlibs}
  %package authlibs
  Summary: OpenAFS authentication shared libraries
  Group: Networking/Filesystems
***************
*** 313,321 ****
--- 333,344 ----
  None of the programs included with OpenAFS currently use these shared 
  libraries; however, third-party software that wishes to perform AFS 
  authentication may link against them.
+ %endif
  
  %package authlibs-devel
+ %if %{build_authlibs}
  Requires: openafs-authlibs = %{PACKAGE_VERSION}
+ %endif
  Requires: openafs-devel = %{PACKAGE_VERSION}
  Summary: OpenAFS shared library development
  Group: Development/Filesystems
***************
*** 408,414 ****
  Summary: OpenAFS programs to use with krb5
  Requires: openafs = %{PACKAGE_VERSION}
  Group: Networking/Filesystems
! BuildRequires: krb5-devel
  
  %description krb5
  The AFS distributed filesystem.  AFS is a distributed filesystem
--- 431,437 ----
  Summary: OpenAFS programs to use with krb5
  Requires: openafs = %{PACKAGE_VERSION}
  Group: Networking/Filesystems
! BuildRequires: krb5-devel, autoconf, automake
  
  %description krb5
  The AFS distributed filesystem.  AFS is a distributed filesystem
***************
*** 438,446 ****
  %package kernel
  Summary: OpenAFS Kernel Module (compiled for UP)
  Release: %{modpkgrel}
- Provides: openafs-kernel = %{PACKAGE_VERSION}
- Requires: kernel = %{kversion}
  Group: Networking/Filesystems
  
  %description kernel
  The AFS distributed filesystem.  AFS is a distributed filesystem
--- 461,473 ----
  %package kernel
  Summary: OpenAFS Kernel Module (compiled for UP)
  Release: %{modpkgrel}
  Group: Networking/Filesystems
+ Provides: openafs-kernel = %{PACKAGE_VERSION}
+ %if %{kprovidesarch}
+ Requires: kernel-%{_target_cpu} = %{kversion}
+ %else
+ Requires: /boot/config-%{kernvers}
+ %endif
  
  %description kernel
  The AFS distributed filesystem.  AFS is a distributed filesystem
***************
*** 456,462 ****
  Summary: OpenAFS Kernel Module (compiled for SMP)
  Release: %{modpkgrel}
  Provides: openafs-kernel = %{PACKAGE_VERSION}
! Requires: kernel-smp = %{kversion}
  Group: Networking/Filesystems
  
  %description kernel-smp
--- 483,493 ----
  Summary: OpenAFS Kernel Module (compiled for SMP)
  Release: %{modpkgrel}
  Provides: openafs-kernel = %{PACKAGE_VERSION}
! %if %{kprovidesarch}
! Requires: kernel-smp-%{_target_cpu} = %{kversion}
! %else
! Requires: /boot/config-%{kernvers}%{?smp_ext:%{smp_ext}}
! %endif
  Group: Networking/Filesystems
  
  %description kernel-smp
***************
*** 473,479 ****
  Summary: OpenAFS Kernel Module (compiled for LARGESMP)
  Release: %{modpkgrel}
  Provides: openafs-kernel = %{PACKAGE_VERSION}
! Requires: kernel-largesmp = %{kversion}
  Group: Networking/Filesystems
  
  %description kernel-largesmp
--- 504,514 ----
  Summary: OpenAFS Kernel Module (compiled for LARGESMP)
  Release: %{modpkgrel}
  Provides: openafs-kernel = %{PACKAGE_VERSION}
! %if %{kprovidesarch}
! Requires: kernel-largesmp-%{_target_cpu} = %{kversion}
! %else
! Requires: /boot/config-%{kernvers}%{?largesmp_ext:%{largesmp_ext}}
! %endif
  Group: Networking/Filesystems
  
  %description kernel-largesmp
***************
*** 490,496 ****
  Summary: OpenAFS Kernel Module (compiled for SMP & big memory support)
  Release: %{modpkgrel}
  Provides: openafs-kernel = %{PACKAGE_VERSION}
! Requires: kernel-bigmem = %{kversion}
  Group: Networking/Filesystems
  
  %description kernel-bigmem
--- 525,535 ----
  Summary: OpenAFS Kernel Module (compiled for SMP & big memory support)
  Release: %{modpkgrel}
  Provides: openafs-kernel = %{PACKAGE_VERSION}
! %if %{kprovidesarch}
! Requires: kernel-bigmem-%{_target_cpu} = %{kversion}
! %else
! Requires: /boot/config-%{kernvers}%{?bigmem_ext:%{bigmem_ext}}
! %endif
  Group: Networking/Filesystems
  
  %description kernel-bigmem
***************
*** 507,513 ****
  Summary: OpenAFS Kernel Module (compiled for SMP & huge memory support)
  Release: %{modpkgrel}
  Provides: openafs-kernel = %{PACKAGE_VERSION}
! Requires: kernel-hugemem = %{kversion}
  Group: Networking/Filesystems
  
  %description kernel-hugemem
--- 546,556 ----
  Summary: OpenAFS Kernel Module (compiled for SMP & huge memory support)
  Release: %{modpkgrel}
  Provides: openafs-kernel = %{PACKAGE_VERSION}
! %if %{kprovidesarch}
! Requires: kernel-hugemem-%{_target_cpu} = %{kversion}
! %else
! Requires: /boot/config-%{kernvers}%{?hugemem_ext:%{hugemem_ext}}
! %endif
  Group: Networking/Filesystems
  
  %description kernel-hugemem
***************
*** 876,883 ****
  # Populate /usr/vice/etc
  uve=$RPM_BUILD_ROOT%{_prefix}/vice/etc
  install -p -m 644 %{SOURCE2} $uve/ThisCell
! install -p -m 644 %{SOURCE3} $uve/CellServDB
! install -p -m 644 %{SOURCE4} $uve/SuidCells
  install -p -m 644 %{SOURCE5} $uve/cacheinfo
  
  #
--- 919,926 ----
  # Populate /usr/vice/etc
  uve=$RPM_BUILD_ROOT%{_prefix}/vice/etc
  install -p -m 644 %{SOURCE2} $uve/ThisCell
! install -p -m 644 %{SOURCE3} $uve/CellServDB.dist
! install -p -m 644 %{SOURCE4} $uve/SuidCells.dist
  install -p -m 644 %{SOURCE5} $uve/cacheinfo
  
  #
***************
*** 1041,1046 ****
--- 1084,1094 ----
    rm -f $RPM_BUILD_ROOT%{_sbindir}/$f
  done
  
+ %if !%{build_authlibs}
+ rm -f $RPM_BUILD_ROOT%{_libdir}/libafsauthent.so
+ rm -f $RPM_BUILD_ROOT%{_libdir}/libafsrpc.so
+ %endif
+ 
  %endif
  
  %if %{build_modules}
***************
*** 1057,1063 ****
      fi
  
      srcdir=${sysname}/dest/root.client%{_prefix}/vice/etc/modload
!     dstdir=$RPM_BUILD_ROOT${kvar}/kernel/fs/openafs
  
      mkdir -p ${dstdir}
  
--- 1105,1111 ----
      fi
  
      srcdir=${sysname}/dest/root.client%{_prefix}/vice/etc/modload
!     dstdir=$RPM_BUILD_ROOT${kvar}/fs/openafs
  
      mkdir -p ${dstdir}
  
***************
*** 1098,1103 ****
--- 1146,1161 ----
  	chmod 0755 /afs
  fi
  
+ # Create the CellServDB and SuidCells
+ [ -f /usr/vice/etc/CellServDB.local ] || touch /usr/vice/etc/CellServDB.local
+ [ -f /usr/vice/etc/SuidCells.local ] || touch /usr/vice/etc/SuidCells.local
+ 
+ ( cd /usr/vice/etc ; \
+   cat CellServDB.local CellServDB.dist > CellServDB ; \
+   chmod 644 CellServDB ; \
+   cat SuidCells.local SuidCells.dist > SuidCells ; \
+   chmod 644 SuidCells )
+ 
  echo
  echo The AFS cache is configured for 100 MB. Edit the
  echo /usr/vice/etc/cacheinfo file to change this before
***************
*** 1117,1127 ****
--- 1175,1187 ----
  chkconfig --add openafs-server
  %{initdir}/openafs-server condrestart
  
+ %if %{build_authlibs}
  %post authlibs
  /sbin/ldconfig
  
  %postun authlibs
  /sbin/ldconfig
+ %endif
  
  %preun
  if [ $1 = 0 ] ; then
***************
*** 1132,1137 ****
--- 1192,1200 ----
  if [ $1 = 0 ] ; then
          %{initdir}/openafs-client stop
          chkconfig --del openafs-client
+ 
+         rm -f /usr/vice/etc/CellServDB /usr/vice/etc/SuidCells
+         rm -f /usr/vice/etc/CellServDB.local /usr/vice/etc/SuidCells.local
  fi
  
  %preun server
***************
*** 1209,1216 ****
  %dir %{_prefix}/vice
  %dir %{_prefix}/vice/cache
  %dir %{_prefix}/vice/etc
! %config %{_prefix}/vice/etc/CellServDB
! %config %{_prefix}/vice/etc/SuidCells
  %config %{_prefix}/vice/etc/ThisCell
  %config %{_prefix}/vice/etc/cacheinfo
  %{_bindir}/cmdebug
--- 1272,1279 ----
  %dir %{_prefix}/vice
  %dir %{_prefix}/vice/cache
  %dir %{_prefix}/vice/etc
! %{_prefix}/vice/etc/CellServDB.dist
! %{_prefix}/vice/etc/SuidCells.dist
  %config %{_prefix}/vice/etc/ThisCell
  %config %{_prefix}/vice/etc/cacheinfo
  %{_bindir}/cmdebug
***************
*** 1292,1308 ****
  %{_mandir}/man8/volserver.*
  #%{_mandir}/man8/vldb_convert.*
  
  %files authlibs
  %defattr(-,root,root)
  %{_libdir}/libafsauthent.so.*
  %{_libdir}/libafsrpc.so.*
  
  %files authlibs-devel
  %defattr(-,root,root)
  %{_libdir}/libafsauthent.a
- %{_libdir}/libafsauthent.so
  %{_libdir}/libafsrpc.a
  %{_libdir}/libafsrpc.so
  
  %files devel
  %defattr(-,root,root)
--- 1355,1375 ----
  %{_mandir}/man8/volserver.*
  #%{_mandir}/man8/vldb_convert.*
  
+ %if %{build_authlibs}
  %files authlibs
  %defattr(-,root,root)
  %{_libdir}/libafsauthent.so.*
  %{_libdir}/libafsrpc.so.*
+ %endif
  
  %files authlibs-devel
  %defattr(-,root,root)
  %{_libdir}/libafsauthent.a
  %{_libdir}/libafsrpc.a
+ %if %{build_authlibs}
+ %{_libdir}/libafsauthent.so
  %{_libdir}/libafsrpc.so
+ %endif
  
  %files devel
  %defattr(-,root,root)
***************
*** 1363,1387 ****
  %if %{up_package}
  %files kernel
  %defattr(-,root,root)
! %{kxmoddir}/kernel/fs/openafs/openafs.*
  %endif
  
  %if %{smp_package}
  %files kernel-smp
  %defattr(-,root,root)
! %{kxmoddir}%{?smp_ext:%{smp_ext}}/kernel/fs/openafs/openafs.*
  %endif
  
  %if %{largesmp_package}
  %files kernel-largesmp
  %defattr(-,root,root)
! %{kxmoddir}%{?largesmp_ext:%{largesmp_ext}}/kernel/fs/openafs/openafs.*
  %endif
   
  %if %{bigmem_package}
  %files kernel-bigmem
  %defattr(-,root,root)
! %{kxmoddir}%{?bigmem_ext:%{bigmem_ext}}/kernel/fs/openafs/openafs.*
  %endif
  
  %if %{hugemem_package}
--- 1430,1454 ----
  %if %{up_package}
  %files kernel
  %defattr(-,root,root)
! %{kxmoddir}/fs/openafs/openafs.*
  %endif
  
  %if %{smp_package}
  %files kernel-smp
  %defattr(-,root,root)
! %{kxmoddir}%{?smp_ext:%{smp_ext}}/fs/openafs/openafs.*
  %endif
  
  %if %{largesmp_package}
  %files kernel-largesmp
  %defattr(-,root,root)
! %{kxmoddir}%{?largesmp_ext:%{largesmp_ext}}/fs/openafs/openafs.*
  %endif
   
  %if %{bigmem_package}
  %files kernel-bigmem
  %defattr(-,root,root)
! %{kxmoddir}%{?bigmem_ext:%{bigmem_ext}}/fs/openafs/openafs.*
  %endif
  
  %if %{hugemem_package}
***************
*** 1398,1408 ****
--- 1465,1524 ----
  ###
  ##############################################################################
  %changelog
+ * Fri Dec 01 2006  Derrick Brashear <shadow@dementia.org> 1.4.2-2
+ - integrate s390x changes
+ - allow for building libafs*.a and not libafs*.so into packages, for platforms
+   that won't build the .so files.
+ 
  * Sun Aug 20 2006  Derrick Brashear <shadow@dementia.org> 1.4.2-1
  - update to 1.4.2
  - use installed aklog manpage.
  - moduleparam patch obsoleted.
  
+ * Tue Aug 22 2006  Derek Atkins <warlord@MIT.EDU> 1.4.2-0.1.rc1
+ - update to 1.4.2-rc1
+ - hand-apply lee damon's changes to support largesmp kernels from RHEL4
+   (but only add support for 2.6 kernels.  No need for the 2.4 kernels).
+ - don't need the posixlock patch anymore.
+ 
+ * Wed Jul 12 2006  Derek Atkins <warlord@MIT.EDU> 1.4.2-0.beta2
+ - update to 1.4.2-beta2
+ - add linux2.4 posixlock API patch
+ 
+ * Mon Jun 26 2006  Derek Atkins <warlord@MIT.EDU>
+ - moduleparam and krb524 patches no longer required in OA-CVS
+ 
+ * Wed May 17 2006  Derek Atkins <warlord@MIT.EDU>
+ - change non-target-cpu kernel dep to a file dep
+ - make sure we use the proper kernel version for the dependency.
+ 
+ * Tue May 16 2006  Derek Atkins <warlord@MIT.EDU>
+ - allow users to specify local CellServDB and SuidCells entries
+   don't overwrite user's changes.  Provide a .dist an let users
+   make entries in a ".local"
+ - build the CellServDB and SuidCells at client startup and at
+   client install-time
+ - add provideskernelarch functionality to openafs-kvers-is.sh
+ - use that functionality to Require kernel{,-<type>}-targetcpu
+   to get better package safety due to RPM bugs where the kernel
+   release isn't used so you can install the kernel module against
+   any kernel of the same major version.
+ 
+ * Mon May 15 2006  Derek Atkins <warlord@MIT.EDU>
+ - update the README in openafs-kernel-source
+ - fix openafs-kvers-is.sh from Alexander Bergolth's patch.
+ - move kernel module from .../kernel/fs/openafs to .../fs/openafs/
+ 
+ * Fri Apr 21 2006  Derek Atkins <warlord@MIT.EDU>
+ - build requires autoconf and automake for krb5support
+   and autoconf for standard package
+ - dont setup the krb5 migration kit (or patches) if we don't care.
+ - require ncurses-devel to build
+ 
+ * Wed Apr 19 2006  Derek Atkins <warlord@MIT.EDU> 1.4.1-3
+ - look for krb524 functions in libkrb524 if we can't find them
+   in the standard locations.
+ 
  * Tue Apr 18 2006  Derek Atkins <warlord@MIT.EDU> 1.4.1-2
  - fix the module_param_array macro for Linux 2.6.9.
  
Index: openafs/src/ptserver/ptuser.c
diff -c openafs/src/ptserver/ptuser.c:1.16.2.12 openafs/src/ptserver/ptuser.c:1.16.2.14
*** openafs/src/ptserver/ptuser.c:1.16.2.12	Fri Oct 13 08:46:02 2006
--- openafs/src/ptserver/ptuser.c	Fri Jan  5 13:23:25 2007
***************
*** 15,21 ****
  #endif
  
  RCSID
!     ("$Header: /cvs/openafs/src/ptserver/ptuser.c,v 1.16.2.12 2006/10/13 12:46:02 shadow Exp $");
  
  #if defined(UKERNEL)
  #include "afs/sysincludes.h"
--- 15,21 ----
  #endif
  
  RCSID
!     ("$Header: /cvs/openafs/src/ptserver/ptuser.c,v 1.16.2.14 2007/01/05 18:23:25 shadow Exp $");
  
  #if defined(UKERNEL)
  #include "afs/sysincludes.h"
***************
*** 681,687 ****
  	if (oid == ANONYMOUSID)
  	    return PRNOENT;
      }
!     code = ubik_PR_ChangeEntry(pruclient, 0, id, newname, oid, *newid);
      return code;
  }
  
--- 681,690 ----
  	if (oid == ANONYMOUSID)
  	    return PRNOENT;
      }
!     if (newid)
! 	code = ubik_PR_ChangeEntry(pruclient, 0, id, newname, oid, *newid);
!     else
! 	code = ubik_PR_ChangeEntry(pruclient, 0, id, newname, oid, 0);
      return code;
  }
  
Index: openafs/src/rx/rx_globals.c
diff -c openafs/src/rx/rx_globals.c:1.8.2.2 openafs/src/rx/rx_globals.c:1.8.2.3
*** openafs/src/rx/rx_globals.c:1.8.2.2	Mon Jul 31 17:51:21 2006
--- openafs/src/rx/rx_globals.c	Mon Dec 18 22:21:46 2006
***************
*** 26,35 ****
  #endif
  
  RCSID
!     ("$Header: /cvs/openafs/src/rx/rx_globals.c,v 1.8.2.2 2006/07/31 21:51:21 shadow Exp $");
  
  /* Enable data initialization when the header file is included */
! #define INIT(stuff) = stuff
  #if defined(AFS_NT40_ENV) && defined(AFS_PTHREAD_ENV)
  #define EXT __declspec(dllexport)
  #define EXT2 __declspec(dllexport)
--- 26,35 ----
  #endif
  
  RCSID
!     ("$Header: /cvs/openafs/src/rx/rx_globals.c,v 1.8.2.3 2006/12/19 03:21:46 shadow Exp $");
  
  /* Enable data initialization when the header file is included */
! #define GLOBALSINIT(stuff) = stuff
  #if defined(AFS_NT40_ENV) && defined(AFS_PTHREAD_ENV)
  #define EXT __declspec(dllexport)
  #define EXT2 __declspec(dllexport)
Index: openafs/src/rx/rx_globals.h
diff -c openafs/src/rx/rx_globals.h:1.9.2.12 openafs/src/rx/rx_globals.h:1.9.2.15
*** openafs/src/rx/rx_globals.h:1.9.2.12	Mon Jul 31 17:51:21 2006
--- openafs/src/rx/rx_globals.h	Fri Jan  5 20:21:27 2007
***************
*** 19,26 ****
  # include "rx.h"
  #endif /* KERNEL */
  
! #ifndef INIT
! #define INIT(x)
  #if defined(AFS_NT40_ENV)
  #if defined(AFS_PTHREAD_ENV)
  #define EXT __declspec(dllimport) extern
--- 19,26 ----
  # include "rx.h"
  #endif /* KERNEL */
  
! #ifndef GLOBALSINIT
! #define GLOBALSINIT(x)
  #if defined(AFS_NT40_ENV)
  #if defined(AFS_PTHREAD_ENV)
  #define EXT __declspec(dllimport) extern
***************
*** 32,38 ****
  #define EXT2 extern
  #define EXT extern
  #endif
! #endif /* !INIT */
  
  /* Basic socket for client requests; other sockets (for receiving server requests) are in the service structures */
  EXT osi_socket rx_socket;
--- 32,38 ----
  #define EXT2 extern
  #define EXT extern
  #endif
! #endif /* !GLOBALSINIT */
  
  /* Basic socket for client requests; other sockets (for receiving server requests) are in the service structures */
  EXT osi_socket rx_socket;
***************
*** 67,97 ****
  
  /* Variable to allow introduction of network unreliability */
  #ifdef RXDEBUG
! EXT int rx_intentionallyDroppedPacketsPer100 INIT(0);	/* Dropped on Send */
  #endif
  
  /* extra packets to add to the quota */
! EXT int rx_extraQuota INIT(0);
  /* extra packets to alloc (2 windows by deflt) */
! EXT int rx_extraPackets INIT(32);
  
! EXT int rx_stackSize INIT(RX_DEFAULT_STACK_SIZE);
  
  /* Time until an unresponsive connection is declared dead */
! EXT int rx_connDeadTime INIT(12);
  /* Set rx default connection dead time; set on both services and connections at creation time */
  #define rx_SetRxDeadTime(seconds)   (rx_connDeadTime = (seconds))
  
  /* Time until we toss an idle connection */
! EXT int rx_idleConnectionTime INIT(700);
  /* Time until we toss a peer structure, after all connections using are gone */
! EXT int rx_idlePeerTime INIT(60);
  
  /* The file server is temporarily salvaging */
! EXT int rx_tranquil INIT(0);
  
  /* UDP rcv buffer size */
! EXT int rx_UdpBufSize INIT(64 * 1024);
  #define rx_GetMinUdpBufSize()   (64*1024)
  #define rx_SetUdpBufSize(x)     (((x)>rx_GetMinUdpBufSize()) ? (rx_UdpBufSize = (x)):0)
  
--- 67,97 ----
  
  /* Variable to allow introduction of network unreliability */
  #ifdef RXDEBUG
! EXT int rx_intentionallyDroppedPacketsPer100 GLOBALSINIT(0);	/* Dropped on Send */
  #endif
  
  /* extra packets to add to the quota */
! EXT int rx_extraQuota GLOBALSINIT(0);
  /* extra packets to alloc (2 windows by deflt) */
! EXT int rx_extraPackets GLOBALSINIT(32);
  
! EXT int rx_stackSize GLOBALSINIT(RX_DEFAULT_STACK_SIZE);
  
  /* Time until an unresponsive connection is declared dead */
! EXT int rx_connDeadTime GLOBALSINIT(12);
  /* Set rx default connection dead time; set on both services and connections at creation time */
  #define rx_SetRxDeadTime(seconds)   (rx_connDeadTime = (seconds))
  
  /* Time until we toss an idle connection */
! EXT int rx_idleConnectionTime GLOBALSINIT(700);
  /* Time until we toss a peer structure, after all connections using are gone */
! EXT int rx_idlePeerTime GLOBALSINIT(60);
  
  /* The file server is temporarily salvaging */
! EXT int rx_tranquil GLOBALSINIT(0);
  
  /* UDP rcv buffer size */
! EXT int rx_UdpBufSize GLOBALSINIT(64 * 1024);
  #define rx_GetMinUdpBufSize()   (64*1024)
  #define rx_SetUdpBufSize(x)     (((x)>rx_GetMinUdpBufSize()) ? (rx_UdpBufSize = (x)):0)
  
***************
*** 100,107 ****
   * waiting for a thread exceed the threshold, new calls are aborted
   * with the busy error. 
   */
! EXT int rx_BusyThreshold INIT(-1);	/* default is disabled */
! EXT int rx_BusyError INIT(-1);
  
  /* These definitions should be in one place */
  #ifdef	AFS_SUN5_ENV
--- 100,107 ----
   * waiting for a thread exceed the threshold, new calls are aborted
   * with the busy error. 
   */
! EXT int rx_BusyThreshold GLOBALSINIT(-1);	/* default is disabled */
! EXT int rx_BusyError GLOBALSINIT(-1);
  
  /* These definitions should be in one place */
  #ifdef	AFS_SUN5_ENV
***************
*** 115,145 ****
  #define RX_FAST_ACK_RATE 1	/* as of 3.4, ask for an ack every 
  				 * other packet. */
  
! EXT int rx_minWindow INIT(1);
! EXT int rx_initReceiveWindow INIT(16);	/* how much to accept */
! EXT int rx_maxReceiveWindow INIT(32);	/* how much to accept */
! EXT int rx_initSendWindow INIT(8);
! EXT int rx_maxSendWindow INIT(32);
! EXT int rx_nackThreshold INIT(3);	/* Number NACKS to trigger congestion recovery */
! EXT int rx_nDgramThreshold INIT(4);	/* Number of packets before increasing
  					 * packets per datagram */
  #define RX_MAX_FRAGS 4
! EXT int rxi_nSendFrags INIT(RX_MAX_FRAGS);	/* max fragments in a datagram */
! EXT int rxi_nRecvFrags INIT(RX_MAX_FRAGS);
! EXT int rxi_OrphanFragSize INIT(512);
  
  #define RX_MAX_DGRAM_PACKETS 6	/* max packets per jumbogram */
  
! EXT int rxi_nDgramPackets INIT(RX_MAX_DGRAM_PACKETS);
  /* allow n packets between soft acks - must be power of 2 -1, else change
   * macro below */
! EXT int rxi_SoftAckRate INIT(RX_FAST_ACK_RATE);
  /* consume n packets before sending hard ack, should be larger than above,
     but not absolutely necessary.  If it's smaller, than fast receivers will
     send a soft ack, immediately followed by a hard ack. */
! EXT int rxi_HardAckRate INIT(RX_FAST_ACK_RATE + 1);
  
! /* EXT int rx_maxWindow INIT(15);   Temporary HACK:  transmit/receive window */
  
  /* If window sizes become very variable (in terms of #packets), be
   * sure that the sender can get back a hard acks without having to wait for
--- 115,145 ----
  #define RX_FAST_ACK_RATE 1	/* as of 3.4, ask for an ack every 
  				 * other packet. */
  
! EXT int rx_minWindow GLOBALSINIT(1);
! EXT int rx_initReceiveWindow GLOBALSINIT(16);	/* how much to accept */
! EXT int rx_maxReceiveWindow GLOBALSINIT(32);	/* how much to accept */
! EXT int rx_initSendWindow GLOBALSINIT(8);
! EXT int rx_maxSendWindow GLOBALSINIT(32);
! EXT int rx_nackThreshold GLOBALSINIT(3);	/* Number NACKS to trigger congestion recovery */
! EXT int rx_nDgramThreshold GLOBALSINIT(4);	/* Number of packets before increasing
  					 * packets per datagram */
  #define RX_MAX_FRAGS 4
! EXT int rxi_nSendFrags GLOBALSINIT(RX_MAX_FRAGS);	/* max fragments in a datagram */
! EXT int rxi_nRecvFrags GLOBALSINIT(RX_MAX_FRAGS);
! EXT int rxi_OrphanFragSize GLOBALSINIT(512);
  
  #define RX_MAX_DGRAM_PACKETS 6	/* max packets per jumbogram */
  
! EXT int rxi_nDgramPackets GLOBALSINIT(RX_MAX_DGRAM_PACKETS);
  /* allow n packets between soft acks - must be power of 2 -1, else change
   * macro below */
! EXT int rxi_SoftAckRate GLOBALSINIT(RX_FAST_ACK_RATE);
  /* consume n packets before sending hard ack, should be larger than above,
     but not absolutely necessary.  If it's smaller, than fast receivers will
     send a soft ack, immediately followed by a hard ack. */
! EXT int rxi_HardAckRate GLOBALSINIT(RX_FAST_ACK_RATE + 1);
  
! /* EXT int rx_maxWindow GLOBALSINIT(15);   Temporary HACK:  transmit/receive window */
  
  /* If window sizes become very variable (in terms of #packets), be
   * sure that the sender can get back a hard acks without having to wait for
***************
*** 149,155 ****
  
  #define	ACKHACK(p,r) { if (((p)->header.seq & (rxi_SoftAckRate))==0) (p)->header.flags |= RX_REQUEST_ACK; }
  
! EXT int rx_nPackets INIT(100);	/* obsolete; use rx_extraPackets now */
  
  /*
   * pthreads thread-specific rx info support
--- 149,155 ----
  
  #define	ACKHACK(p,r) { if (((p)->header.seq & (rxi_SoftAckRate))==0) (p)->header.flags |= RX_REQUEST_ACK; }
  
! EXT int rx_nPackets GLOBALSINIT(100);	/* obsolete; use rx_extraPackets now */
  
  /*
   * pthreads thread-specific rx info support
***************
*** 201,206 ****
--- 201,208 ----
          if ((p)->flags & RX_PKTFLAG_FREE) \
              osi_Panic("rx packet already free\n"); \
          (p)->flags |= RX_PKTFLAG_FREE; \
+         (p)->length = 0; \
+         (p)->niovecs = 0; \
      } while(0)
  #define RX_FPQ_MARK_USED(p) \
      do { \
***************
*** 232,240 ****
  
  #if defined(AFS_PTHREAD_ENV)
  #define RX_ENABLE_TSFPQ
! EXT int rx_TSFPQGlobSize INIT(3); /* number of packets to transfer between global and local queues in one op */
! EXT int rx_TSFPQLocalMax INIT(15); /* max number of packets on local FPQ before returning a glob to the global pool */
! EXT int rx_TSFPQMaxProcs INIT(0); /* max number of threads expected */
  EXT void rxi_MorePacketsTSFPQ(int apackets, int flush_global, int num_keep_local); /* more flexible packet alloc function */
  EXT void rxi_AdjustLocalPacketsTSFPQ(int num_keep_local, int allow_overcommit); /* adjust thread-local queue length, for places where we know how many packets we will need a priori */
  EXT void rxi_FlushLocalPacketsTSFPQ(void); /* flush all thread-local packets to global queue */
--- 234,242 ----
  
  #if defined(AFS_PTHREAD_ENV)
  #define RX_ENABLE_TSFPQ
! EXT int rx_TSFPQGlobSize GLOBALSINIT(3); /* number of packets to transfer between global and local queues in one op */
! EXT int rx_TSFPQLocalMax GLOBALSINIT(15); /* max number of packets on local FPQ before returning a glob to the global pool */
! EXT int rx_TSFPQMaxProcs GLOBALSINIT(0); /* max number of threads expected */
  EXT void rxi_MorePacketsTSFPQ(int apackets, int flush_global, int num_keep_local); /* more flexible packet alloc function */
  EXT void rxi_AdjustLocalPacketsTSFPQ(int num_keep_local, int allow_overcommit); /* adjust thread-local queue length, for places where we know how many packets we will need a priori */
  EXT void rxi_FlushLocalPacketsTSFPQ(void); /* flush all thread-local packets to global queue */
***************
*** 342,348 ****
          (rx_ts_info_p)->_FPQ.checkout_xfer++; \
      } while(0)
  /* checkout multiple packets from the thread-specific free packet queue */
! #define RX_TS_FPQ_CHECKOUT2(rx_ts_info_p,num_transfer,q) \
      do { \
          register int i; \
          register struct rx_packet *p; \
--- 344,350 ----
          (rx_ts_info_p)->_FPQ.checkout_xfer++; \
      } while(0)
  /* checkout multiple packets from the thread-specific free packet queue */
! #define RX_TS_FPQ_QCHECKOUT(rx_ts_info_p,num_transfer,q) \
      do { \
          register int i; \
          register struct rx_packet *p; \
***************
*** 369,375 ****
  /* num_transfer must equal length of (q); it is not a means of checking 
   * in part of (q).  passing num_transfer just saves us instructions 
   * since caller already knows length of (q) for other reasons */
! #define RX_TS_FPQ_CHECKIN2(rx_ts_info_p,num_transfer,q) \
      do { \
          register struct rx_packet *p, *np; \
          for (queue_Scan((q), p, np, rx_packet)) { \
--- 371,377 ----
  /* num_transfer must equal length of (q); it is not a means of checking 
   * in part of (q).  passing num_transfer just saves us instructions 
   * since caller already knows length of (q) for other reasons */
! #define RX_TS_FPQ_QCHECKIN(rx_ts_info_p,num_transfer,q) \
      do { \
          register struct rx_packet *p, *np; \
          for (queue_Scan((q), p, np, rx_packet)) { \
***************
*** 383,419 ****
  #endif /* AFS_PTHREAD_ENV */
  
  /* Number of free packets */
! EXT int rx_nFreePackets INIT(0);
! EXT int rxi_NeedMorePackets INIT(0);
! EXT int rx_nWaiting INIT(0);
! EXT int rx_nWaited INIT(0);
! EXT int rx_packetReclaims INIT(0);
  
  /* largest packet which we can safely receive, initialized to AFS 3.2 value
   * This is provided for backward compatibility with peers which may be unable
   * to swallow anything larger. THIS MUST NEVER DECREASE WHILE AN APPLICATION
   * IS RUNNING! */
! EXT afs_uint32 rx_maxReceiveSize INIT(OLD_MAX_PACKET_SIZE * RX_MAX_FRAGS +
  				      UDP_HDR_SIZE * (RX_MAX_FRAGS - 1));
  
  /* this is the maximum packet size that the user wants us to receive */
  /* this is set by rxTune if required */
! EXT afs_uint32 rx_maxReceiveSizeUser INIT(0xffffffff);
  
  /* rx_MyMaxSendSize is the size of the largest packet we will send,
   * including the RX header. Just as rx_maxReceiveSize is the
   * max we will receive, including the rx header.
   */
! EXT afs_uint32 rx_MyMaxSendSize INIT(8588);
  
  /* Maximum size of a jumbo datagram we can receive */
! EXT afs_uint32 rx_maxJumboRecvSize INIT(RX_MAX_PACKET_SIZE);
  
  /* need this to permit progs to run on AIX systems */
! EXT int (*rxi_syscallp) (afs_uint32 a3, afs_uint32 a4, void *a5)INIT(0);
  
  /* List of free queue entries */
! EXT struct rx_serverQueueEntry *rx_FreeSQEList INIT(0);
  #ifdef	RX_ENABLE_LOCKS
  EXT afs_kmutex_t freeSQEList_lock;
  #endif
--- 385,421 ----
  #endif /* AFS_PTHREAD_ENV */
  
  /* Number of free packets */
! EXT int rx_nFreePackets GLOBALSINIT(0);
! EXT int rxi_NeedMorePackets GLOBALSINIT(0);
! EXT int rx_nWaiting GLOBALSINIT(0);
! EXT int rx_nWaited GLOBALSINIT(0);
! EXT int rx_packetReclaims GLOBALSINIT(0);
  
  /* largest packet which we can safely receive, initialized to AFS 3.2 value
   * This is provided for backward compatibility with peers which may be unable
   * to swallow anything larger. THIS MUST NEVER DECREASE WHILE AN APPLICATION
   * IS RUNNING! */
! EXT afs_uint32 rx_maxReceiveSize GLOBALSINIT(OLD_MAX_PACKET_SIZE * RX_MAX_FRAGS +
  				      UDP_HDR_SIZE * (RX_MAX_FRAGS - 1));
  
  /* this is the maximum packet size that the user wants us to receive */
  /* this is set by rxTune if required */
! EXT afs_uint32 rx_maxReceiveSizeUser GLOBALSINIT(0xffffffff);
  
  /* rx_MyMaxSendSize is the size of the largest packet we will send,
   * including the RX header. Just as rx_maxReceiveSize is the
   * max we will receive, including the rx header.
   */
! EXT afs_uint32 rx_MyMaxSendSize GLOBALSINIT(8588);
  
  /* Maximum size of a jumbo datagram we can receive */
! EXT afs_uint32 rx_maxJumboRecvSize GLOBALSINIT(RX_MAX_PACKET_SIZE);
  
  /* need this to permit progs to run on AIX systems */
! EXT int (*rxi_syscallp) (afs_uint32 a3, afs_uint32 a4, void *a5)GLOBALSINIT(0);
  
  /* List of free queue entries */
! EXT struct rx_serverQueueEntry *rx_FreeSQEList GLOBALSINIT(0);
  #ifdef	RX_ENABLE_LOCKS
  EXT afs_kmutex_t freeSQEList_lock;
  #endif
***************
*** 423,429 ****
  #ifdef	RX_ENABLE_LOCKS
  EXT afs_kmutex_t rx_freeCallQueue_lock;
  #endif
! EXT afs_int32 rxi_nCalls INIT(0);
  
  /* Port requested at rx_Init.  If this is zero, the actual port used will be different--but it will only be used for client operations.  If non-zero, server provided services may use the same port. */
  EXT u_short rx_port;
--- 425,431 ----
  #ifdef	RX_ENABLE_LOCKS
  EXT afs_kmutex_t rx_freeCallQueue_lock;
  #endif
! EXT afs_int32 rxi_nCalls GLOBALSINIT(0);
  
  /* Port requested at rx_Init.  If this is zero, the actual port used will be different--but it will only be used for client operations.  If non-zero, server provided services may use the same port. */
  EXT u_short rx_port;
***************
*** 433,439 ****
  EXT fd_set rx_selectMask;
  EXT int rx_maxSocketNumber;	/* Maximum socket number in the select mask. */
  /* Minumum socket number in the select mask. */
! EXT int rx_minSocketNumber INIT(0x7fffffff);
  #endif
  
  /* This is actually the minimum number of packets that must remain free,
--- 435,441 ----
  EXT fd_set rx_selectMask;
  EXT int rx_maxSocketNumber;	/* Maximum socket number in the select mask. */
  /* Minumum socket number in the select mask. */
! EXT int rx_minSocketNumber GLOBALSINIT(0x7fffffff);
  #endif
  
  /* This is actually the minimum number of packets that must remain free,
***************
*** 445,455 ****
  /* value large enough to guarantee that no allocation fails due to RX_PACKET_QUOTAS.
     Make it a little bigger, just for fun */
  #define	RX_MAX_QUOTA	15	/* part of min packet computation */
! EXT int rx_packetQuota[RX_N_PACKET_CLASSES] INIT(RX_PACKET_QUOTAS);
! EXT int meltdown_1pkt INIT(1);	/* prefer to schedule single-packet calls */
! EXT int rxi_doreclaim INIT(1);	/* if discard one packet, discard all */
! EXT int rxi_md2cnt INIT(0);	/* counter of skipped calls */
! EXT int rxi_2dchoice INIT(1);	/* keep track of another call to schedule */
  
  /* quota system: each attached server process must be able to make
      progress to avoid system deadlock, so we ensure that we can always
--- 447,457 ----
  /* value large enough to guarantee that no allocation fails due to RX_PACKET_QUOTAS.
     Make it a little bigger, just for fun */
  #define	RX_MAX_QUOTA	15	/* part of min packet computation */
! EXT int rx_packetQuota[RX_N_PACKET_CLASSES] GLOBALSINIT(RX_PACKET_QUOTAS);
! EXT int meltdown_1pkt GLOBALSINIT(1);	/* prefer to schedule single-packet calls */
! EXT int rxi_doreclaim GLOBALSINIT(1);	/* if discard one packet, discard all */
! EXT int rxi_md2cnt GLOBALSINIT(0);	/* counter of skipped calls */
! EXT int rxi_2dchoice GLOBALSINIT(1);	/* keep track of another call to schedule */
  
  /* quota system: each attached server process must be able to make
      progress to avoid system deadlock, so we ensure that we can always
***************
*** 466,476 ****
      quota to send any packets) */
  /* # to reserve so that thread with input can still make calls (send packets)
     without blocking */
! EXT int rxi_dataQuota INIT(RX_MAX_QUOTA);	/* packets to reserve for active threads */
  
! EXT afs_int32 rxi_availProcs INIT(0);	/* number of threads in the pool */
! EXT afs_int32 rxi_totalMin INIT(0);	/* Sum(minProcs) forall services */
! EXT afs_int32 rxi_minDeficit INIT(0);	/* number of procs needed to handle all minProcs */
  
  EXT int rx_nextCid;		/* Next connection call id */
  EXT int rx_epoch;		/* Initialization time of rx */
--- 468,478 ----
      quota to send any packets) */
  /* # to reserve so that thread with input can still make calls (send packets)
     without blocking */
! EXT int rxi_dataQuota GLOBALSINIT(RX_MAX_QUOTA);	/* packets to reserve for active threads */
  
! EXT afs_int32 rxi_availProcs GLOBALSINIT(0);	/* number of threads in the pool */
! EXT afs_int32 rxi_totalMin GLOBALSINIT(0);	/* Sum(minProcs) forall services */
! EXT afs_int32 rxi_minDeficit GLOBALSINIT(0);	/* number of procs needed to handle all minProcs */
  
  EXT int rx_nextCid;		/* Next connection call id */
  EXT int rx_epoch;		/* Initialization time of rx */
***************
*** 483,490 ****
  
  EXT struct rx_peer **rx_peerHashTable;
  EXT struct rx_connection **rx_connHashTable;
! EXT struct rx_connection *rx_connCleanup_list INIT(0);
! EXT afs_uint32 rx_hashTableSize INIT(257);	/* Prime number */
  #ifdef RX_ENABLE_LOCKS
  EXT afs_kmutex_t rx_peerHashTable_lock;
  EXT afs_kmutex_t rx_connHashTable_lock;
--- 485,492 ----
  
  EXT struct rx_peer **rx_peerHashTable;
  EXT struct rx_connection **rx_connHashTable;
! EXT struct rx_connection *rx_connCleanup_list GLOBALSINIT(0);
! EXT afs_uint32 rx_hashTableSize GLOBALSINIT(257);	/* Prime number */
  #ifdef RX_ENABLE_LOCKS
  EXT afs_kmutex_t rx_peerHashTable_lock;
  EXT afs_kmutex_t rx_connHashTable_lock;
***************
*** 524,540 ****
  #endif
  #define rx_Log_event rxevent_debugFile
  
! EXT char *rx_packetTypes[RX_N_PACKET_TYPES] INIT(RX_PACKET_TYPES);	/* Strings defined in rx.h */
  
  #ifndef KERNEL
  /*
   * Counter used to implement connection specific data
   */
! EXT int rxi_keyCreate_counter INIT(0);
  /*
   * Array of function pointers used to destory connection specific data
   */
! EXT rx_destructor_t *rxi_keyCreate_destructor INIT(NULL);
  #ifdef RX_ENABLE_LOCKS
  EXT afs_kmutex_t rxi_keyCreate_lock;
  #endif /* RX_ENABLE_LOCKS */
--- 526,542 ----
  #endif
  #define rx_Log_event rxevent_debugFile
  
! EXT char *rx_packetTypes[RX_N_PACKET_TYPES] GLOBALSINIT(RX_PACKET_TYPES);	/* Strings defined in rx.h */
  
  #ifndef KERNEL
  /*
   * Counter used to implement connection specific data
   */
! EXT int rxi_keyCreate_counter GLOBALSINIT(0);
  /*
   * Array of function pointers used to destory connection specific data
   */
! EXT rx_destructor_t *rxi_keyCreate_destructor GLOBALSINIT(NULL);
  #ifdef RX_ENABLE_LOCKS
  EXT afs_kmutex_t rxi_keyCreate_lock;
  #endif /* RX_ENABLE_LOCKS */
***************
*** 550,570 ****
   * server throttles the client by waiting before sending error messages.
   * Disabled if abort thresholds are zero.
   */
! EXT int rxi_connAbortThreshhold INIT(0);
! EXT int rxi_connAbortDelay INIT(3000);
! EXT int rxi_callAbortThreshhold INIT(0);
! EXT int rxi_callAbortDelay INIT(3000);
  
  /*
   * Thread specific thread ID used to implement LWP_Index().
   */
  
  #if defined(AFS_PTHREAD_ENV)
! EXT int rxi_fcfs_thread_num INIT(0);
  EXT pthread_key_t rx_thread_id_key;
  /* keep track of pthread numbers - protected by rx_stats_mutex, 
     except in rx_Init() before mutex exists! */
! EXT int rxi_pthread_hinum INIT(0);
  #else
  #define rxi_fcfs_thread_num (0)
  #endif
--- 552,572 ----
   * server throttles the client by waiting before sending error messages.
   * Disabled if abort thresholds are zero.
   */
! EXT int rxi_connAbortThreshhold GLOBALSINIT(0);
! EXT int rxi_connAbortDelay GLOBALSINIT(3000);
! EXT int rxi_callAbortThreshhold GLOBALSINIT(0);
! EXT int rxi_callAbortDelay GLOBALSINIT(3000);
  
  /*
   * Thread specific thread ID used to implement LWP_Index().
   */
  
  #if defined(AFS_PTHREAD_ENV)
! EXT int rxi_fcfs_thread_num GLOBALSINIT(0);
  EXT pthread_key_t rx_thread_id_key;
  /* keep track of pthread numbers - protected by rx_stats_mutex, 
     except in rx_Init() before mutex exists! */
! EXT int rxi_pthread_hinum GLOBALSINIT(0);
  #else
  #define rxi_fcfs_thread_num (0)
  #endif
***************
*** 573,585 ****
  EXT afs_kmutex_t rx_stats_mutex;	/* used to activate stats gathering */
  #endif
  
! EXT2 int rx_enable_stats INIT(0);
  
  /*
   * Set this flag to enable the listener thread to trade places with an idle
   * worker thread to move the context switch from listener to worker out of
   * the request path.
   */
! EXT int rx_enable_hot_thread INIT(0);
  
  #endif /* AFS_RX_GLOBALS_H */
--- 575,587 ----
  EXT afs_kmutex_t rx_stats_mutex;	/* used to activate stats gathering */
  #endif
  
! EXT2 int rx_enable_stats GLOBALSINIT(0);
  
  /*
   * Set this flag to enable the listener thread to trade places with an idle
   * worker thread to move the context switch from listener to worker out of
   * the request path.
   */
! EXT int rx_enable_hot_thread GLOBALSINIT(0);
  
  #endif /* AFS_RX_GLOBALS_H */
Index: openafs/src/rx/rx_kcommon.c
diff -c openafs/src/rx/rx_kcommon.c:1.44.2.13 openafs/src/rx/rx_kcommon.c:1.44.2.14
*** openafs/src/rx/rx_kcommon.c:1.44.2.13	Thu Aug 31 00:54:55 2006
--- openafs/src/rx/rx_kcommon.c	Thu Nov  9 19:16:29 2006
***************
*** 15,21 ****
  #include "afs/param.h"
  
  RCSID
!     ("$Header: /cvs/openafs/src/rx/rx_kcommon.c,v 1.44.2.13 2006/08/31 04:54:55 shadow Exp $");
  
  #include "rx/rx_kcommon.h"
  
--- 15,21 ----
  #include "afs/param.h"
  
  RCSID
!     ("$Header: /cvs/openafs/src/rx/rx_kcommon.c,v 1.44.2.14 2006/11/10 00:16:29 shadow Exp $");
  
  #include "rx/rx_kcommon.h"
  
***************
*** 639,649 ****
      afs_uint32 ifinaddr;
  #if defined(AFS_DARWIN80_ENV)
      errno_t t;
!     int cnt=0;
!     ifaddr_t *ifads, ifad;
!     register ifnet_t ifn;
      struct sockaddr sout;
      struct sockaddr_in *sin;
  #else
      struct ifaddr *ifad;	/* ifnet points to a if_addrlist of ifaddrs */
      register struct ifnet *ifn;
--- 639,651 ----
      afs_uint32 ifinaddr;
  #if defined(AFS_DARWIN80_ENV)
      errno_t t;
!     unsigned int count;
!     int cnt=0, m, j;
!     ifaddr_t *ifads;
!     ifnet_t *ifn;
      struct sockaddr sout;
      struct sockaddr_in *sin;
+     struct in_addr pin;
  #else
      struct ifaddr *ifad;	/* ifnet points to a if_addrlist of ifaddrs */
      register struct ifnet *ifn;
***************
*** 653,683 ****
      memset(mtus, 0, sizeof(mtus));
  
  #if defined(AFS_DARWIN80_ENV)
!     t = ifnet_get_address_list_family(NULL, &ifads, AF_INET);
!     if (t == 0) {
! 	rxmtu = ifnet_mtu(ifn) - RX_IPUDP_SIZE;
! 	while((ifads[cnt] != NULL) && cnt < ADDRSPERSITE) {
! 	    t = ifaddr_address(ifads[cnt], &sout, sizeof(sout));
! 	    sin = (struct sockaddr_in *)&sout;
! 	    ifinaddr = ntohl(sin->sin_addr.s_addr);
! 	    if (myNetAddrs[i] != ifinaddr) {
! 		different++;
! 	    }
! 	    mtus[i] = rxmtu;
! 	    rxmtu = rxi_AdjustIfMTU(rxmtu);
! 	    maxmtu =
! 		rxmtu * rxi_nRecvFrags +
! 		((rxi_nRecvFrags - 1) * UDP_HDR_SIZE);
! 	    maxmtu = rxi_AdjustMaxMTU(rxmtu, maxmtu);
! 	    addrs[i++] = ifinaddr;
! 	    if ((ifinaddr != 0x7f000001) && (maxmtu > rx_maxReceiveSize)) {
! 		rx_maxReceiveSize = MIN(RX_MAX_PACKET_SIZE, maxmtu);
! 		rx_maxReceiveSize =
! 		    MIN(rx_maxReceiveSize, rx_maxReceiveSizeUser);
  	    }
- 	    cnt++;
  	}
! 	ifnet_free_address_list(ifads);
      }
  #else
  #if defined(AFS_DARWIN_ENV) || defined(AFS_FBSD_ENV)
--- 655,692 ----
      memset(mtus, 0, sizeof(mtus));
  
  #if defined(AFS_DARWIN80_ENV)
!     if (!ifnet_list_get(AF_INET, &ifn, &count)) {
! 	for (m = 0; m < count; m++) {
! 	    if (!ifnet_get_address_list(ifn[m], &ifads)) {
! 		for (j = 0; ifads[j] != NULL && cnt < ADDRSPERSITE; j++) {
! 		    if ((t = ifaddr_address(ifads[j], &sout, sizeof(struct sockaddr))) == 0) {
! 			sin = (struct sockaddr_in *)&sout;
! 			rxmtu = ifnet_mtu(ifaddr_ifnet(ifads[j])) - RX_IPUDP_SIZE;
! 			ifinaddr = ntohl(sin->sin_addr.s_addr);
! 			if (myNetAddrs[i] != ifinaddr) {
! 			    different++;
! 			}
! 			mtus[i] = rxmtu;
! 			rxmtu = rxi_AdjustIfMTU(rxmtu);
! 			maxmtu =
! 			    rxmtu * rxi_nRecvFrags +
! 			    ((rxi_nRecvFrags - 1) * UDP_HDR_SIZE);
! 			maxmtu = rxi_AdjustMaxMTU(rxmtu, maxmtu);
! 			addrs[i++] = ifinaddr;
! 			if ((ifinaddr != 0x7f000001) && 
! 			    (maxmtu > rx_maxReceiveSize)) {
! 			    rx_maxReceiveSize = 
! 				MIN(RX_MAX_PACKET_SIZE, maxmtu);
! 			    rx_maxReceiveSize =
! 				MIN(rx_maxReceiveSize, rx_maxReceiveSizeUser);
! 			}
! 			cnt++;
! 		    }
! 		}
! 		ifnet_free_address_list(ifads);
  	    }
  	}
! 	ifnet_list_free(ifn);
      }
  #else
  #if defined(AFS_DARWIN_ENV) || defined(AFS_FBSD_ENV)
***************
*** 733,742 ****
      rx_maxJumboRecvSize = MAX(rx_maxJumboRecvSize, rx_maxReceiveSize);
  
      if (different) {
! 	int j;
! 	for (j = 0; j < i; j++) {
! 	    myNetMTUs[j] = mtus[j];
! 	    myNetAddrs[j] = addrs[j];
  	}
      }
      return different;
--- 742,751 ----
      rx_maxJumboRecvSize = MAX(rx_maxJumboRecvSize, rx_maxReceiveSize);
  
      if (different) {
! 	int l;
! 	for (l = 0; l < i; l++) {
! 	    myNetMTUs[l] = mtus[l];
! 	    myNetAddrs[l] = addrs[l];
  	}
      }
      return different;
Index: openafs/src/rx/rx_kcommon.h
diff -c openafs/src/rx/rx_kcommon.h:1.27.2.5 openafs/src/rx/rx_kcommon.h:1.27.2.7
*** openafs/src/rx/rx_kcommon.h:1.27.2.5	Tue Nov 29 01:54:47 2005
--- openafs/src/rx/rx_kcommon.h	Thu Jan  4 16:26:35 2007
***************
*** 112,117 ****
--- 112,120 ----
  #endif
  #ifdef AFS_LINUX22_ENV
  #include "h/sched.h"
+ #if defined(FREEZER_H_EXISTS)
+ #include "h/freezer.h"
+ #endif
  #include "h/netdevice.h"
  #include "linux/if.h"
  #else
Index: openafs/src/rx/rx_packet.c
diff -c openafs/src/rx/rx_packet.c:1.35.2.25 openafs/src/rx/rx_packet.c:1.35.2.30
*** openafs/src/rx/rx_packet.c:1.35.2.25	Mon Jul 31 11:08:20 2006
--- openafs/src/rx/rx_packet.c	Thu Jan 11 22:51:23 2007
***************
*** 15,21 ****
  #endif
  
  RCSID
!     ("$Header: /cvs/openafs/src/rx/rx_packet.c,v 1.35.2.25 2006/07/31 15:08:20 shadow Exp $");
  
  #ifdef KERNEL
  #if defined(UKERNEL)
--- 15,21 ----
  #endif
  
  RCSID
!     ("$Header: /cvs/openafs/src/rx/rx_packet.c,v 1.35.2.30 2007/01/12 03:51:23 shadow Exp $");
  
  #ifdef KERNEL
  #if defined(UKERNEL)
***************
*** 115,122 ****
  				afs_int32 ahost, short aport,
  				afs_int32 istack);
  
! static int rxi_FreeDataBufsToQueue(struct rx_packet *p, int first, 
  				   struct rx_queue * q);
  
  /* some rules about packets:
   * 1.  When a packet is allocated, the final iov_buf contains room for
--- 115,126 ----
  				afs_int32 ahost, short aport,
  				afs_int32 istack);
  
! static int rxi_FreeDataBufsToQueue(struct rx_packet *p, 
! 				   afs_uint32 first, 
  				   struct rx_queue * q);
+ static int
+ rxi_FreeDataBufsTSFPQ(struct rx_packet *p, afs_uint32 first, int flush_global);
+ 
  
  /* some rules about packets:
   * 1.  When a packet is allocated, the final iov_buf contains room for
***************
*** 297,303 ****
  	USERPRI;
      }
  
!     RX_TS_FPQ_CHECKOUT2(rx_ts_info, num_pkts, q);
  
      return num_pkts;
  }
--- 301,307 ----
  	USERPRI;
      }
  
!     RX_TS_FPQ_QCHECKOUT(rx_ts_info, num_pkts, q);
  
      return num_pkts;
  }
***************
*** 390,405 ****
  
      if (!num_pkts) {
  	for (queue_Scan(q, c, nc, rx_packet), num_pkts++) {
! 	    rxi_FreeDataBufsTSFPQ(c, 1, 0);
  	}
      } else {
  	for (queue_Scan(q, c, nc, rx_packet)) {
! 	    rxi_FreeDataBufsTSFPQ(c, 1, 0);
  	}
      }
  
      if (num_pkts) {
! 	RX_TS_FPQ_CHECKIN2(rx_ts_info, num_pkts, q);
      }
  
      if (rx_ts_info->_FPQ.len > rx_TSFPQLocalMax) {
--- 394,409 ----
  
      if (!num_pkts) {
  	for (queue_Scan(q, c, nc, rx_packet), num_pkts++) {
! 	    rxi_FreeDataBufsTSFPQ(c, 2, 0);
  	}
      } else {
  	for (queue_Scan(q, c, nc, rx_packet)) {
! 	    rxi_FreeDataBufsTSFPQ(c, 2, 0);
  	}
      }
  
      if (num_pkts) {
! 	RX_TS_FPQ_QCHECKIN(rx_ts_info, num_pkts, q);
      }
  
      if (rx_ts_info->_FPQ.len > rx_TSFPQLocalMax) {
***************
*** 806,825 ****
  }
  #endif /* RX_ENABLE_TSFPQ */
  
! /* free continuation buffers off a packet into a queue of buffers */
  static int
! rxi_FreeDataBufsToQueue(struct rx_packet *p, int first, struct rx_queue * q)
  {
      struct iovec *iov;
      struct rx_packet * cb;
      int count = 0;
  
!     if (first < 2)
! 	first = 2;
!     for (; first < p->niovecs; first++, count++) {
  	iov = &p->wirevec[first];
  	if (!iov->iov_base)
! 	    osi_Panic("rxi_PacketIOVToQueue: unexpected NULL iov");
  	cb = RX_CBUF_TO_PACKET(iov->iov_base, p);
  	RX_FPQ_MARK_FREE(cb);
  	queue_Append(q, cb);
--- 810,836 ----
  }
  #endif /* RX_ENABLE_TSFPQ */
  
! /* 
!  * free continuation buffers off a packet into a queue
!  *
!  * [IN] p      -- packet from which continuation buffers will be freed
!  * [IN] first  -- iovec offset of first continuation buffer to free
!  * [IN] q      -- queue into which continuation buffers will be chained
!  *
!  * returns:
!  *   number of continuation buffers freed
!  */
  static int
! rxi_FreeDataBufsToQueue(struct rx_packet *p, afs_uint32 first, struct rx_queue * q)
  {
      struct iovec *iov;
      struct rx_packet * cb;
      int count = 0;
  
!     for (first = MAX(2, first); first < p->niovecs; first++, count++) {
  	iov = &p->wirevec[first];
  	if (!iov->iov_base)
! 	    osi_Panic("rxi_FreeDataBufsToQueue: unexpected NULL iov");
  	cb = RX_CBUF_TO_PACKET(iov->iov_base, p);
  	RX_FPQ_MARK_FREE(cb);
  	queue_Append(q, cb);
***************
*** 830,849 ****
      return count;
  }
  
  int
! rxi_FreeDataBufsNoLock(struct rx_packet *p, int first)
  {
!     struct iovec *iov, *end;
  
!     if (first != 1)		/* MTUXXX */
! 	osi_Panic("FreeDataBufs 1: first must be 1");
!     iov = &p->wirevec[1];
!     end = iov + (p->niovecs - 1);
!     if (iov->iov_base != (caddr_t) p->localdata)	/* MTUXXX */
! 	osi_Panic("FreeDataBufs 2: vec 1 must be localdata");
!     for (iov++; iov < end; iov++) {
  	if (!iov->iov_base)
! 	    osi_Panic("FreeDataBufs 3: vecs 2-niovecs must not be NULL");
  	rxi_FreePacketNoLock(RX_CBUF_TO_PACKET(iov->iov_base, p));
      }
      p->length = 0;
--- 841,864 ----
      return count;
  }
  
+ /*
+  * free packet continuation buffers into the global free packet pool
+  *
+  * [IN] p      -- packet from which to free continuation buffers
+  * [IN] first  -- iovec offset of first continuation buffer to free
+  *
+  * returns:
+  *   zero always
+  */
  int
! rxi_FreeDataBufsNoLock(struct rx_packet *p, afs_uint32 first)
  {
!     struct iovec *iov;
  
!     for (first = MAX(2, first); first < p->niovecs; first++) {
! 	iov = &p->wirevec[first];
  	if (!iov->iov_base)
! 	    osi_Panic("rxi_FreeDataBufsNoLock: unexpected NULL iov");
  	rxi_FreePacketNoLock(RX_CBUF_TO_PACKET(iov->iov_base, p));
      }
      p->length = 0;
***************
*** 853,875 ****
  }
  
  #ifdef RX_ENABLE_TSFPQ
! int
! rxi_FreeDataBufsTSFPQ(struct rx_packet *p, int first, int flush_global)
  {
!     struct iovec *iov, *end;
      register struct rx_ts_info_t * rx_ts_info;
  
      RX_TS_INFO_GET(rx_ts_info);
  
!     if (first != 1)		/* MTUXXX */
! 	osi_Panic("FreeDataBufs 1: first must be 1");
!     iov = &p->wirevec[1];
!     end = iov + (p->niovecs - 1);
!     if (iov->iov_base != (caddr_t) p->localdata)	/* MTUXXX */
! 	osi_Panic("FreeDataBufs 2: vec 1 must be localdata");
!     for (iov++; iov < end; iov++) {
  	if (!iov->iov_base)
! 	    osi_Panic("FreeDataBufs 3: vecs 2-niovecs must not be NULL");
  	RX_TS_FPQ_CHECKIN(rx_ts_info,RX_CBUF_TO_PACKET(iov->iov_base, p));
      }
      p->length = 0;
--- 868,896 ----
  }
  
  #ifdef RX_ENABLE_TSFPQ
! /*
!  * free packet continuation buffers into the thread-local free pool
!  *
!  * [IN] p             -- packet from which continuation buffers will be freed
!  * [IN] first         -- iovec offset of first continuation buffer to free
!  * [IN] flush_global  -- if nonzero, we will flush overquota packets to the
!  *                       global free pool before returning
!  *
!  * returns:
!  *   zero always
!  */
! static int
! rxi_FreeDataBufsTSFPQ(struct rx_packet *p, afs_uint32 first, int flush_global)
  {
!     struct iovec *iov;
      register struct rx_ts_info_t * rx_ts_info;
  
      RX_TS_INFO_GET(rx_ts_info);
  
!     for (first = MAX(2, first); first < p->niovecs; first++) {
! 	iov = &p->wirevec[first];
  	if (!iov->iov_base)
! 	    osi_Panic("rxi_FreeDataBufsTSFPQ: unexpected NULL iov");
  	RX_TS_FPQ_CHECKIN(rx_ts_info,RX_CBUF_TO_PACKET(iov->iov_base, p));
      }
      p->length = 0;
***************
*** 1011,1017 ****
  void
  rxi_FreePacket(struct rx_packet *p)
  {
!     rxi_FreeDataBufsTSFPQ(p, 1, 0);
      rxi_FreePacketTSFPQ(p, RX_TS_FPQ_FLUSH_GLOBAL);
  }
  #else /* RX_ENABLE_TSFPQ */
--- 1032,1038 ----
  void
  rxi_FreePacket(struct rx_packet *p)
  {
!     rxi_FreeDataBufsTSFPQ(p, 2, 0);
      rxi_FreePacketTSFPQ(p, RX_TS_FPQ_FLUSH_GLOBAL);
  }
  #else /* RX_ENABLE_TSFPQ */
***************
*** 1023,1029 ****
      NETPRI;
      MUTEX_ENTER(&rx_freePktQ_lock);
  
!     rxi_FreeDataBufsNoLock(p, 1);
      rxi_FreePacketNoLock(p);
      /* Wakeup anyone waiting for packets */
      rxi_PacketsUnWait();
--- 1044,1050 ----
      NETPRI;
      MUTEX_ENTER(&rx_freePktQ_lock);
  
!     rxi_FreeDataBufsNoLock(p, 2);
      rxi_FreePacketNoLock(p);
      /* Wakeup anyone waiting for packets */
      rxi_PacketsUnWait();
***************
*** 2604,2625 ****
      }
      if (len > 0) {
  	osi_Panic("PrepareSendPacket 1\n");	/* MTUXXX */
!     } else {
!         struct rx_queue q;
!        int nb;
! 
! 	queue_Init(&q);
! 
  	/* Free any extra elements in the wirevec */
! 	for (j = MAX(2, i), nb = p->niovecs - j; j < p->niovecs; j++) {
! 	    queue_Append(&q,RX_CBUF_TO_PACKET(p->wirevec[j].iov_base, p));
! 	}
! 	if (nb)
! 	    rxi_FreePackets(nb, &q);
  
  	p->niovecs = i;
- 	p->wirevec[i - 1].iov_len += len;
      }
      RXS_PreparePacket(conn->securityObject, call, p);
  }
  
--- 2625,2643 ----
      }
      if (len > 0) {
  	osi_Panic("PrepareSendPacket 1\n");	/* MTUXXX */
!     } else if (i < p->niovecs) {
  	/* Free any extra elements in the wirevec */
! #if defined(RX_ENABLE_TSFPQ)
! 	rxi_FreeDataBufsTSFPQ(p, i, 1 /* allow global pool flush if overquota */);
! #else /* !RX_ENABLE_TSFPQ */
!         MUTEX_ENTER(&rx_freePktQ_lock);
! 	rxi_FreeDataBufsNoLock(p, i);
!         MUTEX_EXIT(&rx_freePktQ_lock);
! #endif /* !RX_ENABLE_TSFPQ */
  
  	p->niovecs = i;
      }
+     p->wirevec[i - 1].iov_len += len;
      RXS_PreparePacket(conn->securityObject, call, p);
  }
  
Index: openafs/src/rx/rx_prototypes.h
diff -c openafs/src/rx/rx_prototypes.h:1.14.2.16 openafs/src/rx/rx_prototypes.h:1.14.2.17
*** openafs/src/rx/rx_prototypes.h:1.14.2.16	Thu Aug 31 00:54:55 2006
--- openafs/src/rx/rx_prototypes.h	Thu Jan 11 22:51:23 2007
***************
*** 471,477 ****
  extern void rxi_FreeAllPackets(void);
  extern void rx_CheckPackets(void);
  extern void rxi_FreePacketNoLock(struct rx_packet *p);
! extern int rxi_FreeDataBufsNoLock(struct rx_packet *p, int first);
  extern void rxi_RestoreDataBufs(struct rx_packet *p);
  extern int rxi_TrimDataBufs(struct rx_packet *p, int first);
  extern void rxi_FreePacket(struct rx_packet *p);
--- 471,477 ----
  extern void rxi_FreeAllPackets(void);
  extern void rx_CheckPackets(void);
  extern void rxi_FreePacketNoLock(struct rx_packet *p);
! extern int rxi_FreeDataBufsNoLock(struct rx_packet *p, afs_uint32 first);
  extern void rxi_RestoreDataBufs(struct rx_packet *p);
  extern int rxi_TrimDataBufs(struct rx_packet *p, int first);
  extern void rxi_FreePacket(struct rx_packet *p);
Index: openafs/src/rx/LINUX/rx_kmutex.c
diff -c openafs/src/rx/LINUX/rx_kmutex.c:1.7.2.6 openafs/src/rx/LINUX/rx_kmutex.c:1.7.2.7
*** openafs/src/rx/LINUX/rx_kmutex.c:1.7.2.6	Thu Mar  9 16:41:55 2006
--- openafs/src/rx/LINUX/rx_kmutex.c	Thu Dec 28 16:32:09 2006
***************
*** 17,23 ****
  #include "afs/param.h"
  
  RCSID
!     ("$Header: /cvs/openafs/src/rx/LINUX/rx_kmutex.c,v 1.7.2.6 2006/03/09 21:41:55 shadow Exp $");
  
  #include "rx/rx_kcommon.h"
  #include "rx_kmutex.h"
--- 17,23 ----
  #include "afs/param.h"
  
  RCSID
!     ("$Header: /cvs/openafs/src/rx/LINUX/rx_kmutex.c,v 1.7.2.7 2006/12/28 21:32:09 shadow Exp $");
  
  #include "rx/rx_kcommon.h"
  #include "rx_kmutex.h"
***************
*** 119,125 ****
--- 119,129 ----
  #ifdef PF_FREEZE
  	    current->flags & PF_FREEZE
  #else
+ #if defined(STRUCT_TASK_STRUCT_HAS_TODO)
  	    !current->todo
+ #else
+ 	    test_ti_thread_flag(current->thread_info, TIF_FREEZE)
+ #endif
  #endif
  	    )
  #ifdef LINUX_REFRIGERATOR_TAKES_PF_FREEZE
Index: openafs/src/rx/LINUX/rx_knet.c
diff -c openafs/src/rx/LINUX/rx_knet.c:1.23.2.10 openafs/src/rx/LINUX/rx_knet.c:1.23.2.11
*** openafs/src/rx/LINUX/rx_knet.c:1.23.2.10	Fri Sep 22 07:20:35 2006
--- openafs/src/rx/LINUX/rx_knet.c	Thu Dec 28 16:32:09 2006
***************
*** 16,22 ****
  #include "afs/param.h"
  
  RCSID
!     ("$Header: /cvs/openafs/src/rx/LINUX/rx_knet.c,v 1.23.2.10 2006/09/22 11:20:35 shadow Exp $");
  
  #include <linux/version.h>
  #ifdef AFS_LINUX22_ENV
--- 16,22 ----
  #include "afs/param.h"
  
  RCSID
!     ("$Header: /cvs/openafs/src/rx/LINUX/rx_knet.c,v 1.23.2.11 2006/12/28 21:32:09 shadow Exp $");
  
  #include <linux/version.h>
  #ifdef AFS_LINUX22_ENV
***************
*** 170,176 ****
--- 170,180 ----
  #ifdef PF_FREEZE
  	    current->flags & PF_FREEZE
  #else
+ #if defined(STRUCT_TASK_STRUCT_HAS_TODO)
  	    !current->todo
+ #else
+             test_ti_thread_flag(current->thread_info, TIF_FREEZE)
+ #endif
  #endif
  	    )
  #ifdef LINUX_REFRIGERATOR_TAKES_PF_FREEZE
Index: openafs/src/rxkad/private_data.h
diff -c openafs/src/rxkad/private_data.h:1.4.2.2 openafs/src/rxkad/private_data.h:1.4.2.3
*** openafs/src/rxkad/private_data.h:1.4.2.2	Thu Jul 13 13:56:33 2006
--- openafs/src/rxkad/private_data.h	Wed Nov 29 16:23:46 2006
***************
*** 56,62 ****
      rxkad_type type;		/* always client */
      rxkad_level level;		/* minimum security level of client */
      afs_int32 kvno;		/* key version of ticket */
!     afs_int16 ticketLen;	/* length of ticket */
      fc_KeySchedule keysched;	/* the session key */
      fc_InitializationVector ivec;	/* initialization vector for cbc */
      char ticket[MAXKTCTICKETLEN];	/* the ticket for the server */
--- 56,62 ----
      rxkad_type type;		/* always client */
      rxkad_level level;		/* minimum security level of client */
      afs_int32 kvno;		/* key version of ticket */
!     afs_int32 ticketLen;	/* length of ticket */
      fc_KeySchedule keysched;	/* the session key */
      fc_InitializationVector ivec;	/* initialization vector for cbc */
      char ticket[MAXKTCTICKETLEN];	/* the ticket for the server */
Index: openafs/src/rxkad/rxkad_server.c
diff -c openafs/src/rxkad/rxkad_server.c:1.14.2.6 openafs/src/rxkad/rxkad_server.c:1.14.2.8
*** openafs/src/rxkad/rxkad_server.c:1.14.2.6	Fri Apr 14 09:13:49 2006
--- openafs/src/rxkad/rxkad_server.c	Sat Nov  4 18:50:38 2006
***************
*** 15,21 ****
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/rxkad/rxkad_server.c,v 1.14.2.6 2006/04/14 13:13:49 shadow Exp $");
  
  #include <afs/stds.h>
  #include <sys/types.h>
--- 15,21 ----
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/rxkad/rxkad_server.c,v 1.14.2.8 2006/11/04 23:50:38 jaltman Exp $");
  
  #include <afs/stds.h>
  #include <sys/types.h>
***************
*** 352,364 ****
  			     client.instance, client.cell, &sessionkey, &host,
  			     &start, &end);
  	if (code)
! 	    return RXKADBADTICKET;
      }
      code = tkt_CheckTimes(start, end, time(0));
!     if (code == -1)
  	return RXKADEXPIRED;
      else if (code <= 0)
! 	return RXKADNOAUTH;
  
      code = fc_keysched(&sessionkey, sconn->keysched);
      if (code)
--- 352,368 ----
  			     client.instance, client.cell, &sessionkey, &host,
  			     &start, &end);
  	if (code)
! 	    return code;
      }
      code = tkt_CheckTimes(start, end, time(0));
!     if (code == 0) 
! 	return RXKADNOAUTH;
!     else if (code == -1)
  	return RXKADEXPIRED;
+     else if (code < -1)
+ 	return RXKADBADTICKET;
      else if (code <= 0)
! 	return RXKADBADTICKET;
  
      code = fc_keysched(&sessionkey, sconn->keysched);
      if (code)
Index: openafs/src/rxkad/ticket.c
diff -c openafs/src/rxkad/ticket.c:1.13 openafs/src/rxkad/ticket.c:1.13.2.1
*** openafs/src/rxkad/ticket.c:1.13	Tue Jul 15 19:16:42 2003
--- openafs/src/rxkad/ticket.c	Sat Nov  4 18:50:38 2006
***************
*** 15,21 ****
  #endif
  
  RCSID
!     ("$Header: /cvs/openafs/src/rxkad/ticket.c,v 1.13 2003/07/15 23:16:42 shadow Exp $");
  
  #if defined(UKERNEL)
  #include "afs/sysincludes.h"
--- 15,21 ----
  #endif
  
  RCSID
!     ("$Header: /cvs/openafs/src/rxkad/ticket.c,v 1.13.2.1 2006/11/04 23:50:38 jaltman Exp $");
  
  #if defined(UKERNEL)
  #include "afs/sysincludes.h"
***************
*** 148,154 ****
  
      if (code)
  	return RXKADBADTICKET;
!     if (tkt_CheckTimes(*start, *end, time(0)) < -1)
  	return RXKADBADTICKET;
  
      return 0;
--- 148,160 ----
  
      if (code)
  	return RXKADBADTICKET;
! 
!     code = tkt_CheckTimes(*start, *end, time(0));
!     if (code == 0)
! 	return RXKADNOAUTH;
!     else if (code == -1)
! 	return RXKADEXPIRED;
!     else if (code < -1)
  	return RXKADBADTICKET;
  
      return 0;
Index: openafs/src/ubik/remote.c
diff -c openafs/src/ubik/remote.c:1.12.2.2 openafs/src/ubik/remote.c:1.12.2.3
*** openafs/src/ubik/remote.c:1.12.2.2	Sun Feb 20 20:15:27 2005
--- openafs/src/ubik/remote.c	Fri Dec 15 11:38:22 2006
***************
*** 11,17 ****
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/ubik/remote.c,v 1.12.2.2 2005/02/21 01:15:27 shadow Exp $");
  
  #include <sys/types.h>
  #ifdef AFS_NT40_ENV
--- 11,17 ----
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/ubik/remote.c,v 1.12.2.3 2006/12/15 16:38:22 shadow Exp $");
  
  #include <sys/types.h>
  #ifdef AFS_NT40_ENV
***************
*** 459,464 ****
--- 459,465 ----
      code = rx_Write(rxcall, &tlen, sizeof(afs_int32));
      if (code != sizeof(afs_int32)) {
  	DBRELE(dbase);
+ 	ubik_dprint("Rx-write length error=%d\n", code);
  	return BULK_ERROR;
      }
      offset = 0;
***************
*** 467,477 ****
--- 468,480 ----
  	code = (*dbase->read) (dbase, file, tbuffer, offset, tlen);
  	if (code != tlen) {
  	    DBRELE(dbase);
+ 	    ubik_dprint("read failed error=%d\n", code);
  	    return UIOERROR;
  	}
  	code = rx_Write(rxcall, tbuffer, tlen);
  	if (code != tlen) {
  	    DBRELE(dbase);
+ 	    ubik_dprint("Rx-write length error=%d\n", code);
  	    return BULK_ERROR;
  	}
  	length -= tlen;
***************
*** 545,556 ****
--- 548,561 ----
  	code = rx_Read(rxcall, tbuffer, tlen);
  	if (code != tlen) {
  	    DBRELE(dbase);
+ 	    ubik_dprint("Rx-read length error=%d\n", code);
  	    code = BULK_ERROR;
  	    goto failed;
  	}
  	code = (*dbase->write) (dbase, file, tbuffer, offset, tlen);
  	if (code != tlen) {
  	    DBRELE(dbase);
+ 	    ubik_dprint("write failed error=%d\n", code);
  	    code = UIOERROR;
  	    goto failed;
  	}
Index: openafs/src/util/dirpath.c
diff -c openafs/src/util/dirpath.c:1.15 openafs/src/util/dirpath.c:1.15.2.1
*** openafs/src/util/dirpath.c:1.15	Tue Jul 13 23:28:45 2004
--- openafs/src/util/dirpath.c	Mon Nov 20 18:47:24 2006
***************
*** 11,17 ****
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/util/dirpath.c,v 1.15 2004/07/14 03:28:45 jaltman Exp $");
  
  #include <stddef.h>
  #include <stdlib.h>
--- 11,17 ----
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/util/dirpath.c,v 1.15.2.1 2006/11/20 23:47:24 rra Exp $");
  
  #include <stddef.h>
  #include <stdlib.h>
***************
*** 420,436 ****
  /*
   * LocalizePathHead() -- Make path relative to local part
   *
!  * ConstructLocalPath takes a path  and a directory that path should
!  * be considered relative to.   This  function checks the given path
!  * for   a prefix  that represents a canonical path.  If such a prefix
!  * is found,  the path is adjusted to remove the prefix and the path
!  * is considered  relative to the local version of that path.
   */
  
  /* The following array  maps cannonical parts to local parts.  It
   * might  seem reasonable to  simply construct an array in parallel to
   * dirpatharray  but it turns out you don't want translations for all
!  local paths.
  */
  
  struct canonmapping {
--- 420,444 ----
  /*
   * LocalizePathHead() -- Make path relative to local part
   *
!  * ConstructLocalPath takes a path and a directory that path should
!  * be considered relative to.  There are two possible cases:
!  *
!  * The path is an absolute path.  In this case, the relative path
!  * is ignored.  We check the path for a prefix that represents a
!  * canonical path, and if one is found, we adjust the path to remove
!  * the prefix and adjust the directory to which it should be
!  * considered relative to be the local version of that canonical path.
!  *
!  * The path is a relative path.  In this case, we check to see if the
!  * directory to which it is relative represents a canonical path, and
!  * if so, we adjust that directory to be the local version of that
!  * canonical path.  The relative path itself is left unchanged.
   */
  
  /* The following array  maps cannonical parts to local parts.  It
   * might  seem reasonable to  simply construct an array in parallel to
   * dirpatharray  but it turns out you don't want translations for all
!  * local paths.
  */
  
  struct canonmapping {
***************
*** 448,462 ****
  static void
  LocalizePathHead(const char **path, const char **relativeTo)
  {
!     struct canonmapping *current;
!     for (current = CanonicalTranslations; current->local != NULL; current++) {
! 	int canonlength = strlen(current->canonical);
! 	if (strncmp(*path, current->canonical, canonlength) == 0) {
! 	    (*path) += canonlength;
! 	    if (**path == '/')
! 		(*path)++;
! 	    *relativeTo = current->local;
! 	    return;
  	}
      }
  }
--- 456,480 ----
  static void
  LocalizePathHead(const char **path, const char **relativeTo)
  {
!     struct canonmapping *map;
!  
!     if (**path == '/') {
! 	for (map = CanonicalTranslations; map->local != NULL; map++) {
! 	    int canonlength = strlen(map->canonical);
! 	    if (strncmp(*path, map->canonical, canonlength) == 0) {
! 		(*path) += canonlength;
! 		if (**path == '/')
! 		    (*path)++;
! 		*relativeTo = map->local;
! 		return;
! 	    }
! 	}
!     } else {
! 	for (map = CanonicalTranslations; map->local != NULL; map++) {
! 	    if (strcmp(*relativeTo, map->canonical) == 0) {
! 		*relativeTo = map->local;
! 		return;
! 	    }
  	}
      }
  }
Index: openafs/src/util/kreltime.c
diff -c openafs/src/util/kreltime.c:1.8.2.3 openafs/src/util/kreltime.c:1.8.2.4
*** openafs/src/util/kreltime.c:1.8.2.3	Mon Jul 31 17:12:59 2006
--- openafs/src/util/kreltime.c	Sat Oct 21 21:51:57 2006
***************
*** 11,17 ****
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/util/kreltime.c,v 1.8.2.3 2006/07/31 21:12:59 shadow Exp $");
  
  #include <afs/stds.h>
  #include <sys/types.h>
--- 11,17 ----
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/util/kreltime.c,v 1.8.2.4 2006/10/22 01:51:57 jaltman Exp $");
  
  #include <afs/stds.h>
  #include <sys/types.h>
***************
*** 121,128 ****
  
      timePtr = &timeP;
  
!     memset(&timePtr, 0, sizeof(timePtr));
!     localtime_r(&tt, &timePtr);
  #else
      timePtr = localtime(&tt);
  #endif
--- 121,128 ----
  
      timePtr = &timeP;
  
!     memset(&timeP, 0, sizeof(timeP));
!     localtime_r(&tt, &timeP);
  #else
      timePtr = localtime(&tt);
  #endif
Index: openafs/src/util/netutils.c
diff -c openafs/src/util/netutils.c:1.13.2.1 openafs/src/util/netutils.c:1.13.2.2
*** openafs/src/util/netutils.c:1.13.2.1	Mon Oct 18 03:12:18 2004
--- openafs/src/util/netutils.c	Fri Jan 12 00:23:43 2007
***************
*** 20,26 ****
  #endif
  
  RCSID
!     ("$Header: /cvs/openafs/src/util/netutils.c,v 1.13.2.1 2004/10/18 07:12:18 shadow Exp $");
  
  #include <stdlib.h>
  #include <stdio.h>
--- 20,26 ----
  #endif
  
  RCSID
!     ("$Header: /cvs/openafs/src/util/netutils.c,v 1.13.2.2 2007/01/12 05:23:43 shadow Exp $");
  
  #include <stdlib.h>
  #include <stdio.h>
***************
*** 132,140 ****
  */
  
  int
! parseNetRestrictFile(afs_uint32 outAddrs[], afs_uint32 * mask,
! 		     afs_uint32 * mtu, afs_uint32 maxAddrs,
! 		     afs_uint32 * nAddrs, char reason[], const char *fileName)
  {
      FILE *fp;
      char line[MAX_NETFILE_LINE];
--- 132,141 ----
  */
  
  int
! parseNetRestrictFile_int(afs_uint32 outAddrs[], afs_uint32 * mask,
! 			 afs_uint32 * mtu, afs_uint32 maxAddrs,
! 			 afs_uint32 * nAddrs, char reason[], 
! 			 const char *fileName, const char *fileName_ni)
  {
      FILE *fp;
      char line[MAX_NETFILE_LINE];
***************
*** 161,166 ****
--- 162,175 ----
  	sprintf(reason, "No existing IP interfaces found");
  	return -1;
      }
+     i = 0;
+     if ((neaddrs < MAXIPADDRS) && fileName_ni) 
+ 	i = ParseNetInfoFile_int(&(eAddrs[neaddrs]), &(eMask[neaddrs]), 
+ 				 &(eMtu[neaddrs]), MAXIPADDRS-neaddrs, reason,
+ 				 fileName_ni, 1);
+ 
+     if (i > 0)
+ 	neaddrs += i;
  
      if ((fp = fopen(fileName, "r")) == 0) {
  	sprintf(reason, "Could not open file %s for reading:%s", fileName,
***************
*** 223,229 ****
      return (usedfile ? 0 : 1);	/* 0=>used the file.  1=>didn't use file */
  }
  
! 
  
  /*
   * this function reads in stuff from InterfaceAddr file in
--- 232,245 ----
      return (usedfile ? 0 : 1);	/* 0=>used the file.  1=>didn't use file */
  }
  
! int
! parseNetRestrictFile(afs_uint32 outAddrs[], afs_uint32 * mask,
! 			 afs_uint32 * mtu, afs_uint32 maxAddrs,
! 			 afs_uint32 * nAddrs, char reason[], 
! 			 const char *fileName)
! {
!     return parseNetRestrictFile_int(outAddrs, mask, mtu, maxAddrs, nAddrs, reason, fileName, NULL);
! }
  
  /*
   * this function reads in stuff from InterfaceAddr file in
***************
*** 234,241 ****
   * interface addresses. Pulled out from afsd.c
   */
  int
! ParseNetInfoFile(afs_uint32 * final, afs_uint32 * mask, afs_uint32 * mtu,
! 		 int max, char reason[], const char *fileName)
  {
  
      afs_uint32 existingAddr[MAXIPADDRS], existingMask[MAXIPADDRS],
--- 250,258 ----
   * interface addresses. Pulled out from afsd.c
   */
  int
! ParseNetInfoFile_int(afs_uint32 * final, afs_uint32 * mask, afs_uint32 * mtu,
! 		     int max, char reason[], const char *fileName, 
! 		     int fakeonly)
  {
  
      afs_uint32 existingAddr[MAXIPADDRS], existingMask[MAXIPADDRS],
***************
*** 327,338 ****
  		    "afs:Too many interfaces. The current kernel configuration supports a maximum of %d interfaces\n",
  		    max);
  	} else if (fake) {
! 	    fprintf(stderr, "Client (2) also has address %s\n", line);
  	    final[count] = addr;
  	    mask[count] = 0xffffffff;
  	    mtu[count] = htonl(1500);
  	    count++;
! 	} else {
  	    final[count] = existingAddr[i];
  	    mask[count] = existingMask[i];
  	    mtu[count] = existingMtu[i];
--- 344,356 ----
  		    "afs:Too many interfaces. The current kernel configuration supports a maximum of %d interfaces\n",
  		    max);
  	} else if (fake) {
! 	    if (!fake) 
! 		fprintf(stderr, "Client (2) also has address %s\n", line);
  	    final[count] = addr;
  	    mask[count] = 0xffffffff;
  	    mtu[count] = htonl(1500);
  	    count++;
! 	} else if (!fakeonly) {
  	    final[count] = existingAddr[i];
  	    mask[count] = existingMask[i];
  	    mtu[count] = existingMtu[i];
***************
*** 354,360 ****
      return count;
  }
  
! 
  
  /*
   * Given two arrays of addresses, masks and mtus find the common ones
--- 372,383 ----
      return count;
  }
  
! int
! ParseNetInfoFile(afs_uint32 * final, afs_uint32 * mask, afs_uint32 * mtu,
! 		 int max, char reason[], const char *fileName)
! {
!     return ParseNetInfoFile_int(final, mask, mtu, max, reason, fileName, 0);
! }
  
  /*
   * Given two arrays of addresses, masks and mtus find the common ones
***************
*** 439,446 ****
  	ParseNetInfoFile(addrbuf1, maskbuf1, mtubuf1, MAXIPADDRS, reason,
  			 niFileName);
      code =
! 	parseNetRestrictFile(addrbuf2, maskbuf2, mtubuf2, MAXIPADDRS,
! 			     &nAddrs2, reason, nrFileName);
      if ((nAddrs1 < 0) && (code)) {
  	/* both failed */
  	return -1;
--- 462,469 ----
  	ParseNetInfoFile(addrbuf1, maskbuf1, mtubuf1, MAXIPADDRS, reason,
  			 niFileName);
      code =
! 	parseNetRestrictFile_int(addrbuf2, maskbuf2, mtubuf2, MAXIPADDRS,
! 			     &nAddrs2, reason, nrFileName, niFileName);
      if ((nAddrs1 < 0) && (code)) {
  	/* both failed */
  	return -1;
Index: openafs/src/viced/viced.c
diff -c openafs/src/viced/viced.c:1.58.2.18 openafs/src/viced/viced.c:1.58.2.19
*** openafs/src/viced/viced.c:1.58.2.18	Fri Sep 15 19:19:28 2006
--- openafs/src/viced/viced.c	Fri Jan 12 00:23:44 2007
***************
*** 20,26 ****
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/viced/viced.c,v 1.58.2.18 2006/09/15 23:19:28 jaltman Exp $");
  
  #include <stdio.h>
  #include <stdlib.h>
--- 20,26 ----
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/viced/viced.c,v 1.58.2.19 2007/01/12 05:23:44 shadow Exp $");
  
  #include <stdio.h>
  #include <stdlib.h>
***************
*** 1444,1459 ****
  		 AFSDIR_SERVER_SYSID_FILEPATH, nentries));
  	return EIO;
      }
!     FS_HostAddr_cnt = nentries;
!     for (i = 0; i < nentries; i++) {
! 	if (read(fd, (char *)&FS_HostAddrs[i], sizeof(afs_int32)) !=
! 	    sizeof(afs_int32)) {
! 	    ViceLog(0,
! 		    ("%s: Read of addresses failed (%d)\n",
! 		     AFSDIR_SERVER_SYSID_FILEPATH, errno));
! 	    FS_HostAddr_cnt = 0;	/* reset it */
! 	    return EIO;
  	}
      }
      close(fd);
      return 0;
--- 1444,1465 ----
  		 AFSDIR_SERVER_SYSID_FILEPATH, nentries));
  	return EIO;
      }
!     if (FS_HostAddr_cnt == 0) {
! 	FS_HostAddr_cnt = nentries;
! 	for (i = 0; i < nentries; i++) {
! 	    if (read(fd, (char *)&FS_HostAddrs[i], sizeof(afs_int32)) !=
! 		sizeof(afs_int32)) {
! 		ViceLog(0,
! 			("%s: Read of addresses failed (%d)\n",
! 			 AFSDIR_SERVER_SYSID_FILEPATH, errno));
! 		FS_HostAddr_cnt = 0;	/* reset it */
! 		return EIO;
! 	    }
  	}
+     } else {
+ 	ViceLog(1,
+ 		("%s: address list ignored (NetInfo/NetRestrict override)\n",
+ 		 AFSDIR_SERVER_SYSID_FILEPATH));
      }
      close(fd);
      return 0;
Index: openafs/src/vlserver/vldb_check.c
diff -c openafs/src/vlserver/vldb_check.c:1.11 openafs/src/vlserver/vldb_check.c:1.11.2.1
*** openafs/src/vlserver/vldb_check.c:1.11	Sat Nov 29 16:38:04 2003
--- openafs/src/vlserver/vldb_check.c	Sat Dec 16 01:26:42 2006
***************
*** 21,31 ****
  #define MHC 0x100		/* on multihomed chain */
  #define FRC 0x200		/* on free chain */
  
  #include <afsconfig.h>
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/vlserver/vldb_check.c,v 1.11 2003/11/29 21:38:04 jaltman Exp $");
  
  #include <sys/types.h>
  #include <sys/stat.h>
--- 21,39 ----
  #define MHC 0x100		/* on multihomed chain */
  #define FRC 0x200		/* on free chain */
  
+ #define REFRW 0x1000            /* linked from something (RW) */
+ #define REFRO 0x2000            /* linked from something (RO) */
+ #define REFBK 0x4000            /* linked from something (BK) */
+ #define REFN  0x8000            /* linked from something (name) */
+ 
+ #define vldbread(x,y,z) vldbio(x,y,z,0)
+ #define vldbwrite(x,y,z) vldbio(x,y,z,1)
+ 
  #include <afsconfig.h>
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/vlserver/vldb_check.c,v 1.11.2.1 2006/12/16 06:26:42 shadow Exp $");
  
  #include <sys/types.h>
  #include <sys/stat.h>
***************
*** 55,69 ****
--- 63,88 ----
  #include <afs/afsutil.h>
  #include <afs/cmd.h>
  
+ #define ADDR(x) (x/sizeof(struct nvlentry))
+ 
  int fd;
  int listentries, listservers, listheader, listuheader, verbose;
  
+ int fix = 0;
+ 
  struct er {
      long addr;
      int type;
  } *record;
  int serveraddrs[MAXSERVERID + 2];
  
+ #if 0
+ int
+ writeUbikHeader()
+ {
+     /* Bump the version number?? We could cheat and push a new db... */
+ }
+ #endif
  
  #define HDRSIZE 64
  int
***************
*** 110,119 ****
  }
  
  int
! vldbread(position, buffer, size)
!      int position;
!      char *buffer;
!      int size;
  {
      int offset, r, p;
  
--- 129,135 ----
  }
  
  int
! vldbio(int position, char *buffer, int size, int rdwr)
  {
      int offset, r, p;
  
***************
*** 125,142 ****
  	return (-1);
      }
  
!     /* now read the info */
!     r = read(fd, buffer, size);
      if (r != size) {
! 	printf("error: read of %d bytes failed: %d %d\n", size, r, errno);
  	return (-1);
      }
      return (0);
  }
  
  char *
! vtype(type)
!      int type;
  {
      static char Type[3];
  
--- 141,161 ----
  	return (-1);
      }
  
!     if (rdwr == 1) 
! 	r = write(fd, buffer, size);
!     else 
! 	r = read(fd, buffer, size);
! 
      if (r != size) {
! 	printf("error: %s of %d bytes failed: %d %d\n", rdwr==1?"write":"read",
! 	       size, r, errno);
  	return (-1);
      }
      return (0);
  }
  
  char *
! vtype(int type)
  {
      static char Type[3];
  
***************
*** 152,159 ****
  }
  
  afs_int32
! NameHash(volname)
!      char *volname;
  {
      unsigned int hash;
      char *vchar;
--- 171,177 ----
  }
  
  afs_int32
! NameHash(char *volname)
  {
      unsigned int hash;
      char *vchar;
***************
*** 165,180 ****
  }
  
  afs_int32
! IdHash(volid)
!      afs_int32 volid;
  {
      return ((abs(volid)) % HASHSIZE);
  }
  
  #define LEGALCHARS ".ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_"
  int
! InvalidVolname(volname)
!      char *volname;
  {
      char *map;
      size_t slen;
--- 183,196 ----
  }
  
  afs_int32
! IdHash(afs_int32 volid)
  {
      return ((abs(volid)) % HASHSIZE);
  }
  
  #define LEGALCHARS ".ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_"
  int
! InvalidVolname(char *volname)
  {
      char *map;
      size_t slen;
***************
*** 186,193 ****
      return (slen != strspn(volname, map));
  }
  
! readheader(headerp)
!      struct vlheader *headerp;
  {
      int i, j;
  
--- 202,209 ----
      return (slen != strspn(volname, map));
  }
  
! void
! readheader(struct vlheader *headerp)
  {
      int i, j;
  
***************
*** 251,259 ****
  	       headerp->vital_header.headersize, sizeof(*headerp));
  }
  
! readMH(addr, mhblockP)
!      afs_int32 addr;
!      struct extentaddr *mhblockP;
  {
      int i, j;
      struct extentaddr *e;
--- 267,307 ----
  	       headerp->vital_header.headersize, sizeof(*headerp));
  }
  
! void
! writeheader(struct vlheader *headerp)
! {
!     int i, j;
! 
!     headerp->vital_header.vldbversion =
! 	htonl(headerp->vital_header.vldbversion);
!     headerp->vital_header.headersize =
! 	htonl(headerp->vital_header.headersize);
!     headerp->vital_header.freePtr = htonl(headerp->vital_header.freePtr);
!     headerp->vital_header.eofPtr = htonl(headerp->vital_header.eofPtr);
!     headerp->vital_header.allocs = htonl(headerp->vital_header.allocs);
!     headerp->vital_header.frees = htonl(headerp->vital_header.frees);
!     headerp->vital_header.MaxVolumeId =
! 	htonl(headerp->vital_header.MaxVolumeId);
!     headerp->vital_header.totalEntries[0] =
! 	htonl(headerp->vital_header.totalEntries[0]);
!     for (i = 0; i < MAXTYPES; i++)
! 	headerp->vital_header.totalEntries[i] =
! 	    htonl(headerp->vital_header.totalEntries[1]);
! 
!     headerp->SIT = htonl(headerp->SIT);
!     for (i = 0; i < MAXSERVERID; i++)
! 	headerp->IpMappedAddr[i] = htonl(headerp->IpMappedAddr[i]);
!     for (i = 0; i < HASHSIZE; i++)
! 	headerp->VolnameHash[i] = htonl(headerp->VolnameHash[i]);
!     for (i = 0; i < MAXTYPES; i++)
! 	for (j = 0; j < HASHSIZE; j++)
! 	    headerp->VolidHash[i][j] = htonl(headerp->VolidHash[i][j]);
! 
!     vldbwrite(0, headerp, sizeof(*headerp));
! }
! 
! void
! readMH(afs_int32 addr, struct extentaddr *mhblockP)
  {
      int i, j;
      struct extentaddr *e;
***************
*** 275,284 ****
      }
  }
  
! readentry(addr, vlentryp, type)
!      afs_int32 addr;
!      struct nvlentry *vlentryp;
!      afs_int32 *type;
  {
      int i;
  
--- 323,330 ----
      }
  }
  
! void
! readentry(afs_int32 addr, struct nvlentry *vlentryp, afs_int32 *type)
  {
      int i;
  
***************
*** 356,364 ****
  }
  
  void
! readSIT(base, addr)
!      int base;
!      int addr;
  {
      int i, j, a;
      char sitbuf[VL_ADDREXTBLK_SIZE];
--- 402,433 ----
  }
  
  void
! writeentry(afs_int32 addr, struct nvlentry *vlentryp)
! {
!     int i;
! 
!     if (verbose)
! 	printf("Writing back entry at addr %u\n", addr);
! 
!     for (i = 0; i < MAXTYPES; i++)
! 	vlentryp->volumeId[i] = htonl(vlentryp->volumeId[i]);
!     vlentryp->flags = htonl(vlentryp->flags);
!     vlentryp->LockAfsId = htonl(vlentryp->LockAfsId);
!     vlentryp->LockTimestamp = htonl(vlentryp->LockTimestamp);
!     vlentryp->cloneId = htonl(vlentryp->cloneId);
!     for (i = 0; i < MAXTYPES; i++)
! 	vlentryp->nextIdHash[i] = htonl(vlentryp->nextIdHash[i]);
!     vlentryp->nextNameHash = htonl(vlentryp->nextNameHash);
!     for (i = 0; i < NMAXNSERVERS; i++) {
! 	vlentryp->serverNumber[i] = htonl(vlentryp->serverNumber[i]);
! 	vlentryp->serverPartition[i] = htonl(vlentryp->serverPartition[i]);
! 	vlentryp->serverFlags[i] = htonl(vlentryp->serverFlags[i]);
!     }
!     vldbwrite(addr, vlentryp, sizeof(*vlentryp));
! }
! 
! void
! readSIT(int base, int addr)
  {
      int i, j, a;
      char sitbuf[VL_ADDREXTBLK_SIZE];
***************
*** 418,425 ****
   * Remember what the maximum volume id we found is and check against the header.
   */
  void
! ReadAllEntries(header)
!      struct vlheader *header;
  {
      afs_int32 type, rindex, i, j, e;
      int freecount = 0, mhcount = 0, vlcount = 0;
--- 487,493 ----
   * Remember what the maximum volume id we found is and check against the header.
   */
  void
! ReadAllEntries(struct vlheader *header)
  {
      afs_int32 type, rindex, i, j, e;
      int freecount = 0, mhcount = 0, vlcount = 0;
***************
*** 457,462 ****
--- 525,534 ----
  			bkcount++;
  		    continue;
  		}
+ 		if (!vlentry.serverFlags[j]) {
+ 		    /*e = 0;*/
+ 		    continue;
+  		}
  		if (e) {
  		    printf
  			("VLDB entry '%s' contains an unknown RW/RO index serverFlag\n",
***************
*** 508,520 ****
  }
  
  
  /*
   * Follow each Name hash bucket marking it as read in the record array.
   * Record we found it in the name hash within the record array.
   * Check that the name is hashed correctly.
   */
! FollowNameHash(header)
!      struct vlheader *header;
  {
      int count = 0, longest = 0, shortest = -1, chainlength;
      struct nvlentry vlentry;
--- 580,642 ----
  }
  
  
+ void
+ SetHashEnd(long addr, int type, long new)
+ {
+     struct nvlentry vlentry;
+     afs_int32 i, rindex, type2, next = -1;
+ 
+     for (; addr; addr = next) {
+ 	readentry(addr, &vlentry, &type2);
+ 	switch(type & 0xf0) {
+ 	case RWH:
+ 	    next = vlentry.nextIdHash[0];
+ 	    break;
+ 	case ROH:
+ 	    next = vlentry.nextIdHash[1];
+ 	    break;
+ 	case BKH:
+ 	    next = vlentry.nextIdHash[2];
+ 	    break;
+ 	case NH:
+ 	    next = vlentry.nextNameHash;
+ 	    break;
+ 	default:
+ 	    next = -1;
+ 	}
+ 
+ 	if (next < 1) {
+ 	    switch(type & 0xf0) {
+ 	    case RWH:
+ 	      if (vlentry.nextIdHash[0] != 0) {printf("bwoop\n");}
+ 		vlentry.nextIdHash[0] = new;
+ 		break;
+ 	    case ROH:
+ 	      if (vlentry.nextIdHash[1] != 0) {printf("bwoop\n");}
+ 		vlentry.nextIdHash[1] = new;
+ 		break;
+ 	    case BKH:
+ 	      if (vlentry.nextIdHash[2] != 0) {printf("bwoop\n");}
+ 		vlentry.nextIdHash[2] = new;
+ 		break;
+ 	    case NH:
+ 	      if (vlentry.nextNameHash != 0) {printf("bwoop\n");}
+ 		vlentry.nextNameHash = new;
+ 		break;
+ 	    }
+ 	    writeentry(addr, &vlentry);
+ 	    return;
+ 	}
+     }
+ }
+ 
  /*
   * Follow each Name hash bucket marking it as read in the record array.
   * Record we found it in the name hash within the record array.
   * Check that the name is hashed correctly.
   */
! void
! FollowNameHash(struct vlheader *header)
  {
      int count = 0, longest = 0, shortest = -1, chainlength;
      struct nvlentry vlentry;
***************
*** 549,554 ****
--- 671,678 ----
  	    }
  	    record[rindex].type |= NH;
  
+ 	    record[rindex].type |= REFN;
+ 
  	    chainlength++;
  	    count++;
  
***************
*** 576,594 ****
   * Record we found it in the id hash within the record array.
   * Check that the ID is hashed correctly.
   */
! FollowIdHash(header)
!      struct vlheader *header;
  {
      int count = 0, longest = 0, shortest = -1, chainlength;
      struct nvlentry vlentry;
      afs_uint32 addr;
!     afs_int32 i, j, hash, type, rindex;
  
      /* Now follow the RW, RO, and BK Hash Tables */
      if (verbose)
  	printf("Check RW, RO, and BK id Hashes\n");
      for (i = 0; i < MAXTYPES; i++) {
  	hash = ((i == 0) ? RWH : ((i == 1) ? ROH : BKH));
  	count = longest = 0;
  	shortest = -1;
  
--- 700,719 ----
   * Record we found it in the id hash within the record array.
   * Check that the ID is hashed correctly.
   */
! void
! FollowIdHash(struct vlheader *header)
  {
      int count = 0, longest = 0, shortest = -1, chainlength;
      struct nvlentry vlentry;
      afs_uint32 addr;
!     afs_int32 i, j, hash, type, rindex, ref;
  
      /* Now follow the RW, RO, and BK Hash Tables */
      if (verbose)
  	printf("Check RW, RO, and BK id Hashes\n");
      for (i = 0; i < MAXTYPES; i++) {
  	hash = ((i == 0) ? RWH : ((i == 1) ? ROH : BKH));
+ 	ref = ((i == 0) ? REFRW : ((i == 1) ? REFRO : REFBK));
  	count = longest = 0;
  	shortest = -1;
  
***************
*** 617,622 ****
--- 742,748 ----
  		    break;
  		}
  		record[rindex].type |= hash;
+ 		record[rindex].type |= ref;
  
  		chainlength++;
  		count++;
***************
*** 648,655 ****
   * Follow the free chain.
   * Record we found it in the free chain within the record array.
   */
! FollowFreeChain(header)
!      struct vlheader *header;
  {
      afs_int32 count = 0;
      struct nvlentry vlentry;
--- 774,781 ----
   * Follow the free chain.
   * Record we found it in the free chain within the record array.
   */
! void
! FollowFreeChain(struct vlheader *header)
  {
      afs_int32 count = 0;
      struct nvlentry vlentry;
***************
*** 704,711 ****
   * The code does not verify if there are duplicate IP addresses in the 
   * list. The vlserver does this when a fileserver registeres itself.
   */
! CheckIpAddrs(header)
!      struct vlheader *header;
  {
      int mhblocks = 0;
      afs_int32 i, j, m, rindex;
--- 830,837 ----
   * The code does not verify if there are duplicate IP addresses in the 
   * list. The vlserver does this when a fileserver registeres itself.
   */
! void
! CheckIpAddrs(struct vlheader *header)
  {
      int mhblocks = 0;
      afs_int32 i, j, m, rindex;
***************
*** 899,911 ****
  
  }
  
  int
! WorkerBee(as, arock)
!      struct cmd_syndesc *as;
!      char *arock;
  {
      char *dbfile;
!     afs_int32 maxentries, type;
      struct vlheader header;
      struct nvlentry vlentry;
      int i, j, help = 0;
--- 1025,1043 ----
  
  }
  
+ void 
+ FixBad(afs_uint32 idx, afs_uint32 addr, afs_uint32 type, afs_uint32 tmp, 
+        struct nvlentry *vlentry) {
+     SetHashEnd(addr, type, tmp);
+     printf("linked unlinked chain %u (index %d) to end of chain\n", 
+ 	   tmp, ADDR(tmp));
+ }
+ 
  int
! WorkerBee(struct cmd_syndesc *as, char *arock)
  {
      char *dbfile;
!     afs_int32 maxentries, type, tmp;
      struct vlheader header;
      struct nvlentry vlentry;
      int i, j, help = 0;
***************
*** 916,924 ****
      listservers = (as->parms[3].items ? 1 : 0);	/* -servers  */
      listentries = (as->parms[4].items ? 1 : 0);	/* -entries  */
      verbose = (as->parms[5].items ? 1 : 0);	/* -verbose  */
  
      /* open the vldb database file */
!     fd = open(dbfile, O_RDONLY, 0);
      if (fd < 0) {
  	printf("can't open file '%s'. error = %d\n", dbfile, errno);
  	return 0;
--- 1048,1057 ----
      listservers = (as->parms[3].items ? 1 : 0);	/* -servers  */
      listentries = (as->parms[4].items ? 1 : 0);	/* -entries  */
      verbose = (as->parms[5].items ? 1 : 0);	/* -verbose  */
+     fix = (as->parms[6].items ? 1 : 0);	/* -fix  */
  
      /* open the vldb database file */
!     fd = open(dbfile, (fix > 0)?O_RDWR:O_RDONLY, 0);
      if (fd < 0) {
  	printf("can't open file '%s'. error = %d\n", dbfile, errno);
  	return 0;
***************
*** 960,965 ****
--- 1093,1104 ----
      if (verbose)
  	printf("Verify each volume entry\n");
      for (i = 0; i < maxentries; i++) {
+ 	int nextp;
+ 	int reft;
+ 	int hash;
+ 	int *nextpp;
+ 	char *which;
+ 
  	if (record[i].type == 0)
  	    continue;
  
***************
*** 967,993 ****
  	 * on the hash chains, and its server numbers are good.
  	 */
  	if (record[i].type & VL) {
  	    readentry(record[i].addr, &vlentry, &type);
  
  	    if (InvalidVolname(vlentry.name))
  		printf("Volume '%s' at addr %u has an invalid name\n",
  		       vlentry.name, record[i].addr);
  
! 	    if (!(record[i].type & NH))
! 		printf("Volume '%s' not found in name hash\n", vlentry.name);
  
! 	    if (vlentry.volumeId[0] && !(record[i].type & RWH))
! 		printf("Volume '%s' id %u not found in RW hash chain\n",
! 		       vlentry.name, vlentry.volumeId[0]);
! 
! 	    if (vlentry.volumeId[1] && !(record[i].type & ROH))
! 		printf("Volume '%s' id %u not found in RO hash chain\n",
! 		       vlentry.name, vlentry.volumeId[1]);
! 
! 	    if (vlentry.volumeId[2] && !(record[i].type & BKH))
! 		printf("Volume '%s' id %u not found in BK hash chain\n",
! 		       vlentry.name, vlentry.volumeId[2]);
  
  	    for (j = 0; j < NMAXNSERVERS; j++) {
  		if ((vlentry.serverNumber[j] != 255)
  		    && (serveraddrs[vlentry.serverNumber[j]] == 0)) {
--- 1106,1181 ----
  	 * on the hash chains, and its server numbers are good.
  	 */
  	if (record[i].type & VL) {
+ 	    int foundbad = 0;
+ 	    char volidbuf[256];
+ 
  	    readentry(record[i].addr, &vlentry, &type);
  
  	    if (InvalidVolname(vlentry.name))
  		printf("Volume '%s' at addr %u has an invalid name\n",
  		       vlentry.name, record[i].addr);
  
! 	    if (!(record[i].type & NH)) {
! 		nextp = ADDR(vlentry.nextNameHash);
! 		reft = REFN;
! 		hash = NameHash(vlentry.name);
! 		nextpp = &vlentry.nextNameHash;
! 		which = "name";
! 		sprintf(volidbuf, "");
! 		foundbad = 1;
! 	    }
! 
! 	    if (vlentry.volumeId[0] && !(record[i].type & RWH)) {
! 		nextp = ADDR(vlentry.nextIdHash[0]);
! 		reft = REFRW;
! 		hash = IdHash(vlentry.volumeId[0]);
! 		nextpp = &(vlentry.nextIdHash[0]);
! 		which = "RW";
! 		sprintf(volidbuf, "id %u ", vlentry.volumeId[0]);
! 		foundbad = 1;
! 	    }
  
! 	    if (vlentry.volumeId[1] && !(record[i].type & ROH)) {
! 		nextp = ADDR(vlentry.nextIdHash[1]);
! 		reft = REFRO;
! 		hash = IdHash(vlentry.volumeId[1]);
! 		nextpp = &(vlentry.nextIdHash[1]);
! 		which = "RO";
! 		sprintf(volidbuf, "id %u ", vlentry.volumeId[1]);
! 		foundbad = 1;
! 	    }
! 
! 	    if (vlentry.volumeId[2] && !(record[i].type & BKH)) {
! 		nextp = ADDR(vlentry.nextIdHash[2]);
! 		reft = REFBK;
! 		hash = IdHash(vlentry.volumeId[2]);
! 		nextpp = &(vlentry.nextIdHash[2]);
! 		which = "BK";
! 		sprintf(volidbuf, "id %u ", vlentry.volumeId[2]);
! 		foundbad = 1;
! 	    }
  
+ 	    if (foundbad) {
+ 		printf("%d: Volume '%s' %snot found in %s hash %d", i, 
+ 		       vlentry.name, volidbuf, which, hash);
+ 		if (nextp) {
+ 		    printf(" (next %d", nextp);
+ 		    if (!(record[nextp].type & reft)) {
+ 			printf(" not in chain ");
+ 			record[nextp].type |= reft;
+ 		    } else if (nextp != 0) {
+ 			printf(" next in chain");
+ 			if (fix) {
+ 			    printf(", unchaining");
+ 			    *nextpp = 0;
+ 			    writeentry(record[i].addr, &vlentry);
+ 			}
+ 		    }
+ 		    printf(")");
+ 		}
+ 		printf("\n");
+ 	    }
+ 	
  	    for (j = 0; j < NMAXNSERVERS; j++) {
  		if ((vlentry.serverNumber[j] != 255)
  		    && (serveraddrs[vlentry.serverNumber[j]] == 0)) {
***************
*** 996,1040 ****
  			 vlentry.name, j, vlentry.serverNumber[j]);
  		}
  	    }
! 
! 	    if (record[i].type & 0xffffff00)
  		printf
  		    ("Volume '%s' id %u also found on other chains (0x%x)\n",
  		     vlentry.name, vlentry.volumeId[0], record[i].type);
! 
  	    /* A free entry */
  	} else if (record[i].type & FR) {
  	    if (!(record[i].type & FRC))
  		printf("Free vlentry at %u not on free chain\n",
  		       record[i].addr);
! 
  	    if (record[i].type & 0xfffffdf0)
  		printf
  		    ("Free vlentry at %u also found on other chains (0x%x)\n",
  		     record[i].addr, record[i].type);
! 
  	    /* A multihomed entry */
  	} else if (record[i].type & MH) {
  	    if (!(record[i].type & MHC))
  		printf("Multihomed block at %u is orphaned\n",
  		       record[i].addr);
! 
  	    if (record[i].type & 0xfffffef0)
  		printf
  		    ("Multihomed block at %u also found on other chains (0x%x)\n",
  		     record[i].addr, record[i].type);
! 
  	} else {
  	    printf("Unknown entry type at %u (0x%x)\n", record[i].addr,
  		   record[i].type);
  	}
      }
      return 0;
  }
  
! main(argc, argv)
!      int argc;
!      char **argv;
  {
      struct cmd_syndesc *ts;
  
--- 1184,1279 ----
  			 vlentry.name, j, vlentry.serverNumber[j]);
  		}
  	    }
! 	
! 	    if (record[i].type & 0xffff0f00)
  		printf
  		    ("Volume '%s' id %u also found on other chains (0x%x)\n",
  		     vlentry.name, vlentry.volumeId[0], record[i].type);
! 	    
  	    /* A free entry */
  	} else if (record[i].type & FR) {
  	    if (!(record[i].type & FRC))
  		printf("Free vlentry at %u not on free chain\n",
  		       record[i].addr);
! 	    
  	    if (record[i].type & 0xfffffdf0)
  		printf
  		    ("Free vlentry at %u also found on other chains (0x%x)\n",
  		     record[i].addr, record[i].type);
! 	    
  	    /* A multihomed entry */
  	} else if (record[i].type & MH) {
  	    if (!(record[i].type & MHC))
  		printf("Multihomed block at %u is orphaned\n",
  		       record[i].addr);
! 	    
  	    if (record[i].type & 0xfffffef0)
  		printf
  		    ("Multihomed block at %u also found on other chains (0x%x)\n",
  		     record[i].addr, record[i].type);
! 	    
  	} else {
  	    printf("Unknown entry type at %u (0x%x)\n", record[i].addr,
  		   record[i].type);
  	}
      }
+ 
+     /* By the time we get here, unchained entries are really unchained */
+     printf("Scanning %u entries for possible repairs\n", maxentries);
+     for (i = 0; i < maxentries; i++) {
+ 	if (record[i].type & VL) {
+ 	    readentry(record[i].addr, &vlentry, &type);
+ 	    if (!(record[i].type & REFN) && (strlen(vlentry.name)>0)) {
+ 		printf("%d: Record %u (type 0x%x) not in a name chain\n", i, 
+ 		       record[i].addr, record[i].type);
+ 		if (fix) {
+ 		    if (header.VolnameHash[NameHash(vlentry.name)] == 0)
+ 			header.VolnameHash[NameHash(vlentry.name)] = record[i].addr;
+ 		    else
+ 			FixBad(i, header.VolnameHash[NameHash(vlentry.name)], NH, record[i].addr, &vlentry);
+ 		}
+ 	    }
+ 	    if (vlentry.volumeId[0] && !(record[i].type & REFRW)) {
+ 		printf("%d: Record %u (type 0x%x) not in a RW chain\n", i,
+ 		       record[i].addr, record[i].type);
+ 		if (fix) {
+ 		    if (header.VolidHash[0][IdHash(vlentry.volumeId[0])] == 0)
+ 			header.VolidHash[0][IdHash(vlentry.volumeId[0])] = record[i].addr;
+ 		    else
+ 			FixBad(i, header.VolidHash[0][IdHash(vlentry.volumeId[0])], RWH, record[i].addr, &vlentry);
+ 		}
+ 	    }
+ 	    if (vlentry.volumeId[1] && !(record[i].type & REFRO)) {
+ 		printf("%d: Record %u (type 0x%x) not in a RO chain\n", i, 
+ 		       record[i].addr, record[i].type);
+ 		if (fix) {
+ 		    if (header.VolidHash[1][IdHash(vlentry.volumeId[1])] == 0)
+ 			header.VolidHash[1][IdHash(vlentry.volumeId[1])] = record[i].addr;
+ 		    else
+ 			FixBad(i, header.VolidHash[1][IdHash(vlentry.volumeId[1])], ROH, record[i].addr, &vlentry);
+ 		}
+ 	    }
+ 	    if (vlentry.volumeId[2] && !(record[i].type & REFBK)) {
+ 		printf("%d: Record %u (type 0x%x) not in a BK chain\n", i, 
+ 		       record[i].addr, record[i].type);
+ 		if (fix) {
+ 		    if (header.VolidHash[2][IdHash(vlentry.volumeId[2])] == 0)
+ 			header.VolidHash[2][IdHash(vlentry.volumeId[2])] = record[i].addr;
+ 		    else
+ 			FixBad(i, header.VolidHash[2][IdHash(vlentry.volumeId[2])], BKH, record[i].addr, &vlentry);
+ 		}
+ 
+ 	    }
+ 	}
+     }
+     if (fix) 
+ 	writeheader(&header);
+ 
      return 0;
  }
  
! int
! main(int argc, char **argv)
  {
      struct cmd_syndesc *ts;
  
***************
*** 1050,1055 ****
--- 1289,1295 ----
  		"Display server list");
      cmd_AddParm(ts, "-entries", CMD_FLAG, CMD_OPTIONAL, "Display entries");
      cmd_AddParm(ts, "-verbose", CMD_FLAG, CMD_OPTIONAL, "verbose");
+     cmd_AddParm(ts, "-fix", CMD_FLAG, CMD_OPTIONAL, "attempt to patch the database (potentially dangerous)");
  
      return cmd_Dispatch(argc, argv);
  }
Index: openafs/src/vol/volume.c
diff -c openafs/src/vol/volume.c:1.35.2.8 openafs/src/vol/volume.c:1.35.2.9
*** openafs/src/vol/volume.c:1.35.2.8	Thu Aug 24 16:21:49 2006
--- openafs/src/vol/volume.c	Sat Oct 21 22:02:01 2006
***************
*** 20,26 ****
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/vol/volume.c,v 1.35.2.8 2006/08/24 20:21:49 shadow Exp $");
  
  #include <rx/xdr.h>
  #include <afs/afsint.h>
--- 20,26 ----
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/vol/volume.c,v 1.35.2.9 2006/10/22 02:02:01 jaltman Exp $");
  
  #include <rx/xdr.h>
  #include <afs/afsint.h>
***************
*** 317,323 ****
  	    dpq = (diskpartition_queue_t *) malloc(sizeof(struct diskpartition_queue_t));
  	    assert(dpq != NULL);
  	    dpq->diskP = diskP;
! 	    queue_Prepend(&params,dpq);
  	}
  
  	assert(pthread_attr_init(&attrs) == 0);
--- 317,323 ----
  	    dpq = (diskpartition_queue_t *) malloc(sizeof(struct diskpartition_queue_t));
  	    assert(dpq != NULL);
  	    dpq->diskP = diskP;
! 	    queue_Append(&params,dpq);
  	}
  
  	assert(pthread_attr_init(&attrs) == 0);
Index: openafs/src/volser/dumpstuff.c
diff -c openafs/src/volser/dumpstuff.c:1.25.2.5 openafs/src/volser/dumpstuff.c:1.25.2.8
*** openafs/src/volser/dumpstuff.c:1.25.2.5	Fri Oct 13 08:46:03 2006
--- openafs/src/volser/dumpstuff.c	Mon Dec 18 23:51:08 2006
***************
*** 11,17 ****
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/volser/dumpstuff.c,v 1.25.2.5 2006/10/13 12:46:03 shadow Exp $");
  
  #include <sys/types.h>
  #include <ctype.h>
--- 11,17 ----
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/volser/dumpstuff.c,v 1.25.2.8 2006/12/19 04:51:08 shadow Exp $");
  
  #include <sys/types.h>
  #include <ctype.h>
***************
*** 990,996 ****
  	    if (Buf == NULL) {
  		STREAM_CLOSE(afile);
  		FDH_CLOSE(fdP);
! 		return 1;
  	    }
  	    memset((char *)Buf, 0, nVnodes * sizeof(afs_int32));
  	    STREAM_SEEK(afile, offset = vcp->diskSize, 0);
--- 990,996 ----
  	    if (Buf == NULL) {
  		STREAM_CLOSE(afile);
  		FDH_CLOSE(fdP);
! 		return -1;
  	    }
  	    memset((char *)Buf, 0, nVnodes * sizeof(afs_int32));
  	    STREAM_SEEK(afile, offset = vcp->diskSize, 0);
***************
*** 1027,1038 ****
      struct iod iod;
      register struct iod *iodp = &iod;
      afs_int32 *b1 = NULL, *b2 = NULL;
!     int s1 = 0, s2 = 0, delo = incremental, tdelo;
      int tag;
  
      iod_Init(iodp, call);
  
      vp = avp;
      if (!ReadDumpHeader(iodp, &header)) {
  	Log("1 Volser: RestoreVolume: Error reading header file for dump; aborted\n");
  	return VOLSERREAD_DUMPERROR;
--- 1027,1041 ----
      struct iod iod;
      register struct iod *iodp = &iod;
      afs_int32 *b1 = NULL, *b2 = NULL;
!     int s1 = 0, s2 = 0, delo = 0, tdelo;
      int tag;
  
      iod_Init(iodp, call);
  
      vp = avp;
+     if (V_parentId(vp) == V_id(vp))
+       delo = incremental;
+ 
      if (!ReadDumpHeader(iodp, &header)) {
  	Log("1 Volser: RestoreVolume: Error reading header file for dump; aborted\n");
  	return VOLSERREAD_DUMPERROR;
***************
*** 1048,1060 ****
  	delo = ProcessIndex(vp, vLarge, &b1, &s1, 0);
      if (!delo)
  	delo = ProcessIndex(vp, vSmall, &b2, &s2, 0);
!     if (delo) {
! 	if (b1)
! 	    free((char *)b1);
! 	if (b2)
! 	    free((char *)b2);
! 	b1 = b2 = NULL;
! 	s1 = s2 = 0;
      }
  
      strncpy(vol.name, cookie->name, VOLSER_OLDMAXVOLNAME);
--- 1051,1060 ----
  	delo = ProcessIndex(vp, vLarge, &b1, &s1, 0);
      if (!delo)
  	delo = ProcessIndex(vp, vSmall, &b2, &s2, 0);
!     if (delo < 0) {
! 	Log("1 Volser: RestoreVolume: ProcessIndex failed; not restored\n");
! 	error = VOLSERREAD_DUMPERROR;
! 	goto out;
      }
  
      strncpy(vol.name, cookie->name, VOLSER_OLDMAXVOLNAME);
***************
*** 1062,1068 ****
      vol.cloneId = cookie->clone;
      vol.parentId = cookie->parent;
  
- 
      tdelo = delo;
      while (1) {
  	if (ReadVnodes(iodp, vp, 0, b1, s1, b2, s2, tdelo)) {
--- 1062,1067 ----
***************
*** 1095,1102 ****
      if (!delo) {
  	delo = ProcessIndex(vp, vLarge, &b1, &s1, 1);
  	if (!delo)
! 	    ProcessIndex(vp, vSmall, &b2, &s2, 1);
! 	if (delo) {
  	    error = VOLSERREAD_DUMPERROR;
  	    goto clean;
  	}
--- 1094,1101 ----
      if (!delo) {
  	delo = ProcessIndex(vp, vLarge, &b1, &s1, 1);
  	if (!delo)
! 	    delo = ProcessIndex(vp, vSmall, &b2, &s2, 1);
! 	if (delo < 0) {
  	    error = VOLSERREAD_DUMPERROR;
  	    goto clean;
  	}
Index: openafs/src/volser/volprocs.c
diff -c openafs/src/volser/volprocs.c:1.34.2.5 openafs/src/volser/volprocs.c:1.34.2.7
*** openafs/src/volser/volprocs.c:1.34.2.5	Tue Jan 24 22:25:49 2006
--- openafs/src/volser/volprocs.c	Mon Dec 18 22:40:14 2006
***************
*** 11,17 ****
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/volser/volprocs.c,v 1.34.2.5 2006/01/25 03:25:49 shadow Exp $");
  
  #include <stdio.h>
  #include <sys/types.h>
--- 11,17 ----
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/volser/volprocs.c,v 1.34.2.7 2006/12/19 03:40:14 jaltman Exp $");
  
  #include <stdio.h>
  #include <sys/types.h>
***************
*** 1196,1202 ****
      vp = tt->volume;
      strcpy(tt->lastProcName, "ForwardMulti");
  
!     /* (fromDate == 0) ==> incremental dump */
      is_incremental = (fromDate ? 1 : 0);
  
      i = results->manyResults_len = destinations->manyDests_len;
--- 1196,1202 ----
      vp = tt->volume;
      strcpy(tt->lastProcName, "ForwardMulti");
  
!     /* (fromDate == 0) ==> full dump */
      is_incremental = (fromDate ? 1 : 0);
  
      i = results->manyResults_len = destinations->manyDests_len;
