Index: openafs/src/NTMakefile
diff -c openafs/src/NTMakefile:1.27.2.4 openafs/src/NTMakefile:1.27.2.5
*** openafs/src/NTMakefile:1.27.2.4	Sun Aug 12 22:13:28 2007
--- openafs/src/NTMakefile	Wed Oct 10 12:06:30 2007
***************
*** 577,583 ****
  	$(NTMAKE)
  	$(CD) ..\..\..
  
! netidmgr_plugin: aklog
       echo ***** $@
  	$(DOCD) $(SRC)\WINNT\$@
  	$(CD) $(SRC)\WINNT\$@
--- 577,590 ----
  	$(NTMAKE)
  	$(CD) ..\..\..
  
! xstat: aklog
!      echo ***** $@
! 	$(DOCD) $(SRC)\$@
! 	$(CD) $(SRC)\$@
! 	$(NTMAKE)
! 	$(CD) ..\..
! 
! netidmgr_plugin: xstat
       echo ***** $@
  	$(DOCD) $(SRC)\WINNT\$@
  	$(CD) $(SRC)\WINNT\$@
***************
*** 600,609 ****
  	$(DOCD) $(SRC)\$@
  	$(CD) $(SRC)\$@
  	$(NTMAKE)
! 	$(CD) ..\..	
! 	echo Build Finished Successfully
  
  install: finale
  
  # Clean target for obj tree
  clean:
--- 607,617 ----
  	$(DOCD) $(SRC)\$@
  	$(CD) $(SRC)\$@
  	$(NTMAKE)
! 	$(CD) ..\..
  
  install: finale
+ 	echo Build Finished Successfully
+         
  
  # Clean target for obj tree
  clean:
***************
*** 658,661 ****
  install-wix: install wix
  
  
- 
--- 666,668 ----
Index: openafs/src/WINNT/afsd/afsd_init.c
diff -c openafs/src/WINNT/afsd/afsd_init.c:1.79.2.17 openafs/src/WINNT/afsd/afsd_init.c:1.79.2.18
*** openafs/src/WINNT/afsd/afsd_init.c:1.79.2.17	Mon Sep 10 15:08:17 2007
--- openafs/src/WINNT/afsd/afsd_init.c	Sat Oct 20 00:03:04 2007
***************
*** 41,46 ****
--- 41,47 ----
  extern int cm_enableServerLocks;
  extern int cm_deleteReadOnly;
  extern afs_int32 cm_BPlusTrees;
+ extern afs_int32 cm_OfflineROIsValid;
  extern const char **smb_ExecutableExtensions;
  
  osi_log_t *afsd_logp;
***************
*** 1108,1113 ****
--- 1109,1122 ----
      if (!smb_ExecutableExtensions)
          afsi_log("No PrefetchExecutableExtensions");
  
+     dummyLen = sizeof(DWORD);
+     code = RegQueryValueEx(parmKey, "OfflineReadOnlyIsValid", NULL, NULL,
+                            (BYTE *) &dwValue, &dummyLen);
+     if (code == ERROR_SUCCESS) {
+         cm_OfflineROIsValid = (unsigned short) dwValue;
+     } 
+     afsi_log("CM OfflineReadOnlyIsValid is %u", cm_deleteReadOnly);
+     
      RegCloseKey (parmKey);
  
      cacheBlocks = ((afs_uint64)cacheSize * 1024) / blockSize;
Index: openafs/src/WINNT/afsd/afskfw.c
diff -c openafs/src/WINNT/afsd/afskfw.c:1.28.4.11 openafs/src/WINNT/afsd/afskfw.c:1.28.4.12
*** openafs/src/WINNT/afsd/afskfw.c:1.28.4.11	Sun Sep  2 12:37:43 2007
--- openafs/src/WINNT/afsd/afskfw.c	Thu Oct 18 01:21:35 2007
***************
*** 497,502 ****
--- 497,532 ----
          FreeLibrary(hKrb5);
  }
  
+ 
+ int
+ KFW_accept_dotted_usernames(void)
+ {
+     HKEY parmKey;
+     DWORD code, len;
+     DWORD value = 1;
+ 
+     code = RegOpenKeyEx(HKEY_CURRENT_USER, AFSREG_USER_OPENAFS_SUBKEY,
+                          0, KEY_QUERY_VALUE, &parmKey);
+     if (code == ERROR_SUCCESS) {
+         len = sizeof(value);
+         code = RegQueryValueEx(parmKey, "AcceptDottedPrincipalNames", NULL, NULL,
+                                 (BYTE *) &value, &len);
+         RegCloseKey(parmKey);
+     }
+     if (code != ERROR_SUCCESS) {
+         code = RegOpenKeyEx(HKEY_LOCAL_MACHINE, AFSREG_CLT_OPENAFS_SUBKEY,
+                              0, KEY_QUERY_VALUE, &parmKey);
+         if (code == ERROR_SUCCESS) {
+             len = sizeof(value);
+             code = RegQueryValueEx(parmKey, "AcceptDottedPrincipalNames", NULL, NULL,
+                                     (BYTE *) &value, &len);
+             RegCloseKey (parmKey);
+         }
+     }
+     return value;
+ }
+ 
+ 
  int
  KFW_use_krb524(void)
  {
***************
*** 1259,1265 ****
      struct afsconf_cell cellconfig;
      char * dot;
  
- 
      if (!pkrb5_init_context)
          return 0;
  
--- 1289,1294 ----
***************
*** 1282,1305 ****
      userrealm = strchr(username,'@');
      if ( userrealm ) {
          pname = strdup(username);
!         userrealm = strchr(pname, '@');
!         *userrealm = '\0';
! 
!         /* handle kerberos iv notation */
!         while ( dot = strchr(pname,'.') ) {
!             *dot = '/';
          }
-         *userrealm++ = '@';
      } else {
          pname = malloc(strlen(username) + strlen(realm) + 2);
  
          strcpy(pname, username);
  
!         /* handle kerberos iv notation */
!         while ( dot = strchr(pname,'.') ) {
!             *dot = '/';
          }
- 
          strcat(pname,"@");
          strcat(pname,realm);
      }
--- 1311,1337 ----
      userrealm = strchr(username,'@');
      if ( userrealm ) {
          pname = strdup(username);
!         if (!KFW_accept_dotted_usernames()) {
!             userrealm = strchr(pname, '@');
!             *userrealm = '\0';
! 
!             /* handle kerberos iv notation */
!             while ( dot = strchr(pname,'.') ) {
!                 *dot = '/';
!             }
!             *userrealm++ = '@';
          }
      } else {
          pname = malloc(strlen(username) + strlen(realm) + 2);
  
          strcpy(pname, username);
  
!         if (!KFW_accept_dotted_usernames()) {
!             /* handle kerberos iv notation */
!             while ( dot = strchr(pname,'.') ) {
!                 *dot = '/';
!             }
          }
          strcat(pname,"@");
          strcat(pname,realm);
      }
***************
*** 2762,2780 ****
          goto skip_krb5_init;
      }
  
!     /* look for client principals which cannot be distinguished 
!      * from Kerberos 4 multi-component principal names
!      */
!     k5data = krb5_princ_component(ctx,client_principal,0);
!     for ( i=0; i<k5data->length; i++ ) {
!         if ( k5data->data[i] == '.' )
!             break;
!     }
!     if (i != k5data->length)
!     {
!         OutputDebugString("Illegal Principal name contains dot in first component\n");
!         rc = KRB5KRB_ERR_GENERIC;
!         goto cleanup;
      }
  
      i = krb5_princ_realm(ctx, client_principal)->length;
--- 2794,2814 ----
          goto skip_krb5_init;
      }
  
!     if (!KFW_accept_dotted_usernames()) {
!         /* look for client principals which cannot be distinguished 
!          * from Kerberos 4 multi-component principal names
!          */
!         k5data = krb5_princ_component(ctx,client_principal,0);
!         for ( i=0; i<k5data->length; i++ ) {
!             if ( k5data->data[i] == '.' )
!                 break;
!         }
!         if (i != k5data->length)
!         {
!             OutputDebugString("Illegal Principal name contains dot in first component\n");
!             rc = KRB5KRB_ERR_GENERIC;
!             goto cleanup;
!         }
      }
  
      i = krb5_princ_realm(ctx, client_principal)->length;
Index: openafs/src/WINNT/afsd/cm_btree.c
diff -c openafs/src/WINNT/afsd/cm_btree.c:1.1.2.6 openafs/src/WINNT/afsd/cm_btree.c:1.1.2.7
*** openafs/src/WINNT/afsd/cm_btree.c:1.1.2.6	Wed Sep 19 23:55:42 2007
--- openafs/src/WINNT/afsd/cm_btree.c	Thu Oct  4 10:13:10 2007
***************
*** 733,746 ****
               * options.  So we must determine if any of the next nodes
               * are the one we are looking for.
               */
!             Nptr dataNode = newNode;
  
              while ( next ) {
                  if (!comparekeys(B)(getfunkey(B), getdatakey(next), EXACT_MATCH)) {
                      /* we found the one to delete */
!                     getdatanext(dataNode) = getdatanext(next);
                      putFreeNode(B, next);
                  }
              }
              
              /* do not delete the key */
--- 733,749 ----
               * options.  So we must determine if any of the next nodes
               * are the one we are looking for.
               */
!             Nptr prev = newNode;
  
              while ( next ) {
                  if (!comparekeys(B)(getfunkey(B), getdatakey(next), EXACT_MATCH)) {
                      /* we found the one to delete */
!                     getdatanext(prev) = getdatanext(next);
                      putFreeNode(B, next);
+                     break;
                  }
+                 prev = next;
+                 next = getdatanext(next);
              }
              
              /* do not delete the key */
Index: openafs/src/WINNT/afsd/cm_callback.c
diff -c openafs/src/WINNT/afsd/cm_callback.c:1.41.4.19 openafs/src/WINNT/afsd/cm_callback.c:1.41.4.20
*** openafs/src/WINNT/afsd/cm_callback.c:1.41.4.19	Thu Sep 13 13:59:21 2007
--- openafs/src/WINNT/afsd/cm_callback.c	Sat Oct 20 00:03:04 2007
***************
*** 34,39 ****
--- 34,41 ----
  /* read/write lock for all global storage in this module */
  osi_rwlock_t cm_callbackLock;
  
+ afs_int32 cm_OfflineROIsValid = 0;
+ 
  #ifdef AFS_FREELANCE_CLIENT
  extern osi_mutex_t cm_Freelance_Lock;
  #endif
***************
*** 1487,1496 ****
      }
  #endif
  
!     if (scp->cbServerp != NULL)
  	return 1;
!     else 
          return 0;
  }
  
  /* need to detect a broken callback that races with our obtaining a callback.
--- 1489,1508 ----
      }
  #endif
  
!     if (scp->cbServerp != NULL) {
  	return 1;
!     } else if (cm_OfflineROIsValid) {
!         switch (cm_GetVolumeStatus(scp->volp, scp->fid.volume)) {
!         case vl_offline:
!         case vl_alldown:
!         case vl_unknown:
!             return 1;
!         default:
!             return 0;
!         }
!     } else {
          return 0;
+     }
  }
  
  /* need to detect a broken callback that races with our obtaining a callback.
Index: openafs/src/WINNT/afsd/cm_callback.h
diff -c openafs/src/WINNT/afsd/cm_callback.h:1.7.4.3 openafs/src/WINNT/afsd/cm_callback.h:1.7.4.4
*** openafs/src/WINNT/afsd/cm_callback.h:1.7.4.3	Thu Sep 13 13:59:21 2007
--- openafs/src/WINNT/afsd/cm_callback.h	Sat Oct 20 00:03:04 2007
***************
*** 72,75 ****
--- 72,76 ----
  
  extern void cm_GiveUpAllCallbacksAllServers(afs_int32 markDown);
  
+ extern afs_int32 cm_OfflineROIsValid;
  #endif /*  _CM_CALLBACK_H_ENV__ */
Index: openafs/src/WINNT/afsd/cm_cell.c
diff -c openafs/src/WINNT/afsd/cm_cell.c:1.23.2.6 openafs/src/WINNT/afsd/cm_cell.c:1.23.2.7
*** openafs/src/WINNT/afsd/cm_cell.c:1.23.2.6	Fri Jun 22 18:16:39 2007
--- openafs/src/WINNT/afsd/cm_cell.c	Wed Oct 10 11:22:14 2007
***************
*** 359,364 ****
--- 359,367 ----
              cellp->cellID = AFS_FAKE_ROOT_CELL_ID;
              cellp->vlServersp = NULL;
              cellp->flags = CM_CELLFLAG_FREELANCE;
+ 
+ 	    cm_AddCellToNameHashTable(cellp);
+ 	    cm_AddCellToIDHashTable(cellp);           
  #endif  
          } else {
              for (cellp = cm_data.allCellsp; cellp; cellp=cellp->allNextp) {
Index: openafs/src/WINNT/afsd/cm_freelance.c
diff -c openafs/src/WINNT/afsd/cm_freelance.c:1.33.2.2 openafs/src/WINNT/afsd/cm_freelance.c:1.33.2.3
*** openafs/src/WINNT/afsd/cm_freelance.c:1.33.2.2	Sun Jun 10 13:00:07 2007
--- openafs/src/WINNT/afsd/cm_freelance.c	Thu Oct 18 01:28:39 2007
***************
*** 1232,1254 ****
                osi_LogSaveString(afsd_logp,destination));
      
      if ( filename[0] == '\0' || destination[0] == '\0' )
!         return -1;
  
      fullname[0] = '\0';
      if (filename[0] == '.') {
          cm_GetCell_Gen(&filename[1], fullname, CM_FLAG_CREATE);
          if (stricmp(&filename[1],fullname) == 0)
!             return -1;
      } else {
          cm_GetCell_Gen(filename, fullname, CM_FLAG_CREATE);
          if (stricmp(filename,fullname) == 0)
!             return -1;
      }
  
  #if !defined(DJGPP)
      if ( cm_FreelanceMountPointExists(filename) ||
           cm_FreelanceSymlinkExists(filename) )
!         return -1;
  #endif
  
      lock_ObtainMutex(&cm_Freelance_Lock);
--- 1232,1254 ----
                osi_LogSaveString(afsd_logp,destination));
      
      if ( filename[0] == '\0' || destination[0] == '\0' )
!         return CM_ERROR_INVAL;
  
      fullname[0] = '\0';
      if (filename[0] == '.') {
          cm_GetCell_Gen(&filename[1], fullname, CM_FLAG_CREATE);
          if (stricmp(&filename[1],fullname) == 0)
!             return CM_ERROR_EXISTS;
      } else {
          cm_GetCell_Gen(filename, fullname, CM_FLAG_CREATE);
          if (stricmp(filename,fullname) == 0)
!             return CM_ERROR_EXISTS;
      }
  
  #if !defined(DJGPP)
      if ( cm_FreelanceMountPointExists(filename) ||
           cm_FreelanceSymlinkExists(filename) )
!         return CM_ERROR_EXISTS;
  #endif
  
      lock_ObtainMutex(&cm_Freelance_Lock);
Index: openafs/src/WINNT/afsd/cm_ioctl.c
diff -c openafs/src/WINNT/afsd/cm_ioctl.c:1.73.2.20 openafs/src/WINNT/afsd/cm_ioctl.c:1.73.2.26
*** openafs/src/WINNT/afsd/cm_ioctl.c:1.73.2.20	Wed Sep 19 23:55:42 2007
--- openafs/src/WINNT/afsd/cm_ioctl.c	Fri Oct 19 00:27:03 2007
***************
*** 217,224 ****
      long code;
  #ifndef AFSIFS
      cm_scache_t *substRootp = NULL;
  #endif
!     char * relativePath = ioctlp->inDatap;
  
      osi_Log1(afsd_logp, "cm_ParseIoctlPath %s", osi_LogSaveString(afsd_logp,relativePath));
  
--- 217,231 ----
      long code;
  #ifndef AFSIFS
      cm_scache_t *substRootp = NULL;
+     cm_scache_t *iscp = NULL;
  #endif
!     char * relativePath;
!     char * lastComponent = NULL;
!     afs_uint32 follow = 0;
! 
!     relativePath = ioctlp->inDatap;
!     /* setup the next data value for the caller to use */
!     ioctlp->inDatap += (long)strlen(ioctlp->inDatap) + 1;;
  
      osi_Log1(afsd_logp, "cm_ParseIoctlPath %s", osi_LogSaveString(afsd_logp,relativePath));
  
***************
*** 231,243 ****
       */
      TranslateExtendedChars(relativePath);
  
  #ifdef AFSIFS
      /* we have passed the whole path, including the afs prefix.
         when the pioctl call is made, we perform an ioctl to afsrdr
         and it returns the correct (full) path.  therefore, there is
         no drive letter, and the path is absolute. */
      code = cm_NameI(cm_data.rootSCachep, relativePath,
!                      CM_FLAG_CASEFOLD,
                       userp, "", reqp, scpp);
  
      if (code) {
--- 238,253 ----
       */
      TranslateExtendedChars(relativePath);
  
+     /* This is usually nothing, but for StatMountPoint it is the file name. */
+     TranslateExtendedChars(ioctlp->inDatap);
+ 
  #ifdef AFSIFS
      /* we have passed the whole path, including the afs prefix.
         when the pioctl call is made, we perform an ioctl to afsrdr
         and it returns the correct (full) path.  therefore, there is
         no drive letter, and the path is absolute. */
      code = cm_NameI(cm_data.rootSCachep, relativePath,
!                      CM_FLAG_CASEFOLD | follow,
                       userp, "", reqp, scpp);
  
      if (code) {
***************
*** 245,250 ****
--- 255,261 ----
  	return code;
      }
  #else /* AFSIFS */
+ 
      if (relativePath[0] == relativePath[1] &&
           relativePath[1] == '\\' && 
           !_strnicmp(cm_NetbiosName,relativePath+2,strlen(cm_NetbiosName))) 
***************
*** 281,288 ****
                  return code;
  	    }
  
!             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);
--- 292,313 ----
                  return code;
  	    }
  
! 	    lastComponent = strrchr(p, '\\');
! 	    if (lastComponent && (lastComponent - p) > 1 &&strlen(lastComponent) > 1) {
! 		*lastComponent = '\0';
! 		lastComponent++;
! 
! 		code = cm_NameI(substRootp, p, CM_FLAG_CASEFOLD | CM_FLAG_FOLLOW,
! 				 userp, NULL, reqp, &iscp);
! 		if (code == 0)
! 		    code = cm_NameI(iscp, lastComponent, CM_FLAG_CASEFOLD | CM_FLAG_NOMOUNTCHASE,
! 				    userp, NULL, reqp, scpp);
! 		if (iscp)
! 		    cm_ReleaseSCache(iscp);
! 	    } else {
! 		code = cm_NameI(substRootp, p, CM_FLAG_CASEFOLD,
! 				userp, NULL, reqp, scpp);
! 	    }
  	    cm_ReleaseSCache(substRootp);
              if (code) {
  		osi_Log1(afsd_logp,"cm_ParseIoctlPath [2] code 0x%x", code);
***************
*** 314,322 ****
                  return code;
  	    }
  
!             code = cm_NameI(substRootp, p, CM_FLAG_CASEFOLD | CM_FLAG_FOLLOW,
!                             userp, NULL, reqp, scpp);
!             if (code) {
  		cm_ReleaseSCache(substRootp);
  		osi_Log1(afsd_logp,"cm_ParseIoctlPath code [4] 0x%x", code);
                  return code;
--- 339,362 ----
                  return code;
  	    }
  
! 	    lastComponent = strrchr(p, '\\');
! 	    if (lastComponent && (lastComponent - p) > 1 &&strlen(lastComponent) > 1) {
! 		*lastComponent = '\0';
! 		lastComponent++;
! 
! 		code = cm_NameI(substRootp, p, CM_FLAG_CASEFOLD | CM_FLAG_FOLLOW,
! 				 userp, NULL, reqp, &iscp);
! 		if (code == 0)
! 		    code = cm_NameI(iscp, lastComponent, CM_FLAG_CASEFOLD | CM_FLAG_NOMOUNTCHASE,
! 				    userp, NULL, reqp, scpp);
! 		if (iscp)
! 		    cm_ReleaseSCache(iscp);
! 	    } else {
! 		code = cm_NameI(substRootp, p, CM_FLAG_CASEFOLD,
! 				userp, NULL, reqp, scpp);
! 	    }
! 
! 	    if (code) {
  		cm_ReleaseSCache(substRootp);
  		osi_Log1(afsd_logp,"cm_ParseIoctlPath code [4] 0x%x", code);
                  return code;
***************
*** 331,339 ****
              return code;
  	}
          
!         code = cm_NameI(substRootp, relativePath, 
!                          CM_FLAG_CASEFOLD,
!                          userp, NULL, reqp, scpp);
          if (code) {
  	    cm_ReleaseSCache(substRootp);
  	    osi_Log1(afsd_logp,"cm_ParseIoctlPath [7] code 0x%x", code);
--- 371,392 ----
              return code;
  	}
          
! 	lastComponent = strrchr(relativePath, '\\');
! 	if (lastComponent && (lastComponent - relativePath) > 1 && strlen(lastComponent) > 1) {
! 	    *lastComponent = '\0';
! 	    lastComponent++;
! 
! 	    code = cm_NameI(substRootp, relativePath, CM_FLAG_CASEFOLD | CM_FLAG_FOLLOW,
! 			     userp, NULL, reqp, &iscp);
! 	    if (code == 0)
! 		code = cm_NameI(iscp, lastComponent, CM_FLAG_CASEFOLD | CM_FLAG_NOMOUNTCHASE,
! 				 userp, NULL, reqp, scpp);
! 	    if (iscp)
! 		cm_ReleaseSCache(iscp);
! 	} else {
! 	    code = cm_NameI(substRootp, relativePath, CM_FLAG_CASEFOLD,
! 			     userp, NULL, reqp, scpp);
! 	}
          if (code) {
  	    cm_ReleaseSCache(substRootp);
  	    osi_Log1(afsd_logp,"cm_ParseIoctlPath [7] code 0x%x", code);
***************
*** 342,354 ****
      }
  #endif /* AFSIFS */
  
-     /* # of bytes of path */
-     code = (long)strlen(ioctlp->inDatap) + 1;
-     ioctlp->inDatap += code;
- 
-     /* This is usually nothing, but for StatMountPoint it is the file name. */
-     TranslateExtendedChars(ioctlp->inDatap);
- 
      if (substRootp)
  	cm_ReleaseSCache(substRootp);
  
--- 395,400 ----
***************
*** 537,561 ****
      if (code) return code;
  
      /* now make the get acl call */
!     fid.Volume = scp->fid.volume;
!     fid.Vnode = scp->fid.vnode;
!     fid.Unique = scp->fid.unique;
!     do {
!         acl.AFSOpaque_val = ioctlp->outDatap;
!         acl.AFSOpaque_len = 0;
!         code = cm_ConnFromFID(&scp->fid, userp, &req, &connp);
!         if (code) continue;
! 
!         callp = cm_GetRxConn(connp);
!         code = RXAFS_FetchACL(callp, &fid, &acl, &fileStatus, &volSync);
!         rx_PutConnection(callp);
! 
!     } while (cm_Analyze(connp, userp, &req, &scp->fid, &volSync, NULL, NULL, code));
!     code = cm_MapRPCError(code, &req);
!     cm_ReleaseSCache(scp);
  
!     if (code) return code;
  
      /* skip over return data */
      tlen = (int)strlen(ioctlp->outDatap) + 1;
      ioctlp->outDatap += tlen;
--- 583,614 ----
      if (code) return code;
  
      /* now make the get acl call */
! #ifdef AFS_FREELANCE_CLIENT
!     if ( scp->fid.cell == AFS_FAKE_ROOT_CELL_ID && scp->fid.volume == AFS_FAKE_ROOT_VOL_ID ) {
! 	code = 0;
!         ioctlp->outDatap[0] ='\0';
!     } else
! #endif
!     {
!         fid.Volume = scp->fid.volume;
!         fid.Vnode = scp->fid.vnode;
!         fid.Unique = scp->fid.unique;
!         do {
!             acl.AFSOpaque_val = ioctlp->outDatap;
!             acl.AFSOpaque_len = 0;
!             code = cm_ConnFromFID(&scp->fid, userp, &req, &connp);
!             if (code) continue;
! 
!             callp = cm_GetRxConn(connp);
!             code = RXAFS_FetchACL(callp, &fid, &acl, &fileStatus, &volSync);
!             rx_PutConnection(callp);
  
!         } while (cm_Analyze(connp, userp, &req, &scp->fid, &volSync, NULL, NULL, code));
!         code = cm_MapRPCError(code, &req);
!         cm_ReleaseSCache(scp);
  
+         if (code) return code;
+     }
      /* skip over return data */
      tlen = (int)strlen(ioctlp->outDatap) + 1;
      ioctlp->outDatap += tlen;
***************
*** 618,645 ****
      code = cm_ParseIoctlPath(ioctlp, userp, &req, &scp);
      if (code) return code;
  	
!     /* now make the get acl call */
!     fid.Volume = scp->fid.volume;
!     fid.Vnode = scp->fid.vnode;
!     fid.Unique = scp->fid.unique;
!     do {
!         acl.AFSOpaque_val = ioctlp->inDatap;
!         acl.AFSOpaque_len = (u_int)strlen(ioctlp->inDatap)+1;
!         code = cm_ConnFromFID(&scp->fid, userp, &req, &connp);
!         if (code) continue;
! 
!         callp = cm_GetRxConn(connp);
!         code = RXAFS_StoreACL(callp, &fid, &acl, &fileStatus, &volSync);
!         rx_PutConnection(callp);
! 
!     } while (cm_Analyze(connp, userp, &req, &scp->fid, &volSync, NULL, NULL, code));
!     code = cm_MapRPCError(code, &req);
! 
!     /* invalidate cache info, since we just trashed the ACL cache */
!     lock_ObtainMutex(&scp->mx);
!     cm_DiscardSCache(scp);
!     lock_ReleaseMutex(&scp->mx);
! 
      cm_ReleaseSCache(scp);
  
      return code;
--- 671,704 ----
      code = cm_ParseIoctlPath(ioctlp, userp, &req, &scp);
      if (code) return code;
  	
! #ifdef AFS_FREELANCE_CLIENT
!     if ( scp->fid.cell == AFS_FAKE_ROOT_CELL_ID && scp->fid.volume == AFS_FAKE_ROOT_VOL_ID ) {
! 	code = CM_ERROR_NOACCESS;
!     } else
! #endif
!     {
!         /* now make the get acl call */
!         fid.Volume = scp->fid.volume;
!         fid.Vnode = scp->fid.vnode;
!         fid.Unique = scp->fid.unique;
!         do {
!             acl.AFSOpaque_val = ioctlp->inDatap;
!             acl.AFSOpaque_len = (u_int)strlen(ioctlp->inDatap)+1;
!             code = cm_ConnFromFID(&scp->fid, userp, &req, &connp);
!             if (code) continue;
! 
!             callp = cm_GetRxConn(connp);
!             code = RXAFS_StoreACL(callp, &fid, &acl, &fileStatus, &volSync);
!             rx_PutConnection(callp);
! 
!         } while (cm_Analyze(connp, userp, &req, &scp->fid, &volSync, NULL, NULL, code));
!         code = cm_MapRPCError(code, &req);
! 
!         /* invalidate cache info, since we just trashed the ACL cache */
!         lock_ObtainMutex(&scp->mx);
!         cm_DiscardSCache(scp);
!         lock_ReleaseMutex(&scp->mx);
!     }
      cm_ReleaseSCache(scp);
  
      return code;
***************
*** 686,697 ****
      code = cm_ParseIoctlPath(ioctlp, userp, &req, &scp);
      if (code) return code;
          
!     volume = scp->fid.volume;
!     cell = scp->fid.cell;
!     cm_ReleaseSCache(scp);
! 
!     code = cm_FlushVolume(userp, &req, cell, volume);
  
      return code;
  }
  
--- 745,762 ----
      code = cm_ParseIoctlPath(ioctlp, userp, &req, &scp);
      if (code) return code;
          
! #ifdef AFS_FREELANCE_CLIENT
!     if ( scp->fid.cell == AFS_FAKE_ROOT_CELL_ID && scp->fid.volume == AFS_FAKE_ROOT_VOL_ID ) {
! 	code = CM_ERROR_NOACCESS;
!     } else
! #endif
!     {
!         volume = scp->fid.volume;
!         cell = scp->fid.cell;
!         cm_ReleaseSCache(scp);
  
+         code = cm_FlushVolume(userp, &req, cell, volume);
+     }
      return code;
  }
  
***************
*** 706,712 ****
      code = cm_ParseIoctlPath(ioctlp, userp, &req, &scp);
      if (code) return code;
          
!     cm_FlushFile(scp, userp, &req);
      cm_ReleaseSCache(scp);
  
      return 0;
--- 771,784 ----
      code = cm_ParseIoctlPath(ioctlp, userp, &req, &scp);
      if (code) return code;
          
! #ifdef AFS_FREELANCE_CLIENT
!     if ( scp->fid.cell == AFS_FAKE_ROOT_CELL_ID && scp->fid.volume == AFS_FAKE_ROOT_VOL_ID ) {
! 	code = CM_ERROR_NOACCESS;
!     } else
! #endif
!     {
!         cm_FlushFile(scp, userp, &req);
!     }
      cm_ReleaseSCache(scp);
  
      return 0;
***************
*** 733,785 ****
      code = cm_ParseIoctlPath(ioctlp, userp, &req, &scp);
      if (code) return code;
  
!     cellp = cm_FindCellByID(scp->fid.cell);
!     osi_assert(cellp);
! 
!     if (scp->flags & CM_SCACHEFLAG_RO) {
!         cm_ReleaseSCache(scp);
!         return CM_ERROR_READONLY;
!     }
  
!     code = cm_GetVolumeByID(cellp, scp->fid.volume, userp, &req, 
!                             CM_GETVOL_FLAG_CREATE, &tvp);
!     if (code) {
!         cm_ReleaseSCache(scp);
!         return code;
!     }
!     cm_PutVolume(tvp);
  
!     /* Copy the junk out, using cp as a roving pointer. */
!     cp = ioctlp->inDatap;
!     memcpy((char *)&volStat, cp, sizeof(AFSFetchVolumeStatus));
!     cp += sizeof(AFSFetchVolumeStatus);
!     StringCbCopyA(volName, sizeof(volName), cp);
!     cp += strlen(volName)+1;
!     StringCbCopyA(offLineMsg, sizeof(offLineMsg), cp);
!     cp +=  strlen(offLineMsg)+1;
!     StringCbCopyA(motd, sizeof(motd), cp);
!     storeStat.Mask = 0;
!     if (volStat.MinQuota != -1) {
!         storeStat.MinQuota = volStat.MinQuota;
!         storeStat.Mask |= AFS_SETMINQUOTA;
!     }
!     if (volStat.MaxQuota != -1) {
!         storeStat.MaxQuota = volStat.MaxQuota;
!         storeStat.Mask |= AFS_SETMAXQUOTA;
!     }
! 
!     do {
!         code = cm_ConnFromFID(&scp->fid, userp, &req, &tcp);
!         if (code) continue;
! 
!         callp = cm_GetRxConn(tcp);
!         code = RXAFS_SetVolumeStatus(callp, scp->fid.volume,
!                                       &storeStat, volName, offLineMsg, motd);
!         rx_PutConnection(callp);
  
!     } while (cm_Analyze(tcp, userp, &req, &scp->fid, NULL, NULL, NULL, code));
!     code = cm_MapRPCError(code, &req);
  
      /* return on failure */
      cm_ReleaseSCache(scp);
      if (code) {
--- 805,864 ----
      code = cm_ParseIoctlPath(ioctlp, userp, &req, &scp);
      if (code) return code;
  
! #ifdef AFS_FREELANCE_CLIENT
!     if ( scp->fid.cell == AFS_FAKE_ROOT_CELL_ID && scp->fid.volume == AFS_FAKE_ROOT_VOL_ID ) {
! 	code = CM_ERROR_NOACCESS;
!     } else
! #endif
!     {
!         cellp = cm_FindCellByID(scp->fid.cell);
!         osi_assert(cellp);
  
!         if (scp->flags & CM_SCACHEFLAG_RO) {
!             cm_ReleaseSCache(scp);
!             return CM_ERROR_READONLY;
!         }
  
!         code = cm_GetVolumeByID(cellp, scp->fid.volume, userp, &req, 
!                                  CM_GETVOL_FLAG_CREATE, &tvp);
!         if (code) {
!             cm_ReleaseSCache(scp);
!             return code;
!         }
!         cm_PutVolume(tvp);
  
!         /* Copy the junk out, using cp as a roving pointer. */
!         cp = ioctlp->inDatap;
!         memcpy((char *)&volStat, cp, sizeof(AFSFetchVolumeStatus));
!         cp += sizeof(AFSFetchVolumeStatus);
!         StringCbCopyA(volName, sizeof(volName), cp);
!         cp += strlen(volName)+1;
!         StringCbCopyA(offLineMsg, sizeof(offLineMsg), cp);
!         cp +=  strlen(offLineMsg)+1;
!         StringCbCopyA(motd, sizeof(motd), cp);
!         storeStat.Mask = 0;
!         if (volStat.MinQuota != -1) {
!             storeStat.MinQuota = volStat.MinQuota;
!             storeStat.Mask |= AFS_SETMINQUOTA;
!         }
!         if (volStat.MaxQuota != -1) {
!             storeStat.MaxQuota = volStat.MaxQuota;
!             storeStat.Mask |= AFS_SETMAXQUOTA;
!         }
! 
!         do {
!             code = cm_ConnFromFID(&scp->fid, userp, &req, &tcp);
!             if (code) continue;
! 
!             callp = cm_GetRxConn(tcp);
!             code = RXAFS_SetVolumeStatus(callp, scp->fid.volume,
!                                           &storeStat, volName, offLineMsg, motd);
!             rx_PutConnection(callp);
  
+         } while (cm_Analyze(tcp, userp, &req, &scp->fid, NULL, NULL, NULL, code));
+         code = cm_MapRPCError(code, &req);
+     }
+     
      /* return on failure */
      cm_ReleaseSCache(scp);
      if (code) {
***************
*** 827,846 ****
      code = cm_ParseIoctlPath(ioctlp, userp, &req, &scp);
      if (code) return code;
  
!     Name = volName;
!     OfflineMsg = offLineMsg;
!     MOTD = motd;
!     do {
!         code = cm_ConnFromFID(&scp->fid, userp, &req, &connp);
!         if (code) continue;
! 
!         callp = cm_GetRxConn(connp);
!         code = RXAFS_GetVolumeStatus(callp, scp->fid.volume,
!                                       &volStat, &Name, &OfflineMsg, &MOTD);
!         rx_PutConnection(callp);
  
!     } while (cm_Analyze(connp, userp, &req, &scp->fid, NULL, NULL, NULL, code));
!     code = cm_MapRPCError(code, &req);
  
      cm_ReleaseSCache(scp);
      if (code) return code;
--- 906,940 ----
      code = cm_ParseIoctlPath(ioctlp, userp, &req, &scp);
      if (code) return code;
  
! #ifdef AFS_FREELANCE_CLIENT
!     if ( scp->fid.cell == AFS_FAKE_ROOT_CELL_ID && scp->fid.volume == AFS_FAKE_ROOT_VOL_ID ) {
! 	code = 0;
! 	strncpy(volName, "Freelance.Local.Root", sizeof(volName));
! 	offLineMsg[0] = '\0';
! 	strncpy(motd, "Freelance mode in use.", sizeof(motd));
! 	volStat.Vid = scp->fid.volume;
! 	volStat.MaxQuota = 0;
! 	volStat.BlocksInUse = 100;
! 	volStat.PartBlocksAvail = 0;
! 	volStat.PartMaxBlocks = 100;
!     } else
! #endif
!     {
! 	Name = volName;
! 	OfflineMsg = offLineMsg;
! 	MOTD = motd;
! 	do {
! 	    code = cm_ConnFromFID(&scp->fid, userp, &req, &connp);
! 	    if (code) continue;
! 
! 	    callp = cm_GetRxConn(connp);
! 	    code = RXAFS_GetVolumeStatus(callp, scp->fid.volume,
! 					 &volStat, &Name, &OfflineMsg, &MOTD);
! 	    rx_PutConnection(callp);
  
! 	} while (cm_Analyze(connp, userp, &req, &scp->fid, NULL, NULL, NULL, code));
! 	code = cm_MapRPCError(code, &req);
!     }
  
      cm_ReleaseSCache(scp);
      if (code) return code;
***************
*** 947,953 ****
  	return CM_ERROR_NOSUCHCELL;
  
      code = cm_GetVolumeByID(cellp, volume, userp, &req, CM_GETVOL_FLAG_CREATE, &tvp);
!     if (code) return code;
  	
      cp = ioctlp->outDatap;
          
--- 1041,1048 ----
  	return CM_ERROR_NOSUCHCELL;
  
      code = cm_GetVolumeByID(cellp, volume, userp, &req, CM_GETVOL_FLAG_CREATE, &tvp);
!     if (code) 
!         return code;
  	
      cp = ioctlp->outDatap;
          
***************
*** 1120,1126 ****
      if (haveCell) {
          /* have cell name, too */
          cellp = cm_GetCell(cp, 0);
!         if (!cellp) return CM_ERROR_NOSUCHCELL;
      }
      else cellp = (cm_cell_t *) 0;
      if (!cellp && (temp & 2)) {
--- 1215,1222 ----
      if (haveCell) {
          /* have cell name, too */
          cellp = cm_GetCell(cp, 0);
!         if (!cellp) 
!             return CM_ERROR_NOSUCHCELL;
      }
      else cellp = (cm_cell_t *) 0;
      if (!cellp && (temp & 2)) {
***************
*** 1652,1658 ****
      cm_InitReq(&req);
          
      code = cm_ParseIoctlParent(ioctlp, userp, &req, &dscp, leaf);
!     if (code) return code;
  
      /* Translate chars for the mount point name */
      TranslateExtendedChars(leaf);
--- 1748,1755 ----
      cm_InitReq(&req);
          
      code = cm_ParseIoctlParent(ioctlp, userp, &req, &dscp, leaf);
!     if (code) 
!         return code;
  
      /* Translate chars for the mount point name */
      TranslateExtendedChars(leaf);
***************
*** 1677,1684 ****
          if (code && cm_dnsEnabled)
              code = cm_SearchCellByDNS(cell, fullCell, &ttl, 0, 0);
  #endif
!         if (code)
              return CM_ERROR_NOSUCHCELL;
  	
          StringCbPrintfA(mpInfo, sizeof(mpInfo), "%c%s:%s", *ioctlp->inDatap, fullCell, volume);
      } else {
--- 1774,1783 ----
          if (code && cm_dnsEnabled)
              code = cm_SearchCellByDNS(cell, fullCell, &ttl, 0, 0);
  #endif
!         if (code) {
!             cm_ReleaseSCache(dscp);
              return CM_ERROR_NOSUCHCELL;
+         }
  	
          StringCbPrintfA(mpInfo, sizeof(mpInfo), "%c%s:%s", *ioctlp->inDatap, fullCell, volume);
      } else {
***************
*** 2068,2074 ****
  
          /* cell name */
          cellp = cm_GetCell(tp, CM_FLAG_CREATE);
!         if (!cellp) return CM_ERROR_NOSUCHCELL;
          tp += strlen(tp) + 1;
  
          /* user name */
--- 2167,2174 ----
  
          /* cell name */
          cellp = cm_GetCell(tp, CM_FLAG_CREATE);
!         if (!cellp) 
!             return CM_ERROR_NOSUCHCELL;
          tp += strlen(tp) + 1;
  
          /* user name */
***************
*** 2348,2354 ****
  
      /* cell name is right here */
      cellp = cm_GetCell(ioctlp->inDatap, 0);
!     if (!cellp) return CM_ERROR_NOSUCHCELL;
  
      lock_ObtainMutex(&userp->mx);
  
--- 2448,2455 ----
  
      /* cell name is right here */
      cellp = cm_GetCell(ioctlp->inDatap, 0);
!     if (!cellp) 
!         return CM_ERROR_NOSUCHCELL;
  
      lock_ObtainMutex(&userp->mx);
  
***************
*** 2842,2883 ****
      if (code) 
          return code;
          
!     volume = scp->fid.volume;
  
!     cellp = cm_FindCellByID(scp->fid.cell);
  
!     cm_ReleaseSCache(scp);
  
!     if (!cellp)
! 	return CM_ERROR_NOSUCHCELL;
  
!     code = cm_GetVolumeByID(cellp, volume, userp, &req, CM_GETVOL_FLAG_CREATE, &tvp);
!     if (code) 
!         return code;
  	
!     if (volume == tvp->rw.ID)
!         statep = &tvp->rw;
!     else if (volume == tvp->ro.ID)
!         statep = &tvp->ro;
!     else
!         statep = &tvp->bk;
! 
!     switch (statep->state) {
!     case vl_online:
!     case vl_unknown:
!         code = 0;
!         break;
!     case vl_busy:
!         code = CM_ERROR_ALLBUSY;
!         break;
!     case vl_offline:
!         code = CM_ERROR_ALLOFFLINE;
!         break;
!     case vl_alldown:
!         code = CM_ERROR_ALLDOWN;
!         break;
      }
-     cm_PutVolume(tvp);
      return code;
  }       
  
--- 2943,2992 ----
      if (code) 
          return code;
          
! #ifdef AFS_FREELANCE_CLIENT
!     if ( scp->fid.cell == AFS_FAKE_ROOT_CELL_ID && scp->fid.volume == AFS_FAKE_ROOT_VOL_ID ) {
! 	code = 0;
! 	cm_ReleaseSCache(scp);
!     } else
! #endif
!     {
!         volume = scp->fid.volume;
  
!         cellp = cm_FindCellByID(scp->fid.cell);
  
!         cm_ReleaseSCache(scp);
  
!         if (!cellp)
!             return CM_ERROR_NOSUCHCELL;
  
!         code = cm_GetVolumeByID(cellp, volume, userp, &req, CM_GETVOL_FLAG_CREATE, &tvp);
!         if (code) 
!             return code;
  	
!         if (volume == tvp->rw.ID)
!             statep = &tvp->rw;
!         else if (volume == tvp->ro.ID)
!             statep = &tvp->ro;
!         else
!             statep = &tvp->bk;
! 
!         switch (statep->state) {
!         case vl_online:
!         case vl_unknown:
!             code = 0;
!             break;
!         case vl_busy:
!             code = CM_ERROR_ALLBUSY;
!             break;
!         case vl_offline:
!             code = CM_ERROR_ALLOFFLINE;
!             break;
!         case vl_alldown:
!             code = CM_ERROR_ALLDOWN;
!             break;
!         }
!         cm_PutVolume(tvp);
      }
      return code;
  }       
  
Index: openafs/src/WINNT/afsd/cm_volume.c
diff -c openafs/src/WINNT/afsd/cm_volume.c:1.14.4.15 openafs/src/WINNT/afsd/cm_volume.c:1.14.4.17
*** openafs/src/WINNT/afsd/cm_volume.c:1.14.4.15	Thu Aug 23 12:49:03 2007
--- openafs/src/WINNT/afsd/cm_volume.c	Sat Oct 20 00:03:06 2007
***************
*** 188,193 ****
--- 188,196 ----
      enum volstatus rwNewstate = vl_online;
      enum volstatus roNewstate = vl_online;
      enum volstatus bkNewstate = vl_online;
+ #ifdef AFS_FREELANCE_CLIENT
+     int freelance = 0;
+ #endif
  
      /* clear out old bindings */
      if (volp->rw.serversp)
***************
*** 198,205 ****
          cm_FreeServerList(&volp->bk.serversp, CM_FREESERVERLIST_DELETE);
  
  #ifdef AFS_FREELANCE_CLIENT
!     if ( cellp->cellID == AFS_FAKE_ROOT_CELL_ID && atoi(volp->namep)==AFS_FAKE_ROOT_VOL_ID ) 
      {
          memset(&vldbEntry, 0, sizeof(vldbEntry));
          vldbEntry.flags |= VLF_RWEXISTS;
          vldbEntry.volumeId[0] = AFS_FAKE_ROOT_VOL_ID;
--- 201,209 ----
          cm_FreeServerList(&volp->bk.serversp, CM_FREESERVERLIST_DELETE);
  
  #ifdef AFS_FREELANCE_CLIENT
!     if ( cellp->cellID == AFS_FAKE_ROOT_CELL_ID && volp->rw.ID == AFS_FAKE_ROOT_VOL_ID ) 
      {
+ 	freelance = 1;
          memset(&vldbEntry, 0, sizeof(vldbEntry));
          vldbEntry.flags |= VLF_RWEXISTS;
          vldbEntry.volumeId[0] = AFS_FAKE_ROOT_VOL_ID;
***************
*** 289,294 ****
--- 293,303 ----
          afs_int32 bkServers_alldown = 1;
          char      name[VL_MAXNAMELEN];
  
+ #ifdef AFS_FREELANCE_CLIENT
+ 	if (freelance)
+ 	    rwServers_alldown = 0;
+ #endif
+ 
          switch ( method ) {
          case 0:
              flags = vldbEntry.flags;
***************
*** 631,637 ****
      /* otherwise, we didn't find it so consult the VLDB */
      sprintf(volNameString, "%u", volumeID);
      code = cm_GetVolumeByName(cellp, volNameString, userp, reqp,
! 			       flags, outVolpp);
      return code;
  }
  
--- 640,646 ----
      /* otherwise, we didn't find it so consult the VLDB */
      sprintf(volNameString, "%u", volumeID);
      code = cm_GetVolumeByName(cellp, volNameString, userp, reqp,
! 			      flags, outVolpp);
      return code;
  }
  
***************
*** 1475,1477 ****
--- 1484,1500 ----
  
      cm_VolStatus_Change_Notification(volp->cellp->cellID, volID, new);
  }       
+ 
+ enum volstatus cm_GetVolumeStatus(cm_volume_t *volp, afs_uint32 volID)
+ {
+     if (volp->rw.ID == volID) {
+         return volp->rw.state;
+     } else if (volp->ro.ID == volID) {
+         return volp->ro.state;
+     } else if (volp->bk.ID == volID) {
+         return volp->bk.state;
+     } else {
+         return vl_unknown;
+     }
+ }
+ 
Index: openafs/src/WINNT/afsd/cm_volume.h
diff -c openafs/src/WINNT/afsd/cm_volume.h:1.5.6.4 openafs/src/WINNT/afsd/cm_volume.h:1.5.6.5
*** openafs/src/WINNT/afsd/cm_volume.h:1.5.6.4	Tue Jun 12 11:38:43 2007
--- openafs/src/WINNT/afsd/cm_volume.h	Sat Oct 20 00:03:06 2007
***************
*** 118,121 ****
--- 118,122 ----
  
  extern void cm_VolumeStatusNotification(cm_volume_t * volp, afs_uint32 volID, enum volstatus old, enum volstatus new);
  
+ extern enum volstatus cm_GetVolumeStatus(cm_volume_t *volp, afs_uint32 volID);
  #endif /*  __CM_VOLUME_H_ENV__ */
Index: openafs/src/WINNT/afsd/fs.c
diff -c openafs/src/WINNT/afsd/fs.c:1.32.4.12 openafs/src/WINNT/afsd/fs.c:1.32.4.13
*** openafs/src/WINNT/afsd/fs.c:1.32.4.12	Fri Jul 27 23:04:37 2007
--- openafs/src/WINNT/afsd/fs.c	Tue Oct 16 13:26:08 2007
***************
*** 3539,3557 ****
      struct ViceIoctl blob;
      char * uuidstring = NULL;
  
  #ifdef WIN32
!     if ( !IsAdmin() ) {
!         fprintf (stderr,"Permission denied: requires AFS Client Administrator access.\n");
!         return EACCES;
!     }
  #else
!     if (geteuid()) {
!         fprintf (stderr, "Permission denied: requires root access.\n");
!         return EACCES;
!     }
  #endif
- 
-     if (asp->parms[0].items) {
          inValue = 1;            /* generate new UUID */
      } else {
          inValue = 0;            /* just show the current UUID */
--- 3539,3556 ----
      struct ViceIoctl blob;
      char * uuidstring = NULL;
  
+     if (asp->parms[0].items) {
  #ifdef WIN32
!         if ( !IsAdmin() ) {
!             fprintf (stderr,"Permission denied: requires AFS Client Administrator access.\n");
!             return EACCES;
!         }
  #else
!         if (geteuid()) {
!             fprintf (stderr, "Permission denied: requires root access.\n");
!             return EACCES;
!         }
  #endif
          inValue = 1;            /* generate new UUID */
      } else {
          inValue = 0;            /* just show the current UUID */
Index: openafs/src/WINNT/afsd/lanahelper.cpp
diff -c openafs/src/WINNT/afsd/lanahelper.cpp:1.12.2.4 openafs/src/WINNT/afsd/lanahelper.cpp:1.12.2.5
*** openafs/src/WINNT/afsd/lanahelper.cpp:1.12.2.4	Tue Jun 19 01:25:40 2007
--- openafs/src/WINNT/afsd/lanahelper.cpp	Mon Oct  1 16:03:44 2007
***************
*** 450,455 ****
--- 450,456 ----
  
      rv = RegOpenKeyEx(HKEY_LOCAL_MACHINE,AFSREG_CLT_SVC_PARAM_SUBKEY,0,KEY_READ,&hkConfig);
      if (rv == ERROR_SUCCESS) {
+ 	dummyLen = sizeof(regLana);
          rv = RegQueryValueEx(hkConfig, szForceLanaLoopback, NULL, NULL, (LPBYTE) &regLana, &dummyLen);
          RegCloseKey(hkConfig);
  
Index: openafs/src/WINNT/afsd/smb.c
diff -c openafs/src/WINNT/afsd/smb.c:1.118.2.43 openafs/src/WINNT/afsd/smb.c:1.118.2.45
*** openafs/src/WINNT/afsd/smb.c:1.118.2.43	Tue Sep 18 12:59:23 2007
--- openafs/src/WINNT/afsd/smb.c	Sun Oct 21 23:33:20 2007
***************
*** 12,18 ****
--- 12,21 ----
  
  #ifndef DJGPP
  #include <windows.h>
+ #pragma warning(push)
+ #pragma warning(disable: 4005)
  #include <ntstatus.h>
+ #pragma warning(pop)
  #else
  #include <sys/timeb.h>
  #include <tzfile.h>
***************
*** 6046,6051 ****
--- 6049,6055 ----
      cm_scache_t *dscp = NULL;
      char *pathp = NULL;
      cm_scache_t * scp = NULL;
+     cm_scache_t *delscp = NULL;
      int deleted = 0;
      int nullcreator = 0;
  
***************
*** 6153,6160 ****
          char *fullPathp;
  
  	lock_ReleaseMutex(&fidp->mx);
!         smb_FullName(dscp, scp, pathp, &fullPathp, userp, &req);
!         if (scp->fileType == CM_SCACHETYPE_DIRECTORY) {
              code = cm_RemoveDir(dscp, fullPathp, userp, &req);
  	    if (code == 0) {
  		deleted = 1;
--- 6157,6170 ----
          char *fullPathp;
  
  	lock_ReleaseMutex(&fidp->mx);
! 
!         code = cm_Lookup(dscp, pathp, CM_FLAG_NOMOUNTCHASE, userp, &req, &delscp);
!         if (code) {
!             cm_HoldSCache(scp);
!             delscp = scp;
!         }
!         smb_FullName(dscp, delscp, pathp, &fullPathp, userp, &req);
!         if (delscp->fileType == CM_SCACHETYPE_DIRECTORY) {
              code = cm_RemoveDir(dscp, fullPathp, userp, &req);
  	    if (code == 0) {
  		deleted = 1;
***************
*** 6210,6225 ****
      if (dscp)
  	cm_ReleaseSCache(dscp);
  
!     if (scp) {
! 	if (deleted || nullcreator) {
! 	    lock_ObtainMutex(&scp->mx);
! 	    if (nullcreator && scp->creator == userp)
! 		scp->creator = NULL;
  	    if (deleted)
! 		scp->flags |= CM_SCACHEFLAG_DELETED;
! 	    lock_ReleaseMutex(&scp->mx);
  	}
  	lock_ObtainMutex(&scp->mx);
  	scp->flags &= ~CM_SCACHEFLAG_SMB_FID;
  	lock_ReleaseMutex(&scp->mx);
  	cm_ReleaseSCache(scp);
--- 6220,6239 ----
      if (dscp)
  	cm_ReleaseSCache(dscp);
  
!     if (delscp) {
! 	if (deleted) {
! 	    lock_ObtainMutex(&delscp->mx);
  	    if (deleted)
! 		delscp->flags |= CM_SCACHEFLAG_DELETED;
! 	    lock_ReleaseMutex(&delscp->mx);
  	}
+         cm_ReleaseSCache(delscp);
+     }
+ 
+     if (scp) {
  	lock_ObtainMutex(&scp->mx);
+         if (nullcreator && scp->creator == userp)
+             scp->creator = NULL;
  	scp->flags &= ~CM_SCACHEFLAG_SMB_FID;
  	lock_ReleaseMutex(&scp->mx);
  	cm_ReleaseSCache(scp);
Index: openafs/src/WINNT/afsd/smb3.c
diff -c openafs/src/WINNT/afsd/smb3.c:1.95.2.46 openafs/src/WINNT/afsd/smb3.c:1.95.2.47
*** openafs/src/WINNT/afsd/smb3.c:1.95.2.46	Wed Sep 19 17:29:29 2007
--- openafs/src/WINNT/afsd/smb3.c	Thu Oct 18 01:29:09 2007
***************
*** 12,21 ****
--- 12,24 ----
  
  #ifndef DJGPP
  #include <windows.h>
+ #pragma warning(push)
+ #pragma warning(disable: 4005)
  #include <ntstatus.h>
  #define SECURITY_WIN32
  #include <security.h>
  #include <lmaccess.h>
+ #pragma warning(pop)
  #endif /* !DJGPP */
  #include <stdlib.h>
  #include <malloc.h>
***************
*** 3967,3973 ****
      return code;
  }
  
- #ifndef USE_OLD_MATCHING
  // char table for case insensitive comparison
  char mapCaseTable[256];
  
--- 3970,3975 ----
***************
*** 4091,4235 ****
      return retval;
  }
  
- #else /* USE_OLD_MATCHING */
- /* do a case-folding search of the star name mask with the name in namep.
-  * Return 1 if we match, otherwise 0.
-  */
- int smb_V3MatchMask(char *namep, char *maskp, int flags)
- {
-     unsigned char tcp1, tcp2;	/* Pattern characters */
-     unsigned char tcn1;		/* Name characters */
-     int sawDot = 0, sawStar = 0, req8dot3 = 0;
-     char *starNamep, *starMaskp;
-     static char nullCharp[] = {0};
-     int casefold = flags & CM_FLAG_CASEFOLD;
- 
-     /* make sure we only match 8.3 names, if requested */
-     req8dot3 = (flags & CM_FLAG_8DOT3);
-     if (req8dot3 && !cm_Is8Dot3(namep)) 
-         return 0;
- 
-     /* loop */
-     while (1) {
-         /* Next pattern character */
-         tcp1 = *maskp++;
- 
-         /* Next name character */
-         tcn1 = *namep;
- 
-         if (tcp1 == 0) {
-             /* 0 - end of pattern */
-             if (tcn1 == 0)
-                 return 1;
-             else
-                 return 0;
-         }
-         else if (tcp1 == '.' || tcp1 == '"') {
-             if (sawDot) {
-                 if (tcn1 == '.') {
-                     namep++;
-                     continue;
-                 } else
-                     return 0;
-             }
-             else {
-                 /*
-                  * first dot in pattern;
-                  * must match dot or end of name
-                  */
-                 sawDot = 1;
-                 if (tcn1 == 0)
-                     continue;
-                 else if (tcn1 == '.') {
-                     sawStar = 0;
-                     namep++;
-                     continue;
-                 }
-                 else
-                     return 0;
-             }
-         }
-         else if (tcp1 == '?') {
-             if (tcn1 == 0 || tcn1 == '.')
-                 return 0;
-             namep++;
-             continue;
-         }
-         else if (tcp1 == '>') {
-             if (tcn1 != 0 && tcn1 != '.')
-                 namep++;
-             continue;
-         }
-         else if (tcp1 == '*' || tcp1 == '<') {
-             tcp2 = *maskp++;
-             if (tcp2 == 0)
-                 return 1;
-             else if ((req8dot3 && tcp2 == '.') || tcp2 == '"') {
-                 while (req8dot3 && tcn1 != '.' && tcn1 != 0)
-                     tcn1 = *++namep;
-                 if (tcn1 == 0) {
-                     if (sawDot)
-                         return 0;
-                     else
-                         continue;
-                 }
-                 else {
-                     namep++;
-                     continue;
-                 }
-             }
-             else {
-                 /*
-                  * pattern character after '*' is not null or
-                  * period.  If it is '?' or '>', we are not
-                  * going to understand it.  If it is '*' or
-                  * '<', we are going to skip over it.  None of
-                  * these are likely, I hope.
-                  */
-                 /* skip over '*' and '<' */
-                 while (tcp2 == '*' || tcp2 == '<')
-                     tcp2 = *maskp++;
- 
-                 /* skip over characters that don't match tcp2 */
-                 while (req8dot3 && tcn1 != '.' && tcn1 != 0 && 
-                         ((casefold && cm_foldUpper[tcn1] != cm_foldUpper[tcp2]) || 
-                           (!casefold && tcn1 != tcp2)))
-                     tcn1 = *++namep;
- 
-                 /* No match */
-                 if ((req8dot3 && tcn1 == '.') || tcn1 == 0)
-                     return 0;
- 
-                 /* Remember where we are */
-                 sawStar = 1;
-                 starMaskp = maskp;
-                 starNamep = namep;
- 
-                 namep++;
-                 continue;
-             }
-         }
-         else {
-             /* tcp1 is not a wildcard */
-             if ((casefold && cm_foldUpper[tcn1] == cm_foldUpper[tcp1]) || 
-                  (!casefold && tcn1 == tcp1)) {
-                 /* they match */
-                 namep++;
-                 continue;
-             }
-             /* if trying to match a star pattern, go back */
-             if (sawStar) {
-                 maskp = starMaskp - 2;
-                 namep = starNamep + 1;
-                 sawStar = 0;
-                 continue;
-             }
-             /* that's all */
-             return 0;
-         }
-     }
- }
- #endif /* USE_OLD_MATCHING */
  
  /* smb_ReceiveTran2SearchDir implements both 
   * Tran2_Find_First and Tran2_Find_Next
--- 4093,4098 ----
***************
*** 4734,4742 ****
              /* we only failover if we see a CM_ERROR_NOSUCHFILE */
              if (code != CM_ERROR_NOSUCHFILE) {
  #ifdef USE_BPLUS
                  if (code == CM_ERROR_BPLUS_NOMATCH)
                      code = CM_ERROR_NOSUCHFILE;
! #endif
                  return code;
              }
          }
--- 4597,4606 ----
              /* we only failover if we see a CM_ERROR_NOSUCHFILE */
              if (code != CM_ERROR_NOSUCHFILE) {
  #ifdef USE_BPLUS
+                 /* unless we are using the BPlusTree */
                  if (code == CM_ERROR_BPLUS_NOMATCH)
                      code = CM_ERROR_NOSUCHFILE;
! #endif /* USE_BPLUS */
                  return code;
              }
          }
***************
*** 5115,5148 ****
          /* compute offset of cookie representing next entry */
          nextEntryCookie = curOffset.LowPart + (CM_DIR_CHUNKSIZE * numDirChunks);
  
          /* Need 8.3 name? */
          NeedShortName = 0;
!         if (infoLevel == SMB_FIND_FILE_BOTH_DIRECTORY_INFO
!              && dep->fid.vnode != 0
!              && !cm_Is8Dot3(dep->name)) {
              cm_Gen8Dot3Name(dep, shortName, &shortNameEnd);
              NeedShortName = 1;
          }
  
          osi_Log4(smb_logp, "T2 search dir vn %u uniq %u name %s (%s)",
                    dep->fid.vnode, dep->fid.unique, 
! 		  osi_LogSaveString(smb_logp, dep->name),
                    NeedShortName ? osi_LogSaveString(smb_logp, shortName) : "");
  
          /* When matching, we are using doing a case fold if we have a wildcard mask.
           * If we get a non-wildcard match, it's a lookup for a specific file. 
           */
!         if (dep->fid.vnode != 0 && 
!             (smb_V3MatchMask(dep->name, maskp, (starPattern? CM_FLAG_CASEFOLD : 0)) ||
!              (NeedShortName &&
!               smb_V3MatchMask(shortName, maskp, CM_FLAG_CASEFOLD)))) {
! 
              /* Eliminate entries that don't match requested attributes */
              if (smb_hideDotFiles && !(dsp->attribute & SMB_ATTR_HIDDEN) && 
                   smb_IsDotFile(dep->name)) {
                  osi_Log0(smb_logp, "T2 search dir skipping hidden");
                  goto nextEntry; /* no hidden files */
              }
              if (!(dsp->attribute & SMB_ATTR_DIRECTORY))  /* no directories */
              {
                  /* We have already done the cm_TryBulkStat above */
--- 4979,5013 ----
          /* compute offset of cookie representing next entry */
          nextEntryCookie = curOffset.LowPart + (CM_DIR_CHUNKSIZE * numDirChunks);
  
+         if (dep->fid.vnode == 0) 
+             goto nextEntry;             /* This entry is not in use */
+ 
          /* Need 8.3 name? */
          NeedShortName = 0;
!         if (infoLevel == SMB_FIND_FILE_BOTH_DIRECTORY_INFO && 
!              !cm_Is8Dot3(dep->name)) {
              cm_Gen8Dot3Name(dep, shortName, &shortNameEnd);
              NeedShortName = 1;
          }
  
          osi_Log4(smb_logp, "T2 search dir vn %u uniq %u name %s (%s)",
                    dep->fid.vnode, dep->fid.unique, 
!                   osi_LogSaveString(smb_logp, dep->name),
                    NeedShortName ? osi_LogSaveString(smb_logp, shortName) : "");
  
          /* When matching, we are using doing a case fold if we have a wildcard mask.
           * If we get a non-wildcard match, it's a lookup for a specific file. 
           */
!         if (smb_V3MatchMask(dep->name, maskp, (starPattern? CM_FLAG_CASEFOLD : 0)) ||
!              (NeedShortName && smb_V3MatchMask(shortName, maskp, CM_FLAG_CASEFOLD))) 
!         {
              /* Eliminate entries that don't match requested attributes */
              if (smb_hideDotFiles && !(dsp->attribute & SMB_ATTR_HIDDEN) && 
                   smb_IsDotFile(dep->name)) {
                  osi_Log0(smb_logp, "T2 search dir skipping hidden");
                  goto nextEntry; /* no hidden files */
              }
+         
              if (!(dsp->attribute & SMB_ATTR_DIRECTORY))  /* no directories */
              {
                  /* We have already done the cm_TryBulkStat above */
***************
*** 5151,5165 ****
                  fid.vnode = ntohl(dep->fid.vnode);
                  fid.unique = ntohl(dep->fid.unique);
                  fileType = cm_FindFileType(&fid);
!                 /*osi_Log2(smb_logp, "smb_ReceiveTran2SearchDir: file %s "
!                  "has filetype %d", dep->name,
!                  fileType);*/
!                 if (fileType == CM_SCACHETYPE_DIRECTORY ||
!                     fileType == CM_SCACHETYPE_MOUNTPOINT ||
!                     fileType == CM_SCACHETYPE_DFSLINK ||
!                     fileType == CM_SCACHETYPE_INVALID)
                      osi_Log0(smb_logp, "T2 search dir skipping directory or bad link");
!                     goto nextEntry;
              }
  
              /* finally check if this name will fit */
--- 5016,5030 ----
                  fid.vnode = ntohl(dep->fid.vnode);
                  fid.unique = ntohl(dep->fid.unique);
                  fileType = cm_FindFileType(&fid);
!                 /* osi_Log2(smb_logp, "smb_ReceiveTran2SearchDir: file %s "
!                  * "has filetype %d", dep->name, fileType);
!                  */
!                 if ( fileType == CM_SCACHETYPE_DIRECTORY ||
!                      fileType == CM_SCACHETYPE_MOUNTPOINT ||
!                      fileType == CM_SCACHETYPE_DFSLINK ||
!                      fileType == CM_SCACHETYPE_INVALID)
                      osi_Log0(smb_logp, "T2 search dir skipping directory or bad link");
!                 goto nextEntry;
              }
  
              /* finally check if this name will fit */
***************
*** 5179,5187 ****
                  ohbytes += 4;	/* if resume key required */
              }   
  
!             if (infoLevel != SMB_INFO_STANDARD
!                  && infoLevel != SMB_FIND_FILE_DIRECTORY_INFO
!                  && infoLevel != SMB_FIND_FILE_NAMES_INFO)
                  ohbytes += 4;	/* EASIZE */
  
              /* add header to name & term. null */
--- 5044,5052 ----
                  ohbytes += 4;	/* if resume key required */
              }   
  
!             if ( infoLevel != SMB_INFO_STANDARD && 
!                  infoLevel != SMB_FIND_FILE_DIRECTORY_INFO &&
!                  infoLevel != SMB_FIND_FILE_NAMES_INFO)
                  ohbytes += 4;	/* EASIZE */
  
              /* add header to name & term. null */
***************
*** 5190,5196 ****
              /* now, we round up the record to a 4 byte alignment,
               * and we make sure that we have enough room here for
               * even the aligned version (so we don't have to worry
!              * about an * overflow when we pad things out below).
               * That's the reason for the alignment arithmetic below.
               */
              if (infoLevel >= SMB_FIND_FILE_DIRECTORY_INFO)
--- 5055,5061 ----
              /* now, we round up the record to a 4 byte alignment,
               * and we make sure that we have enough room here for
               * even the aligned version (so we don't have to worry
!              * about an overflow when we pad things out below).
               * That's the reason for the alignment arithmetic below.
               */
              if (infoLevel >= SMB_FIND_FILE_DIRECTORY_INFO)
***************
*** 5200,5207 ****
              if (orbytes + bytesInBuffer + align > maxReturnData) {
                  osi_Log1(smb_logp, "T2 dir search exceed max return data %d",
                            maxReturnData);
!                 break;
!             }
  
              /* this is one of the entries to use: it is not deleted
               * and it matches the star pattern we're looking for.
--- 5065,5072 ----
              if (orbytes + bytesInBuffer + align > maxReturnData) {
                  osi_Log1(smb_logp, "T2 dir search exceed max return data %d",
                            maxReturnData);
!                 break;      
!             }       
  
              /* this is one of the entries to use: it is not deleted
               * and it matches the star pattern we're looking for.
***************
*** 5255,5262 ****
               */
              if (infoLevel != SMB_FIND_FILE_NAMES_INFO) {
                  curPatchp = malloc(sizeof(*curPatchp));
!                 osi_QAdd((osi_queue_t **) &dirListPatchesp,
!                           &curPatchp->q);
                  curPatchp->dptr = op;
                  if (infoLevel >= SMB_FIND_FILE_DIRECTORY_INFO)
                      curPatchp->dptr += 8;
--- 5120,5126 ----
               */
              if (infoLevel != SMB_FIND_FILE_NAMES_INFO) {
                  curPatchp = malloc(sizeof(*curPatchp));
!                 osi_QAdd((osi_queue_t **) &dirListPatchesp, &curPatchp->q);
                  curPatchp->dptr = op;
                  if (infoLevel >= SMB_FIND_FILE_DIRECTORY_INFO)
                      curPatchp->dptr += 8;
***************
*** 5291,5303 ****
              }
          }	/* if we're including this name */
          else if (!starPattern &&
!                  !foundInexact &&
!                  dep->fid.vnode != 0 &&
!                  smb_V3MatchMask(dep->name, maskp, CM_FLAG_CASEFOLD)) {
              /* We were looking for exact matches, but here's an inexact one*/
              foundInexact = 1;
          }
!                 
        nextEntry:
          /* and adjust curOffset to be where the new cookie is */
          thyper.HighPart = 0;
--- 5155,5166 ----
              }
          }	/* if we're including this name */
          else if (!starPattern &&
!                   !foundInexact &&
!                   smb_V3MatchMask(dep->name, maskp, CM_FLAG_CASEFOLD)) {
              /* We were looking for exact matches, but here's an inexact one*/
              foundInexact = 1;
          }
! 
        nextEntry:
          /* and adjust curOffset to be where the new cookie is */
          thyper.HighPart = 0;
***************
*** 5326,5333 ****
      /* apply and free last set of patches; if not doing a star match, this
       * will be empty, but better safe (and freeing everything) than sorry.
       */
!     code2 = smb_ApplyV3DirListPatches(scp, &dirListPatchesp, infoLevel, userp,
!                               &req);
          
      /* now put out the final parameters */
      if (returnedNames == 0) 
--- 5189,5195 ----
      /* apply and free last set of patches; if not doing a star match, this
       * will be empty, but better safe (and freeing everything) than sorry.
       */
!     code2 = smb_ApplyV3DirListPatches(scp, &dirListPatchesp, infoLevel, userp, &req);
          
      /* now put out the final parameters */
      if (returnedNames == 0) 
Index: openafs/src/WINNT/afsd/symlink.c
diff -c openafs/src/WINNT/afsd/symlink.c:1.8.4.2 openafs/src/WINNT/afsd/symlink.c:1.8.4.3
*** openafs/src/WINNT/afsd/symlink.c:1.8.4.2	Mon Jul  2 20:35:13 2007
--- openafs/src/WINNT/afsd/symlink.c	Thu Oct 18 01:28:39 2007
***************
*** 620,627 ****
  	else fprintf(stderr,"%s: Invalid argument.\n", pn);
      }
      else if (code == ENOENT) {
! 	if (filename) fprintf(stderr,"%s: File '%s' doesn't exist\n", pn, filename);
! 	else fprintf(stderr,"%s: no such file returned\n", pn);
      }
      else if (code == EROFS)  fprintf(stderr,"%s: You can not change a backup or readonly volume\n", pn);
      else if (code == EACCES || code == EPERM) {
--- 620,631 ----
  	else fprintf(stderr,"%s: Invalid argument.\n", pn);
      }
      else if (code == ENOENT) {
! 	if (filename) fprintf(stderr,"%s: File '%s' doesn't exist.\n", pn, filename);
! 	else fprintf(stderr,"%s: no such file returned.\n", pn);
!     }
!     else if (code == EEXIST) {
! 	if (filename) fprintf(stderr,"%s: File '%s' already exists.\n", pn, filename);
! 	else fprintf(stderr,"%s: the specified file already exists.\n", pn);
      }
      else if (code == EROFS)  fprintf(stderr,"%s: You can not change a backup or readonly volume\n", pn);
      else if (code == EACCES || code == EPERM) {
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.5.4.20 openafs/src/WINNT/doc/install/Documentation/en_US/html/index.htm:1.5.4.21
*** openafs/src/WINNT/doc/install/Documentation/en_US/html/index.htm:1.5.4.20	Wed Sep 19 01:53:46 2007
--- openafs/src/WINNT/doc/install/Documentation/en_US/html/index.htm	Sun Oct 14 23:23:00 2007
***************
*** 57,63 ****
  
  <h1>OpenAFS for Windows</h1>
  
! <h2>Version 1.5.25</h2>
  
  <p class=MsoNormal>&nbsp; </p>
  
--- 57,63 ----
  
  <h1>OpenAFS for Windows</h1>
  
! <h2>Version 1.5.26</h2>
  
  <p class=MsoNormal>&nbsp; </p>
  
***************
*** 80,86 ****
  <span
  style='font-family:Symbol'>·<span style='font:7.0pt "Times New Roman"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  </span></span><a
! href="ReleaseNotes/relnotes-frames.htm">OpenAFS for Windows 1.5.25
  Release Notes</a></p>
  
  <p style='margin-left:36.0pt;text-indent:-18.0pt;'>
--- 80,86 ----
  <span
  style='font-family:Symbol'>·<span style='font:7.0pt "Times New Roman"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  </span></span><a
! href="ReleaseNotes/relnotes-frames.htm">OpenAFS for Windows 1.5.26
  Release Notes</a></p>
  
  <p style='margin-left:36.0pt;text-indent:-18.0pt;'>
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.6.20 openafs/src/WINNT/doc/install/Documentation/en_US/html/ReleaseNotes/logo.htm:1.1.6.21
*** openafs/src/WINNT/doc/install/Documentation/en_US/html/ReleaseNotes/logo.htm:1.1.6.20	Wed Sep 19 01:53:51 2007
--- openafs/src/WINNT/doc/install/Documentation/en_US/html/ReleaseNotes/logo.htm	Sun Oct 14 23:23:06 2007
***************
*** 18,24 ****
  .shape {behavior:url(#default#VML);}
  </style>
  <![endif]-->
! <title>OpenAFS for Windows 1.5.25 Release Notes</title>
  <!--[if gte mso 9]><xml>
   <o:DocumentProperties>
    <o:Revision>1</o:Revision>
--- 18,24 ----
  .shape {behavior:url(#default#VML);}
  </style>
  <![endif]-->
! <title>OpenAFS for Windows 1.5.26 Release Notes</title>
  <!--[if gte mso 9]><xml>
   <o:DocumentProperties>
    <o:Revision>1</o:Revision>
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.4.21 openafs/src/WINNT/doc/install/Documentation/en_US/html/ReleaseNotes/relnotes-frames.htm:1.1.4.23
*** openafs/src/WINNT/doc/install/Documentation/en_US/html/ReleaseNotes/relnotes-frames.htm:1.1.4.21	Tue Aug 28 13:52:05 2007
--- openafs/src/WINNT/doc/install/Documentation/en_US/html/ReleaseNotes/relnotes-frames.htm	Mon Oct 22 19:21:56 2007
***************
*** 8,14 ****
  <meta name=Generator content="Microsoft Word 11">
  <meta name=Originator content="Microsoft Word 11">
  <link rel=File-List href="relnotes-frames_files/filelist.xml">
! <title>OpenAFS for Windows 1.5.24 Release Notes</title>
  <!--[if gte mso 9]><xml>
   <w:WordDocument>
    <w:Zoom>0</w:Zoom>
--- 8,14 ----
  <meta name=Generator content="Microsoft Word 11">
  <meta name=Originator content="Microsoft Word 11">
  <link rel=File-List href="relnotes-frames_files/filelist.xml">
! <title>OpenAFS for Windows 1.5.26 Release Notes</title>
  <!--[if gte mso 9]><xml>
   <w:WordDocument>
    <w:Zoom>0</w:Zoom>
***************
*** 83,92 ****
  <![endif]-->
  </head>
  
! <frameset cols="30%,1*">
!  <frameset rows="16%,1*">
    <frame name=logo src=logo.htm>
!   <frame name=toc src=toc.htm>
   </frameset>
   <frame name=body src=relnotes.htm>
   <noframes>
--- 83,92 ----
  <![endif]-->
  </head>
  
! <frameset cols="30%,*">
!  <frameset rows="16%,*">
    <frame name=logo src=logo.htm>
!   <frame name=toc src=toc.htm target="body">
   </frameset>
   <frame name=body src=relnotes.htm>
   <noframes>
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.6.4.24 openafs/src/WINNT/doc/install/Documentation/en_US/html/ReleaseNotes/relnotes.htm:1.6.4.26
*** openafs/src/WINNT/doc/install/Documentation/en_US/html/ReleaseNotes/relnotes.htm:1.6.4.24	Wed Sep 19 01:53:51 2007
--- openafs/src/WINNT/doc/install/Documentation/en_US/html/ReleaseNotes/relnotes.htm	Mon Oct 22 19:21:56 2007
***************
*** 19,25 ****
  .shape {behavior:url(#default#VML);}
  </style>
  <![endif]-->
! <title>OpenAFS for Windows 1.5.25 Release Notes</title>
  <o:SmartTagType namespaceuri="urn:schemas-microsoft-com:office:smarttags"
   name="PostalCode"/>
  <o:SmartTagType namespaceuri="urn:schemas-microsoft-com:office:smarttags"
--- 19,25 ----
  .shape {behavior:url(#default#VML);}
  </style>
  <![endif]-->
! <title>OpenAFS for Windows 1.5.26 Release Notes</title>
  <o:SmartTagType namespaceuri="urn:schemas-microsoft-com:office:smarttags"
   name="PostalCode"/>
  <o:SmartTagType namespaceuri="urn:schemas-microsoft-com:office:smarttags"
***************
*** 579,585 ****
  
  <div class=Section1>
  
! <p class=MsoTitle>OpenAFS for Windows 1.5.25<br>
  Release Notes</p>
  
  <p class=MsoBodyText>The Andrew File System (AFS) is a location-independent
--- 579,585 ----
  
  <div class=Section1>
  
! <p class=MsoTitle>OpenAFS for Windows 1.5.26<br>
  Release Notes</p>
  
  <p class=MsoBodyText>The Andrew File System (AFS) is a location-independent
***************
*** 5518,5523 ****
--- 5518,5536 ----
   <tr style='mso-yfti-irow:5;mso-yfti-lastrow:yes;height:78.5pt'>
    <td width=590 valign=top style='width:442.8pt;padding:0pt 5.4pt 0pt 5.4pt;
    height:78.5pt'>
+   <h5><a name="_Toc170269018"></a>
+   <a name="_Value:_Realm"></a><span style='mso-bookmark:_Toc170269018'>Value: Realm</span></h5>
+   <p class=MsoBodyText>Type: REG_SZ<br>
+   NSIS: &lt;not set&gt;</p>
+   <p class=MsoBodyText>When Kerberos v5 is being used, Realm specifies the 
+   Kerberos v5 realm that should be appended to the first component of the 
+   Domain logon username to construct the Kerberos v5 principal for which
+   AFS tokens should be obtained.</p>
+   </td>
+  </tr>
+  <tr style='mso-yfti-irow:5;mso-yfti-lastrow:yes;height:78.5pt'>
+   <td width=590 valign=top style='width:442.8pt;padding:0pt 5.4pt 0pt 5.4pt;
+   height:78.5pt'>
    <h5><a name="_Toc170269017"></a><a name="_Toc152605231"></a><a
    name="_Toc139993273"></a><a name="_Toc126872350"></a><a name="_Toc115416281"></a><a
    name="_Value:_TheseCells"></a><span style='mso-bookmark:_Toc170269017'><span
***************
*** 5693,5698 ****
--- 5706,5729 ----
   <tr style='mso-yfti-irow:2;height:119.0pt'>
    <td width=590 valign=top style='width:442.8pt;padding:0pt 5.4pt 0pt 5.4pt;
    height:119.0pt'>
+   <h5><span style='mso-bookmark:
+   _Toc170269029'><span style='mso-bookmark:_Toc152605243'><span
+   style='mso-bookmark:_Toc115416293'>Value: AcceptDottedPrincipalNames</span></span></span></h5>
+   <p class=MsoBodyText>Type: DWORD {0, 1}<br>
+   Default: 1<br>
+   Function: KFW_accept_dotted_usernames()</p>
+   <p class=MsoBodyText>Kerberos v5 principal names are traditionally mapped to 
+ 	Kerberos v4 names by the AFS servers before they can be looked up in the 
+ 	Protection database.&nbsp; The mapping algorithm used permits collisions to 
+ 	occur.&nbsp; Both of the Kerberos v5 names, &quot;<a href="mailto:user.admin@REALM">user.admin@REALM</a>&quot; 
+ 	and &quot;<a href="mailto:user/admin@REALM">user/admin@REALM</a>&quot; are interpreted 
+ 	as the same user identity within the cell.&nbsp; To enable both names to be 
+ 	sent to the server by AFSCreds or Integrated Logon, set this value to 1.</p>
+   </td>
+  </tr>
+  <tr style='mso-yfti-irow:2;height:119.0pt'>
+   <td width=590 valign=top style='width:442.8pt;padding:0pt 5.4pt 0pt 5.4pt;
+   height:119.0pt'>
    <h5><a name="_Toc170269029"></a><a name="_Toc152605243"></a><a
    name="_Value:_Use524"></a><a name=Use524></a><a name="_Toc139993285"></a><a
    name="_Toc126872362"></a><a name="_Toc115416293"></a><a
Index: openafs/src/WINNT/doc/install/Documentation/en_US/html/ReleaseNotes/toc.htm
diff -c openafs/src/WINNT/doc/install/Documentation/en_US/html/ReleaseNotes/toc.htm:1.2.6.19 openafs/src/WINNT/doc/install/Documentation/en_US/html/ReleaseNotes/toc.htm:1.2.6.21
*** openafs/src/WINNT/doc/install/Documentation/en_US/html/ReleaseNotes/toc.htm:1.2.6.19	Wed Sep 19 01:53:52 2007
--- openafs/src/WINNT/doc/install/Documentation/en_US/html/ReleaseNotes/toc.htm	Mon Oct 22 19:21:57 2007
***************
*** 10,16 ****
  <meta name=Originator content="Microsoft Word 11">
  <base target=body>
  <link rel=File-List href="toc_files/filelist.xml">
! <title>OpenAFS for Windows 1.5.25 Table of Contents</title>
  <!--[if gte mso 9]><xml>
   <o:DocumentProperties>
    <o:Author>Jeffrey Altman</o:Author>
--- 10,16 ----
  <meta name=Originator content="Microsoft Word 11">
  <base target=body>
  <link rel=File-List href="toc_files/filelist.xml">
! <title>OpenAFS for Windows 1.5.26 Table of Contents</title>
  <!--[if gte mso 9]><xml>
   <o:DocumentProperties>
    <o:Author>Jeffrey Altman</o:Author>
***************
*** 1318,1323 ****
--- 1318,1328 ----
  
  <p class=MsoToc5 style='tab-stops:right dotted 431.5pt'><span
  class=MsoHyperlink><span style='mso-no-proof:yes'><a
+ href="relnotes.htm#_Toc170269018">Value: Realm</a></span></span><span
+ style='mso-fareast-font-family:"Times New Roman";mso-no-proof:yes'><o:p></o:p></span></p>
+ 
+ <p class=MsoToc5 style='tab-stops:right dotted 431.5pt'><span
+ class=MsoHyperlink><span style='mso-no-proof:yes'><a
  href="relnotes.htm#_Toc170269017">Value: TheseCells</a></span></span><span
  style='mso-fareast-font-family:"Times New Roman";mso-no-proof:yes'><o:p></o:p></span></p>
  
***************
*** 1382,1387 ****
--- 1387,1397 ----
  
  <p class=MsoToc5 style='tab-stops:right dotted 431.5pt'><span
  class=MsoHyperlink><span style='mso-no-proof:yes'><a
+ href="relnotes.htm#_Toc170269029">Value: AcceptDottedPrincipalNames</a></span></span><span
+ style='mso-fareast-font-family:"Times New Roman";mso-no-proof:yes'><o:p></o:p></span></p>
+ 
+ <p class=MsoToc5 style='tab-stops:right dotted 431.5pt'><span
+ class=MsoHyperlink><span style='mso-no-proof:yes'><a
  href="relnotes.htm#_Toc170269029">Value: Use524</a></span></span><span
  style='mso-fareast-font-family:"Times New Roman";mso-no-proof:yes'><o:p></o:p></span></p>
  
Index: openafs/src/WINNT/eventlog/NTMakefile
diff -c openafs/src/WINNT/eventlog/NTMakefile:1.5 openafs/src/WINNT/eventlog/NTMakefile:1.5.14.1
*** openafs/src/WINNT/eventlog/NTMakefile:1.5	Fri Nov 21 03:00:01 2003
--- openafs/src/WINNT/eventlog/NTMakefile	Sun Oct 14 23:19:52 2007
***************
*** 72,77 ****
--- 72,78 ----
  clean::
  	$(DEL) $(LIBFILE)
  	$(CD) lang
+         $(DEL) AFS_component_version_number.h
  	if exist $(NTLANG) $(NTLANG) en_US $(MAKECMD) /nologo /f NTMakefile clean
  	if exist $(NTLANG) $(NTLANG) ja_JP $(MAKECMD) /nologo /f NTMakefile clean
  	if exist $(NTLANG) $(NTLANG) ko_KR $(MAKECMD) /nologo /f NTMakefile clean
***************
*** 85,89 ****
  mkdir:
  	-mkdir $(OUT)\lang
  	cd lang
! 	nmake /nologo /f ntmakefile SRC=$(SRC) OBJ=$(OBJ) mkdir
  	cd ..
--- 86,90 ----
  mkdir:
  	-mkdir $(OUT)\lang
  	cd lang
! 	$(MAKECMD) /nologo /f NTMakefile SRC=$(SRC) OBJ=$(OBJ) mkdir
  	cd ..
Index: openafs/src/WINNT/eventlog/lang/NTMakefile
diff -c openafs/src/WINNT/eventlog/lang/NTMakefile:1.6.14.1 openafs/src/WINNT/eventlog/lang/NTMakefile:1.6.14.2
*** openafs/src/WINNT/eventlog/lang/NTMakefile:1.6.14.1	Tue Jun  6 10:47:09 2006
--- openafs/src/WINNT/eventlog/lang/NTMakefile	Wed Oct 10 11:44:53 2007
***************
*** 75,77 ****
--- 75,78 ----
  	$(DEL) $(LANGNAME)\event.h
  	$(DEL) $(LANGNAME)\event.rc
  	$(DEL) $(LANGNAME)\MSG*.bin
+ 	$(DEL) AFS_component_version_number.h
Index: openafs/src/WINNT/install/wix/config.wxi
diff -c openafs/src/WINNT/install/wix/config.wxi:1.11 openafs/src/WINNT/install/wix/config.wxi:1.11.2.1
*** openafs/src/WINNT/install/wix/config.wxi:1.11	Mon Mar 20 12:20:01 2006
--- openafs/src/WINNT/install/wix/config.wxi	Wed Oct 10 11:38:25 2007
***************
*** 93,99 ****
          <?define PackageCode="6086552D-3EFA-436C-A0BD-25668849F0DB"?>
      <?endif?>
      <?if $(env.AFSDEV_BUILDTYPE) = "CHECKED"?>
!         <?define Debug?>
          <?define ReleaseType="DT"?>
      <?elseif $(env.AFSDEV_BUILDTYPE) = "FREE"?>
          <?define ReleaseType="GA"?>
--- 93,99 ----
          <?define PackageCode="6086552D-3EFA-436C-A0BD-25668849F0DB"?>
      <?endif?>
      <?if $(env.AFSDEV_BUILDTYPE) = "CHECKED"?>
!         <?define Debug = "yes"?>
          <?define ReleaseType="DT"?>
      <?elseif $(env.AFSDEV_BUILDTYPE) = "FREE"?>
          <?define ReleaseType="GA"?>
***************
*** 102,108 ****
      <?endif?>
  
      <!-- We are including debug symbols anyway.  Undefine this for a leaner installer without debug syms. -->
!     <?define DebugSyms?>
  
      <!-- Parameters for the features containing debug symbols -->
      <?ifdef DebugSyms?>
--- 102,108 ----
      <?endif?>
  
      <!-- We are including debug symbols anyway.  Undefine this for a leaner installer without debug syms. -->
!     <?define DebugSyms = "yes"?>
  
      <!-- Parameters for the features containing debug symbols -->
      <?ifdef DebugSyms?>
***************
*** 134,140 ****
      <?endif?>
  
      <!-- Use the afsloopback.dll instead of instloop.exe -->
!     <?define UseDllLoopbackInstaller?>
  
      <!-- Note that if the follwing file does not exist, the build will fail -->
      <?ifndef CellDbFile?>
--- 134,140 ----
      <?endif?>
  
      <!-- Use the afsloopback.dll instead of instloop.exe -->
!     <?define UseDllLoopbackInstaller = "yes"?>
  
      <!-- Note that if the follwing file does not exist, the build will fail -->
      <?ifndef CellDbFile?>
Index: openafs/src/afs/Makefile.in
diff -c openafs/src/afs/Makefile.in:1.20 openafs/src/afs/Makefile.in:1.20.6.1
*** openafs/src/afs/Makefile.in:1.20	Fri Mar 25 19:44:39 2005
--- openafs/src/afs/Makefile.in	Mon Oct 15 13:28:57 2007
***************
*** 137,143 ****
  			${INSTALL} longc_procs.h ${DEST}/include/afs ;; \
  	esac
  	case ${SYS_NAME} in \
! 		next_mach30 | vax_ul43 | *_darwin* | i386_fbsd* ) \
  			echo skipping afszcm.cat install for ${SYS_NAME} ;; \
  		* ) \
  			${INSTALL} afszcm.cat ${DEST}/root.client/usr/vice/etc/C ;; \
--- 137,143 ----
  			${INSTALL} longc_procs.h ${DEST}/include/afs ;; \
  	esac
  	case ${SYS_NAME} in \
! 		i386_fbsd* ) \
  			echo skipping afszcm.cat install for ${SYS_NAME} ;; \
  		* ) \
  			${INSTALL} afszcm.cat ${DEST}/root.client/usr/vice/etc/C ;; \
Index: openafs/src/afs/afs.h
diff -c openafs/src/afs/afs.h:1.85.2.4 openafs/src/afs/afs.h:1.85.2.6
*** openafs/src/afs/afs.h:1.85.2.4	Thu Nov  9 19:11:05 2006
--- openafs/src/afs/afs.h	Wed Oct 10 13:01:42 2007
***************
*** 270,275 ****
--- 270,278 ----
  extern afs_int32 afs_gcpags;
  extern afs_int32 afs_gcpags_procsize;
  extern afs_int32 afs_bkvolpref;
+ extern char afs_cachebasedir[1024];
+ extern afs_int32 afs_numcachefiles;
+ extern afs_int32 afs_numfilesperdir;
  
  struct unixuser {
      struct unixuser *next;	/* next hash pointer */
***************
*** 1225,1229 ****
  };
  
  extern int afs_fakestat_enable;
- 
  #endif /* _AFS_H_ */
--- 1228,1231 ----
Index: openafs/src/afs/afs_call.c
diff -c openafs/src/afs/afs_call.c:1.86.4.12 openafs/src/afs/afs_call.c:1.86.4.17
*** openafs/src/afs/afs_call.c:1.86.4.12	Thu Jul 12 14:12:54 2007
--- openafs/src/afs/afs_call.c	Wed Oct 17 10:34:53 2007
***************
*** 11,17 ****
  #include "afs/param.h"
  
  RCSID
!     ("$Header: /cvs/openafs/src/afs/afs_call.c,v 1.86.4.12 2007/07/12 18:12:54 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.86.4.17 2007/10/17 14:34:53 shadow Exp $");
  
  #include "afs/sysincludes.h"	/* Standard vendor system headers */
  #include "afsincludes.h"	/* Afs-based standard headers */
***************
*** 29,35 ****
  #ifdef AFS_LINUX22_ENV
  #include "h/smp_lock.h"
  #endif
! 
  
  #if defined(AFS_SUN5_ENV) || defined(AFS_AIX_ENV) || defined(AFS_SGI_ENV) || defined(AFS_HPUX_ENV)
  #define	AFS_MINBUFFERS	100
--- 29,38 ----
  #ifdef AFS_LINUX22_ENV
  #include "h/smp_lock.h"
  #endif
! #ifdef AFS_SUN510_ENV
! #include "h/ksynch.h"
! #include "h/sunddi.h"
! #endif
  
  #if defined(AFS_SUN5_ENV) || defined(AFS_AIX_ENV) || defined(AFS_SGI_ENV) || defined(AFS_HPUX_ENV)
  #define	AFS_MINBUFFERS	100
***************
*** 46,51 ****
--- 49,59 ----
  char afs_rootVolumeName[64] = "";
  afs_uint32 rx_bindhost;
  
+ #ifdef AFS_SUN510_ENV
+ ddi_taskq_t *afs_taskq;
+ krwlock_t afsifinfo_lock;
+ #endif
+ 
  afs_int32 afs_initState = 0;
  afs_int32 afs_termState = 0;
  afs_int32 afs_setTime = 0;
***************
*** 58,63 ****
--- 66,74 ----
  extern struct interfaceAddr afs_cb_interface;
  static int afs_RX_Running = 0;
  static int afs_InitSetup_done = 0;
+ afs_int32 afs_numcachefiles = -1;
+ afs_int32 afs_numfilesperdir = -1;
+ char afs_cachebasedir[1024];
  
  afs_int32 afs_rx_deadtime = AFS_RXDEADTIME;
  afs_int32 afs_rx_harddead = AFS_HARDDEADTIME;
***************
*** 80,85 ****
--- 91,106 ----
      if (afs_InitSetup_done)
  	return EAGAIN;
  
+ #ifdef AFS_SUN510_ENV
+     /* Initialize a RW lock for the ifinfo global array */
+     rw_init(&afsifinfo_lock, NULL, RW_DRIVER, NULL);
+ 
+     /* Create a taskq */
+     afs_taskq = ddi_taskq_create(NULL, "afs_taskq", 2, TASKQ_DEFAULTPRI, 0);
+ 
+     osi_StartNetIfPoller();
+ #endif
+ 
  #ifndef AFS_NOSTATS
      /*
       * Set up all the AFS statistics variables.  This should be done
***************
*** 443,448 ****
--- 464,481 ----
  }
  #endif
  
+ static void
+ wait_for_cachedefs(void) {
+ #ifdef AFS_CACHE_VNODE_PATH
+     if (cacheDiskType != AFS_FCACHE_TYPE_MEM) 
+ 	while ((afs_numcachefiles < 1) || (afs_numfilesperdir < 1) ||
+ 	       (afs_cachebasedir[0] != '/')) {
+ 	    printf("afs: waiting for cache parameter definitions\n");
+ 	    afs_osi_Sleep(&afs_initState);
+ 	}
+ #endif
+ }
+ 
  /* leaving as is, probably will barf if we add prototypes here since it's likely being called
  with partial list */
  int
***************
*** 774,779 ****
--- 807,818 ----
  #ifdef AFS_DARWIN80_ENV
  	put_vfs_context();
  #endif
+     } else if (parm == AFSOP_CACHEDIRS) {
+ 	afs_numfilesperdir = parm2;
+ 	afs_osi_Wakeup(&afs_initState);
+     } else if (parm == AFSOP_CACHEFILES) {
+ 	afs_numcachefiles = parm2;
+ 	afs_osi_Wakeup(&afs_initState);
      } else if (parm == AFSOP_ROOTVOLUME) {
  	/* wait for basic init */
  	while (afs_initState < AFSOP_START_BKG)
***************
*** 787,793 ****
  	    code = 0;
      } else if (parm == AFSOP_CACHEFILE || parm == AFSOP_CACHEINFO
  	       || parm == AFSOP_VOLUMEINFO || parm == AFSOP_AFSLOG
! 	       || parm == AFSOP_CELLINFO) {
  	char *tbuffer = osi_AllocSmallSpace(AFS_SMALLOCSIZ);
  
  	code = 0;
--- 826,832 ----
  	    code = 0;
      } else if (parm == AFSOP_CACHEFILE || parm == AFSOP_CACHEINFO
  	       || parm == AFSOP_VOLUMEINFO || parm == AFSOP_AFSLOG
! 	       || parm == AFSOP_CELLINFO || parm == AFSOP_CACHEBASEDIR) {
  	char *tbuffer = osi_AllocSmallSpace(AFS_SMALLOCSIZ);
  
  	code = 0;
***************
*** 803,822 ****
  #ifdef AFS_DARWIN80_ENV
      get_vfs_context();
  #endif
! 	    if (parm == AFSOP_CACHEFILE)
  		code = afs_InitCacheFile(tbuffer, 0);
! 	    else if (parm == AFSOP_CACHEINFO)
  		code = afs_InitCacheInfo(tbuffer);
! 	    else if (parm == AFSOP_VOLUMEINFO)
  		code = afs_InitVolumeInfo(tbuffer);
! 	    else if (parm == AFSOP_CELLINFO)
  		code = afs_InitCellInfo(tbuffer);
  #ifdef AFS_DARWIN80_ENV
  	    put_vfs_context();
  #endif
  	}
  	osi_FreeSmallSpace(tbuffer);
      } else if (parm == AFSOP_GO) {
  	/* the generic initialization calls come here.  One parameter: should we do the
  	 * set-time operation on this workstation */
  	if (afs_Go_Done)
--- 842,890 ----
  #ifdef AFS_DARWIN80_ENV
      get_vfs_context();
  #endif
! 	    if (parm == AFSOP_CACHEBASEDIR) {
! 		strncpy(afs_cachebasedir, tbuffer, 1024);
! 		afs_cachebasedir[1023] = '\0';
! 		afs_osi_Wakeup(&afs_initState);
! 	    } else if (parm == AFSOP_CACHEFILE) {
! 		wait_for_cachedefs();
  		code = afs_InitCacheFile(tbuffer, 0);
! 	    } else if (parm == AFSOP_CACHEINFO) {
! 		wait_for_cachedefs();
  		code = afs_InitCacheInfo(tbuffer);
! 	    } else if (parm == AFSOP_VOLUMEINFO) {
! 		wait_for_cachedefs();
  		code = afs_InitVolumeInfo(tbuffer);
! 	    } else if (parm == AFSOP_CELLINFO) {
! 		wait_for_cachedefs();
  		code = afs_InitCellInfo(tbuffer);
+ 	    }
  #ifdef AFS_DARWIN80_ENV
  	    put_vfs_context();
  #endif
  	}
  	osi_FreeSmallSpace(tbuffer);
      } else if (parm == AFSOP_GO) {
+ #ifdef AFS_CACHE_VNODE_PATH
+ 	if (cacheDiskType != AFS_FCACHE_TYPE_MEM) {
+ 	    afs_int32 dummy;
+ 	    
+ 	    wait_for_cachedefs();
+ 	    
+ #ifdef AFS_DARWIN80_ENV
+ 	    get_vfs_context();
+ #endif
+ 	    if ((afs_numcachefiles > 0) && (afs_numfilesperdir > 0) && 
+ 		(afs_cachebasedir[0] == '/')) {
+ 		for (dummy = 0; dummy < afs_numcachefiles; dummy++) {
+ 		    code = afs_InitCacheFile(NULL, dummy);
+ 		}
+ 	    }
+ #ifdef AFS_DARWIN80_ENV
+ 	    put_vfs_context();
+ #endif
+ 	}
+ #endif
  	/* the generic initialization calls come here.  One parameter: should we do the
  	 * set-time operation on this workstation */
  	if (afs_Go_Done)
***************
*** 1187,1198 ****
  #endif
      afs_warn("\n");
  
      /* Close file only after daemons which can write to it are stopped. */
      if (afs_cacheInodep) {	/* memcache won't set this */
  	osi_UFSClose(afs_cacheInodep);	/* Since we always leave it open */
  	afs_cacheInodep = 0;
      }
-     return;			/* Just kill daemons for now */
  #ifdef notdef
      shutdown_CB();
      shutdown_AFS();
--- 1255,1269 ----
  #endif
      afs_warn("\n");
  
+ #ifdef AFS_AIX51_ENV
+     shutdown_daemons();
+ #endif
+ 
      /* Close file only after daemons which can write to it are stopped. */
      if (afs_cacheInodep) {	/* memcache won't set this */
  	osi_UFSClose(afs_cacheInodep);	/* Since we always leave it open */
  	afs_cacheInodep = 0;
      }
  #ifdef notdef
      shutdown_CB();
      shutdown_AFS();
***************
*** 1200,1220 ****
      shutdown_rxevent();
      shutdown_rx();
      afs_shutdown_BKG();
-     shutdown_bufferpackage();
  #endif
! #ifdef AFS_AIX51_ENV
!     shutdown_daemons();
! #endif
! #ifdef notdef
      shutdown_cache();
      shutdown_osi();
      shutdown_osinet();
      shutdown_osifile();
      shutdown_vnodeops();
-     shutdown_vfsops();
-     shutdown_exporter();
      shutdown_memcache();
  #if (!defined(AFS_NONFSTRANS) || defined(AFS_AIX_IAUTH_ENV)) && !defined(AFS_OSF_ENV)
      shutdown_nfsclnt();
  #endif
      shutdown_afstest();
--- 1271,1286 ----
      shutdown_rxevent();
      shutdown_rx();
      afs_shutdown_BKG();
  #endif
!     shutdown_bufferpackage();
      shutdown_cache();
      shutdown_osi();
      shutdown_osinet();
      shutdown_osifile();
      shutdown_vnodeops();
      shutdown_memcache();
  #if (!defined(AFS_NONFSTRANS) || defined(AFS_AIX_IAUTH_ENV)) && !defined(AFS_OSF_ENV)
+     shutdown_exporter();
      shutdown_nfsclnt();
  #endif
      shutdown_afstest();
***************
*** 1226,1232 ****
  */
      afs_warn(" ALL allocated tables\n");
      afs_shuttingdown = 0;
! #endif
  }
  
  void
--- 1292,1299 ----
  */
      afs_warn(" ALL allocated tables\n");
      afs_shuttingdown = 0;
! 
!     return;			/* Just kill daemons for now */
  }
  
  void
Index: openafs/src/afs/afs_daemons.c
diff -c openafs/src/afs/afs_daemons.c:1.43 openafs/src/afs/afs_daemons.c:1.43.2.1
*** openafs/src/afs/afs_daemons.c:1.43	Thu Mar 30 12:13:39 2006
--- openafs/src/afs/afs_daemons.c	Mon Oct 22 20:02:50 2007
***************
*** 11,17 ****
  #include "afs/param.h"
  
  RCSID
!     ("$Header: /cvs/openafs/src/afs/afs_daemons.c,v 1.43 2006/03/30 17:13:39 rees Exp $");
  
  #ifdef AFS_AIX51_ENV
  #define __FULL_PROTO
--- 11,17 ----
  #include "afs/param.h"
  
  RCSID
!     ("$Header: /cvs/openafs/src/afs/afs_daemons.c,v 1.43.2.1 2007/10/23 00:02:50 shadow Exp $");
  
  #ifdef AFS_AIX51_ENV
  #define __FULL_PROTO
***************
*** 47,53 ****
  
  afs_int32 afs_CheckServerDaemonStarted = 0;
  #ifndef DEFAULT_PROBE_INTERVAL
! #define DEFAULT_PROBE_INTERVAL 180	/* default to 3 min */
  #endif
  afs_int32 afs_probe_interval = DEFAULT_PROBE_INTERVAL;
  afs_int32 afs_probe_all_interval = 600;
--- 47,53 ----
  
  afs_int32 afs_CheckServerDaemonStarted = 0;
  #ifndef DEFAULT_PROBE_INTERVAL
! #define DEFAULT_PROBE_INTERVAL 30	/* default to 3 min */
  #endif
  afs_int32 afs_probe_interval = DEFAULT_PROBE_INTERVAL;
  afs_int32 afs_probe_all_interval = 600;
Index: openafs/src/afs/afs_init.c
diff -c openafs/src/afs/afs_init.c:1.37.4.3 openafs/src/afs/afs_init.c:1.37.4.5
*** openafs/src/afs/afs_init.c:1.37.4.3	Mon Jul 31 17:27:38 2006
--- openafs/src/afs/afs_init.c	Wed Oct 10 13:40:30 2007
***************
*** 17,23 ****
  #include "afs/param.h"
  
  RCSID
!     ("$Header: /cvs/openafs/src/afs/afs_init.c,v 1.37.4.3 2006/07/31 21:27:38 shadow Exp $");
  
  #include "afs/stds.h"
  #include "afs/sysincludes.h"	/* Standard vendor system headers */
--- 17,23 ----
  #include "afs/param.h"
  
  RCSID
!     ("$Header: /cvs/openafs/src/afs/afs_init.c,v 1.37.4.5 2007/10/10 17:40:30 shadow Exp $");
  
  #include "afs/stds.h"
  #include "afs/sysincludes.h"	/* Standard vendor system headers */
***************
*** 245,252 ****
--- 245,256 ----
      ino_t inode;
      int code;
  
+ #ifdef AFS_CACHE_VNODE_PATH
+     return afs_cellname_init(AFS_CACHE_CELLS_INODE, code);
+ #else
      code = LookupInodeByPath(afile, &inode, NULL);
      return afs_cellname_init(inode, code);
+ #endif
  }
  
  /*
***************
*** 287,292 ****
--- 291,298 ----
       * it in the cache...
       */
      code = LookupInodeByPath(afile, &volumeInode, &volumeVnode);
+ #elif defined(AFS_CACHE_VNODE_PATH)
+     volumeInode = AFS_CACHE_VOLUME_INODE;
  #else
      code = LookupInodeByPath(afile, &volumeInode, NULL);
  #endif
***************
*** 417,427 ****
  #if defined(AFS_SGI62_ENV) || defined(AFS_HAVE_VXFS) || defined(AFS_DARWIN_ENV)
      afs_InitDualFSCacheOps(filevp);
  #endif
!     cacheInode = afs_vnodeToInumber(filevp);
!     cacheDev.dev = afs_vnodeToDev(filevp);
  #ifndef AFS_DARWIN80_ENV
      afs_cacheVfsp = filevp->v_vfsp;
  #endif
  #endif /* AFS_LINUX20_ENV */
      AFS_RELE(filevp);
  #endif /* AFS_LINUX22_ENV */
--- 423,437 ----
  #if defined(AFS_SGI62_ENV) || defined(AFS_HAVE_VXFS) || defined(AFS_DARWIN_ENV)
      afs_InitDualFSCacheOps(filevp);
  #endif
! #ifndef AFS_CACHE_VNODE_PATH
  #ifndef AFS_DARWIN80_ENV
      afs_cacheVfsp = filevp->v_vfsp;
  #endif
+     cacheInode = afs_vnodeToInumber(filevp);
+ #else
+     cacheInode = AFS_CACHE_ITEMS_INODE;
+ #endif
+     cacheDev.dev = afs_vnodeToDev(filevp);
  #endif /* AFS_LINUX20_ENV */
      AFS_RELE(filevp);
  #endif /* AFS_LINUX22_ENV */
Index: openafs/src/afs/afs_nfsclnt.c
diff -c openafs/src/afs/afs_nfsclnt.c:1.13.6.6 openafs/src/afs/afs_nfsclnt.c:1.13.6.7
*** openafs/src/afs/afs_nfsclnt.c:1.13.6.6	Wed Aug 22 15:39:03 2007
--- openafs/src/afs/afs_nfsclnt.c	Tue Oct 16 17:56:45 2007
***************
*** 11,17 ****
  #include "afs/param.h"
  
  RCSID
!     ("$Header: /cvs/openafs/src/afs/afs_nfsclnt.c,v 1.13.6.6 2007/08/22 19:39:03 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.13.6.7 2007/10/16 21:56:45 shadow Exp $");
  
  #if !defined(AFS_NONFSTRANS) || defined(AFS_AIX_IAUTH_ENV)
  #include "afs/sysincludes.h"	/* Standard vendor system headers */
***************
*** 503,508 ****
--- 503,510 ----
  	/* Don't touch our arguments when called recursively */
  	*outname = np->sysname;
  	*num = np->sysnamecount;
+ 	if (!np->sysname[0])
+ 	    return ENODEV; /* XXX */
      }
      return 0;
  }
Index: openafs/src/afs/afs_osidnlc.c
diff -c openafs/src/afs/afs_osidnlc.c:1.13 openafs/src/afs/afs_osidnlc.c:1.13.2.1
*** openafs/src/afs/afs_osidnlc.c:1.13	Fri Feb 17 23:08:04 2006
--- openafs/src/afs/afs_osidnlc.c	Fri Oct 19 16:39:07 2007
***************
*** 11,17 ****
  #include "afs/param.h"
  
  RCSID
!     ("$Header: /cvs/openafs/src/afs/afs_osidnlc.c,v 1.13 2006/02/18 04:08:04 shadow Exp $");
  
  #include "afs/sysincludes.h"	/*Standard vendor system headers */
  #include "afsincludes.h"	/*AFS-based standard headers */
--- 11,17 ----
  #include "afs/param.h"
  
  RCSID
!     ("$Header: /cvs/openafs/src/afs/afs_osidnlc.c,v 1.13.2.1 2007/10/19 20:39:07 shadow Exp $");
  
  #include "afs/sysincludes.h"	/*Standard vendor system headers */
  #include "afsincludes.h"	/*AFS-based standard headers */
***************
*** 242,248 ****
  	ReleaseReadLock(&afs_xvcache);
  	dnlcstats.misses++;
      } else {
! 	if (tvc->states & CVInit) {
  	    ReleaseReadLock(&afs_xvcache);
  	    dnlcstats.misses++;
  	    osi_dnlc_remove(adp, aname, tvc);
--- 242,253 ----
  	ReleaseReadLock(&afs_xvcache);
  	dnlcstats.misses++;
      } else {
! 	if ((tvc->states & CVInit)
! #ifdef  AFS_DARWIN80_ENV
! 	    ||(tvc->states & CDeadVnode)
! #endif
! 	    )      
! 	{
  	    ReleaseReadLock(&afs_xvcache);
  	    dnlcstats.misses++;
  	    osi_dnlc_remove(adp, aname, tvc);
Index: openafs/src/afs/afs_server.c
diff -c openafs/src/afs/afs_server.c:1.43.4.2 openafs/src/afs/afs_server.c:1.43.4.3
*** openafs/src/afs/afs_server.c:1.43.4.2	Tue Jun 12 15:14:07 2007
--- openafs/src/afs/afs_server.c	Thu Oct  4 22:24:35 2007
***************
*** 33,39 ****
  #include "afs/param.h"
  
  RCSID
!     ("$Header: /cvs/openafs/src/afs/afs_server.c,v 1.43.4.2 2007/06/12 19:14:07 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.43.4.3 2007/10/05 02:24:35 shadow Exp $");
  
  #include "afs/stds.h"
  #include "afs/sysincludes.h"	/* Standard vendor system headers */
***************
*** 1273,1295 ****
  #else				/* AFS_USERSPACE_IP_ADDR */
  #if	defined(AFS_SUN5_ENV)
  #ifdef AFS_SUN510_ENV
!     ill_walk_context_t ctx;
  #else
      extern struct ill_s *ill_g_headp;
      long *addr = (long *)ill_g_headp;
- #endif
      ill_t *ill;
      ipif_t *ipif;
      int subnet, subnetmask, net, netmask;
  
      if (sa)
  	  sa->sa_iprank = 0;
  #ifdef AFS_SUN510_ENV
!     for (ill = ILL_START_WALK_ALL(&ctx) ; ill ; ill = ill_next(&ctx, ill)) {
  #else
      for (ill = (struct ill_s *)*addr /*ill_g_headp */ ; ill;
  	 ill = ill->ill_next) {
- #endif
  #ifdef AFS_SUN58_ENV
  	/* Make sure this is an IPv4 ILL */
  	if (ill->ill_isv6)
--- 1273,1346 ----
  #else				/* AFS_USERSPACE_IP_ADDR */
  #if	defined(AFS_SUN5_ENV)
  #ifdef AFS_SUN510_ENV
!     int i = 0;
  #else
      extern struct ill_s *ill_g_headp;
      long *addr = (long *)ill_g_headp;
      ill_t *ill;
      ipif_t *ipif;
+ #endif
      int subnet, subnetmask, net, netmask;
  
      if (sa)
  	  sa->sa_iprank = 0;
  #ifdef AFS_SUN510_ENV
!     rw_enter(&afsifinfo_lock, RW_READER);
! 
!     for (i = 0; (afsifinfo[i].ipaddr != NULL) && (i < ADDRSPERSITE); i++) {
! 
! 	if (IN_CLASSA(afsifinfo[i].ipaddr)) {
! 	    netmask = IN_CLASSA_NET;
! 	} else if (IN_CLASSB(afsifinfo[i].ipaddr)) {
! 	    netmask = IN_CLASSB_NET;
! 	} else if (IN_CLASSC(afsifinfo[i].ipaddr)) {
! 	    netmask = IN_CLASSC_NET;
! 	} else {
! 	    netmask = 0;
! 	}
! 	net = afsifinfo[i].ipaddr & netmask;
! 
! #ifdef notdef
! 	if (!s) {
! 	    if (afsifinfo[i].ipaddr != 0x7f000001) {	/* ignore loopback */
! 		*cnt += 1;
! 		if (*cnt > 16)
! 		    return;
! 		*addrp++ = afsifinfo[i].ipaddr;
! 	    }
! 	} else
! #endif /* notdef */
!         {
!             /* XXXXXX Do the individual ip ranking below XXXXX */
!             if ((sa->sa_ip & netmask) == net) {
!                 if ((sa->sa_ip & subnetmask) == subnet) {
!                     if (afsifinfo[i].ipaddr == sa->sa_ip) {   /* ie, ME!  */
!                         sa->sa_iprank = TOPR;
!                     } else {
!                         sa->sa_iprank = HI + afsifinfo[i].metric; /* case #2 */
!                     }
!                 } else {
!                     sa->sa_iprank = MED + afsifinfo[i].metric;    /* case #3 */
!                 }
!             } else {
!                     sa->sa_iprank = LO + afsifinfo[i].metric;     /* case #4 */
!             }
!             /* check for case #5 -- point-to-point link */
!             if ((afsifinfo[i].flags & IFF_POINTOPOINT)
!                 && (afsifinfo[i].dstaddr == sa->sa_ip)) {
! 
!                     if (afsifinfo[i].metric >= (MAXDEFRANK - MED) / PPWEIGHT)
!                         sa->sa_iprank = MAXDEFRANK;
!                     else
!                         sa->sa_iprank = MED + (PPWEIGHT << afsifinfo[i].metric);
!             }
!         }
!     }
!     
!     rw_exit(&afsifinfo_lock);
  #else
      for (ill = (struct ill_s *)*addr /*ill_g_headp */ ; ill;
  	 ill = ill->ill_next) {
  #ifdef AFS_SUN58_ENV
  	/* Make sure this is an IPv4 ILL */
  	if (ill->ill_isv6)
***************
*** 1349,1354 ****
--- 1400,1406 ----
  	    }
  	}
      }
+ #endif /* AFS_SUN510_ENV */
  #else
  #ifndef USEIFADDR
      struct ifnet *ifn = NULL;
Index: openafs/src/afs/DARWIN/osi_file.c
diff -c openafs/src/afs/DARWIN/osi_file.c:1.12.2.2 openafs/src/afs/DARWIN/osi_file.c:1.12.2.3
*** openafs/src/afs/DARWIN/osi_file.c:1.12.2.2	Thu Nov  9 18:30:53 2006
--- openafs/src/afs/DARWIN/osi_file.c	Wed Oct 10 13:01:43 2007
***************
*** 11,17 ****
  #include "afs/param.h"
  
  RCSID
!     ("$Header: /cvs/openafs/src/afs/DARWIN/osi_file.c,v 1.12.2.2 2006/11/09 23:30:53 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.12.2.3 2007/10/10 17:01:43 shadow Exp $");
  
  #include "afs/sysincludes.h"	/* Standard vendor system headers */
  #include "afsincludes.h"	/* Afs-based standard headers */
***************
*** 141,146 ****
--- 141,149 ----
      extern int cacheDiskType;
      afs_int32 code = 0;
      int dummy;
+     char fname[1024];
+     struct osi_stat tstat;
+ 
      AFS_STATCNT(osi_UFSOpen);
      if (cacheDiskType != AFS_FCACHE_TYPE_UFS) {
  	osi_Panic("UFSOpen called for non-UFS cache\n");
***************
*** 154,159 ****
--- 157,184 ----
      }
      afile = (struct osi_file *)osi_AllocSmallSpace(sizeof(struct osi_file));
      AFS_GUNLOCK();
+ #ifdef AFS_CACHE_VNODE_PATH
+     if (ainode < 0) {
+ 	switch (ainode) {
+ 	case AFS_CACHE_CELLS_INODE:
+ 	    snprintf(fname, 1024, "%s/%s", afs_cachebasedir, "CellItems");
+ 	    break;
+ 	case AFS_CACHE_ITEMS_INODE:
+ 	    snprintf(fname, 1024, "%s/%s", afs_cachebasedir, "CacheItems");
+ 	    break;
+ 	case AFS_CACHE_VOLUME_INODE:
+ 	    snprintf(fname, 1024, "%s/%s", afs_cachebasedir, "VolumeItems");
+ 	    break;
+ 	default:
+ 	    osi_Panic("Invalid negative inode");
+ 	}
+     } else {
+ 	dummy = ainode / afs_numfilesperdir;
+ 	snprintf(fname, 1024, "%s/D%d/V%d", afs_cachebasedir, dummy, ainode);
+     }
+ 
+     code = vnode_open(fname, O_RDWR, 0, 0, &vp, afs_osi_ctxtp);
+ #else
  #ifndef AFS_DARWIN80_ENV
      if (afs_CacheFSType == AFS_APPL_HFS_CACHE)
  	code = igetinode(afs_cacheVfsp, (dev_t) cacheDev.dev, &ainode, &vp, &va, &dummy);	/* XXX hfs is broken */
***************
*** 166,181 ****
      else
  	panic("osi_UFSOpen called before cacheops initialized\n");
  #endif
      AFS_GLOCK();
      if (code) {
  	osi_FreeSmallSpace(afile);
  	osi_Panic("UFSOpen: igetinode failed");
      }
      afile->vnode = vp;
-     afile->size = va.va_size;
      afile->offset = 0;
      afile->proc = (int (*)())0;
      afile->inum = ainode;	/* for hint validity checking */
      return (void *)afile;
  }
  
--- 191,212 ----
      else
  	panic("osi_UFSOpen called before cacheops initialized\n");
  #endif
+ #endif
      AFS_GLOCK();
      if (code) {
  	osi_FreeSmallSpace(afile);
  	osi_Panic("UFSOpen: igetinode failed");
      }
      afile->vnode = vp;
      afile->offset = 0;
      afile->proc = (int (*)())0;
      afile->inum = ainode;	/* for hint validity checking */
+ #ifndef AFS_CACHE_VNODE_PATH
+     afile->size = va.va_size;
+ #else
+     code = afs_osi_Stat(afile, &tstat);
+     afile->size = tstat.size;
+ #endif
      return (void *)afile;
  }
  
Index: openafs/src/afs/DARWIN/osi_vnodeops.c
diff -c openafs/src/afs/DARWIN/osi_vnodeops.c:1.41.2.3 openafs/src/afs/DARWIN/osi_vnodeops.c:1.41.2.7
*** openafs/src/afs/DARWIN/osi_vnodeops.c:1.41.2.3	Sat Jul 28 10:33:26 2007
--- openafs/src/afs/DARWIN/osi_vnodeops.c	Mon Oct 22 20:31:23 2007
***************
*** 5,11 ****
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/afs/DARWIN/osi_vnodeops.c,v 1.41.2.3 2007/07/28 14:33:26 shadow Exp $");
  
  #include <afs/sysincludes.h>	/* Standard vendor system headers */
  #include <afsincludes.h>	/* Afs-based standard headers */
--- 5,11 ----
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/afs/DARWIN/osi_vnodeops.c,v 1.41.2.7 2007/10/23 00:31:23 shadow Exp $");
  
  #include <afs/sysincludes.h>	/* Standard vendor system headers */
  #include <afsincludes.h>	/* Afs-based standard headers */
***************
*** 643,649 ****
      if (code) {
          code= 0;               /* if access is ok */
      } else {
!         code = afs_CheckCode(EACCES, &treq, 57);        /* failure code */
      }
  out:
       afs_PutFakeStat(&fakestate);
--- 643,656 ----
      if (code) {
          code= 0;               /* if access is ok */
      } else {
! #if defined(AFS_DARWIN80_ENV) && !defined(AFS_DARWIN90_ENV)
! 	if (ap->a_action == KAUTH_VNODE_READ_DATA) {
! 	    /* In 10.4 cp will loop forever on EACCES */
! 	    code = afs_CheckCode(EACCES, &treq, 57);
!         } else 
! 	    /* but kinit wants EACCES or it gets dumb */
! #endif
! 	    code = afs_CheckCode(EACCES, &treq, 57);        /* failure code */
      }
  out:
       afs_PutFakeStat(&fakestate);
***************
*** 2060,2073 ****
     Don't touch! */
  int 
  afs_darwin_finalizevnode(struct vcache *avc, struct vnode *dvp, struct componentname *cnp, int isroot) {
!    vnode_t ovp = AFSTOV(avc);
     vnode_t nvp;
     int error;
     struct vnode_fsparam par;
     AFS_GLOCK();
     ObtainWriteLock(&avc->lock,325);
     if (!(avc->states & CDeadVnode) && vnode_vtype(ovp) != VNON) {
-         ReleaseWriteLock(&avc->lock);
          AFS_GUNLOCK();
  #if 0 /* unsupported */
          if (dvp && cnp)
--- 2067,2080 ----
     Don't touch! */
  int 
  afs_darwin_finalizevnode(struct vcache *avc, struct vnode *dvp, struct componentname *cnp, int isroot) {
!    vnode_t ovp;
     vnode_t nvp;
     int error;
     struct vnode_fsparam par;
     AFS_GLOCK();
     ObtainWriteLock(&avc->lock,325);
+    ovp = AFSTOV(avc);
     if (!(avc->states & CDeadVnode) && vnode_vtype(ovp) != VNON) {
          AFS_GUNLOCK();
  #if 0 /* unsupported */
          if (dvp && cnp)
***************
*** 2075,2081 ****
--- 2082,2092 ----
                                cnp->cn_hash,
                                VNODE_UPDATE_PARENT|VNODE_UPDATE_NAME);
  #endif
+ 	/* Can end up in reclaim... drop GLOCK */
          vnode_rele(ovp);
+ 	AFS_GLOCK();
+         ReleaseWriteLock(&avc->lock);
+ 	AFS_GUNLOCK();
          return 0;
     }
     if ((avc->states & CDeadVnode) && vnode_vtype(ovp) != VNON) 
***************
*** 2097,2116 ****
     error = vnode_create(VNCREATE_FLAVOR, VCREATESIZE, &par, &nvp);
     if (!error) {
         vnode_addfsref(nvp);
         avc->v = nvp;
         avc->states &=~ CDeadVnode;
-        if (!(avc->states & CVInit)) {
- 	   vnode_clearfsnode(ovp);
- 	   vnode_removefsref(ovp);
-        }
     }
     AFS_GLOCK();
     ReleaseWriteLock(&avc->lock);
     if (!error)
        afs_osi_Wakeup(&avc->states);
     AFS_GUNLOCK();
-    vnode_put(ovp);
-    vnode_rele(ovp);
     return error;
  }
  #endif
--- 2108,2131 ----
     error = vnode_create(VNCREATE_FLAVOR, VCREATESIZE, &par, &nvp);
     if (!error) {
         vnode_addfsref(nvp);
+        if ((avc->states & CDeadVnode) && vnode_vtype(ovp) != VNON) 
+ 	   printf("vcache %p should not be CDeadVnode", avc);
+        if (avc->v == ovp) {
+ 	   if (!(avc->states & CVInit)) {
+ 	       vnode_clearfsnode(ovp);
+ 	       vnode_removefsref(ovp);
+ 	   }
+        }
         avc->v = nvp;
         avc->states &=~ CDeadVnode;
     }
+    vnode_put(ovp);
+    vnode_rele(ovp);
     AFS_GLOCK();
     ReleaseWriteLock(&avc->lock);
     if (!error)
        afs_osi_Wakeup(&avc->states);
     AFS_GUNLOCK();
     return error;
  }
  #endif
Index: openafs/src/afs/LINUX/osi_vfsops.c
diff -c openafs/src/afs/LINUX/osi_vfsops.c:1.42.4.18 openafs/src/afs/LINUX/osi_vfsops.c:1.42.4.19
*** openafs/src/afs/LINUX/osi_vfsops.c:1.42.4.18	Fri Jul 13 18:17:25 2007
--- openafs/src/afs/LINUX/osi_vfsops.c	Thu Oct  4 23:10:00 2007
***************
*** 16,22 ****
  #include "afs/param.h"
  
  RCSID
!     ("$Header: /cvs/openafs/src/afs/LINUX/osi_vfsops.c,v 1.42.4.18 2007/07/13 22:17:25 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.42.4.19 2007/10/05 03:10:00 shadow Exp $");
  
  #define __NO_VERSION__		/* don't define kernel_version in module.h */
  #include <linux/module.h> /* early to avoid printf->printk mapping */
***************
*** 269,275 ****
--- 269,279 ----
  
  
  #if defined(STRUCT_SUPER_HAS_ALLOC_INODE)
+ #if defined(HAVE_KMEM_CACHE_T)
  static kmem_cache_t *afs_inode_cachep;
+ #else
+ struct kmem_cache *afs_inode_cachep;
+ #endif
  
  static struct inode *
  afs_alloc_inode(struct super_block *sb)
***************
*** 294,300 ****
--- 298,308 ----
  }
  
  static void
+ #if defined(HAVE_KMEM_CACHE_T)
  init_once(void * foo, kmem_cache_t * cachep, unsigned long flags)
+ #else
+ init_once(void * foo, struct kmem_cache * cachep, unsigned long flags)
+ #endif
  {
      struct vcache *vcp = (struct vcache *) foo;
  
***************
*** 312,321 ****
--- 320,336 ----
  #define SLAB_RECLAIM_ACCOUNT 0
  #endif
  
+ #if defined(KMEM_CACHE_TAKES_DTOR)
      afs_inode_cachep = kmem_cache_create("afs_inode_cache",
  					 sizeof(struct vcache),
  					 0, SLAB_HWCACHE_ALIGN | SLAB_RECLAIM_ACCOUNT,
  					 init_once, NULL);
+ #else
+     afs_inode_cachep = kmem_cache_create("afs_inode_cache",
+ 					 sizeof(struct vcache),
+ 					 0, SLAB_HWCACHE_ALIGN | SLAB_RECLAIM_ACCOUNT,
+ 					 init_once);
+ #endif
      if (afs_inode_cachep == NULL)
  	return -ENOMEM;
      return 0;
Index: openafs/src/afs/LINUX/osi_vnodeops.c
diff -c openafs/src/afs/LINUX/osi_vnodeops.c:1.126.2.17 openafs/src/afs/LINUX/osi_vnodeops.c:1.126.2.18
*** openafs/src/afs/LINUX/osi_vnodeops.c:1.126.2.17	Tue Jun 12 14:34:18 2007
--- openafs/src/afs/LINUX/osi_vnodeops.c	Thu Oct  4 23:10:00 2007
***************
*** 22,28 ****
  #include "afs/param.h"
  
  RCSID
!     ("$Header: /cvs/openafs/src/afs/LINUX/osi_vnodeops.c,v 1.126.2.17 2007/06/12 18:34:18 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.126.2.18 2007/10/05 03:10:00 shadow Exp $");
  
  #include "afs/sysincludes.h"
  #include "afsincludes.h"
***************
*** 658,664 ****
    .mmap =	afs_linux_mmap,
    .open =	afs_linux_open,
    .flush =	afs_linux_flush,
! #ifdef AFS_LINUX26_ENV
    .sendfile =   generic_file_sendfile,
  #endif
    .release =	afs_linux_release,
--- 658,664 ----
    .mmap =	afs_linux_mmap,
    .open =	afs_linux_open,
    .flush =	afs_linux_flush,
! #if defined(AFS_LINUX26_ENV) && defined(STRUCT_FILE_OPERATIONS_HAS_SENDFILE)
    .sendfile =   generic_file_sendfile,
  #endif
    .release =	afs_linux_release,
Index: openafs/src/afs/SOLARIS/osi_machdep.h
diff -c openafs/src/afs/SOLARIS/osi_machdep.h:1.11.4.2 openafs/src/afs/SOLARIS/osi_machdep.h:1.11.4.4
*** openafs/src/afs/SOLARIS/osi_machdep.h:1.11.4.2	Tue Jan  2 02:34:46 2007
--- openafs/src/afs/SOLARIS/osi_machdep.h	Fri Oct  5 18:18:35 2007
***************
*** 104,107 ****
--- 104,126 ----
  #define AfsLargeFileSize(pos, off) ( ((offset_t)(pos)+(offset_t)(off) > (offset_t)0x7fffffff)?1:0)
  #endif
  
+ #if defined(AFS_SUN510_ENV)
+ #include "h/sunddi.h"
+ extern ddi_taskq_t *afs_taskq;
+ extern krwlock_t afsifinfo_lock;
+ 
+ /* this should be in rx/SOLARIS/rx_knet.c accessed via accessor functions,
+    eventually */
+ #include "net/if.h"
+ /* Global interface info struct */
+ struct afs_ifinfo {
+   char        ifname[LIFNAMSIZ];
+   ipaddr_t    ipaddr;
+   ipaddr_t    netmask;
+   uint_t      mtu;
+   uint64_t    flags;
+   int         metric;
+   ipaddr_t    dstaddr;
+ };
+ #endif
  #endif /* _OSI_MACHDEP_H_ */
Index: openafs/src/afsd/afsd.c
diff -c openafs/src/afsd/afsd.c:1.60.2.6 openafs/src/afsd/afsd.c:1.60.2.7
*** openafs/src/afsd/afsd.c:1.60.2.6	Tue Jun 26 15:13:37 2007
--- openafs/src/afsd/afsd.c	Wed Oct 10 13:01:44 2007
***************
*** 58,64 ****
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/afsd/afsd.c,v 1.60.2.6 2007/06/26 19:13:37 shadow Exp $");
  
  #define VFS 1
  
--- 58,64 ----
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/afsd/afsd.c,v 1.60.2.7 2007/10/10 17:01:44 shadow Exp $");
  
  #define VFS 1
  
***************
*** 334,341 ****
--- 334,343 ----
  				 * -2: file exists in top-level
  				 * >=0: file exists in Dxxx
  				 */
+ #ifndef AFS_CACHE_VNODE_PATH
  AFSD_INO_T *inode_for_V;	/* Array of inodes for desired
  				 * cache files */
+ #endif
  int missing_DCacheFile = 1;	/*Is the DCACHEFILE missing? */
  int missing_VolInfoFile = 1;	/*Is the VOLINFOFILE missing? */
  int missing_CellInfoFile = 1;	/*Is the CELLINFOFILE missing? */
***************
*** 1007,1013 ****
--- 1009,1017 ----
  	     * file's inode, directory, and bump the number of files found
  	     * total and in this directory.
  	     */
+ #ifndef AFS_CACHE_VNODE_PATH
  	    inode_for_V[vFileNum] = currp->d_ino;
+ #endif
  	    dir_for_V[vFileNum] = dirNum;	/* remember this directory */
  
  	    if (!maxDir) {
***************
*** 1144,1150 ****
--- 1148,1156 ----
  			   vFileNum);
  		else {
  		    struct stat statb;
+ #ifndef AFS_CACHE_VNODE_PATH
  		    assert(inode_for_V[vFileNum] == (AFSD_INO_T) 0);
+ #endif
  		    sprintf(vFilePtr, "D%d/V%d", thisDir, vFileNum);
  		    if (afsd_verbose)
  			printf("%s: Creating '%s'\n", rn, fullpn_VFile);
***************
*** 1155,1161 ****
--- 1161,1169 ----
  		    if (CreateCacheFile(fullpn_VFile, &statb))
  			printf("%s: Can't create '%s'\n", rn, fullpn_VFile);
  		    else {
+ #ifndef AFS_CACHE_VNODE_PATH
  			inode_for_V[vFileNum] = statb.st_ino;
+ #endif
  			dir_for_V[vFileNum] = thisDir;
  			cache_dir_list[thisDir]++;
  			(*vFilesFound)++;
***************
*** 1923,1928 ****
--- 1931,1937 ----
  		   cacheStatEntries);
      }
  
+ #ifndef AFS_CACHE_VNODE_PATH
      /*
       * Create and zero the inode table for the desired cache files.
       */
***************
*** 1937,1942 ****
--- 1946,1952 ----
      if (afsd_debug)
  	printf("%s: %d inode_for_V entries at 0x%x, %d bytes\n", rn,
  	       cacheFiles, inode_for_V, (cacheFiles * sizeof(AFSD_INO_T)));
+ #endif
  
      /*
       * Set up all the pathnames we'll need for later.
***************
*** 2125,2130 ****
--- 2135,2157 ----
  		     rn, vFilesFound, cacheFiles, cacheIteration);
  	} while ((vFilesFound < cacheFiles)
  		 && (cacheIteration < MAX_CACHE_LOOPS));
+ #ifdef AFS_CACHE_VNODE_PATH
+ 	if (afsd_debug)
+ 	    printf
+ 		("%s: Calling AFSOP_CACHEBASEDIR with '%s'\n",
+ 		 rn, cacheBaseDir);
+ 	call_syscall(AFSOP_CACHEBASEDIR, cacheBaseDir);
+ 	if (afsd_debug)
+ 	    printf
+ 		("%s: Calling AFSOP_CACHEDIRS with %d dirs\n",
+ 		 rn, nFilesPerDir);
+ 	call_syscall(AFSOP_CACHEDIRS, nFilesPerDir);
+ 	if (afsd_debug)
+ 	    printf
+ 		("%s: Calling AFSOP_CACHEFILES with %d files\n",
+ 		 rn, cacheFiles);
+ 	call_syscall(AFSOP_CACHEFILES, cacheFiles);
+ #endif
      } else if (afsd_verbose)
  	printf("%s: Using memory cache, not swept\n", rn);
  
***************
*** 2259,2264 ****
--- 2286,2292 ----
      if (!(cacheFlags & AFSCALL_INIT_MEMCACHE))
  	call_syscall(AFSOP_VOLUMEINFO, fullpn_VolInfoFile);
  
+ #ifndef AFS_CACHE_VNODE_PATH
      /*
       * Give the kernel the names of the AFS files cached on the workstation's
       * disk.
***************
*** 2277,2283 ****
  	    call_syscall(AFSOP_CACHEINODE, inode_for_V[currVFile]);
  #endif
  	}
! 
  
      /*end for */
      /*
--- 2305,2311 ----
  	    call_syscall(AFSOP_CACHEINODE, inode_for_V[currVFile]);
  #endif
  	}
! #endif
  
      /*end for */
      /*
Index: openafs/src/bucoord/restore.c
diff -c openafs/src/bucoord/restore.c:1.10.6.5 openafs/src/bucoord/restore.c:1.10.6.6
*** openafs/src/bucoord/restore.c:1.10.6.5	Tue Jun 26 01:42:06 2007
--- openafs/src/bucoord/restore.c	Tue Oct 16 12:58:41 2007
***************
*** 15,21 ****
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/bucoord/restore.c,v 1.10.6.5 2007/06/26 05:42:06 jaltman 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.10.6.6 2007/10/16 16:58:41 jaltman Exp $");
  
  #include <afs/stds.h>
  #include <sys/types.h>
***************
*** 224,230 ****
  	    code = bcdb_FindDumpByID(dumpTaskPtr->parentDumpID, dumpDescr);
  	    if (code)
  	      {
! 		afs_com_err(whoami, "Couldn't look up info for dump %d\n",
  			dumpTaskPtr->parentDumpID);
  		continue;
  	      }
--- 224,230 ----
  	    code = bcdb_FindDumpByID(dumpTaskPtr->parentDumpID, dumpDescr);
  	    if (code)
  	      {
! 		afs_com_err(whoami, code, "Couldn't look up info for dump %d\n",
  			dumpTaskPtr->parentDumpID);
  		continue;
  	      }
Index: openafs/src/cf/linux-test4.m4
diff -c openafs/src/cf/linux-test4.m4:1.29.2.26 openafs/src/cf/linux-test4.m4:1.29.2.27
*** openafs/src/cf/linux-test4.m4:1.29.2.26	Tue Jun 12 14:34:18 2007
--- openafs/src/cf/linux-test4.m4	Thu Oct  4 23:10:01 2007
***************
*** 871,873 ****
--- 871,904 ----
        ac_cv_linux_func_f_flush_takes_fl_owner_t=no)])
    AC_MSG_RESULT($ac_cv_linux_func_f_flush_takes_fl_owner_t)])
  
+ AC_DEFUN([LINUX_HAVE_KMEM_CACHE_T], [
+   AC_MSG_CHECKING([whether kmem_cache_t exists])
+   AC_CACHE_VAL([ac_cv_linux_have_kmem_cache_t], [
+     AC_TRY_KBUILD(
+ [#include <linux/slab.h>],
+ [kmem_cache_t *k;],
+       ac_cv_linux_have_kmem_cache_t=yes,
+       ac_cv_linux_have_kmem_cache_t=no)])
+   AC_MSG_RESULT($ac_cv_linux_have_kmem_cache_t)])
+ 
+ AC_DEFUN([LINUX_KMEM_CACHE_CREATE_TAKES_DTOR], [
+   AC_MSG_CHECKING([whether kmem_cache_create takes a destructor argument])
+   AC_CACHE_VAL([ac_cv_linux_kmem_cache_create_takes_dtor], [
+     AC_TRY_KBUILD(
+ [#include <linux/slab.h>],
+ [kmem_cache_create(NULL, 0, 0, 0, NULL, NULL);],
+       ac_cv_linux_kmem_cache_create_takes_dtor=yes,
+       ac_cv_linux_kmem_cache_create_takes_dtor=no)])
+   AC_MSG_RESULT($ac_cv_linux_kmem_cache_create_takes_dtor)])
+ 
+ AC_DEFUN([LINUX_FS_STRUCT_FOP_HAS_SENDFILE], [
+   AC_MSG_CHECKING([for sendfile in struct file_operations])
+   AC_CACHE_VAL([ac_cv_linux_fs_struct_fop_has_sendfile], [
+     AC_TRY_KBUILD(
+ [#include <linux/fs.h>],
+ [struct file_operations _fop;
+ _fop.sendfile(NULL, NULL, 0, 0, NULL);],
+       ac_cv_linux_fs_struct_fop_has_sendfile=yes,
+       ac_cv_linux_fs_struct_fop_has_sendfile=no)])
+   AC_MSG_RESULT($ac_cv_linux_fs_struct_fop_has_sendfile)])
+ 
Index: openafs/src/config/Makefile.config.in
diff -c openafs/src/config/Makefile.config.in:1.12 openafs/src/config/Makefile.config.in:1.12.2.1
*** openafs/src/config/Makefile.config.in:1.12	Wed Apr 26 11:36:21 2006
--- openafs/src/config/Makefile.config.in	Fri Oct 19 20:23:45 2007
***************
*** 32,37 ****
--- 32,38 ----
  AFSD_LIBS = @AFSD_LIBS@
  AFSD_LDFLAGS = @AFSD_LDFLAGS@
  CC = @CC@
+ CPP = @CPP@
  CCOBJ = @CCOBJ@
  CCXPG2 = @CCXPG2@
  CFLAGS = @CFLAGS@
Index: openafs/src/config/NTMakefile.amd64_w2k
diff -c openafs/src/config/NTMakefile.amd64_w2k:1.24.2.30 openafs/src/config/NTMakefile.amd64_w2k:1.24.2.31
*** openafs/src/config/NTMakefile.amd64_w2k:1.24.2.30	Wed Sep 19 23:59:48 2007
--- openafs/src/config/NTMakefile.amd64_w2k	Mon Oct 22 19:28:14 2007
***************
*** 84,90 ****
  #define used in WinNT/2000 installation and program version display
  AFSPRODUCT_VER_MAJOR=1
  AFSPRODUCT_VER_MINOR=5
! AFSPRODUCT_VER_PATCH=2500
  AFSPRODUCT_VER_BUILD=0
  
  AFSPRODUCT_VERSION=$(AFSPRODUCT_VER_MAJOR).$(AFSPRODUCT_VER_MINOR).$(AFSPRODUCT_VER_PATCH)
--- 84,90 ----
  #define used in WinNT/2000 installation and program version display
  AFSPRODUCT_VER_MAJOR=1
  AFSPRODUCT_VER_MINOR=5
! AFSPRODUCT_VER_PATCH=2600
  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.84.2.29 openafs/src/config/NTMakefile.i386_nt40:1.84.2.30
*** openafs/src/config/NTMakefile.i386_nt40:1.84.2.29	Wed Sep 19 23:59:48 2007
--- openafs/src/config/NTMakefile.i386_nt40	Mon Oct 22 19:28:14 2007
***************
*** 84,90 ****
  #define used in WinNT/2000 installation and program version display
  AFSPRODUCT_VER_MAJOR=1
  AFSPRODUCT_VER_MINOR=5
! AFSPRODUCT_VER_PATCH=2500
  AFSPRODUCT_VER_BUILD=0
  
  AFSPRODUCT_VERSION=$(AFSPRODUCT_VER_MAJOR).$(AFSPRODUCT_VER_MINOR).$(AFSPRODUCT_VER_PATCH)
--- 84,90 ----
  #define used in WinNT/2000 installation and program version display
  AFSPRODUCT_VER_MAJOR=1
  AFSPRODUCT_VER_MINOR=5
! AFSPRODUCT_VER_PATCH=2600
  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.23.2.30 openafs/src/config/NTMakefile.i386_w2k:1.23.2.31
*** openafs/src/config/NTMakefile.i386_w2k:1.23.2.30	Wed Sep 19 23:59:48 2007
--- openafs/src/config/NTMakefile.i386_w2k	Mon Oct 22 19:28:14 2007
***************
*** 84,90 ****
  #define used in WinNT/2000 installation and program version display
  AFSPRODUCT_VER_MAJOR=1
  AFSPRODUCT_VER_MINOR=5
! AFSPRODUCT_VER_PATCH=2500
  AFSPRODUCT_VER_BUILD=0
  
  AFSPRODUCT_VERSION=$(AFSPRODUCT_VER_MAJOR).$(AFSPRODUCT_VER_MINOR).$(AFSPRODUCT_VER_PATCH)
--- 84,90 ----
  #define used in WinNT/2000 installation and program version display
  AFSPRODUCT_VER_MAJOR=1
  AFSPRODUCT_VER_MINOR=5
! AFSPRODUCT_VER_PATCH=2600
  AFSPRODUCT_VER_BUILD=0
  
  AFSPRODUCT_VERSION=$(AFSPRODUCT_VER_MAJOR).$(AFSPRODUCT_VER_MINOR).$(AFSPRODUCT_VER_PATCH)
Index: openafs/src/config/afs_args.h
diff -c openafs/src/config/afs_args.h:1.20 openafs/src/config/afs_args.h:1.20.4.1
*** openafs/src/config/afs_args.h:1.20	Thu Oct 13 11:12:11 2005
--- openafs/src/config/afs_args.h	Wed Oct 10 13:01:46 2007
***************
*** 87,92 ****
--- 87,100 ----
  /* For SGI, this can't interfere with any of the 64 bit inode calls. */
  #define AFSOP_RXLISTENER_DAEMON  48	/* starts kernel RX listener */
  
+ /* skip 64 bit calls */
+ #define AFSOP_CACHEBASEDIR       50     /* cache base dir */
+ #define AFSOP_CACHEDIRS          51     /* number of files per dir */
+ #define AFSOP_CACHEFILES         52     /* number of files */
+ 
+ #define AFSOP_SETINT             60     /* we should just set key/value pairs 
+                                           for things which are just ints */
+ 
  /* these are for initialization flags */
  
  #define AFSCALL_INIT_MEMCACHE 0x1
***************
*** 227,230 ****
--- 235,244 ----
  #define SYSCALL_DEV_FNAME "/dev/openafs_ioctl"
  #endif
  
+ #ifdef AFS_CACHE_VNODE_PATH
+ #define AFS_CACHE_CELLS_INODE -2
+ #define AFS_CACHE_ITEMS_INODE -3
+ #define AFS_CACHE_VOLUME_INODE -4
+ #endif
+ 
  #endif /* _AFS_ARGS_H_ */
Index: openafs/src/config/param.ppc_darwin_90.h
diff -c openafs/src/config/param.ppc_darwin_90.h:1.1 openafs/src/config/param.ppc_darwin_90.h:1.1.6.1
*** openafs/src/config/param.ppc_darwin_90.h:1.1	Thu Mar  9 01:38:23 2006
--- openafs/src/config/param.ppc_darwin_90.h	Wed Oct 10 13:01:46 2007
***************
*** 30,35 ****
--- 30,36 ----
  #define AFS_SYSCALL             230
  #define AFS_NAMEI_ENV 1
  #define DARWIN_REFBASE 3
+ #define AFS_CACHE_VNODE_PATH
  
  /* File system entry (used if mount.h doesn't define MOUNT_AFS */
  #define AFS_MOUNT_AFS    "afs"
Index: openafs/src/config/param.x86_darwin_90.h
diff -c openafs/src/config/param.x86_darwin_90.h:1.1 openafs/src/config/param.x86_darwin_90.h:1.1.6.1
*** openafs/src/config/param.x86_darwin_90.h:1.1	Thu Mar  9 01:38:23 2006
--- openafs/src/config/param.x86_darwin_90.h	Wed Oct 10 13:01:46 2007
***************
*** 30,35 ****
--- 30,36 ----
  #define AFS_SYSCALL             230
  #define AFS_NAMEI_ENV 1
  #define DARWIN_REFBASE 3
+ #define AFS_CACHE_VNODE_PATH
  
  /* File system entry (used if mount.h doesn't define MOUNT_AFS */
  #define AFS_MOUNT_AFS    "afs"
Index: openafs/src/dir/dir.c
diff -c openafs/src/dir/dir.c:1.24 openafs/src/dir/dir.c:1.24.4.3
*** openafs/src/dir/dir.c:1.24	Thu Oct 13 11:12:12 2005
--- openafs/src/dir/dir.c	Thu Oct 11 13:46:37 2007
***************
*** 11,17 ****
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/dir/dir.c,v 1.24 2005/10/13 15:12:12 shadow Exp $");
  
  #ifdef KERNEL
  #if !defined(UKERNEL)
--- 11,17 ----
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/dir/dir.c,v 1.24.4.3 2007/10/11 17:46:37 shadow Exp $");
  
  #ifdef KERNEL
  #if !defined(UKERNEL)
***************
*** 478,484 ****
  {
      /* Hash a string to a number between 0 and NHASHENT. */
      register unsigned char tc;
!     register int hval;
      register int tval;
      hval = 0;
      while ((tc = (*string++))) {
--- 478,484 ----
  {
      /* Hash a string to a number between 0 and NHASHENT. */
      register unsigned char tc;
!     unsigned int hval;
      register int tval;
      hval = 0;
      while ((tc = (*string++))) {
***************
*** 488,494 ****
      tval = hval & (NHASHENT - 1);
      if (tval == 0)
  	return tval;
!     else if (hval < 0)
  	tval = NHASHENT - tval;
      return tval;
  }
--- 488,494 ----
      tval = hval & (NHASHENT - 1);
      if (tval == 0)
  	return tval;
!     else if (hval >= 1<<31)
  	tval = NHASHENT - tval;
      return tval;
  }
Index: openafs/src/libadmin/adminutil/afs_AdminInternal.h
diff -c openafs/src/libadmin/adminutil/afs_AdminInternal.h:1.4 openafs/src/libadmin/adminutil/afs_AdminInternal.h:1.4.14.1
*** openafs/src/libadmin/adminutil/afs_AdminInternal.h:1.4	Tue Jul 15 19:15:23 2003
--- openafs/src/libadmin/adminutil/afs_AdminInternal.h	Wed Oct  3 11:29:28 2007
***************
*** 50,55 ****
--- 50,61 ----
      int pts_valid;
      int vos_valid;
      int vos_new;
+     /* need to add server lists with TTL 
+      * so we don't pound the dns servers constantly 
+      * when generating the iterators
+      */
+     void *server_list;
+     time_t server_ttl;	/* expiration time */
      int end_magic;
  } afs_cell_handle_t, *afs_cell_handle_p;
  
Index: openafs/src/libadmin/client/afs_clientAdmin.c
diff -c openafs/src/libadmin/client/afs_clientAdmin.c:1.11.4.1 openafs/src/libadmin/client/afs_clientAdmin.c:1.11.4.2
*** openafs/src/libadmin/client/afs_clientAdmin.c:1.11.4.1	Sun Jul 15 20:02:16 2007
--- openafs/src/libadmin/client/afs_clientAdmin.c	Wed Oct  3 11:29:29 2007
***************
*** 11,17 ****
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/libadmin/client/afs_clientAdmin.c,v 1.11.4.1 2007/07/16 00:02:16 jaltman Exp $");
  
  #include <afs/stds.h>
  #include "afs_clientAdmin.h"
--- 11,17 ----
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/libadmin/client/afs_clientAdmin.c,v 1.11.4.2 2007/10/03 15:29:29 jaltman Exp $");
  
  #include <afs/stds.h>
  #include "afs_clientAdmin.h"
***************
*** 59,64 ****
--- 59,66 ----
  
  static const unsigned long ADMIN_TICKET_LIFETIME = 24 * 3600;
  
+ static const unsigned long SERVER_TTL = 10 * 60;
+ 
  /*
   * We need a way to track whether or not the client library has been 
   * initialized.  We count on the fact that the other library initialization
***************
*** 946,951 ****
--- 948,955 ----
  	c_handle->begin_magic = BEGIN_MAGIC;
  	c_handle->is_valid = 1;
  	c_handle->is_null = 0;
+ 	c_handle->server_list = NULL;
+ 	c_handle->server_ttl = 0;
  	c_handle->end_magic = END_MAGIC;
  	*cellHandleP = (void *)c_handle;
      }
***************
*** 1020,1028 ****
      c_handle->kas_valid = 0;
      c_handle->pts_valid = 0;
      c_handle->vos_valid = 0;
!     c_handle->kas = 0;
!     c_handle->pts = 0;
!     c_handle->vos = 0;
      *cellHandleP = (void *)c_handle;
      rc = 1;
  
--- 1024,1034 ----
      c_handle->kas_valid = 0;
      c_handle->pts_valid = 0;
      c_handle->vos_valid = 0;
!     c_handle->kas = NULL;
!     c_handle->pts = NULL;
!     c_handle->vos = NULL;
!     c_handle->server_list = NULL;
!     c_handle->server_ttl = 0;
      *cellHandleP = (void *)c_handle;
      rc = 1;
  
***************
*** 1071,1076 ****
--- 1077,1084 ----
  	goto fail_afsclient_CellClose;
      }
  
+     if (c_handle->server_list)
+ 	free(c_handle->server_list);
      if (c_handle->kas_valid)
  	ubik_ClientDestroy(c_handle->kas);
      if (c_handle->pts_valid)
***************
*** 1825,1830 ****
--- 1833,1839 ----
      afs_admin_iterator_p iter =
  	(afs_admin_iterator_p) malloc(sizeof(afs_admin_iterator_t));
      server_get_p serv = (server_get_p) calloc(1, sizeof(server_get_t));
+     server_get_p serv_cache = NULL;
      const char *cellName;
      void *database_iter;
      util_databaseServerEntry_t database_entry;
***************
*** 1847,1903 ****
  	goto fail_afsclient_AFSServerGetBegin;
      }
  
!     /*
!      * Retrieve the list of database servers for this cell.
!      */
! 
!     if (!afsclient_CellNameGet(cellHandle, &cellName, &tst)) {
! 	goto fail_afsclient_AFSServerGetBegin;
      }
  
!     if (!util_DatabaseServerGetBegin(cellName, &database_iter, &tst)) {
! 	goto fail_afsclient_AFSServerGetBegin;
!     }
  
!     while (util_DatabaseServerGetNext(database_iter, &database_entry, &tst)) {
! 	serv->server[serv->total].serverAddress[0] =
! 	    database_entry.serverAddress;
! 	serv->server[serv->total].serverType = DATABASE_SERVER;
! 	serv->total++;
!     }
  
!     if (tst != ADMITERATORDONE) {
! 	util_DatabaseServerGetDone(database_iter, 0);
! 	goto fail_afsclient_AFSServerGetBegin;
!     }
  
!     if (!util_DatabaseServerGetDone(database_iter, &tst)) {
! 	goto fail_afsclient_AFSServerGetBegin;
!     }
  
!     /*
!      * Retrieve the list of file servers for this cell.
!      */
  
!     if (!vos_FileServerGetBegin(cellHandle, 0, &fileserver_iter, &tst)) {
! 	goto fail_afsclient_AFSServerGetBegin;
!     }
  
-     while (vos_FileServerGetNext(fileserver_iter, &fileserver_entry, &tst)) {
  	/*
! 	 * See if any of the addresses returned in this fileserver_entry
! 	 * structure already exist in the list of servers we're building.
! 	 * If not, create a new record for this server.
  	 */
! 	is_dup = 0;
! 	for (iserv = 0; iserv < serv->total; iserv++) {
! 	    for (ientryaddr = 0; ientryaddr < fileserver_entry.count;
! 		 ientryaddr++) {
! 		for (iservaddr = 0; iservaddr < AFS_MAX_SERVER_ADDRESS;
! 		     iservaddr++) {
! 		    if (serv->server[iserv].serverAddress[iservaddr] ==
! 			fileserver_entry.serverAddress[ientryaddr]) {
! 			is_dup = 1;
  			break;
  		    }
  		}
--- 1856,1932 ----
  	goto fail_afsclient_AFSServerGetBegin;
      }
  
!   restart:
!     LOCK_GLOBAL_MUTEX;
!     if (c_handle->server_list != NULL && c_handle->server_ttl < time(NULL)) {
! 	serv_cache = c_handle->server_list;
! 	c_handle->server_list = NULL;
      }
+     UNLOCK_GLOBAL_MUTEX;
  
!     if (c_handle->server_list == NULL) {
! 	if (serv_cache == NULL) {
! 	    serv_cache = (server_get_p) calloc(1, sizeof(server_get_t));
! 
! 	    if (serv_cache == NULL) {
! 		tst = ADMNOMEM;
! 		goto fail_afsclient_AFSServerGetBegin;
! 	    }
! 	}
  
! 	/*
! 	 * Retrieve the list of database servers for this cell.
! 	 */
  
! 	if (!afsclient_CellNameGet(c_handle, &cellName, &tst)) {
! 	    goto fail_afsclient_AFSServerGetBegin;
! 	}
  
! 	if (!util_DatabaseServerGetBegin(cellName, &database_iter, &tst)) {
! 	    goto fail_afsclient_AFSServerGetBegin;
! 	}
  
! 	while (util_DatabaseServerGetNext(database_iter, &database_entry, &tst)) {
! 	    serv->server[serv->total].serverAddress[0] =
! 		database_entry.serverAddress;
! 	    serv->server[serv->total].serverType = DATABASE_SERVER;
! 	    serv->total++;
! 	}
  
! 	if (tst != ADMITERATORDONE) {
! 	    util_DatabaseServerGetDone(database_iter, 0);
! 	    goto fail_afsclient_AFSServerGetBegin;
! 	}
! 
! 	if (!util_DatabaseServerGetDone(database_iter, &tst)) {
! 	    goto fail_afsclient_AFSServerGetBegin;
! 	}
  
  	/*
!  	 * Retrieve the list of file servers for this cell.
  	 */
! 
! 	if (!vos_FileServerGetBegin(c_handle, 0, &fileserver_iter, &tst)) {
! 	    goto fail_afsclient_AFSServerGetBegin;
! 	}
! 
! 	while (vos_FileServerGetNext(fileserver_iter, &fileserver_entry, &tst)) {
! 	    /*
! 	     * See if any of the addresses returned in this fileserver_entry
! 	     * structure already exist in the list of servers we're building.
! 	     * If not, create a new record for this server.
! 	     */
! 	    is_dup = 0;
! 	    for (iserv = 0; iserv < serv->total; iserv++) {
! 		for (ientryaddr = 0; ientryaddr < fileserver_entry.count; ientryaddr++) {
! 		    for (iservaddr = 0; iservaddr < AFS_MAX_SERVER_ADDRESS; iservaddr++) {
! 			if (serv->server[iserv].serverAddress[iservaddr] ==
! 			     fileserver_entry.serverAddress[ientryaddr]) {
! 			    is_dup = 1;
! 			    break;
! 			}
! 		    }
! 		    if (is_dup) {
  			break;
  		    }
  		}
***************
*** 1905,1976 ****
  		    break;
  		}
  	    }
  	    if (is_dup) {
! 		break;
  	    }
- 	}
  
! 	if (is_dup) {
! 	    serv->server[iserv].serverType |= FILE_SERVER;
! 	} else {
! 	    iserv = serv->total++;
! 	    serv->server[iserv].serverType = FILE_SERVER;
! 	}
! 
! 	/*
! 	 * Add the addresses from the vldb list to the serv->server[iserv]
! 	 * record.  Remember that VLDB's list-of-addrs is not guaranteed
! 	 * to be unique in a particular entry, or to return only one entry
! 	 * per machine--so when we add addresses, always check for
! 	 * duplicate entries.
! 	 */
  
! 	for (ientryaddr = 0; ientryaddr < fileserver_entry.count;
! 	     ientryaddr++) {
! 	    for (iservaddr = 0; iservaddr < AFS_MAX_SERVER_ADDRESS;
! 		 iservaddr++) {
! 		if (serv->server[iserv].serverAddress[iservaddr] ==
! 		    fileserver_entry.serverAddress[ientryaddr]) {
! 		    break;
! 		}
! 	    }
! 	    if (iservaddr == AFS_MAX_SERVER_ADDRESS) {
! 		for (iservaddr = 0; iservaddr < AFS_MAX_SERVER_ADDRESS;
! 		     iservaddr++) {
! 		    if (!serv->server[iserv].serverAddress[iservaddr]) {
! 			serv->server[iserv].serverAddress[iservaddr] =
! 			    fileserver_entry.serverAddress[ientryaddr];
  			break;
  		    }
  		}
  	    }
  	}
-     }
  
!     if (tst != ADMITERATORDONE) {
! 	vos_FileServerGetDone(fileserver_iter, 0);
! 	goto fail_afsclient_AFSServerGetBegin;
!     }
  
!     if (!vos_FileServerGetDone(fileserver_iter, &tst)) {
! 	goto fail_afsclient_AFSServerGetBegin;
!     }
  
!     /*
!      * Iterate over the list and fill in the hostname of each of the servers
!      */
  
!     LOCK_GLOBAL_MUTEX;
!     for (iserv = 0; iserv < serv->total; iserv++) {
! 	int addr = htonl(serv->server[iserv].serverAddress[0]);
! 	host = gethostbyaddr((const char *)&addr, sizeof(int), AF_INET);
! 	if (host != NULL) {
! 	    strncpy(serv->server[iserv].serverName, host->h_name,
! 		    AFS_MAX_SERVER_NAME_LEN);
!             serv->server[iserv].serverName[AFS_MAX_SERVER_NAME_LEN - 1] = '\0';
  	}
      }
!     UNLOCK_GLOBAL_MUTEX;
      if (IteratorInit
  	    (iter, (void *)serv, GetServerRPC, GetServerFromCache, NULL, NULL,
  	     &tst)) {
--- 1934,2013 ----
  		    break;
  		}
  	    }
+ 
  	    if (is_dup) {
! 		serv->server[iserv].serverType |= FILE_SERVER;
! 	    } else {
! 		iserv = serv->total++;
! 		serv->server[iserv].serverType = FILE_SERVER;
  	    }
  
! 	    /*
! 	     * Add the addresses from the vldb list to the serv->server[iserv]
! 	     * record.  Remember that VLDB's list-of-addrs is not guaranteed
! 	     * to be unique in a particular entry, or to return only one entry
! 	     * per machine--so when we add addresses, always check for
! 	     * duplicate entries.
! 	     */
  
! 	    for (ientryaddr = 0; ientryaddr < fileserver_entry.count; ientryaddr++) {
! 		for (iservaddr = 0; iservaddr < AFS_MAX_SERVER_ADDRESS; iservaddr++) {
! 		    if (serv->server[iserv].serverAddress[iservaddr] ==
! 			 fileserver_entry.serverAddress[ientryaddr]) {
  			break;
  		    }
  		}
+ 		if (iservaddr == AFS_MAX_SERVER_ADDRESS) {
+ 		    for (iservaddr = 0; iservaddr < AFS_MAX_SERVER_ADDRESS;
+ 			  iservaddr++) {
+ 			if (!serv->server[iserv].serverAddress[iservaddr]) {
+ 			    serv->server[iserv].serverAddress[iservaddr] =
+ 				fileserver_entry.serverAddress[ientryaddr];
+ 			    break;
+ 			}
+ 		    }
+ 		}
  	    }
  	}
  
! 	if (tst != ADMITERATORDONE) {
! 	    vos_FileServerGetDone(fileserver_iter, 0);
! 	    goto fail_afsclient_AFSServerGetBegin;
! 	}
  
! 	if (!vos_FileServerGetDone(fileserver_iter, &tst)) {
! 	    goto fail_afsclient_AFSServerGetBegin;
! 	}
  
! 	/*
! 	 * Iterate over the list and fill in the hostname of each of the servers
! 	 */
  
! 	for (iserv = 0; iserv < serv->total; iserv++) {
! 	    int addr = htonl(serv->server[iserv].serverAddress[0]);
! 	    LOCK_GLOBAL_MUTEX;
! 	    host = gethostbyaddr((const char *)&addr, sizeof(int), AF_INET);
! 	    if (host != NULL) {
! 		strncpy(serv->server[iserv].serverName, host->h_name,
! 			 AFS_MAX_SERVER_NAME_LEN);
! 		serv->server[iserv].serverName[AFS_MAX_SERVER_NAME_LEN - 1] = '\0';
! 	    }
! 	    UNLOCK_GLOBAL_MUTEX;
  	}
+     
+ 	memcpy(serv_cache, serv, sizeof(server_get_t));
+     } else {
+ 	int race = 0;
+ 	LOCK_GLOBAL_MUTEX;
+ 	if (c_handle->server_list == NULL)
+ 	    race = 1;
+ 	else
+ 	    memcpy(serv, c_handle->server_list, sizeof(server_get_t));
+ 	UNLOCK_GLOBAL_MUTEX;
+ 	if (race)
+ 	    goto restart;
      }
! 
      if (IteratorInit
  	    (iter, (void *)serv, GetServerRPC, GetServerFromCache, NULL, NULL,
  	     &tst)) {
***************
*** 1981,1997 ****
    fail_afsclient_AFSServerGetBegin:
  
      if (rc == 0) {
! 	if (iter != NULL) {
  	    free(iter);
! 	}
! 	if (serv != NULL) {
  	    free(serv);
  	}
      }
  
!     if (st != NULL) {
  	*st = tst;
!     }
      return rc;
  }
  
--- 2018,2045 ----
    fail_afsclient_AFSServerGetBegin:
  
      if (rc == 0) {
! 	if (iter != NULL)
  	    free(iter);
! 	if (serv != NULL)
  	    free(serv);
+ 	if (serv_cache != NULL)
+ 	    free(serv_cache);
+     } else {
+ 	if (serv_cache) {
+ 	    LOCK_GLOBAL_MUTEX;
+ 	    /* in case there was a race and we constructed the list twice */
+ 	    if (c_handle->server_list)
+ 		free(c_handle->server_list);
+ 
+ 	    c_handle->server_list = serv_cache;
+ 	    c_handle->server_ttl = time(NULL) + SERVER_TTL;
+ 	    UNLOCK_GLOBAL_MUTEX;
  	}
      }
  
!     if (st != NULL)
  	*st = tst;
! 
      return rc;
  }
  
Index: openafs/src/libafs/MakefileProto.DARWIN.in
diff -c openafs/src/libafs/MakefileProto.DARWIN.in:1.27 openafs/src/libafs/MakefileProto.DARWIN.in:1.27.2.2
*** openafs/src/libafs/MakefileProto.DARWIN.in:1.27	Thu Mar  9 01:34:40 2006
--- openafs/src/libafs/MakefileProto.DARWIN.in	Tue Oct  9 17:30:02 2007
***************
*** 4,10 ****
  # 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
! # $Header: /cvs/openafs/src/libafs/MakefileProto.DARWIN.in,v 1.27 2006/03/09 06:34:40 shadow Exp $
  # 
  # MakefileProto for Digital Unix systems
  #
--- 4,10 ----
  # 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
! # $Header: /cvs/openafs/src/libafs/MakefileProto.DARWIN.in,v 1.27.2.2 2007/10/09 21:30:02 shadow Exp $
  # 
  # MakefileProto for Digital Unix systems
  #
***************
*** 33,60 ****
  KDEFS=
  DBUG = 
  DEFINES= -D_KERNEL -DKERNEL -DKERNEL_PRIVATE -DDIAGNOSTIC -DUSE_SELECT -DMACH_USER_API -DMACH_KERNEL
  <ppc_darwin_80 x86_darwin_80 ppc_darwin_90 x86_darwin_90>
! KOPTS_ppc=-static -g -nostdinc -nostdlib -fno-builtin -finline -fno-keep-inline-functions -msoft-float -mlong-branch -fsigned-bitfields -arch ppc -Dppc -DPPC -D__PPC__ -DPAGE_SIZE_FIXED -mcpu=750 -mmultiple -fschedule-insns
! KOPTS_x86=-static -g -nostdinc -nostdlib -fno-builtin -finline -fno-keep-inline-functions -msoft-float -mlong-branch -fsigned-bitfields -arch i386 -Di386 -DI386 -D__I386__ -DPAGE_SIZE_FIXED -march=i686 -mpreferred-stack-boundary=2 -falign-functions=4
  ARCH_ppc=$(shell echo "${ARCHFLAGS}" | grep -q -w ppc && echo yes)
  ARCH_x86=$(shell echo "${ARCHFLAGS}" | grep -q -w i386 && echo yes)
  ifeq ($(ARCH_ppc),yes)
  ifeq ($(ARCH_x86),yes)
! MODLD=$(CC) -static -g -nostdlib -arch ppc -arch i386
! CFLAGS_ppc=${KINCLUDES} -I. -I.. -I${TOP_OBJDIR}/src/config $(DEFINES) $(KDEFS) $(KOPTS_ppc)
! CFLAGS_x86=${KINCLUDES} -I. -I.. -I${TOP_OBJDIR}/src/config $(DEFINES) $(KDEFS) $(KOPTS_x86)
  else
! MODLD=$(CC) -static -g -nostdlib -arch ppc
  KOPTS=$(KOPTS_ppc)
  CFLAGS=${KINCLUDES} -I. -I.. -I${TOP_OBJDIR}/src/config $(DEFINES) $(KDEFS) $(KOPTS)
  endif
  else
  ifeq ($(ARCH_x86),yes)
! MODLD=$(CC) -static -g -nostdlib -arch i386
  KOPTS=$(KOPTS_x86)
  else
  _ARCH=$(shell arch)
! MODLD=$(CC) -static -g -nostdlib -arch $(_ARCH)
  KOPTS=$(KOPTS_$(shell echo $(_ARCH) | sed 's/i386/x86/'))
  endif
  CFLAGS=${KINCLUDES} -I. -I.. -I${TOP_OBJDIR}/src/config $(DEFINES) $(KDEFS) $(KOPTS)
--- 33,64 ----
  KDEFS=
  DBUG = 
  DEFINES= -D_KERNEL -DKERNEL -DKERNEL_PRIVATE -DDIAGNOSTIC -DUSE_SELECT -DMACH_USER_API -DMACH_KERNEL
+ <ppc_darwin_80 x86_darwin_80>
+ KOPTS_DBUG=-g
+ <ppc_darwin_90 x86_darwin_90>
+ KOPTS_DBUG=-ggdb
  <ppc_darwin_80 x86_darwin_80 ppc_darwin_90 x86_darwin_90>
! KOPTS_ppc=-static -nostdinc -nostdlib -fno-builtin -finline -fno-keep-inline-functions -msoft-float -mlong-branch -fsigned-bitfields -arch ppc -Dppc -DPPC -D__PPC__ -DPAGE_SIZE_FIXED -mcpu=750 -mmultiple -fschedule-insns -force_cpusubtype_ALL
! KOPTS_x86=-static -nostdinc -nostdlib -fno-builtin -finline -fno-keep-inline-functions -msoft-float -mlong-branch -fsigned-bitfields -arch i386 -Di386 -DI386 -D__I386__ -DPAGE_SIZE_FIXED -march=i686 -mpreferred-stack-boundary=2 -falign-functions=4
  ARCH_ppc=$(shell echo "${ARCHFLAGS}" | grep -q -w ppc && echo yes)
  ARCH_x86=$(shell echo "${ARCHFLAGS}" | grep -q -w i386 && echo yes)
  ifeq ($(ARCH_ppc),yes)
  ifeq ($(ARCH_x86),yes)
! MODLD=$(CC) -static $(KOPTS_DBUG) -nostdlib -arch ppc -arch i386
! CFLAGS_ppc=${KINCLUDES} -I. -I.. -I${TOP_OBJDIR}/src/config $(DEFINES) $(KDEFS) $(KOPTS_ppc) $(KOPTS_DBUG)
! CFLAGS_x86=${KINCLUDES} -I. -I.. -I${TOP_OBJDIR}/src/config $(DEFINES) $(KDEFS) $(KOPTS_x86) $(KOPTS_DBUG)
  else
! MODLD=$(CC) -static $(KOPTS_DBUG) -nostdlib -arch ppc
  KOPTS=$(KOPTS_ppc)
  CFLAGS=${KINCLUDES} -I. -I.. -I${TOP_OBJDIR}/src/config $(DEFINES) $(KDEFS) $(KOPTS)
  endif
  else
  ifeq ($(ARCH_x86),yes)
! MODLD=$(CC) -static $(KOPTS_DBUG) -nostdlib -arch i386
  KOPTS=$(KOPTS_x86)
  else
  _ARCH=$(shell arch)
! MODLD=$(CC) -static $(KOPTS_DBUG) -nostdlib -arch $(_ARCH)
  KOPTS=$(KOPTS_$(shell echo $(_ARCH) | sed 's/i386/x86/'))
  endif
  CFLAGS=${KINCLUDES} -I. -I.. -I${TOP_OBJDIR}/src/config $(DEFINES) $(KDEFS) $(KOPTS)
***************
*** 141,146 ****
--- 145,156 ----
  
  ${LIBAFS}: $(AFSAOBJS) $(AFSNFSOBJS)
  	$(MODLD) -r -o ${LIBAFS} ${AFSAOBJS} ${AFSNFSOBJS} -lcc_kext
+ <ppc_darwin_90 x86_darwin_90>
+ 	dsymutil -o ${LIBAFS}.dSYM ${LIBAFS}
+ <all>
  
  ${LIBAFSNONFS}:  $(AFSAOBJS) $(AFSNONFSOBJS)
  	$(MODLD) -r -o ${LIBAFSNONFS} ${AFSAOBJS} ${AFSNONFSOBJS} -lcc_kext
+ <ppc_darwin_90 x86_darwin_90>
+ 	dsymutil -o ${LIBAFSNONFS}.dSYM ${LIBAFSNONFS}
+ <all>
Index: openafs/src/libafs/afs.ppc_darwin_12.plist.in
diff -c openafs/src/libafs/afs.ppc_darwin_12.plist.in:1.1 openafs/src/libafs/afs.ppc_darwin_12.plist.in:1.1.22.1
*** openafs/src/libafs/afs.ppc_darwin_12.plist.in:1.1	Wed Sep 12 01:00:53 2001
--- openafs/src/libafs/afs.ppc_darwin_12.plist.in	Thu Oct 11 13:27:37 2007
***************
*** 15,25 ****
  	<key>CFBundlePackageType</key>
  	<string>KEXT</string>
  	<key>CFBundleShortVersionString</key>
! 	<string>@VERSION@</string>
  	<key>CFBundleSignature</key>
  	<string>????</string>
  	<key>CFBundleVersion</key>
! 	<string>@VERSION@</string>
  	<key>OSBundleLibraries</key>
  	<dict>
  		<key>com.apple.kernel.bsd</key>
--- 15,25 ----
  	<key>CFBundlePackageType</key>
  	<string>KEXT</string>
  	<key>CFBundleShortVersionString</key>
! 	<string>@MACOS_VERSION@</string>
  	<key>CFBundleSignature</key>
  	<string>????</string>
  	<key>CFBundleVersion</key>
! 	<string>@MACOS_VERSION@</string>
  	<key>OSBundleLibraries</key>
  	<dict>
  		<key>com.apple.kernel.bsd</key>
Index: openafs/src/libafs/afs.ppc_darwin_13.plist.in
diff -c openafs/src/libafs/afs.ppc_darwin_13.plist.in:1.1 openafs/src/libafs/afs.ppc_darwin_13.plist.in:1.1.22.1
*** openafs/src/libafs/afs.ppc_darwin_13.plist.in:1.1	Wed Sep 12 01:00:53 2001
--- openafs/src/libafs/afs.ppc_darwin_13.plist.in	Thu Oct 11 13:27:37 2007
***************
*** 15,25 ****
  	<key>CFBundlePackageType</key>
  	<string>KEXT</string>
  	<key>CFBundleShortVersionString</key>
! 	<string>@VERSION@</string>
  	<key>CFBundleSignature</key>
  	<string>????</string>
  	<key>CFBundleVersion</key>
! 	<string>@VERSION@</string>
  	<key>OSBundleLibraries</key>
  	<dict>
  		<key>com.apple.kernel.bsd</key>
--- 15,25 ----
  	<key>CFBundlePackageType</key>
  	<string>KEXT</string>
  	<key>CFBundleShortVersionString</key>
! 	<string>@MACOS_VERSION@</string>
  	<key>CFBundleSignature</key>
  	<string>????</string>
  	<key>CFBundleVersion</key>
! 	<string>@MACOS_VERSION@</string>
  	<key>OSBundleLibraries</key>
  	<dict>
  		<key>com.apple.kernel.bsd</key>
Index: openafs/src/libafs/afs.ppc_darwin_14.plist.in
diff -c openafs/src/libafs/afs.ppc_darwin_14.plist.in:1.2 openafs/src/libafs/afs.ppc_darwin_14.plist.in:1.2.20.1
*** openafs/src/libafs/afs.ppc_darwin_14.plist.in:1.2	Sat Nov 10 18:20:21 2001
--- openafs/src/libafs/afs.ppc_darwin_14.plist.in	Thu Oct 11 13:27:37 2007
***************
*** 15,25 ****
  	<key>CFBundlePackageType</key>
  	<string>KEXT</string>
  	<key>CFBundleShortVersionString</key>
! 	<string>@VERSION@</string>
  	<key>CFBundleSignature</key>
  	<string>????</string>
  	<key>CFBundleVersion</key>
! 	<string>@VERSION@</string>
  	<key>OSBundleLibraries</key>
  	<dict>
  		<key>com.apple.kernel.bsd</key>
--- 15,25 ----
  	<key>CFBundlePackageType</key>
  	<string>KEXT</string>
  	<key>CFBundleShortVersionString</key>
! 	<string>@MACOS_VERSION@</string>
  	<key>CFBundleSignature</key>
  	<string>????</string>
  	<key>CFBundleVersion</key>
! 	<string>@MACOS_VERSION@</string>
  	<key>OSBundleLibraries</key>
  	<dict>
  		<key>com.apple.kernel.bsd</key>
Index: openafs/src/libafs/afs.ppc_darwin_60.plist.in
diff -c openafs/src/libafs/afs.ppc_darwin_60.plist.in:1.1 openafs/src/libafs/afs.ppc_darwin_60.plist.in:1.1.20.1
*** openafs/src/libafs/afs.ppc_darwin_60.plist.in:1.1	Wed Aug 21 18:07:54 2002
--- openafs/src/libafs/afs.ppc_darwin_60.plist.in	Thu Oct 11 13:27:37 2007
***************
*** 15,25 ****
  	<key>CFBundlePackageType</key>
  	<string>KEXT</string>
  	<key>CFBundleShortVersionString</key>
! 	<string>@VERSION@</string>
  	<key>CFBundleSignature</key>
  	<string>????</string>
  	<key>CFBundleVersion</key>
! 	<string>@VERSION@</string>
  	<key>OSBundleLibraries</key>
  	<dict>
  		<key>com.apple.kernel.bsd</key>
--- 15,25 ----
  	<key>CFBundlePackageType</key>
  	<string>KEXT</string>
  	<key>CFBundleShortVersionString</key>
! 	<string>@MACOS_VERSION@</string>
  	<key>CFBundleSignature</key>
  	<string>????</string>
  	<key>CFBundleVersion</key>
! 	<string>@MACOS_VERSION@</string>
  	<key>OSBundleLibraries</key>
  	<dict>
  		<key>com.apple.kernel.bsd</key>
Index: openafs/src/libafs/afs.ppc_darwin_70.plist.in
diff -c openafs/src/libafs/afs.ppc_darwin_70.plist.in:1.2.10.21 openafs/src/libafs/afs.ppc_darwin_70.plist.in:1.2.10.22
*** openafs/src/libafs/afs.ppc_darwin_70.plist.in:1.2.10.21	Thu Sep 20 00:14:07 2007
--- openafs/src/libafs/afs.ppc_darwin_70.plist.in	Thu Oct 11 13:27:37 2007
***************
*** 15,25 ****
  	<key>CFBundlePackageType</key>
  	<string>KEXT</string>
  	<key>CFBundleShortVersionString</key>
! 	<string>1.5.25</string>
  	<key>CFBundleSignature</key>
  	<string>????</string>
  	<key>CFBundleVersion</key>
! 	<string>1.5.25</string>
  	<key>OSBundleLibraries</key>
  	<dict>
  		<key>com.apple.kernel.bsd</key>
--- 15,25 ----
  	<key>CFBundlePackageType</key>
  	<string>KEXT</string>
  	<key>CFBundleShortVersionString</key>
! 	<string>@MACOS_VERSION@</string>
  	<key>CFBundleSignature</key>
  	<string>????</string>
  	<key>CFBundleVersion</key>
! 	<string>@MACOS_VERSION@</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.2.4.21 openafs/src/libafs/afs.ppc_darwin_80.plist.in:1.2.4.22
*** openafs/src/libafs/afs.ppc_darwin_80.plist.in:1.2.4.21	Thu Sep 20 00:14:07 2007
--- openafs/src/libafs/afs.ppc_darwin_80.plist.in	Thu Oct 11 13:27:37 2007
***************
*** 15,25 ****
  	<key>CFBundlePackageType</key>
  	<string>KEXT</string>
  	<key>CFBundleShortVersionString</key>
! 	<string>1.5.25</string>
  	<key>CFBundleSignature</key>
  	<string>????</string>
  	<key>CFBundleVersion</key>
! 	<string>1.5.25</string>
  	<key>OSBundleLibraries</key>
  	<dict>
  		<key>com.apple.kpi.bsd</key>
--- 15,25 ----
  	<key>CFBundlePackageType</key>
  	<string>KEXT</string>
  	<key>CFBundleShortVersionString</key>
! 	<string>@MACOS_VERSION@</string>
  	<key>CFBundleSignature</key>
  	<string>????</string>
  	<key>CFBundleVersion</key>
! 	<string>@MACOS_VERSION@</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.6.21 openafs/src/libafs/afs.ppc_darwin_90.plist.in:1.1.6.22
*** openafs/src/libafs/afs.ppc_darwin_90.plist.in:1.1.6.21	Thu Sep 20 00:14:07 2007
--- openafs/src/libafs/afs.ppc_darwin_90.plist.in	Thu Oct 11 13:27:37 2007
***************
*** 15,25 ****
  	<key>CFBundlePackageType</key>
  	<string>KEXT</string>
  	<key>CFBundleShortVersionString</key>
! 	<string>1.5.25</string>
  	<key>CFBundleSignature</key>
  	<string>????</string>
  	<key>CFBundleVersion</key>
! 	<string>1.5.25</string>
  	<key>OSBundleLibraries</key>
  	<dict>
  		<key>com.apple.kpi.bsd</key>
--- 15,25 ----
  	<key>CFBundlePackageType</key>
  	<string>KEXT</string>
  	<key>CFBundleShortVersionString</key>
! 	<string>@MACOS_VERSION@</string>
  	<key>CFBundleSignature</key>
  	<string>????</string>
  	<key>CFBundleVersion</key>
! 	<string>@MACOS_VERSION@</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.6.21 openafs/src/libafs/afs.x86_darwin_80.plist.in:1.1.6.22
*** openafs/src/libafs/afs.x86_darwin_80.plist.in:1.1.6.21	Thu Sep 20 00:14:07 2007
--- openafs/src/libafs/afs.x86_darwin_80.plist.in	Thu Oct 11 13:27:37 2007
***************
*** 15,25 ****
  	<key>CFBundlePackageType</key>
  	<string>KEXT</string>
  	<key>CFBundleShortVersionString</key>
! 	<string>1.5.25</string>
  	<key>CFBundleSignature</key>
  	<string>????</string>
  	<key>CFBundleVersion</key>
! 	<string>1.5.25</string>
  	<key>OSBundleLibraries</key>
  	<dict>
  		<key>com.apple.kpi.bsd</key>
--- 15,25 ----
  	<key>CFBundlePackageType</key>
  	<string>KEXT</string>
  	<key>CFBundleShortVersionString</key>
! 	<string>@MACOS_VERSION@</string>
  	<key>CFBundleSignature</key>
  	<string>????</string>
  	<key>CFBundleVersion</key>
! 	<string>@MACOS_VERSION@</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.6.21 openafs/src/libafs/afs.x86_darwin_90.plist.in:1.1.6.22
*** openafs/src/libafs/afs.x86_darwin_90.plist.in:1.1.6.21	Thu Sep 20 00:14:07 2007
--- openafs/src/libafs/afs.x86_darwin_90.plist.in	Thu Oct 11 13:27:37 2007
***************
*** 15,25 ****
  	<key>CFBundlePackageType</key>
  	<string>KEXT</string>
  	<key>CFBundleShortVersionString</key>
! 	<string>1.5.25</string>
  	<key>CFBundleSignature</key>
  	<string>????</string>
  	<key>CFBundleVersion</key>
! 	<string>1.5.25</string>
  	<key>OSBundleLibraries</key>
  	<dict>
  		<key>com.apple.kpi.bsd</key>
--- 15,25 ----
  	<key>CFBundlePackageType</key>
  	<string>KEXT</string>
  	<key>CFBundleShortVersionString</key>
! 	<string>@MACOS_VERSION@</string>
  	<key>CFBundleSignature</key>
  	<string>????</string>
  	<key>CFBundleVersion</key>
! 	<string>@MACOS_VERSION@</string>
  	<key>OSBundleLibraries</key>
  	<dict>
  		<key>com.apple.kpi.bsd</key>
Index: openafs/src/libafsrpc/Makefile.in
diff -c openafs/src/libafsrpc/Makefile.in:1.36 openafs/src/libafsrpc/Makefile.in:1.36.4.1
*** openafs/src/libafsrpc/Makefile.in:1.36	Mon Aug 15 18:30:47 2005
--- openafs/src/libafsrpc/Makefile.in	Fri Oct 19 20:23:45 2007
***************
*** 272,278 ****
  #
  #   $ what /opt/langtools/bin/pxdb32
  #   /opt/langtools/bin/pxdb32:
! #           HP92453-02 A.10.0A HP-UX SYMBOLIC DEBUGGER (PXDB) $Revision: 1.36 $
  #
  # The problem occurs when -g and -O are both used when compiling des.c.
  # The simplest way to work around the problem is to leave out either -g or -O.
--- 272,278 ----
  #
  #   $ what /opt/langtools/bin/pxdb32
  #   /opt/langtools/bin/pxdb32:
! #           HP92453-02 A.10.0A HP-UX SYMBOLIC DEBUGGER (PXDB) $Revision: 1.36.4.1 $
  #
  # The problem occurs when -g and -O are both used when compiling des.c.
  # The simplest way to work around the problem is to leave out either -g or -O.
***************
*** 354,360 ****
  syscall.o: ${SYS}/syscall.s
  	case "$(SYS_NAME)" in \
  	     sun4x_5* | sunx86_5*) \
! 		/usr/ccs/lib/cpp  ${SFLAGS} ${SYS}/syscall.s syscall.ss; \
  		as -o syscall.o syscall.ss;		\
  		$(RM) syscall.ss;;				\
  	 sgi_* | *_darwin_* ) \
--- 354,360 ----
  syscall.o: ${SYS}/syscall.s
  	case "$(SYS_NAME)" in \
  	     sun4x_5* | sunx86_5*) \
! 		$(CPP)  ${SFLAGS} ${SYS}/syscall.s syscall.ss; \
  		as -o syscall.o syscall.ss;		\
  		$(RM) syscall.ss;;				\
  	 sgi_* | *_darwin_* ) \
***************
*** 366,372 ****
  	 *bsd* ) \
  		touch syscall.o ;; \
  	 *) \
! 		/lib/cpp  ${SFLAGS} ${SYS}/syscall.s syscall.ss; \
  		as -o syscall.o syscall.ss;		\
  		$(RM) syscall.ss;;				\
  	esac
--- 366,372 ----
  	 *bsd* ) \
  		touch syscall.o ;; \
  	 *) \
! 		$(CPP)  ${SFLAGS} ${SYS}/syscall.s syscall.ss; \
  		as -o syscall.o syscall.ss;		\
  		$(RM) syscall.ss;;				\
  	esac
Index: openafs/src/lwp/Makefile.in
diff -c openafs/src/lwp/Makefile.in:1.35 openafs/src/lwp/Makefile.in:1.35.2.1
*** openafs/src/lwp/Makefile.in:1.35	Thu Mar  9 01:34:43 2006
--- openafs/src/lwp/Makefile.in	Fri Oct 19 20:23:46 2007
***************
*** 37,43 ****
  	pmax_he1) \
  		$(CCOBJ) ${LWP_DBG} ${LWP_OPTMZ} -c -I${TOP_INCDIR} process.s;; \
  	sun4c_51 | sun4c_52 | sun4m_51 | sun4m_52 | sun4c_53 | sun4m_53  | sun4_53 | sun4_52 | sun4_54 | sun4c_54 | sun4m_54 | sun4x_5* ) \
! 		/usr/ccs/lib/cpp -P -I${TOP_INCDIR} ${srcdir}/process.s process.ss; \
  		${AS} process.ss -o process.o; \
  			$(RM) process.ss ;; \
  	sgi_5* ) \
--- 37,43 ----
  	pmax_he1) \
  		$(CCOBJ) ${LWP_DBG} ${LWP_OPTMZ} -c -I${TOP_INCDIR} process.s;; \
  	sun4c_51 | sun4c_52 | sun4m_51 | sun4m_52 | sun4c_53 | sun4m_53  | sun4_53 | sun4_52 | sun4_54 | sun4c_54 | sun4m_54 | sun4x_5* ) \
! 		$(CPP) -P -I${TOP_INCDIR} ${srcdir}/process.s process.ss; \
  		${AS} process.ss -o process.o; \
  			$(RM) process.ss ;; \
  	sgi_5* ) \
***************
*** 45,55 ****
  	sgi_61 | sgi_62 | sgi_63 ) \
  		$(CCOBJ) ${LWP_DBG} ${LWP_OPTMZ} -c ${XCFLAGS} ${ARCHFLAGS} -I${TOP_INCDIR} -KPIC -G0  ${srcdir}/process.s;; \
  	s390_*) \
! 		/lib/cpp -P -I${TOP_INCDIR} ${srcdir}/process.s390.s >process.ss; \
  		${AS} -ahlns process.ss -o process.o >process.lst; \
  		$(RM) process.ss ;; \
  	s390x_*) \
! 		/lib/cpp -P -I${TOP_INCDIR} ${srcdir}/process.s390x.s >process.ss; \
  		${AS} -ahlns process.ss -o process.o >process.lst; \
  		$(RM) process.ss ;; \
  	*_darwin* ) \
--- 45,55 ----
  	sgi_61 | sgi_62 | sgi_63 ) \
  		$(CCOBJ) ${LWP_DBG} ${LWP_OPTMZ} -c ${XCFLAGS} ${ARCHFLAGS} -I${TOP_INCDIR} -KPIC -G0  ${srcdir}/process.s;; \
  	s390_*) \
! 		$(CPP) -P -I${TOP_INCDIR} ${srcdir}/process.s390.s >process.ss; \
  		${AS} -ahlns process.ss -o process.o >process.lst; \
  		$(RM) process.ss ;; \
  	s390x_*) \
! 		$(CPP) -P -I${TOP_INCDIR} ${srcdir}/process.s390x.s >process.ss; \
  		${AS} -ahlns process.ss -o process.o >process.lst; \
  		$(RM) process.ss ;; \
  	*_darwin* ) \
***************
*** 88,98 ****
  		${AS} process.ss -o process.o ;  \
  		$(RM) -f process.S ;;\
  	ncrx86_* | sunx86_*) \
! 		/usr/ccs/lib/cpp -P -D__sun -D__i386 -DIGNORE_STDS_H -I${TOP_INCDIR} -I${srcdir} ${srcdir}/process.i386.s process.ss; \
  		${AS} -o process.o process.ss; \
  		$(RM) process.ss ;; \
  	alpha_nbsd* ) \
! 		/usr/bin/cpp -DASSEMBLER -P -I${TOP_INCDIR} ${srcdir}/process.s > process.ss; \
  		${AS} -o process.o process.ss; \
  		$(RM) process.ss ;; \
  	hp* | *_linux* | *_umlinux* | sgi_64 | sgi_65 ) \
--- 88,98 ----
  		${AS} process.ss -o process.o ;  \
  		$(RM) -f process.S ;;\
  	ncrx86_* | sunx86_*) \
! 		$(CPP) -P -D__sun -D__i386 -DIGNORE_STDS_H -I${TOP_INCDIR} -I${srcdir} ${srcdir}/process.i386.s process.ss; \
  		${AS} -o process.o process.ss; \
  		$(RM) process.ss ;; \
  	alpha_nbsd* ) \
! 		$(CPP) -DASSEMBLER -P -I${TOP_INCDIR} ${srcdir}/process.s > process.ss; \
  		${AS} -o process.o process.ss; \
  		$(RM) process.ss ;; \
  	hp* | *_linux* | *_umlinux* | sgi_64 | sgi_65 ) \
***************
*** 103,113 ****
  	ia64_hpux11* | hp_ux11* ) \
  		${CC} ${CFLAGS} -c ${srcdir}/process.c;; \
  	i386_*) \
! 		/lib/cpp -P -I${TOP_INCDIR} -I${srcdir} ${srcdir}/process.i386.s process.ss; \
  		${AS} process.ss -o process.o; \
  		$(RM) process.ss ;; \
  	*) \
! 		/lib/cpp -P -I${TOP_INCDIR} ${srcdir}/process.s process.ss; \
  		${AS} process.ss -o process.o; \
  		$(RM) process.ss ;; \
  	esac
--- 103,113 ----
  	ia64_hpux11* | hp_ux11* ) \
  		${CC} ${CFLAGS} -c ${srcdir}/process.c;; \
  	i386_*) \
! 		$(CPP) -P -I${TOP_INCDIR} -I${srcdir} ${srcdir}/process.i386.s process.ss; \
  		${AS} process.ss -o process.o; \
  		$(RM) process.ss ;; \
  	*) \
! 		$(CPP) -P -I${TOP_INCDIR} ${srcdir}/process.s process.ss; \
  		${AS} process.ss -o process.o; \
  		$(RM) process.ss ;; \
  	esac
Index: openafs/src/packaging/MacOS/OpenAFS.Info.plist
diff -c openafs/src/packaging/MacOS/OpenAFS.Info.plist:1.2.10.22 openafs/src/packaging/MacOS/OpenAFS.Info.plist:removed
*** openafs/src/packaging/MacOS/OpenAFS.Info.plist:1.2.10.22	Thu Sep 20 00:14:07 2007
--- openafs/src/packaging/MacOS/OpenAFS.Info.plist	Mon Oct 22 23:21:23 2007
***************
*** 1,44 ****
- <?xml version="1.0" encoding="UTF-8"?>
- <!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
- <plist version="1.0">
- <dict>
- 	<key>CFBundleGetInfoString</key>
- 	<string>OpenAFS 1.5.25</string>
- 	<key>CFBundleIdentifier</key>
- 	<string>org.openafs.OpenAFS.pkg</string>
- 	<key>CFBundleName</key>
- 	<string>OpenAFS</string>
- 	<key>CFBundleShortVersionString</key>
- 	<string>1.5.25</string>
- 	<key>IFMajorVersion</key>
- 	<integer>1</integer>
- 	<key>IFMinorVersion</key>
- 	<integer>5</integer>
- 	<key>IFPkgFlagAllowBackRev</key>
- 	<false/>
- 	<key>IFPkgFlagAuthorizationAction</key>
- 	<string>RootAuthorization</string>
- 	<key>IFPkgFlagBackgroundAlignment</key>
- 	<string>bottomright</string>
- 	<key>IfPkgFlagBackgroundScaling</key>
- 	<string>proportional</string>
- 	<key>IFPkgFlagDefaultLocation</key>
- 	<string>/</string>
- 	<key>IFPkgFlagInstallFat</key>
- 	<false/>
- 	<key>IFPkgFlagIsRequired</key>
- 	<false/>
- 	<key>IFPkgFlagRelocatable</key>
- 	<false/>
- 	<key>IFPkgFlagRestartAction</key>
- 	<string>NoRestart</string>
- 	<key>IFPkgFlagRootVolumeOnly</key>
- 	<true/>
- 	<key>IFPkgFlagUpdateInstalledLanguages</key>
- 	<false/>
- 	<key>IFPkgFlagUseUserMask</key>
- 	<false/>
- 	<key>IFPkgFormatVersion</key>
- 	<real>0.10000000149011612</real>
- </dict>
- </plist>
--- 0 ----
Index: openafs/src/packaging/MacOS/OpenAFS.Info.plist.in
diff -c /dev/null openafs/src/packaging/MacOS/OpenAFS.Info.plist.in:1.1.2.2
*** /dev/null	Mon Oct 22 23:21:23 2007
--- openafs/src/packaging/MacOS/OpenAFS.Info.plist.in	Thu Oct 11 13:27:39 2007
***************
*** 0 ****
--- 1,44 ----
+ <?xml version="1.0" encoding="UTF-8"?>
+ <!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+ <plist version="1.0">
+ <dict>
+ 	<key>CFBundleGetInfoString</key>
+ 	<string>OpenAFS @MACOS_VERSION@</string>
+ 	<key>CFBundleIdentifier</key>
+ 	<string>org.openafs.OpenAFS.pkg</string>
+ 	<key>CFBundleName</key>
+ 	<string>OpenAFS</string>
+ 	<key>CFBundleShortVersionString</key>
+ 	<string>@MACOS_VERSION@</string>
+ 	<key>IFMajorVersion</key>
+ 	<integer>1</integer>
+ 	<key>IFMinorVersion</key>
+ 	<integer>5</integer>
+ 	<key>IFPkgFlagAllowBackRev</key>
+ 	<false/>
+ 	<key>IFPkgFlagAuthorizationAction</key>
+ 	<string>RootAuthorization</string>
+ 	<key>IFPkgFlagBackgroundAlignment</key>
+ 	<string>bottomright</string>
+ 	<key>IfPkgFlagBackgroundScaling</key>
+ 	<string>proportional</string>
+ 	<key>IFPkgFlagDefaultLocation</key>
+ 	<string>/</string>
+ 	<key>IFPkgFlagInstallFat</key>
+ 	<false/>
+ 	<key>IFPkgFlagIsRequired</key>
+ 	<false/>
+ 	<key>IFPkgFlagRelocatable</key>
+ 	<false/>
+ 	<key>IFPkgFlagRestartAction</key>
+ 	<string>NoRestart</string>
+ 	<key>IFPkgFlagRootVolumeOnly</key>
+ 	<true/>
+ 	<key>IFPkgFlagUpdateInstalledLanguages</key>
+ 	<false/>
+ 	<key>IFPkgFlagUseUserMask</key>
+ 	<false/>
+ 	<key>IFPkgFormatVersion</key>
+ 	<real>0.10000000149011612</real>
+ </dict>
+ </plist>
Index: openafs/src/packaging/MacOS/OpenAFS.info
diff -c openafs/src/packaging/MacOS/OpenAFS.info:1.1.12.21 openafs/src/packaging/MacOS/OpenAFS.info:removed
*** openafs/src/packaging/MacOS/OpenAFS.info:1.1.12.21	Thu Sep 20 00:14:07 2007
--- openafs/src/packaging/MacOS/OpenAFS.info	Mon Oct 22 23:21:23 2007
***************
*** 1,16 ****
- Title OpenAFS
- Version 1.5.25
- 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)
- DeleteWarning 
- NeedsAuthorization YES
- DisableStop NO
- UseUserMask NO
- Application NO
- Relocatable NO
- Required NO
- InstallOnly NO
- RequiresReboot NO
- InstallFat NO
- rootVolumeOnly YES
--- 0 ----
Index: openafs/src/packaging/MacOS/OpenAFS.info.in
diff -c /dev/null openafs/src/packaging/MacOS/OpenAFS.info.in:1.1.2.2
*** /dev/null	Mon Oct 22 23:21:23 2007
--- openafs/src/packaging/MacOS/OpenAFS.info.in	Thu Oct 11 13:27:39 2007
***************
*** 0 ****
--- 1,16 ----
+ Title OpenAFS
+ Version @VERSION@
+ 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)
+ DeleteWarning 
+ NeedsAuthorization YES
+ DisableStop NO
+ UseUserMask NO
+ Application NO
+ Relocatable NO
+ Required NO
+ InstallOnly NO
+ RequiresReboot NO
+ InstallFat NO
+ rootVolumeOnly YES
Index: openafs/src/packaging/MacOS/buildpkg.sh
diff -c openafs/src/packaging/MacOS/buildpkg.sh:1.13.2.10 openafs/src/packaging/MacOS/buildpkg.sh:1.13.2.11
*** openafs/src/packaging/MacOS/buildpkg.sh:1.13.2.10	Tue Jul  3 10:02:54 2007
--- openafs/src/packaging/MacOS/buildpkg.sh	Wed Oct 10 13:40:30 2007
***************
*** 122,132 ****
      else
  	echo /Network/afs:/var/db/openafs/cache:30000 > $PKGROOT/private/var/db/openafs/etc/cacheinfo.sample
      fi
-     if [ $majorvers -ge 9 ]; then
-     echo '-memcache -afsdb -stat 2000 -dcache 800 -daemons 3 -volumes 70 -dynroot -fakestat-all' > $PKGROOT/private/var/db/openafs/etc/config/afsd.options.sample
-     else
      echo '-afsdb -stat 2000 -dcache 800 -daemons 3 -volumes 70 -dynroot -fakestat-all' > $PKGROOT/private/var/db/openafs/etc/config/afsd.options.sample
-     fi
  
      strip -X -S $PKGROOT/Library/OpenAFS/Tools/root.client/usr/vice/etc/afs.kext/Contents/MacOS/afs
  
--- 122,128 ----
Index: openafs/src/packaging/RedHat/kmodtool
diff -c /dev/null openafs/src/packaging/RedHat/kmodtool:1.1.2.2
*** /dev/null	Mon Oct 22 23:21:23 2007
--- openafs/src/packaging/RedHat/kmodtool	Thu Oct 11 10:13:23 2007
***************
*** 0 ****
--- 1,172 ----
+ #!/bin/bash
+ 
+ # kmodtool - Helper script for building kernel module RPMs
+ # Copyright (c) 2003-2007 Ville SkyttÃ¤ <ville.skytta@iki.fi>,
+ #                         Thorsten Leemhuis <fedora@leemhuis.info>
+ #
+ # Permission is hereby granted, free of charge, to any person obtaining
+ # a copy of this software and associated documentation files (the
+ # "Software"), to deal in the Software without restriction, including
+ # without limitation the rights to use, copy, modify, merge, publish,
+ # distribute, sublicense, and/or sell copies of the Software, and to
+ # permit persons to whom the Software is furnished to do so, subject to
+ # the following conditions:
+ #
+ # The above copyright notice and this permission notice shall be
+ # included in all copies or substantial portions of the Software.
+ #
+ # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ # EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+ # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+ # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+ # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ 
+ shopt -s extglob
+ 
+ myprog="kmodtool"
+ myver="0.10.13"
+ knownvariants=@(BOOT|PAE?(-debug)|@(big|huge)mem|debug|enterprise|kdump|?(large)smp?(-debug)|uml|xen?([0U])?(-PAE))
+ kmod_name=
+ kver=
+ verrel=
+ variant=
+ 
+ get_verrel ()
+ {
+   verrel=${1:-$(uname -r)}
+   verrel=${verrel%%$knownvariants}
+ }
+ 
+ print_verrel ()
+ {
+   get_verrel $@
+   echo "${verrel}"
+ }
+ 
+ get_variant ()
+ {
+   get_verrel $@
+   variant=${1:-$(uname -r)}
+   variant=${variant##$verrel}
+   variant=${variant:-'""'}
+ }
+ 
+ print_variant ()
+ {
+   get_variant $@
+   echo "${variant}"
+ }
+ 
+ 
+ get_rpmtemplate ()
+ {
+     local variant="${1}"
+     local dashvariant="${variant:+-${variant}}"
+     case "$verrel" in
+         *.EL*) kdep="kernel${dashvariant}-%{_target_cpu} = ${verrel}" ;;
+         *)     kdep="kernel-%{_target_cpu} = ${verrel}${variant}"     ;;
+     esac
+     cat <<EOF
+ %package       -n kmod-${kmod_name}${dashvariant}
+ Summary:          ${kmod_name} kernel module(s)
+ Group:            System Environment/Kernel
+ Provides:         kernel-modules = ${verrel}${variant}
+ Provides:         ${kmod_name}-kmod = %{?epoch:%{epoch}:}%{version}-%{release}
+ Requires:         ${kdep}
+ Requires:         ${kmod_name}-kmod-common >= %{?epoch:%{epoch}:}%{version}
+ Requires(post):   /sbin/depmod
+ Requires(postun): /sbin/depmod
+ BuildRequires:    kernel${dashvariant}-devel-%{_target_cpu} = ${verrel}
+ %description   -n kmod-${kmod_name}${dashvariant}
+ This package provides the ${kmod_name} kernel modules built for the Linux
+ kernel ${verrel}${variant} for the %{_target_cpu} family of processors.
+ %post          -n kmod-${kmod_name}${dashvariant}
+ /sbin/depmod -aeF /boot/System.map-${verrel}${variant} ${verrel}${variant} > /dev/null || :
+ %postun        -n kmod-${kmod_name}${dashvariant}
+ /sbin/depmod -aF /boot/System.map-${verrel}${variant} ${verrel}${variant} &> /dev/null || :
+ %files         -n kmod-${kmod_name}${dashvariant}
+ %defattr(644,root,root,755)
+ /lib/modules/${verrel}${variant}/extra/${kmod_name}/
+ 
+ EOF
+ }
+ 
+ print_rpmtemplate ()
+ {
+   kmod_name="${1}"
+   shift
+   kver="${1}"
+   get_verrel "${1}"
+   shift
+   if [ -z "${kmod_name}" ] ; then
+     echo "Please provide the kmodule-name as first parameter." >&2
+     exit 2
+   elif [ -z "${kver}" ] ; then
+     echo "Please provide the kver as second parameter." >&2
+     exit 2
+   elif [ -z "${verrel}" ] ; then
+     echo "Couldn't find out the verrel." >&2
+     exit 2
+   fi
+ 
+   for variant in "$@" ; do
+     get_rpmtemplate "${variant}"
+   done
+ }
+ 
+ usage ()
+ {
+   cat <<EOF
+ You called: ${invocation}
+ 
+ Usage: ${myprog} <command> <option>+
+  Commands:
+   verrel <uname>                               
+     - Get "base" version-release.
+   variant <uname>                               
+     - Get variant from uname.
+   rpmtemplate <mainpgkname> <uname> <variants> 
+     - Return a template for
+   version  
+     - Output version number and exit.
+ EOF
+ }
+ 
+ invocation="$(basename ${0}) $@"
+ while [ "${1}" ] ; do
+   case "${1}" in
+     verrel)
+       shift
+       print_verrel $@
+       exit $?
+       ;;
+     variant)
+       shift
+       print_variant $@
+       exit $?
+       ;;
+     rpmtemplate)
+       shift
+       print_rpmtemplate "$@"
+       exit $?
+       ;;
+     version)
+       echo "${myprog} ${myver}"
+       exit 0
+       ;;
+     *)
+       echo "Error: Unknown option '${1}'." >&2
+       usage >&2
+       exit 2
+       ;;
+   esac
+ done
+ 
+ # Local variables:
+ # mode: sh
+ # sh-indentation: 2
+ # indent-tabs-mode: nil
+ # End:
+ # ex: ts=2 sw=2 et
Index: openafs/src/packaging/RedHat/openafs-1.4.0-kmodule26.patch
diff -c /dev/null openafs/src/packaging/RedHat/openafs-1.4.0-kmodule26.patch:1.1.2.2
*** /dev/null	Mon Oct 22 23:21:23 2007
--- openafs/src/packaging/RedHat/openafs-1.4.0-kmodule26.patch	Fri Oct 12 00:30:41 2007
***************
*** 0 ****
--- 1,17 ----
+ --- openafs-1.4.0-rc4/src/libafs/MakefileProto.LINUX.in-orig	2005-07-25 14:32:15.000000000 -0400
+ +++ openafs-1.4.0-rc4/src/libafs/MakefileProto.LINUX.in	2005-09-23 16:45:44.000000000 -0400
+ @@ -245,11 +245,11 @@
+  	echo BM Build Complete
+  
+  <linux26 linux_26 umlinux26>
+ -${LIBAFS} ${LIBAFS_MP} ${LIBAFS_EP} ${LIBAFS_BM}: libafs.ko
+ -	cp libafs.ko $@
+ +${LIBAFS} ${LIBAFS_MP} ${LIBAFS_EP} ${LIBAFS_BM}: openafs.ko
+ +	cp openafs.ko $@
+  
+  .FORCE:
+ -libafs.ko: .FORCE
+ +openafs.ko: .FORCE
+  	env EXTRA_CFLAGS="${EXTRA_CFLAGS}" @TOP_SRCDIR@/libafs/make_kbuild_makefile.pl ${KDIR} $@ @TOP_OBJDIR@/src/config/Makefile.config Makefile.afs Makefile.common
+  	env EXTRA_CFLAGS="${EXTRA_CFLAGS}" $(MAKE) -C ${LINUX_KERNEL_PATH} M=@TOP_OBJDIR@/src/libafs/${KDIR} modules
+          
Index: openafs/src/packaging/RedHat/openafs-buildall.sh
diff -c openafs/src/packaging/RedHat/openafs-buildall.sh:1.2.2.3 openafs/src/packaging/RedHat/openafs-buildall.sh:1.2.2.4
*** openafs/src/packaging/RedHat/openafs-buildall.sh:1.2.2.3	Fri Dec  1 13:35:33 2006
--- openafs/src/packaging/RedHat/openafs-buildall.sh	Thu Oct 18 00:04:10 2007
***************
*** 4,10 ****
  #
  # Written by:  Derek Atkins <warlord@MIT.EDU>
  #
! # $Revision: 1.2.2.3 $
  #
  
  # Define where the Specfile is located.
--- 4,10 ----
  #
  # Written by:  Derek Atkins <warlord@MIT.EDU>
  #
! # $Revision: 1.2.2.4 $
  #
  
  # Define where the Specfile is located.
***************
*** 21,30 ****
--- 21,37 ----
  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 'Fedora'` = 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 'CentOS'` = 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'`
Index: openafs/src/packaging/RedHat/openafs.spec.in
diff -c openafs/src/packaging/RedHat/openafs.spec.in:1.2.2.3 openafs/src/packaging/RedHat/openafs.spec.in:1.2.2.7
*** openafs/src/packaging/RedHat/openafs.spec.in:1.2.2.3	Fri Dec  1 13:35:33 2006
--- openafs/src/packaging/RedHat/openafs.spec.in	Thu Oct 18 00:12:44 2007
***************
*** 1,7 ****
! # Openafs Spec $Revision: 1.2.2.3 $
  
! %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
--- 1,7 ----
! # Openafs Spec $Revision: 1.2.2.7 $
  
! %define afsvers 1.4.5pre1
! %define pkgvers 1.4.5pre1
  # 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
***************
*** 11,16 ****
--- 11,18 ----
  %define osvers 1
  %endif
  
+ %{!?fedorakmod: %define fedorakmod 0}
+ 
  # Determine presence of rpmbuild command line --define arguments used for
  # option specification
  %define kernvers_on_cmdline %{?kernvers:1}%{!?kernvers:0}
***************
*** 24,29 ****
--- 26,55 ----
  %if !%{kernvers_on_cmdline}
  %define kernvers %(%{_sourcedir}/openafs-kernel-version.sh)
  %endif
+ 
+ %if %{fedorakmod}
+ %define kmodtool bash %{_sourcedir}/kmodtool
+ 
+ %define kmod_name openafs
+ %define kverrel %(%{kmodtool} verrel %{?kernvers} 2>/dev/null)
+ 
+ %define upvar ""
+ %ifarch i686
+ %define paevar PAE
+ %endif
+ %ifarch ppc
+ %define smpvar smp
+ %endif
+ %ifarch i686 x86_64
+ %define xenvar xen
+ %define kdumpvar kdump
+ %endif
+ %{!?kvariants: %define kvariants %{?upvar} %{?smpvar} %{?paevar} %{?xenvar} %{?kdumpvar}}
+ 
+ %define ksrcdir %{_usrsrc}/kernels/%{kverrel}-%{_target_cpu}
+ 
+ %else # Legacy kernel build stuff 
+ 
  %define kversis %{_sourcedir}/openafs-kvers-is.sh
  %define kvers %(%{kversis} parsev %{kernvers})
  %define kvers_is_24 %(%{kversis} %{kvers} "2.4")
***************
*** 51,56 ****
--- 77,85 ----
  %endif
  %define kxmoddir %{kmoddir}/%{kernvers}
  
+ # End legacy kernel build stuff
+ %endif 
+ 
  # Set 'debugspec' to 1 if you want to debug the spec file.  This will
  # not remove the installed tree as part of the %clean operation
  %if %{?debugspec:0}%{!?debugspec:1}
***************
*** 74,79 ****
--- 103,110 ----
  # Define the location of the PAM security module directory
  %define pamdir /%{_lib}/security
  
+ %if !%{fedorakmod}
+ 
  # Define the set of kernel module variations to be built:
  # For 2.4 kernels we just build everything at once for a particular
  # kernel.   So we build up, smp, and bigmem all at once.
***************
*** 138,143 ****
--- 169,177 ----
  %endif
  %endif
  
+ # End of legacy kernel module build
+ %endif 
+ 
  #######################################################################
  # You probably don't need to change anything beyond this line
  # NOTE: If you do, please email me!!!
***************
*** 195,201 ****
  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
--- 229,235 ----
  BuildRoot: %{_tmppath}/%{name}-%{version}-root
  Packager: Derek Atkins <warlord@MIT.EDU>
  Group: Networking/Filesystems
! BuildRequires: %{?kdepend:%{kdepend}, } pam-devel, ncurses-devel, flex, bison
  %if %{build_userspace}
  BuildRequires: autoconf
  %endif
***************
*** 206,242 ****
  Source1: http://www.openafs.org/dl/openafs/%{afsvers}/openafs-%{afsvers}-doc.tar.bz2
  %define srcdir openafs-%{afsvers}
  
- Source2: openafs-ThisCell
- # http://grand.central.org/dl/cellservdb/CellServDB
- Source3: openafs-CellServDB
- Source4: openafs-SuidCells
- Source5: openafs-cacheinfo
- # Source6: openafs-afsmodname
- Source7: openafs-LICENSE.Sun
- Source8: openafs-README
  Source10: http://www.openafs.org/dl/openafs/%{afsvers}/RELNOTES-%{afsvers}
  Source11: http://www.openafs.org/dl/openafs/%{afsvers}/ChangeLog
  
- Source15: openafs.sysconfig
- Source16: openafs-client.init
- Source17: openafs-server.init
- 
- #  from ftp://ftp.cmf.nrl.navy.mil/pub/kerberos5/afs-krb5-2.0.tar.gz
- Source20: openafs-krb5-2.0.tar.gz
- 
  Source30: openafs-kernel-version.sh
! Source31: openafs-buildall.sh
! Source32: openafs-makesrc.sh
! Source33: openafs-kvers-is.sh
  
  Patch0:  openafs-1.4.0-kmodule26.patch
- #Patch1:  openafs-1.4.1-moduleparam.patch
- 
- Patch10: afs-krb5-2.0-krb524.patch
- Patch11: afs-krb5-2.0-libsocket.patch
- Patch12: afs-krb5-2.0-com_err.patch
- Patch13: afs-krb5-2.0-openafs1.3.patch
- Patch14: afs-krb5-2.0-res_search.patch
  
  %description
  The AFS distributed filesystem.  AFS is a distributed filesystem
--- 240,253 ----
  Source1: http://www.openafs.org/dl/openafs/%{afsvers}/openafs-%{afsvers}-doc.tar.bz2
  %define srcdir openafs-%{afsvers}
  
  Source10: http://www.openafs.org/dl/openafs/%{afsvers}/RELNOTES-%{afsvers}
  Source11: http://www.openafs.org/dl/openafs/%{afsvers}/ChangeLog
  
  Source30: openafs-kernel-version.sh
! Source998: openafs-buildall.sh
! Source999: kmodtool
  
  Patch0:  openafs-1.4.0-kmodule26.patch
  
  %description
  The AFS distributed filesystem.  AFS is a distributed filesystem
***************
*** 280,285 ****
--- 291,298 ----
                                    will be installed.  You probably don't
                                    need to change this ever.
  
+  --define "fedorakmod 1"	  Build 'Fedora' style kernel modules
+ 
  To a kernel module for your running kernel, just run:
    rpmbuild --rebuild --target=`uname -m` openafs-%{pkgvers}-%{osvers}.%{pkgrel}.src.rpm
  
***************
*** 291,297 ****
  %if %{build_userspace}
  
  %package client
! Requires: binutils, openafs-kernel, openafs = %{PACKAGE_VERSION}
  Summary: OpenAFS Filesystem Client
  Group: Networking/Filesystem
  
--- 304,318 ----
  %if %{build_userspace}
  
  %package client
! Requires: binutils, openafs = %{PACKAGE_VERSION}
! 
! %if %{fedorakmod}
! Requires: %{name}-kmod >= %{version}
! Provides: %{name}-kmod-common = %{version}
! %else
! Requires: openafs-kernel
! %endif
! 
  Summary: OpenAFS Filesystem Client
  Group: Networking/Filesystem
  
***************
*** 385,390 ****
--- 406,414 ----
  Summary: OpenAFS Kernel Module source tree
  Group: Networking/Filesystems
  Provides: openafs-kernel = %{PACKAGE_VERSION}
+ %if %{fedorakmod}
+ Provides: %{name}-kmod = %{PACKAGE_VERSION}
+ %endif
  
  %description kernel-source
  The AFS distributed filesystem.  AFS is a distributed filesystem
***************
*** 453,458 ****
--- 477,488 ----
  ##############################################################################
  %if %{build_modules}
  
+ %if %{fedorakmod}
+ %{expand:%(%{kmodtool} rpmtemplate %{kmod_name} %{kverrel} %{kvariants} 2>/dev/null)}
+ 
+ %else
+ 
+ # Legacy kernel compilation code here ...
  %define modkversion %(echo %{kernvers} | cut -d- -f1)
  %define modkrelease %(echo %{kernvers} | cut -d- -f2)
  %define modpkgrel %{modkversion}_%{modkrelease}_%{pkgrel}
***************
*** 563,568 ****
--- 593,600 ----
  %endif
  
  %endif
+ # End legacy kernel compilation code ...
+ %endif
  
  ##############################################################################
  #
***************
*** 575,580 ****
--- 607,615 ----
  : @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
  : @@@
  : @@@ kernel version:     %{kernvers}
+ %if %{fedorakmod}
+ : @@@ kernel variations:  %{kvariants}
+ %else
  : @@@ base kernel version:%{kversion}
  : @@@ kernel modules dir: %{kxmoddir}
  : @@@ kernel source dir:  %{ksrcdir}
***************
*** 587,592 ****
--- 622,628 ----
  : @@@ kernel type:        %{ktype}
  %endif
  %endif
+ %endif
  : @@@ PAM modules dir:    %{pamdir}
  : @@@ build userspace:    %{build_userspace}
  : @@@ build modules:      %{build_modules}
***************
*** 602,615 ****
  # Patch openafs to build a kernel module named "openafs" instead of "libafs"
  %patch0 -p1 -b .kmod26
  
- # Patch to work around the Linux 2.6.9 module_param function
- #%patch1 -p0 -b .modparam
- 
  %if %{build_userspace}
  # Save some time -- install these if we're building userspace
  
  # Install the Krb5 Migration Kit
! %setup -q -T -D -a 20 -n %{srcdir}
  
  #
  # patch afs-krb5 migration kit to work with openafs-1.3 and krb5-1.3;
--- 638,648 ----
  # Patch openafs to build a kernel module named "openafs" instead of "libafs"
  %patch0 -p1 -b .kmod26
  
  %if %{build_userspace}
  # Save some time -- install these if we're building userspace
  
  # Install the Krb5 Migration Kit
! tar -xzf src/packaging/RedHat/openafs-krb5-2.0.tar.gz
  
  #
  # patch afs-krb5 migration kit to work with openafs-1.3 and krb5-1.3;
***************
*** 617,642 ****
  #
  
  # krb524 is no longer in a separate library as of krb5-1.3; handle this
! %patch10 -p0 -b .krb524
  
  # make sure NETLIBS gets added to the proper programs (seems to be 
  # needed only for Solaris)
! %patch11 -p0 -b .libsocket
  
  # find an existing libcom_err and use that
! %patch12 -p0 -b .com_err
  
  # make afs-krb5 work with recent OpenAFS; includes and prototypes
! %patch13 -p0 -b .openafs13
  
  # nothing in afs-krb5 actually uses res_search
! %patch14 -p0 -b .res_search
  
  (cd afs-krb5/src && autoreconf) || exit 1
  
  %endif
  
- 
  ##############################################################################
  #
  # building
--- 650,674 ----
  #
  
  # krb524 is no longer in a separate library as of krb5-1.3; handle this
! patch -p0 -b -z .krb524 < src/packaging/RedHat/afs-krb5-2.0-krb524.patch
  
  # make sure NETLIBS gets added to the proper programs (seems to be 
  # needed only for Solaris)
! patch -p0 -b -z .libsocket < src/packaging/RedHat/afs-krb5-2.0-libsocket.patch
  
  # find an existing libcom_err and use that
! patch -p0 -b -z .com_err < src/packaging/RedHat/afs-krb5-2.0-com_err.patch
  
  # make afs-krb5 work with recent OpenAFS; includes and prototypes
! patch -p0 -b -z .openafs13 < src/packaging/RedHat/afs-krb5-2.0-openafs1.3.patch
  
  # nothing in afs-krb5 actually uses res_search
! patch -p0 -b -z .res_search < src/packaging/RedHat/afs-krb5-2.0-res_search.patch
  
  (cd afs-krb5/src && autoreconf) || exit 1
  
  %endif
  
  ##############################################################################
  #
  # building
***************
*** 784,803 ****
         --libdir=%{_libdir} \
         --bindir=%{_bindir} \
         --sbindir=%{_sbindir} \
         --with-linux-kernel-headers=%{ksrcdir} \
  %if %{krb5support}
  	--with-krb5-conf \
  %endif
         $config_opts \
         || exit 1
  
  %if %{build_userspace}
  # Build the user-space AFS stuff
  make dest_nolibafs || exit 1
  
- # Build the libafs tree
- make only_libafs_tree || exit 1
- 
  %if %{krb5support}
  # Now build ka-forwarder
  (cd afs-krb5/src &&
--- 816,858 ----
         --libdir=%{_libdir} \
         --bindir=%{_bindir} \
         --sbindir=%{_sbindir} \
+ %if %{build_modules}
         --with-linux-kernel-headers=%{ksrcdir} \
+ %endif
  %if %{krb5support}
  	--with-krb5-conf \
  %endif
         $config_opts \
         || exit 1
  
+ # Build the libafs tree
+ make only_libafs_tree || exit 1
+ 
+ # Configure each of our kernel modules
+ 
+ %if %{fedorakmod} && %{build_modules}
+ for kvariant in %{kvariants} ; do
+   cp -R libafs_tree _kmod_build_${kvariant}
+   pushd _kmod_build_${kvariant}
+   ./configure --with-afs-sysname=${sysname} \
+   	--prefix=%{_prefix} \
+ 	--libdir=%{_libdir} \
+ 	--bindir=%{_bindir} \
+ 	--sbindir=%{_sbindir} \
+ 	--with-linux-kernel-headers=%{_usrsrc}/kernels/%{kverrel}${kvariant:+-$kvariant}-%{_target_cpu} \
+ %if %{krb5support}
+ 	--with-krb5-conf \
+ %endif
+ 	$config_opts \
+ 	|| exit 1
+   popd
+ done
+ %endif
+ 
  %if %{build_userspace}
  # Build the user-space AFS stuff
  make dest_nolibafs || exit 1
  
  %if %{krb5support}
  # Now build ka-forwarder
  (cd afs-krb5/src &&
***************
*** 814,819 ****
--- 869,885 ----
  %endif
  
  %if %{build_modules}
+ %if %{fedorakmod}
+ for kvariant in %{kvariants}
+ do
+   pushd _kmod_build_$kvariant;
+   make all MPS=SP
+   popd
+ done
+ 
+ %else
+ # Begin legacy kernel module building code
+ 
  %if %{kvers_is_24}
  # Build all the kernel modules for linux 2.4.x
  for variation in %{kvariations}
***************
*** 843,848 ****
--- 909,916 ----
    make dest_only_libafs MPS=SP
  
  %endif
+ # End legacy kernel module building code
+ %endif
  %endif
  
  
***************
*** 905,913 ****
  ln -f $RPM_BUILD_ROOT%{_bindir}/kpasswd $RPM_BUILD_ROOT%{_bindir}/kapasswd
  
  # Copy root.client config files
! install -m 755 %{SOURCE15} $RPM_BUILD_ROOT/etc/sysconfig/openafs
! install -m 755 %{SOURCE16} $RPM_BUILD_ROOT%{initdir}/openafs-client
! install -m 755 %{SOURCE17} $RPM_BUILD_ROOT%{initdir}/openafs-server
  
  # Copy PAM modules
  install -m 755 ${sysname}/dest/lib/pam* $RPM_BUILD_ROOT%{pamdir}
--- 973,981 ----
  ln -f $RPM_BUILD_ROOT%{_bindir}/kpasswd $RPM_BUILD_ROOT%{_bindir}/kapasswd
  
  # Copy root.client config files
! install -m 755 src/packaging/RedHat/openafs.sysconfig $RPM_BUILD_ROOT/etc/sysconfig/openafs
! install -m 755 src/packaging/RedHat/openafs-client.init $RPM_BUILD_ROOT%{initdir}/openafs-client
! install -m 755 src/packaging/RedHat/openafs-server.init $RPM_BUILD_ROOT%{initdir}/openafs-server
  
  # Copy PAM modules
  install -m 755 ${sysname}/dest/lib/pam* $RPM_BUILD_ROOT%{pamdir}
***************
*** 918,927 ****
  
  # 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
  
  #
  # install kernel-source
--- 986,994 ----
  
  # Populate /usr/vice/etc
  uve=$RPM_BUILD_ROOT%{_prefix}/vice/etc
! install -p -m 644 src/packaging/RedHat/openafs-ThisCell $uve/ThisCell
! install -p -m 644 src/afsd/CellServDB $uve/CellServDB.dist
! install -p -m 644 src/packaging/RedHat/openafs-cacheinfo $uve/cacheinfo
  
  #
  # install kernel-source
***************
*** 934,941 ****
  
  # Next, copy the LICENSE Files, README
  install -m 644 src/LICENSE $RPM_BUILD_ROOT%{_prefix}/src/openafs-kernel-%{afsvers}/LICENSE.IBM
! install -m 644 %{SOURCE7} $RPM_BUILD_ROOT%{_prefix}/src/openafs-kernel-%{afsvers}/LICENSE.Sun
! install -m 644 %{SOURCE8} $RPM_BUILD_ROOT%{_prefix}/src/openafs-kernel-%{afsvers}/README
  
  #
  # Install DOCUMENTATION
--- 1001,1008 ----
  
  # Next, copy the LICENSE Files, README
  install -m 644 src/LICENSE $RPM_BUILD_ROOT%{_prefix}/src/openafs-kernel-%{afsvers}/LICENSE.IBM
! install -m 644 src/packaging/RedHat/openafs-LICENSE.Sun $RPM_BUILD_ROOT%{_prefix}/src/openafs-kernel-%{afsvers}/LICENSE.Sun
! install -m 644 src/packaging/RedHat/openafs-README $RPM_BUILD_ROOT%{_prefix}/src/openafs-kernel-%{afsvers}/README
  
  #
  # Install DOCUMENTATION
***************
*** 1013,1019 ****
  %{_sbindir}/fms
  %{_sbindir}/fstrace
  %{_sbindir}/kas
- %{_sbindir}/kseal
  %{_sbindir}/read_tape
  %{_sbindir}/restorevol
  %{_sbindir}/rxdebug
--- 1080,1085 ----
***************
*** 1067,1073 ****
  for f in kdb rmtsysd kpwvalid ; do
    rm -f $RPM_BUILD_ROOT%{_sbindir}/$f
  done
! rm -f $RPM_BUILD_ROOT%{_sbindir}/kdump*
  
  # remove man pages from programs deleted above
  for f in 1/dlog 1/dpass 1/livesys 1/xstat_cm_test 1/xstat_fs_test 8/kdb 8/kpwvalid 8/xfs_size_check 1/package_test 5/package 8/package ; do
--- 1133,1140 ----
  for f in kdb rmtsysd kpwvalid ; do
    rm -f $RPM_BUILD_ROOT%{_sbindir}/$f
  done
! # sometimes install sucks and puts down a directory. kill it all.
! rm -rf $RPM_BUILD_ROOT%{_sbindir}/kdump*
  
  # remove man pages from programs deleted above
  for f in 1/dlog 1/dpass 1/livesys 1/xstat_cm_test 1/xstat_fs_test 8/kdb 8/kpwvalid 8/xfs_size_check 1/package_test 5/package 8/package ; do
***************
*** 1092,1097 ****
--- 1159,1176 ----
  %endif
  
  %if %{build_modules}
+ %if %{fedorakmod}
+ for kvariant in %{kvariants}
+ do
+     pushd _kmod_build_$kvariant
+     srcdir=src/libafs/MODLOAD-%{kverrel}${kvariant}-SP
+     dstdir=$RPM_BUILD_ROOT/lib/modules/%{kverrel}${kvariant}/extra/openafs
+ 
+     mkdir -p ${dstdir}
+     install -m 744 ${srcdir}/libafs-%{kverrel}${kvariant}.ko $dstdir/openafs.ko
+     popd
+ done
+ %else
  # Install the kernel modules
  for variation in %{kvariations}
  do
***************
*** 1114,1119 ****
--- 1193,1199 ----
      install -m 744 ${srcdir}/${modname} ${dstdir}/openafs${kmodend}
  done
  %endif
+ %endif
  
  ##############################################################################
  ###
***************
*** 1146,1160 ****
  	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
--- 1226,1237 ----
  	chmod 0755 /afs
  fi
  
! # Create the CellServDB
  [ -f /usr/vice/etc/CellServDB.local ] || touch /usr/vice/etc/CellServDB.local
  
  ( cd /usr/vice/etc ; \
    cat CellServDB.local CellServDB.dist > CellServDB ; \
!   chmod 644 CellServDB )
  
  echo
  echo The AFS cache is configured for 100 MB. Edit the
***************
*** 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
--- 1269,1274 ----
***************
*** 1206,1212 ****
  %endif
  
  %if %{build_modules}
! 
  %if %{up_package}
  %post kernel
  /sbin/depmod -ae %{kernvers}
--- 1280,1286 ----
  %endif
  
  %if %{build_modules}
! %if !%{fedorakmod}
  %if %{up_package}
  %post kernel
  /sbin/depmod -ae %{kernvers}
***************
*** 1247,1253 ****
  %postun kernel-hugemem
  /sbin/depmod -ae %{kernvers}%{?hugemem_ext:%{hugemem_ext}}
  %endif
! 
  %endif
  
  
--- 1321,1327 ----
  %postun kernel-hugemem
  /sbin/depmod -ae %{kernvers}%{?hugemem_ext:%{hugemem_ext}}
  %endif
! %endif
  %endif
  
  
***************
*** 1273,1279 ****
  %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
--- 1347,1352 ----
***************
*** 1289,1294 ****
--- 1362,1368 ----
  %{_mandir}/man5/afs*
  %{_mandir}/man5/cacheinfo.*
  %{_mandir}/man8/afsd.*
+ %{_mandir}/man5/CellAlias.*
  
  %files server
  %defattr(-,root,root)
***************
*** 1302,1307 ****
--- 1376,1382 ----
  %{_prefix}/afs/bin/fileserver
  # Should we support KAServer?
  %{_prefix}/afs/bin/kaserver
+ %{_prefix}/afs/bin/ka-forwarder
  %{_prefix}/afs/bin/pt_util
  %{_prefix}/afs/bin/ptserver
  %{_prefix}/afs/bin/salvager
***************
*** 1343,1350 ****
--- 1418,1427 ----
  %{_mandir}/man8/buserver.*
  %{_mandir}/man8/fileserver.*
  %{_mandir}/man8/kadb_check.*
+ %{_mandir}/man8/ka-forwarder.*
  %{_mandir}/man8/prdb_check.*
  %{_mandir}/man8/ptserver.*
+ %{_mandir}/man8/pt_util.*
  %{_mandir}/man8/salvager.*
  %{_mandir}/man8/upclient.*
  %{_mandir}/man8/upserver.*
***************
*** 1427,1432 ****
--- 1504,1510 ----
  
  %if %{build_modules}
  
+ %if !%{fedorakmod}
  %if %{up_package}
  %files kernel
  %defattr(-,root,root)
***************
*** 1456,1461 ****
--- 1534,1540 ----
  %defattr(-,root,root)
  %{kxmoddir}%{?hugemem_ext:%{hugemem_ext}}/kernel/fs/openafs/openafs.*
  %endif
+ %endif
  
  %endif
  
***************
*** 1465,1476 ****
  ###
  ##############################################################################
  %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.
--- 1544,1562 ----
  ###
  ##############################################################################
  %changelog
+ * Wed Oct 10 2007  Simon Wilkinson <simon@sxw.org.uk> 1.4.5pre1-1
+ - Use Fedora style kmods, which allows us to install multiple kernel types
+ 
+ * Thu Jun 07 2007  Simon Wilkinson <simon@sxw.org.uk> 1.4.4-3
+ - Use distributed files, rather than those in packager's SOURCE directory
+ - Remove SuidCells stuff, which was unused
+ 
  * 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.
  
! * Wed Aug 23 2006  Derrick Brashear <shadow@dementia.org> 1.4.2-1
  - update to 1.4.2
  - use installed aklog manpage.
  - moduleparam patch obsoleted.
Index: openafs/src/rx/rx_kcommon.h
diff -c openafs/src/rx/rx_kcommon.h:1.32.4.2 openafs/src/rx/rx_kcommon.h:1.32.4.3
*** openafs/src/rx/rx_kcommon.h:1.32.4.2	Thu Jan  4 16:17:05 2007
--- openafs/src/rx/rx_kcommon.h	Fri Oct  5 18:18:36 2007
***************
*** 158,163 ****
--- 158,167 ----
  extern struct domain inetdomain;
  #endif /* AFS_XBSD_ENV */
  
+ #if defined(AFS_SUN510_ENV)
+ extern struct afs_ifinfo afsifinfo[ADDRSPERSITE];
+ #endif
+ 
  #endif /* _RX_KCOMMON_H_ */
  
  #endif
Index: openafs/src/rx/rx_prototypes.h
diff -c openafs/src/rx/rx_prototypes.h:1.29.4.4 openafs/src/rx/rx_prototypes.h:1.29.4.6
*** openafs/src/rx/rx_prototypes.h:1.29.4.4	Thu Jan 11 22:49:56 2007
--- openafs/src/rx/rx_prototypes.h	Fri Oct  5 18:18:36 2007
***************
*** 380,386 ****
  #endif
  extern void osi_StopListener(void);
  
- 
  /* ARCH/rx_kmutex.c */
  #if defined(KERNEL) && defined(AFS_LINUX20_ENV)
  extern void afs_mutex_init(afs_kmutex_t * l);
--- 380,385 ----
***************
*** 402,407 ****
--- 401,411 ----
  #endif
  extern int osi_NetReceive(osi_socket so, struct sockaddr_in *addr,
  			  struct iovec *dvec, int nvecs, int *lengthp);
+ #if defined(KERNEL) && defined(AFS_SUN510_ENV)
+ extern void osi_StartNetIfPoller(void);
+ extern void osi_NetIfPoller(void);
+ extern struct afs_ifinfo afsifinfo[ADDRSPERSITE];
+ #endif
  extern void osi_StopListener(void);
  extern int rxi_FindIfMTU(afs_uint32 addr);
  #ifndef RXK_LISTENER_ENV
Index: openafs/src/rx/SOLARIS/rx_knet.c
diff -c openafs/src/rx/SOLARIS/rx_knet.c:1.20 openafs/src/rx/SOLARIS/rx_knet.c:1.20.6.1
*** openafs/src/rx/SOLARIS/rx_knet.c:1.20	Fri Apr 15 14:33:34 2005
--- openafs/src/rx/SOLARIS/rx_knet.c	Thu Oct  4 22:24:39 2007
***************
*** 11,17 ****
  #include "afs/param.h"
  
  RCSID
!     ("$Header: /cvs/openafs/src/rx/SOLARIS/rx_knet.c,v 1.20 2005/04/15 18:33:34 shadow Exp $");
  
  #ifdef AFS_SUN5_ENV
  #include "rx/rx_kcommon.h"
--- 11,17 ----
  #include "afs/param.h"
  
  RCSID
!     ("$Header: /cvs/openafs/src/rx/SOLARIS/rx_knet.c,v 1.20.6.1 2007/10/05 02:24:39 shadow Exp $");
  
  #ifdef AFS_SUN5_ENV
  #include "rx/rx_kcommon.h"
***************
*** 36,41 ****
--- 36,51 ----
  #include "inet/ip.h"
  #include "inet/ip_if.h"
  #include "netinet/udp.h"
+ #ifdef AFS_SUN510_ENV
+ #include "h/ddi.h"
+ #include "h/ksynch.h"
+ #include "h/sunddi.h"
+ #include "h/sunldi.h"
+ #include "h/sockio.h"
+ #include "h/cmn_err.h"
+ #include "h/socket.h"
+ #include "netinet/in.h"
+ #endif
  
  /*
   * Function pointers for kernel socket routines
***************
*** 68,81 ****
  {
      int i = 0;
      int different = 0;
! 
      ill_t *ill;
      ipif_t *ipif;
-     int rxmtu, maxmtu;
- #ifdef AFS_SUN510_ENV
-     ill_walk_context_t ctx;
  #endif
! 
      int mtus[ADDRSPERSITE];
      afs_uint32 addrs[ADDRSPERSITE];
      afs_uint32 ifinaddr;
--- 78,88 ----
  {
      int i = 0;
      int different = 0;
! #ifndef AFS_SUN510_ENV
      ill_t *ill;
      ipif_t *ipif;
  #endif
!     int rxmtu, maxmtu;
      int mtus[ADDRSPERSITE];
      afs_uint32 addrs[ADDRSPERSITE];
      afs_uint32 ifinaddr;
***************
*** 84,93 ****
      memset(addrs, 0, sizeof(addrs));
  
  #ifdef AFS_SUN510_ENV
!     for (ill = ILL_START_WALK_ALL(&ctx) ; ill ; ill = ill_next(&ctx, ill)) {
  #else
      for (ill = ill_g_head; ill; ill = ill->ill_next) {
- #endif
  #ifdef AFS_SUN58_ENV
  	/* Make sure this is an IPv4 ILL */
  	if (ill->ill_isv6)
--- 91,148 ----
      memset(addrs, 0, sizeof(addrs));
  
  #ifdef AFS_SUN510_ENV
!     (void) rw_enter(&afsifinfo_lock, RW_READER);
! 
!     for (i = 0; (afsifinfo[i].ipaddr != NULL) && (i < ADDRSPERSITE); i++) {
! 
!              /* Ignore addresses which are down.. */
!             if (!(afsifinfo[i].flags & IFF_UP))
!                 continue;
! 
!             /* Compute the Rx interface MTU */
! 	    rxmtu = (afsifinfo[i].mtu - RX_IPUDP_SIZE);
! 
! 	    ifinaddr = afsifinfo[i].ipaddr;
! 	    if (myNetAddrs[i] != ifinaddr)
! 		different++;
! 
! 	    /* Copy interface MTU and address; adjust maxmtu */
! 	    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);
! 	    }
!             
!     }
!     
!     (void) rw_exit(&afsifinfo_lock);
! 
!     rx_maxJumboRecvSize =
! 	RX_HEADER_SIZE + rxi_nDgramPackets * RX_JUMBOBUFFERSIZE +
! 	(rxi_nDgramPackets - 1) * RX_JUMBOHEADERSIZE;
!     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;
! }
! 
  #else
      for (ill = ill_g_head; ill; ill = ill->ill_next) {
  #ifdef AFS_SUN58_ENV
  	/* Make sure this is an IPv4 ILL */
  	if (ill->ill_isv6)
***************
*** 144,160 ****
  
      return different;
  }
  
  int
  rxi_FindIfMTU(afs_uint32 addr)
  {
-     ill_t *ill;
-     ipif_t *ipif;
      afs_uint32 myAddr, netMask;
      int match_value = 0;
      int mtu = -1;
  #ifdef AFS_SUN510_ENV
!     ill_walk_context_t ctx;
  #endif
  
      if (numMyNetAddrs == 0)
--- 199,217 ----
  
      return different;
  }
+ #endif
  
  int
  rxi_FindIfMTU(afs_uint32 addr)
  {
      afs_uint32 myAddr, netMask;
      int match_value = 0;
      int mtu = -1;
  #ifdef AFS_SUN510_ENV
!     int i = 0;
! #else
!     ill_t *ill;
!     ipif_t *ipif;
  #endif
  
      if (numMyNetAddrs == 0)
***************
*** 171,180 ****
  	netMask = 0;
  
  #ifdef AFS_SUN510_ENV
!     for (ill = ILL_START_WALK_ALL(&ctx) ; ill ; ill = ill_next(&ctx, ill)) {
  #else
      for (ill = ill_g_head; ill; ill = ill->ill_next) {
- #endif
  #ifdef AFS_SUN58_ENV
  	/* Make sure this is an IPv4 ILL */
  	if (ill->ill_isv6)
--- 228,273 ----
  	netMask = 0;
  
  #ifdef AFS_SUN510_ENV
!     (void) rw_enter(&afsifinfo_lock, RW_READER);
! 
!     for (i = 0; (afsifinfo[i].ipaddr != NULL) && (i < ADDRSPERSITE); i++) {
!         afs_uint32 thisAddr, subnetMask;
!     	int thisMtu;
! 
!         /* Ignore addresses which are down.. */
!         if ((afsifinfo[i].flags & IFF_UP) == 0)
!             continue;
! 
!         thisAddr = afsifinfo[i].ipaddr;
!         subnetMask = afsifinfo[i].netmask;
!         thisMtu = afsifinfo[i].mtu;
! 
!         if ((myAddr & netMask) == (thisAddr & netMask)) {
! 	   if ((myAddr & subnetMask) == (thisAddr & subnetMask)) {
! 	        if (myAddr == thisAddr) {
!                     match_value = 4;
!                     mtu = thisMtu;
!                 }
! 
!                 if (match_value < 3) {
!                     match_value = 3;
!                     mtu = thisMtu;
!                 }
!            }
! 
!            if (match_value < 2) {
!                 match_value = 2;
!                 mtu = thisMtu;
!            }
!         }
!      }
!      
!      (void) rw_exit(&afsifinfo_lock);
! 
!      return mtu;
! }
  #else
      for (ill = ill_g_head; ill; ill = ill->ill_next) {
  #ifdef AFS_SUN58_ENV
  	/* Make sure this is an IPv4 ILL */
  	if (ill->ill_isv6)
***************
*** 213,218 ****
--- 306,312 ----
  
      return mtu;
  }
+ #endif
  
  /* rxi_NewSocket, rxi_FreeSocket and osi_NetSend are from the now defunct
   * afs_osinet.c. 
***************
*** 462,467 ****
--- 556,729 ----
      return error;
  }
  
+ #if defined(AFS_SUN510_ENV)
+ /* How often afs collects interface info. Tunable via /etc/system:      */
+ /* set afs:afs_if_poll_interval = integer (value is in seconds)         */
+ static int afs_if_poll_interval = 30;
+ 
+ /* Global array which holds the interface info for consumers            */
+ struct afs_ifinfo afsifinfo[ADDRSPERSITE];
+ 
+ void
+ osi_StartNetIfPoller()
+ {
+     (void) ddi_taskq_dispatch(afs_taskq, (void(*) (void*)) osi_NetIfPoller,
+             NULL, DDI_SLEEP);
+ }
+ 
+ void
+ osi_NetIfPoller()
+ {
+     cred_t *cr;
+     ldi_ident_t li;
+     ldi_handle_t lh;
+     struct lifnum lifn;
+     struct lifconf lifc;
+     struct lifreq lifr;
+     struct lifreq *lifrp;
+     struct sockaddr_in *sin4_local;
+     struct sockaddr_in *sin4_dst;
+     major_t udpmajor;
+     caddr_t lifcbuf;
+     int i, count, error, rv;
+     int ifcount;
+     int metric;
+     int index;
+     uint_t mtu;
+     uint64_t flags;
+ 
+     /* Get our permissions */
+     cr = CRED();
+ 
+     /* Initialize and open /dev/udp for receiving ioctls */
+     udpmajor = ddi_name_to_major(UDP_MOD_NAME);
+ 
+     error = ldi_ident_from_major(udpmajor, &li);
+     if (error)
+         cmn_err(CE_PANIC, "osi_NetIfPoller: ldi_ident_from_major failed: %d",
+             error);
+ 
+     error = ldi_open_by_name(UDP_DEV_NAME, FREAD, cr, &lh, li);
+     if (error)
+         cmn_err(CE_PANIC,
+             "osi_NetIfPoller: ldi_open_by_name failed: %d", error);
+ 
+ 
+     /* First, how many interfaces do we have? */
+     (void) bzero((void *)&lifn, sizeof(struct lifnum));
+     lifn.lifn_family   = AF_INET;
+ 
+     error = ldi_ioctl(lh, SIOCGLIFNUM, (intptr_t)&lifn,
+         FKIOCTL, cr, &rv);
+     if (error)
+      cmn_err(CE_PANIC,
+          "osi_NetIfPoller: ldi_ioctl: SIOCGLIFNUM failed: %d", error);
+ 
+     ifcount = lifn.lifn_count;
+ 
+     /* Set up some stuff for storing the results of SIOCGLIFCONF */
+     (void) bzero((void *)&lifc, sizeof(struct lifconf));
+ 
+     lifcbuf = kmem_zalloc(ifcount * sizeof(struct lifreq), KM_SLEEP);
+ 
+     lifc.lifc_family  = AF_INET;
+     lifc.lifc_flags   = IFF_UP;
+     lifc.lifc_len     = ifcount * sizeof(struct lifreq);
+     lifc.lifc_buf     = lifcbuf;
+ 
+     /* Get info on each of our available interfaces. */
+     error = ldi_ioctl(lh, SIOCGLIFCONF, (intptr_t)&lifc,
+         FKIOCTL, cr, &rv);
+     if (error)
+         cmn_err(CE_PANIC,
+             "osi_NetIfPoller: ldi_ioctl: SIOCGLIFCONF failed: %d", error);
+ 
+     lifrp = lifc.lifc_req;
+ 
+     count = 0;
+ 
+     /* Loop through our interfaces and pick out the info we want */
+     for (i = lifc.lifc_len / sizeof(struct lifreq);
+         i > 0; i--, lifrp++) {
+                 
+         if (count >= ADDRSPERSITE)
+                 break;
+ 
+         (void) bzero((void *)&lifr, sizeof(struct lifreq));
+ 
+         (void) strncpy(lifr.lifr_name, lifrp->lifr_name,
+             sizeof(lifr.lifr_name));
+ 
+         /* Get this interface's Flags */
+         error = ldi_ioctl(lh, SIOCGLIFFLAGS, (intptr_t)&lifr,
+             FKIOCTL, cr, &rv);
+         if (error)
+             cmn_err(CE_PANIC,
+                 "osi_NetIfPoller: ldi_ioctl: SIOCGLIFFLAGS failed: %d",
+                     error);
+ 
+         /* Ignore plumbed but down interfaces. */
+         if ((lifr.lifr_flags & IFF_UP) == 0)
+             continue;
+ 
+         flags = lifr.lifr_flags;
+ 
+         /* Get this interface's MTU */
+         error = ldi_ioctl(lh, SIOCGLIFMTU, (intptr_t)&lifr,
+             FKIOCTL, cr, &rv);
+ 
+         if (error) {
+             mtu = 1125;
+         } else {
+             mtu = lifr.lifr_metric;
+         }
+ 
+         /* Get this interface's Metric */
+         error = ldi_ioctl(lh, SIOCGLIFMETRIC, (intptr_t)&lifr,
+             FKIOCTL, cr, &rv);
+ 
+         if (error) {
+             metric = 0;
+         } else {
+             metric = lifr.lifr_metric;
+         }
+ 
+         sin4_local = (struct sockaddr_in *) &lifrp->lifr_addr;
+         sin4_dst = (struct sockaddr_in *) &lifrp->lifr_dstaddr;
+ 
+         /* Acquire global array write lock */
+         (void) rw_enter(&afsifinfo_lock, RW_WRITER);
+ 
+         /* Copy our collected data into the global array */
+         (void) strncpy(afsifinfo[count].ifname, lifrp->lifr_name,
+             sizeof(afsifinfo[count].ifname));
+         afsifinfo[count].ipaddr     = ntohl(sin4_local->sin_addr.s_addr);
+         afsifinfo[count].mtu        = mtu;
+         afsifinfo[count].netmask    = lifrp->lifr_addrlen;
+         afsifinfo[count].flags      = flags;
+         afsifinfo[count].metric     = metric;
+         afsifinfo[count].dstaddr    = ntohl(sin4_dst->sin_addr.s_addr);
+ 
+         /* Release global array write lock */
+         (void) rw_exit(&afsifinfo_lock);
+ 
+         count++;
+ 
+     } /* Bottom of loop: for each interface ... */
+ 
+     kmem_free(lifcbuf, ifcount * sizeof(struct lifreq));
+ 
+     /* End of thread. Time to clean up */
+     (void) ldi_close(lh, FREAD, cr);
+     (void) ldi_ident_release(li);
+ 
+     /* Schedule this to run again after afs_if_poll_interval seconds */
+     (void) timeout((void(*) (void *)) osi_StartNetIfPoller, NULL,
+         drv_usectohz((clock_t)afs_if_poll_interval * MICROSEC));
+ 
+ }
+ #endif /* AFS_SUN510_ENV */
+ 
  void
  shutdown_rxkernel(void)
  {
Index: openafs/src/rxgen/Makefile.in
diff -c openafs/src/rxgen/Makefile.in:1.8 openafs/src/rxgen/Makefile.in:1.8.14.1
*** openafs/src/rxgen/Makefile.in:1.8	Sat Jan 11 02:34:52 2003
--- openafs/src/rxgen/Makefile.in	Fri Oct 19 20:23:46 2007
***************
*** 18,23 ****
--- 18,26 ----
  rxgen: $(OBJS) AFS_component_version_number.c $(HDRS)
  	$(CC) $(CFLAGS) $(OBJS) $(XLIBS) -o $@
  
+ rpc_main.o: rpc_main.c
+ 	$(CCOBJ) $(CFLAGS) -c $< -D__PROG_CPP__="\"$(CPP)\""
+ 
  #
  # Install targets
  #
Index: openafs/src/rxgen/rpc_main.c
diff -c openafs/src/rxgen/rpc_main.c:1.23.4.2 openafs/src/rxgen/rpc_main.c:1.23.4.3
*** openafs/src/rxgen/rpc_main.c:1.23.4.2	Thu Aug 24 11:55:20 2006
--- openafs/src/rxgen/rpc_main.c	Fri Oct 19 20:23:46 2007
***************
*** 37,43 ****
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/rxgen/rpc_main.c,v 1.23.4.2 2006/08/24 15:55:20 shadow Exp $");
  
  #include <limits.h>
  #include <stdio.h>
--- 37,43 ----
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/rxgen/rpc_main.c,v 1.23.4.3 2007/10/20 00:23:46 shadow Exp $");
  
  #include <limits.h>
  #include <stdio.h>
***************
*** 98,111 ****
  char yflag = 0;			/* if set, only emit function name arrays to xdr file */
  int debug = 0;
  static char *cmdname;
! #ifdef	AFS_SUN5_ENV
! static char CPP[] = "/usr/ccs/lib/cpp";
! #elif defined(AFS_XBSD_ENV) || defined(AFS_DARWIN60_ENV)
! static char CPP[] = "/usr/bin/cpp";
! #elif defined(AFS_NT40_ENV)
! static char CPP[MAXCMDLINE];
! #elif defined(AFS_DARWIN_ENV)
! static char CPP[] = "cc -E";
  #else
  static char CPP[] = "/lib/cpp";
  #endif
--- 98,105 ----
  char yflag = 0;			/* if set, only emit function name arrays to xdr file */
  int debug = 0;
  static char *cmdname;
! #ifdef	__PROG_CPP__
! static char CPP[] = __PROG_CPP__;
  #else
  static char CPP[] = "/lib/cpp";
  #endif
Index: openafs/src/shlibafsrpc/Makefile.in
diff -c openafs/src/shlibafsrpc/Makefile.in:1.22.4.3 openafs/src/shlibafsrpc/Makefile.in:1.22.4.4
*** openafs/src/shlibafsrpc/Makefile.in:1.22.4.3	Sun Aug 20 18:23:06 2006
--- openafs/src/shlibafsrpc/Makefile.in	Fri Oct 19 20:23:46 2007
***************
*** 284,290 ****
  #
  #   $ what /opt/langtools/bin/pxdb32
  #   /opt/langtools/bin/pxdb32:
! #           HP92453-02 A.10.0A HP-UX SYMBOLIC DEBUGGER (PXDB) $Revision: 1.22.4.3 $
  #
  # The problem occurs when -g and -O are both used when compiling des.c.
  # The simplest way to work around the problem is to leave out either -g or -O.
--- 284,290 ----
  #
  #   $ what /opt/langtools/bin/pxdb32
  #   /opt/langtools/bin/pxdb32:
! #           HP92453-02 A.10.0A HP-UX SYMBOLIC DEBUGGER (PXDB) $Revision: 1.22.4.4 $
  #
  # The problem occurs when -g and -O are both used when compiling des.c.
  # The simplest way to work around the problem is to leave out either -g or -O.
***************
*** 366,372 ****
  syscall.o: ${SYS}/syscall.s
  	case "$(SYS_NAME)" in \
  	     sun4x_5* | sunx86_5*) \
! 		/usr/ccs/lib/cpp  ${SFLAGS} ${SYS}/syscall.s syscall.ss; \
  		as -o syscall.o syscall.ss;		\
  		$(RM) syscall.ss;;				\
  	 sgi_* | *_darwin_* ) \
--- 366,372 ----
  syscall.o: ${SYS}/syscall.s
  	case "$(SYS_NAME)" in \
  	     sun4x_5* | sunx86_5*) \
! 		$(CPP)  ${SFLAGS} ${SYS}/syscall.s syscall.ss; \
  		as -o syscall.o syscall.ss;		\
  		$(RM) syscall.ss;;				\
  	 sgi_* | *_darwin_* ) \
***************
*** 378,384 ****
  	 *fbsd* ) \
  		touch syscall.o ;; \
  	 *) \
! 		/lib/cpp  ${SFLAGS} ${SYS}/syscall.s syscall.ss; \
  		as -o syscall.o syscall.ss;		\
  		$(RM) syscall.ss;;				\
  	esac
--- 378,384 ----
  	 *fbsd* ) \
  		touch syscall.o ;; \
  	 *) \
! 		$(CPP)  ${SFLAGS} ${SYS}/syscall.s syscall.ss; \
  		as -o syscall.o syscall.ss;		\
  		$(RM) syscall.ss;;				\
  	esac
Index: openafs/src/sys/Makefile.in
diff -c openafs/src/sys/Makefile.in:1.36.2.3 openafs/src/sys/Makefile.in:1.36.2.4
*** openafs/src/sys/Makefile.in:1.36.2.3	Mon Jul 31 17:27:41 2006
--- openafs/src/sys/Makefile.in	Fri Oct 19 20:23:46 2007
***************
*** 80,86 ****
  syscall.o: syscall.s
  	@set -x; case "$(SYS_NAME)" in \
  	 sun4c_51 | sun4c_52 | sun4m_51 | sun4m_52 | sun4c_53 | sun4m_53  | sun4_53 | sun4_52 | sun4_54 | sun4c_54 | sun4m_54 | sun4x_5? | sun4x_5?? | sunx86_5? | sunx86_5?? ) \
! 		/usr/ccs/lib/cpp -P ${SFLAGS} ${srcdir}/syscall.s syscall.ss; \
  		as -o syscall.o syscall.ss;		\
  		$(RM) syscall.ss;;				\
  	 sgi_* |*_darwin* ) \
--- 80,86 ----
  syscall.o: syscall.s
  	@set -x; case "$(SYS_NAME)" in \
  	 sun4c_51 | sun4c_52 | sun4m_51 | sun4m_52 | sun4c_53 | sun4m_53  | sun4_53 | sun4_52 | sun4_54 | sun4c_54 | sun4m_54 | sun4x_5? | sun4x_5?? | sunx86_5? | sunx86_5?? ) \
! 		$(CPP) -P ${SFLAGS} ${srcdir}/syscall.s syscall.ss; \
  		as -o syscall.o syscall.ss;		\
  		$(RM) syscall.ss;;				\
  	 sgi_* |*_darwin* ) \
***************
*** 96,102 ****
  		${AS} syscall.S -o syscall.o ;  \
  		$(RM) -f syscall.S ;;\
  	 *) \
! 		/lib/cpp -P ${SFLAGS} ${srcdir}/syscall.s syscall.ss; \
  		as -o syscall.o syscall.ss;		\
  		$(RM) syscall.ss;;				\
  	esac
--- 96,102 ----
  		${AS} syscall.S -o syscall.o ;  \
  		$(RM) -f syscall.S ;;\
  	 *) \
! 		$(CPP) -P ${SFLAGS} ${srcdir}/syscall.s syscall.ss; \
  		as -o syscall.o syscall.ss;		\
  		$(RM) syscall.ss;;				\
  	esac
Index: openafs/src/sys/pioctl_nt.c
diff -c openafs/src/sys/pioctl_nt.c:1.34.4.7 openafs/src/sys/pioctl_nt.c:1.34.4.8
*** openafs/src/sys/pioctl_nt.c:1.34.4.7	Wed Jul 18 09:03:44 2007
--- openafs/src/sys/pioctl_nt.c	Thu Oct 18 18:07:59 2007
***************
*** 35,41 ****
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/sys/pioctl_nt.c,v 1.34.4.7 2007/07/18 13:03:44 jaltman Exp $");
  
  #include <afs/stds.h>
  #include <windows.h>
--- 35,41 ----
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/sys/pioctl_nt.c,v 1.34.4.8 2007/10/18 22:07:59 jaltman Exp $");
  
  #include <afs/stds.h>
  #include <windows.h>
***************
*** 92,103 ****
--- 92,105 ----
  	return EACCES;
      case CM_ERROR_NOSUCHFILE:
      case CM_ERROR_NOSUCHPATH:
+     case CM_ERROR_BPLUS_NOMATCH:
  	return ENOENT;
      case CM_ERROR_INVAL:
  	return EINVAL;
      case CM_ERROR_BADFD:
  	return EBADF;
      case CM_ERROR_EXISTS:
+     case CM_ERROR_INEXACT_MATCH:
  	return EEXIST;
      case CM_ERROR_CROSSDEVLINK:
  	return EXDEV;
Index: openafs/src/tbutc/NTMakefile
diff -c openafs/src/tbutc/NTMakefile:1.16 openafs/src/tbutc/NTMakefile:1.16.4.1
*** openafs/src/tbutc/NTMakefile:1.16	Sun Nov 20 20:57:28 2005
--- openafs/src/tbutc/NTMakefile	Thu Sep 20 07:46:07 2007
***************
*** 66,71 ****
--- 66,74 ----
           $(OUT)\butc_xbsa.obj \
           $(LWPOBJS) \
           $(BUCOORDOBJS)
+ 
+ BUTCRES = $(OUT)\butc.res
+ 
  BUTCINCLUDE= -I. -I$(DESTDIR)\include -I$(XBSADIR)
  BUTCLIBS=$(DESTDIR)\lib\afs\afsbudb.lib  \
  	     $(DESTDIR)\lib\afs\afsbubasics.lib \
***************
*** 110,116 ****
  # nmake /nologo /f ntmakefile install
  #----------------------------------------------- BUTC
  
! $(BUTCEXE): $(BUTCOBJS) $(BUTCLIBS)
  	$(EXECONLINK) dnsapi.lib mpr.lib
          $(_VC_MANIFEST_EMBED_EXE)
  	$(EXEPREP)
--- 113,121 ----
  # nmake /nologo /f ntmakefile install
  #----------------------------------------------- BUTC
  
! $(BUTCRES): butc.rc AFS_component_version_number.h
! 
! $(BUTCEXE): $(BUTCOBJS) $(BUTCRES) $(BUTCLIBS)
  	$(EXECONLINK) dnsapi.lib mpr.lib
          $(_VC_MANIFEST_EMBED_EXE)
  	$(EXEPREP)
***************
*** 186,188 ****
--- 191,195 ----
  
  mkdir:
  	
+ clean::
+ 	$(DEL) $(BUTCRES)
Index: openafs/src/tbutc/butc.rc
diff -c /dev/null openafs/src/tbutc/butc.rc:1.1.2.2
*** /dev/null	Mon Oct 22 23:21:23 2007
--- openafs/src/tbutc/butc.rc	Thu Sep 20 07:46:07 2007
***************
*** 0 ****
--- 1,17 ----
+ /*
+  * Copyright 2000, International Business Machines Corporation and others.
+  * All Rights Reserved.
+  * 
+  * This software has been released under the terms of the IBM Public
+  * License.  For details, see the LICENSE file in the top-level source
+  * directory or online at http://www.openafs.org/dl/license10.html
+  */
+ 
+ /* Define VERSIONINFO resource */
+ 
+ #define  AFS_VERINFO_FILE_DESCRIPTION "AFS Tape Coordinator Server (threaded)"
+ #define  AFS_VERINFO_NAME "butc"
+ #define  AFS_VERINFO_FILENAME "butc.exe"
+ 
+ #include "AFS_component_version_number.h"
+ #include "..\config\NTVersioninfo.rc"
Index: openafs/src/tviced/NTMakefile
diff -c openafs/src/tviced/NTMakefile:1.10.2.2 openafs/src/tviced/NTMakefile:1.10.2.3
*** openafs/src/tviced/NTMakefile:1.10.2.2	Mon Aug 20 13:39:08 2007
--- openafs/src/tviced/NTMakefile	Wed Oct  3 11:19:06 2007
***************
*** 33,39 ****
           $(OUT)\xdr_int32.obj
  
  VICEDOBJS = $(OUT)\viced.obj $(OUT)\afsfileprocs.obj $(OUT)\host.obj $(OUT)\physio.obj $(OUT)\callback.obj 
! VICEDRES =	$(OUT)\$(VICED)\fileserver.res
  
  TVICEDOBJS = $(OUT)\serialize_state.obj
  
--- 33,39 ----
           $(OUT)\xdr_int32.obj
  
  VICEDOBJS = $(OUT)\viced.obj $(OUT)\afsfileprocs.obj $(OUT)\host.obj $(OUT)\physio.obj $(OUT)\callback.obj 
! TVICEDRES =  $(OUT)\fileserver.res
  
  TVICEDOBJS = $(OUT)\serialize_state.obj
  
***************
*** 53,60 ****
  
  FSINTOBJS = $(OUT)\afsaux.obj $(OUT)\afscbint.cs.obj $(OUT)\afsint.ss.obj $(OUT)\afsint.xdr.obj
  
! EXEOBJS = $(VICEDOBJS) $(VICEDRES) $(VLSERVEROBJS) $(LWPOBJS) $(LIBACLOBJS) \
! 	 $(UTILOBJS) $(DIROBJS) $(VOLOBJS) $(FSINTOBJS) $(RXOBJS) #$(TVICEDOBJS) 
  
  noversion: install
  
--- 53,60 ----
  
  FSINTOBJS = $(OUT)\afsaux.obj $(OUT)\afscbint.cs.obj $(OUT)\afsint.ss.obj $(OUT)\afsint.xdr.obj
  
! EXEOBJS = $(VICEDOBJS) $(TVICEDRES) $(VLSERVEROBJS) $(LWPOBJS) $(LIBACLOBJS) \
! 	 $(UTILOBJS) $(DIROBJS) $(VOLOBJS) $(FSINTOBJS) $(RXOBJS) #$(TVICEDOBJS)
  
  noversion: install
  
***************
*** 66,71 ****
--- 66,74 ----
  $(VICEDOBJS): $(VICED)\$$(@B).c
  	$(C2OBJ) -I$(VICED) -I$(UTIL) $**
  
+ $(TVICEDRES): $(VICED)\fileserver.rc AFS_component_version_number.h
+ 	$(RC) /fo $(TVICEDRES) $(VICED)\fileserver.rc 
+ 
  $(TVICEDOBJS): $(TVICED)\$$(@B).c
  	$(C2OBJ) -I$(TVICED) -I$(UTIL) $**
  
***************
*** 112,114 ****
--- 115,121 ----
  
  mkdir:
  	
+ clean::
+ 	$(DEL) $(TVICEDRES)
+ 
+ 	
\ No newline at end of file
Index: openafs/src/venus/fs.c
diff -c openafs/src/venus/fs.c:1.30.2.9 openafs/src/venus/fs.c:1.30.2.10
*** openafs/src/venus/fs.c:1.30.2.9	Tue Jun 12 15:14:12 2007
--- openafs/src/venus/fs.c	Tue Oct 16 13:21:55 2007
***************
*** 11,17 ****
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/venus/fs.c,v 1.30.2.9 2007/06/12 19:14:12 shadow Exp $");
  
  #include <afs/afs_args.h>
  #include <rx/xdr.h>
--- 11,17 ----
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/venus/fs.c,v 1.30.2.10 2007/10/16 17:21:55 jaltman Exp $");
  
  #include <afs/afs_args.h>
  #include <rx/xdr.h>
***************
*** 69,75 ****
  static struct ubik_client *uclient;
  
  static int GetClientAddrsCmd(), SetClientAddrsCmd(), FlushMountCmd();
! static int RxStatProcCmd(), RxStatPeerCmd(), GetFidCmd(), NewUuidCmd();
  
  extern char *hostutil_GetNameByINet();
  extern struct hostent *hostutil_GetHostByName();
--- 69,75 ----
  static struct ubik_client *uclient;
  
  static int GetClientAddrsCmd(), SetClientAddrsCmd(), FlushMountCmd();
! static int RxStatProcCmd(), RxStatPeerCmd(), GetFidCmd(), UuidCmd();
  
  extern char *hostutil_GetNameByINet();
  extern struct hostent *hostutil_GetHostByName();
***************
*** 1244,1264 ****
      return error;
  }
  
  static int
! NewUuidCmd(struct cmd_syndesc *as, char *arock)
  {
      afs_int32 code;
      struct ViceIoctl blob;
  
      blob.in_size = 0;
      blob.out_size = 0;
!     code = pioctl(0, VIOC_NEWUUID, &blob, 1);
!     if (code) {
! 	Die(errno, 0);
! 	return 1;
!     }
  
!     printf("New uuid generated.\n");
      return 0;
  }
  
--- 1244,1283 ----
      return error;
  }
  
+ /* 
+  * The Windows version of UuidCmd displays the UUID.
+  * When the UNIX version is updated to do the same
+  * be sure to replace the CMD_REQUIRED flag with
+  * CMD_OPTIONAL in the cmd_AddParam(-generate) call 
+  */
  static int
! UuidCmd(struct cmd_syndesc *as, char *arock)
  {
      afs_int32 code;
      struct ViceIoctl blob;
  
      blob.in_size = 0;
      blob.out_size = 0;
!     
!     if (as->parms[0].items) {
!         if (geteuid()) {
!             fprintf (stderr, "Permission denied: requires root access.\n");
!             return EACCES;
!         }
! 
!         /* generate new UUID */
!         code = pioctl(0, VIOC_NEWUUID, &blob, 1);
  
!         if (code) {
!             Die(errno, 0);
!             return 1;
!         }
! 
!         printf("New uuid generated.\n");
!     } else {
!         /* This will never execute */
!         printf("Please add the '-generate' option to generate a new UUID.\n");
!     }
      return 0;
  }
  
***************
*** 3638,3645 ****
      ts = cmd_CreateSyntax("nukenfscreds", NukeNFSCredsCmd, 0, "nuke credentials for NFS client");
      cmd_AddParm(ts, "-addr", CMD_SINGLE, 0, "host name or address");
  
!     ts = cmd_CreateSyntax("newuuid", NewUuidCmd, 0,
! 			  "force a new uuid");
  
      code = cmd_Dispatch(argc, argv);
      if (rxInitDone)
--- 3657,3664 ----
      ts = cmd_CreateSyntax("nukenfscreds", NukeNFSCredsCmd, 0, "nuke credentials for NFS client");
      cmd_AddParm(ts, "-addr", CMD_SINGLE, 0, "host name or address");
  
!     ts = cmd_CreateSyntax("uuid", UuidCmd, 0, "manage the UUID for the cache manager");
!     cmd_AddParm(ts, "-generate", CMD_FLAG, CMD_REQUIRED, "generate a new UUID");
  
      code = cmd_Dispatch(argc, argv);
      if (rxInitDone)
Index: openafs/src/viced/callback.c
diff -c openafs/src/viced/callback.c:1.77.2.6 openafs/src/viced/callback.c:1.77.2.7
*** openafs/src/viced/callback.c:1.77.2.6	Mon Sep  3 00:00:21 2007
--- openafs/src/viced/callback.c	Mon Oct  1 20:16:00 2007
***************
*** 85,91 ****
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/viced/callback.c,v 1.77.2.6 2007/09/03 04:00:21 shadow Exp $");
  
  #include <stdio.h>
  #include <stdlib.h>		/* for malloc() */
--- 85,91 ----
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/viced/callback.c,v 1.77.2.7 2007/10/02 00:16:00 shadow Exp $");
  
  #include <stdio.h>
  #include <stdlib.h>		/* for malloc() */
***************
*** 2315,2321 ****
  static int
  cb_stateSaveFE(struct fs_dump_state * state, struct FileEntry * fe)
  {
!     int ret = 0, iovcnt, cbi, idx, len, written = 0;
      afs_uint32 fei;
      struct callback_state_entry_header hdr;
      struct FEDiskEntry fedsk;
--- 2315,2321 ----
  static int
  cb_stateSaveFE(struct fs_dump_state * state, struct FileEntry * fe)
  {
!     int ret = 0, iovcnt, cbi, written = 0;
      afs_uint32 fei;
      struct callback_state_entry_header hdr;
      struct FEDiskEntry fedsk;
***************
*** 2336,2359 ****
      }
  
      iov[0].iov_base = (char *)&hdr;
!     len = iov[0].iov_len = sizeof(hdr);
      iov[1].iov_base = (char *)&fedsk;
!     len += iov[1].iov_len = sizeof(struct FEDiskEntry);
      iovcnt = 2;
  
!     for (cbi = fe->firstcb, cb = itocb(cbi), idx = 2; 
  	 cb != NULL; 
! 	 cbi = cb->cnext, cb = itocb(cbi), idx++, hdr.nCBs++) {
  	if (cbi > state->cb_hdr->cb_max) {
  	    state->cb_hdr->cb_max = cbi;
  	}
! 	if (cb_stateCBToDiskEntry(cb, &cbdsk[idx])) {
  	    ret = 1;
  	    goto done;
  	}
! 	cbdsk[idx].index = cbi;
! 	iov[iovcnt].iov_base = (char *)&cbdsk[idx];
! 	len += iov[iovcnt].iov_len = sizeof(struct CBDiskEntry);
  	iovcnt++;
  	if ((iovcnt == 16) || (!cb->cnext)) {
  	    if (fs_stateWriteV(state, iov, iovcnt)) {
--- 2336,2359 ----
      }
  
      iov[0].iov_base = (char *)&hdr;
!     iov[0].iov_len = sizeof(hdr);
      iov[1].iov_base = (char *)&fedsk;
!     iov[1].iov_len = sizeof(struct FEDiskEntry);
      iovcnt = 2;
  
!     for (cbi = fe->firstcb, cb = itocb(cbi); 
  	 cb != NULL; 
! 	 cbi = cb->cnext, cb = itocb(cbi), hdr.nCBs++) {
  	if (cbi > state->cb_hdr->cb_max) {
  	    state->cb_hdr->cb_max = cbi;
  	}
! 	if (cb_stateCBToDiskEntry(cb, &cbdsk[iovcnt])) {
  	    ret = 1;
  	    goto done;
  	}
! 	cbdsk[iovcnt].index = cbi;
! 	iov[iovcnt].iov_base = (char *)&cbdsk[iovcnt];
! 	iov[iovcnt].iov_len = sizeof(struct CBDiskEntry);
  	iovcnt++;
  	if ((iovcnt == 16) || (!cb->cnext)) {
  	    if (fs_stateWriteV(state, iov, iovcnt)) {
***************
*** 2362,2368 ****
  	    }
  	    written = 1;
  	    iovcnt = 0;
- 	    len = 0;
  	}
      }
  
--- 2362,2367 ----
***************
*** 2401,2407 ****
  static int
  cb_stateRestoreFE(struct fs_dump_state * state)
  {
!     int ret = 0, iovcnt, len, nCBs, idx;
      struct callback_state_entry_header hdr;
      struct FEDiskEntry fedsk;
      struct CBDiskEntry cbdsk[16];
--- 2400,2406 ----
  static int
  cb_stateRestoreFE(struct fs_dump_state * state)
  {
!     int ret = 0, iovcnt, nCBs;
      struct callback_state_entry_header hdr;
      struct FEDiskEntry fedsk;
      struct CBDiskEntry cbdsk[16];
***************
*** 2410,2418 ****
      struct CallBack * cb;
  
      iov[0].iov_base = (char *)&hdr;
!     len = iov[0].iov_len = sizeof(hdr);
      iov[1].iov_base = (char *)&fedsk;
!     len += iov[1].iov_len = sizeof(fedsk);
      iovcnt = 2;
  
      if (fs_stateReadV(state, iov, iovcnt)) {
--- 2409,2417 ----
      struct CallBack * cb;
  
      iov[0].iov_base = (char *)&hdr;
!     iov[0].iov_len = sizeof(hdr);
      iov[1].iov_base = (char *)&fedsk;
!     iov[1].iov_len = sizeof(fedsk);
      iovcnt = 2;
  
      if (fs_stateReadV(state, iov, iovcnt)) {
***************
*** 2438,2448 ****
      }
  
      if (hdr.nCBs) {
! 	for (iovcnt = 0, idx = 0, len = 0, nCBs = 0;
  	     nCBs < hdr.nCBs;
! 	     idx++, nCBs++) {
! 	    iov[idx].iov_base = (char *)&cbdsk[idx];
! 	    len += iov[idx].iov_len = sizeof(struct CBDiskEntry);
  	    iovcnt++;
  	    if ((iovcnt == 16) || (nCBs == hdr.nCBs - 1)) {
  		if (fs_stateReadV(state, iov, iovcnt)) {
--- 2437,2447 ----
      }
  
      if (hdr.nCBs) {
! 	for (iovcnt = 0, nCBs = 0;
  	     nCBs < hdr.nCBs;
! 	     nCBs++) {
! 	    iov[iovcnt].iov_base = (char *)&cbdsk[iovcnt];
! 	    iov[iovcnt].iov_len = sizeof(struct CBDiskEntry);
  	    iovcnt++;
  	    if ((iovcnt == 16) || (nCBs == hdr.nCBs - 1)) {
  		if (fs_stateReadV(state, iov, iovcnt)) {
***************
*** 2453,2459 ****
  		    ret = 1;
  		    goto done;
  		}
- 		len = 0;
  		iovcnt = 0;
  	    }
  	}
--- 2452,2457 ----
Index: openafs/src/viced/viced.c
diff -c openafs/src/viced/viced.c:1.75.2.14 openafs/src/viced/viced.c:1.75.2.15
*** openafs/src/viced/viced.c:1.75.2.14	Sun Aug 12 22:26:41 2007
--- openafs/src/viced/viced.c	Thu Oct  4 23:31:51 2007
***************
*** 22,28 ****
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/viced/viced.c,v 1.75.2.14 2007/08/13 02:26:41 jaltman Exp $");
  
  #include <stdio.h>
  #include <stdlib.h>
--- 22,28 ----
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/viced/viced.c,v 1.75.2.15 2007/10/05 03:31:51 shadow Exp $");
  
  #include <stdio.h>
  #include <stdlib.h>
***************
*** 2141,2147 ****
--- 2141,2158 ----
      /* allow super users to manage RX statistics */
      rx_SetRxStatUserOk(fs_rxstat_userok);
  
+ #if !defined(AFS_DEMAND_ATTACH_FS)
+     /* 
+      * For DAFS, we do not start the Rx server threads until after
+      * the volume package is initialized, and fileserver state is
+      * restored.  This is necessary in order to keep host and callback
+      * package state pristine until we have a chance to restore state.
+      *
+      * Furthermore, startup latency is much lower with dafs, so this
+      * shouldn't pose a serious problem.
+      */
      rx_StartServer(0);		/* now start handling requests */
+ #endif
  
      /* we ensure that there is enough space in the vnode buffer to satisfy
       ** requests from all concurrent threads. 
***************
*** 2181,2186 ****
--- 2192,2198 ----
  	 * restore fileserver state */
  	fs_stateRestore();
      }
+     rx_StartServer(0);  /* now start handling requests */
  #endif /* AFS_DEMAND_ATTACH_FS */
  
      /*
Index: openafs/src/vol/fssync-server.c
diff -c openafs/src/vol/fssync-server.c:1.1.4.2 openafs/src/vol/fssync-server.c:1.1.4.3
*** openafs/src/vol/fssync-server.c:1.1.4.2	Thu Feb  8 18:59:32 2007
--- openafs/src/vol/fssync-server.c	Mon Oct 22 13:29:51 2007
***************
*** 53,59 ****
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/vol/fssync-server.c,v 1.1.4.2 2007/02/08 23:59:32 shadow Exp $");
  
  #include <sys/types.h>
  #include <stdio.h>
--- 53,59 ----
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/vol/fssync-server.c,v 1.1.4.3 2007/10/22 17:29:51 shadow Exp $");
  
  #include <sys/types.h>
  #include <stdio.h>
***************
*** 98,103 ****
--- 98,107 ----
  #include "volume.h"
  #include "partition.h"
  
+ #ifdef HAVE_POLL
+ #include <sys/poll.h>
+ #endif /* HAVE_POLL */
+ 
  #ifdef USE_UNIX_SOCKETS
  #include <sys/un.h>
  #include <afs/afsutil.h>
***************
*** 140,152 ****
  static void AcceptOn();
  static void AcceptOff();
  static void InitHandler();
- static void CallHandler(fd_set * fdsetp);
  static int AddHandler();
  static int FindHandler();
  static int FindHandler_r();
  static int RemoveHandler();
  static void GetHandler(fd_set * fdsetp, int *maxfdp);
! 
  extern int LogLevel;
  
  static afs_int32 FSYNC_com_VolOp(int fd, SYNC_command * com, SYNC_response * res);
--- 144,160 ----
  static void AcceptOn();
  static void AcceptOff();
  static void InitHandler();
  static int AddHandler();
  static int FindHandler();
  static int FindHandler_r();
  static int RemoveHandler();
+ #if defined(HAVE_POLL) && defined (AFS_PTHREAD_ENV)
+ static void CallHandler(struct pollfd *fds, int nfds, int mask);
+ static void GetHandler(struct pollfd *fds, int maxfds, int events, int *nfds);
+ #else
+ static void CallHandler(fd_set * fdsetp);
  static void GetHandler(fd_set * fdsetp, int *maxfdp);
! #endif
  extern int LogLevel;
  
  static afs_int32 FSYNC_com_VolOp(int fd, SYNC_command * com, SYNC_response * res);
***************
*** 203,209 ****
--- 211,221 ----
  #endif /* AFS_PTHREAD_ENV */
  }
  
+ #if defined(HAVE_POLL) && defined(AFS_PTHREAD_ENV)
+ static struct pollfd FSYNC_readfds[MAXHANDLERS];
+ #else
  static fd_set FSYNC_readfds;
+ #endif
  
  #ifdef USE_UNIX_SOCKETS
  static int
***************
*** 309,314 ****
--- 321,332 ----
      InitHandler();
      AcceptOn();
      for (;;) {
+ #if defined(HAVE_POLL) && defined(AFS_PTHREAD_ENV)
+         int nfds;
+         GetHandler(FSYNC_readfds, MAXHANDLERS, POLLIN|POLLPRI, &nfds);
+         if (poll(FSYNC_readfds, nfds, -1) >=1)
+ 	    CallHandler(FSYNC_readfds, nfds, POLLIN|POLLPRI);
+ #else
  	int maxfd;
  	GetHandler(&FSYNC_readfds, &maxfd);
  	/* Note: check for >= 1 below is essential since IOMGR_select
***************
*** 320,325 ****
--- 338,344 ----
  	if (IOMGR_Select(maxfd + 1, &FSYNC_readfds, NULL, NULL, NULL) >= 1)
  #endif /* AFS_PTHREAD_ENV */
  	    CallHandler(&FSYNC_readfds);
+ #endif
      }
  }
  
***************
*** 1129,1134 ****
--- 1148,1171 ----
      ReleaseWriteLock(&FSYNC_handler_lock);
  }
  
+ #if defined(HAVE_POLL) && defined(AFS_PTHREAD_ENV)
+ static void
+ CallHandler(struct pollfd *fds, int nfds, int mask)
+ {
+     int i;
+     int handler;
+     ObtainReadLock(&FSYNC_handler_lock);
+     for (i = 0; i < nfds; i++) {
+         if (fds[i].revents & mask) {
+ 	    handler = FindHandler_r(fds[i].fd);
+             ReleaseReadLock(&FSYNC_handler_lock);
+             (*HandlerProc[handler]) (fds[i].fd);
+ 	    ObtainReadLock(&FSYNC_handler_lock);
+         }
+     }
+     ReleaseReadLock(&FSYNC_handler_lock);
+ }
+ #else
  static void
  CallHandler(fd_set * fdsetp)
  {
***************
*** 1143,1148 ****
--- 1180,1186 ----
      }
      ReleaseReadLock(&FSYNC_handler_lock);
  }
+ #endif
  
  static int
  AddHandler(int afd, int (*aproc) ())
***************
*** 1198,1203 ****
--- 1236,1259 ----
      return 1;
  }
  
+ #if defined(HAVE_POLL) && defined(AFS_PTHREAD_ENV)
+ static void
+ GetHandler(struct pollfd *fds, int maxfds, int events, int *nfds)
+ {
+     int i;
+     int fdi = 0;
+     ObtainReadLock(&FSYNC_handler_lock);
+     for (i = 0; i < MAXHANDLERS; i++)
+ 	if (HandlerFD[i] != -1) {
+ 	    assert(fdi<maxfds);
+ 	    fds[fdi].fd = HandlerFD[i];
+ 	    fds[fdi].events = events;
+ 	    fds[fdi].revents = 0;
+ 	    fdi++;
+ 	}
+     *nfds = fdi;
+ }
+ #else
  static void
  GetHandler(fd_set * fdsetp, int *maxfdp)
  {
***************
*** 1214,1218 ****
--- 1270,1275 ----
      *maxfdp = maxfd;
      ReleaseReadLock(&FSYNC_handler_lock);	/* just in case */
  }
+ #endif /* HAVE_POLL && AFS_PTHREAD_ENV */
  
  #endif /* FSSYNC_BUILD_SERVER */
Index: openafs/src/vol/vol-salvage.c
diff -c openafs/src/vol/vol-salvage.c:1.51.2.8 openafs/src/vol/vol-salvage.c:1.51.2.9
*** openafs/src/vol/vol-salvage.c:1.51.2.8	Fri Sep  7 00:03:49 2007
--- openafs/src/vol/vol-salvage.c	Thu Oct  4 23:23:52 2007
***************
*** 87,93 ****
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/vol/vol-salvage.c,v 1.51.2.8 2007/09/07 04:03:49 shadow Exp $");
  
  #ifndef AFS_NT40_ENV
  #include <sys/param.h>
--- 87,93 ----
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/vol/vol-salvage.c,v 1.51.2.9 2007/10/05 03:23:52 shadow Exp $");
  
  #ifndef AFS_NT40_ENV
  #include <sys/param.h>
***************
*** 3427,3437 ****
  	syslog(LOG_INFO, "%s", tmp);
      } else
  #endif
!     {
! 	gettimeofday(&now, 0);
! 	fprintf(logFile, "%s %s", TimeStamp(now.tv_sec, 1), tmp);
! 	fflush(logFile);
!     }
  }
  
  void
--- 3427,3437 ----
  	syslog(LOG_INFO, "%s", tmp);
      } else
  #endif
! 	if (logFile) {
! 	    gettimeofday(&now, 0);
! 	    fprintf(logFile, "%s %s", TimeStamp(now.tv_sec, 1), tmp);
! 	    fflush(logFile);
! 	}
  }
  
  void
***************
*** 3448,3459 ****
  	syslog(LOG_INFO, "%s", tmp);
      } else
  #endif
!     {
! 	fprintf(logFile, "%s", tmp);
! 	fflush(logFile);
! 	if (ShowLog)
! 	    showlog();
!     }
  
      if (debug)
  	abort();
--- 3448,3459 ----
  	syslog(LOG_INFO, "%s", tmp);
      } else
  #endif
! 	if (logFile) {
! 	    fprintf(logFile, "%s", tmp);
! 	    fflush(logFile);
! 	    if (ShowLog)
! 		showlog();
! 	}
  
      if (debug)
  	abort();
Index: openafs/src/vol/volume.c
diff -c openafs/src/vol/volume.c:1.43.2.9 openafs/src/vol/volume.c:1.43.2.10
*** openafs/src/vol/volume.c:1.43.2.9	Thu Sep 20 00:09:45 2007
--- openafs/src/vol/volume.c	Thu Sep 27 12:32:12 2007
***************
*** 22,28 ****
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/vol/volume.c,v 1.43.2.9 2007/09/20 04:09:45 shadow Exp $");
  
  #include <rx/xdr.h>
  #include <afs/afsint.h>
--- 22,28 ----
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/vol/volume.c,v 1.43.2.10 2007/09/27 16:32:12 shadow Exp $");
  
  #include <rx/xdr.h>
  #include <afs/afsint.h>
***************
*** 2761,2772 ****
--- 2761,2774 ----
  		}
  	    }
  	    *ec = VOFFLINE;
+ 	    ReleaseVolumeHeader(vp->header);
  	    vp = NULL;
  	    break;
  	}
  
  	if (V_attachState(vp) == VOL_STATE_UNATTACHED) {
  	    *ec = VOFFLINE;
+ 	    ReleaseVolumeHeader(vp->header);
  	    vp = NULL;
  	    break;
  	}
Index: openafs/src/volser/volprocs.c
diff -c openafs/src/volser/volprocs.c:1.42.2.4 openafs/src/volser/volprocs.c:1.42.2.6
*** openafs/src/volser/volprocs.c:1.42.2.4	Thu Jul 19 14:52:14 2007
--- openafs/src/volser/volprocs.c	Mon Oct 15 10:15:56 2007
***************
*** 11,17 ****
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/volser/volprocs.c,v 1.42.2.4 2007/07/19 18:52:14 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.42.2.6 2007/10/15 14:15:56 shadow Exp $");
  
  #include <stdio.h>
  #include <sys/types.h>
***************
*** 1650,1657 ****
      namehead[7] = '\0';
      for (i = 0; i < 26; i++) {
  	namehead[6] = i + 'a';
! 	if (VGetPartition(namehead, 0))
! 	    partIds->partIds[i] = VGetPartition(namehead, 0) ? i : -1;
      }
  
      return 0;
--- 1650,1656 ----
      namehead[7] = '\0';
      for (i = 0; i < 26; i++) {
  	namehead[6] = i + 'a';
! 	partIds->partIds[i] = VGetPartition(namehead, 0) ? i : -1;
      }
  
      return 0;
***************
*** 2069,2079 ****
  	    xInfoP->accessDate = volDiskDataP->accessDate;
  	    xInfoP->updateDate = volDiskDataP->updateDate;
  	    xInfoP->backupDate = volDiskDataP->backupDate;
- 	    now = FT_ApproxTime();
- 	    if (now - volDiskDataP->dayUseDate > OneDay)
- 		xInfoP->dayUse = 0;
- 	    else
- 		xInfoP->dayUse = volDiskDataP->dayUse;
  	    xInfoP->filecount = volDiskDataP->filecount;
  	    xInfoP->maxquota = volDiskDataP->maxquota;
  	    xInfoP->size = volDiskDataP->diskused;
--- 2068,2073 ----
***************
*** 2081,2088 ****
  	    /*
  	     * Copy out the stat fields in a single operation.
  	     */
! 	    memcpy((char *)&(xInfoP->stat_reads[0]),
  		   (char *)&(volDiskDataP->stat_reads[0]), numStatBytes);
  
  	    /*
  	     * We're done copying.  Detach the volume and iterate (at this
--- 2075,2089 ----
  	    /*
  	     * Copy out the stat fields in a single operation.
  	     */
! 	    now = FT_ApproxTime();
! 	    if (now - volDiskDataP->dayUseDate > OneDay) {
! 		xInfoP->dayUse = 0;
! 		memset((char *)&(xInfoP->stat_reads[0]), 0, numStatBytes);
! 	    } else {
! 		xInfoP->dayUse = volDiskDataP->dayUse;
! 		memcpy((char *)&(xInfoP->stat_reads[0]),
  		   (char *)&(volDiskDataP->stat_reads[0]), numStatBytes);
+ 	    }
  
  	    /*
  	     * We're done copying.  Detach the volume and iterate (at this
