Index: openafs/src/WINNT/afsd/cm_server.h
diff -c openafs/src/WINNT/afsd/cm_server.h:1.5.2.2 openafs/src/WINNT/afsd/cm_server.h:1.5.2.3
*** openafs/src/WINNT/afsd/cm_server.h:1.5.2.2	Mon Oct 18 00:09:26 2004
--- openafs/src/WINNT/afsd/cm_server.h	Mon Dec 13 09:13:08 2004
***************
*** 21,35 ****
   * at the appropriate times to change the pointers to these servers.
   */
  typedef struct cm_server {
! 	struct cm_server *allNextp;		/* locked by cm_serverLock */
      struct sockaddr_in addr;		/* by mx */
      int type;				/* by mx */
! 	struct cm_conn *connsp;			/* locked by cm_connLock */
      long flags;				/* by mx */
!     struct cm_cell *cellp;			/* cell containing this server */
! 	unsigned long refCount;				/* locked by cm_serverLock */
!     osi_mutex_t mx;
! 	unsigned short ipRank;			/* server priority */
  } cm_server_t;
  
  enum repstate {not_busy, busy, offline};
--- 21,35 ----
   * at the appropriate times to change the pointers to these servers.
   */
  typedef struct cm_server {
!     struct cm_server *allNextp;		/* locked by cm_serverLock */
      struct sockaddr_in addr;		/* by mx */
      int type;				/* by mx */
!     struct cm_conn *connsp;		/* locked by cm_connLock */
      long flags;				/* by mx */
!     struct cm_cell *cellp;		/* cell containing this server */
!     unsigned long refCount;		/* locked by cm_serverLock */
!     osi_mutex_t mx;                     
!     unsigned short ipRank;		/* server priority */
  } cm_server_t;
  
  enum repstate {not_busy, busy, offline};
Index: openafs/src/WINNT/afsd/cm_vnodeops.c
diff -c openafs/src/WINNT/afsd/cm_vnodeops.c:1.19.2.7 openafs/src/WINNT/afsd/cm_vnodeops.c:1.19.2.8
*** openafs/src/WINNT/afsd/cm_vnodeops.c:1.19.2.7	Tue Dec  7 01:16:22 2004
--- openafs/src/WINNT/afsd/cm_vnodeops.c	Mon Dec 13 09:13:08 2004
***************
*** 1021,1032 ****
                          code = cm_FreelanceAddMount(namep, &fullname[1], "root.cell.", 1, &rock.fid);
                  }
              } else {
!                 if (cm_GetCell_Gen(namep, fullname, CM_FLAG_CREATE))
                      found = 1;
!                 if ( stricmp(namep, fullname) )
!                     code = cm_FreelanceAddSymlink(namep, fullname, &rock.fid);
!                 else
!                     code = cm_FreelanceAddMount(namep, fullname, "root.cell.", 0, &rock.fid);
              }
              if (!found || code < 0) {   /* add mount point failed, so give up */
                  if (flags & CM_FLAG_CHECKPATH)
--- 1021,1033 ----
                          code = cm_FreelanceAddMount(namep, &fullname[1], "root.cell.", 1, &rock.fid);
                  }
              } else {
!                 if (cm_GetCell_Gen(namep, fullname, CM_FLAG_CREATE)) {
                      found = 1;
!                     if ( stricmp(namep, fullname) )
!                         code = cm_FreelanceAddSymlink(namep, fullname, &rock.fid);
!                     else
!                         code = cm_FreelanceAddMount(namep, fullname, "root.cell.", 0, &rock.fid);
!                 }
              }
              if (!found || code < 0) {   /* add mount point failed, so give up */
                  if (flags & CM_FLAG_CHECKPATH)
Index: openafs/src/WINNT/afsd/cm_volume.c
diff -c openafs/src/WINNT/afsd/cm_volume.c:1.8.2.2 openafs/src/WINNT/afsd/cm_volume.c:1.8.2.3
*** openafs/src/WINNT/afsd/cm_volume.c:1.8.2.2	Tue Dec  7 00:53:57 2004
--- openafs/src/WINNT/afsd/cm_volume.c	Mon Dec 13 09:13:09 2004
***************
*** 63,73 ****
   *    first, and fall back to successively older versions if you get
   *    RXGEN_OPCODE.
   */
  long cm_UpdateVolume(struct cm_cell *cellp, cm_user_t *userp, cm_req_t *reqp,
  	cm_volume_t *volp)
  {
      cm_conn_t *connp;
!     int i;
      cm_serverRef_t *tsrp;
      cm_server_t *tsp;
      struct sockaddr_in tsockAddr;
--- 63,74 ----
   *    first, and fall back to successively older versions if you get
   *    RXGEN_OPCODE.
   */
+ #define MULTIHOMED 1
  long cm_UpdateVolume(struct cm_cell *cellp, cm_user_t *userp, cm_req_t *reqp,
  	cm_volume_t *volp)
  {
      cm_conn_t *connp;
!     int i, j, k;
      cm_serverRef_t *tsrp;
      cm_server_t *tsp;
      struct sockaddr_in tsockAddr;
***************
*** 95,100 ****
--- 96,102 ----
          osi_Log1(afsd_logp, "CALL VL_GetEntryByName{UNO} name %s", volp->namep);
  #ifdef MULTIHOMED
          code = VL_GetEntryByNameU(connp->callp, volp->namep, &uvldbEntry);
+ 		type = 2;
          if ( code == RXGEN_OPCODE ) 
  #endif
          {
***************
*** 147,163 ****
              rwID = uvldbEntry.volumeId[0];
              roID = uvldbEntry.volumeId[1];
              bkID = uvldbEntry.volumeId[2];
!             for ( i=0; i<nServers; i++ ) {
!                 serverFlags[i] = uvldbEntry.serverFlags[i];
!                 if ( !(flags & VLSERVER_FLAG_UUID) )
!                     serverNumber[i] = uvldbEntry.serverNumber[i].time_low;
!                 else {
!                     /* see afs/afs_volume.c InstallUVolumeEntry().  We need to 
!                      * implement an equivalent to afs_FindServer() and afs_GetServer()
!                      * which support multiple addresses.
!                      */
                  }
              }
              break;
  #endif
          }
--- 149,195 ----
              rwID = uvldbEntry.volumeId[0];
              roID = uvldbEntry.volumeId[1];
              bkID = uvldbEntry.volumeId[2];
!             for ( i=0, j=0; i<nServers && j<NMAXNSERVERS; i++ ) {
!                 if ( !(uvldbEntry.serverFlags[i] & VLSERVER_FLAG_UUID) ) {
!                     serverFlags[j] = uvldbEntry.serverFlags[i];
!                     serverNumber[j] = uvldbEntry.serverNumber[i].time_low;
! 					j++;
!                 } else {
!                     afs_uint32 * addrp, nentries, code, unique;
!                     bulkaddrs  addrs;
!                     ListAddrByAttributes attrs;
!                     afsUUID uuid;
! 
!                     memset((char *)&attrs, 0, sizeof(attrs));
!                     attrs.Mask = VLADDR_UUID;
!                     attrs.uuid = uvldbEntry.serverNumber[i];
!                     memset((char *)&uuid, 0, sizeof(uuid));
!                     memset((char *)&addrs, 0, sizeof(addrs));
! 
!                     do {
!                         code = cm_ConnByMServers(cellp->vlServersp, userp, reqp, &connp);
!                         if (code) 
!                             continue;
!                    
!                         code = VL_GetAddrsU(connp->callp, &attrs, &uuid, &unique, &nentries, &addrs);
! 
!                         if (code == 0 && nentries == 0)
!                             code = VL_NOENT;
!                     } while (cm_Analyze(connp, userp, reqp, NULL, NULL, cellp->vlServersp, NULL, code));
!                     code = cm_MapVLRPCError(code, reqp);
!                     if (code)
!                         return code;
! 
!                     addrp = addrs.bulkaddrs_val;
!                     for (k = 0; k < nentries && j < NMAXNSERVERS; j++, k++) {
!                         serverFlags[j] = uvldbEntry.serverFlags[i];
!                         serverNumber[j] = addrp[k];
!                     }
! 
!                     free(addrs.bulkaddrs_val);  /* This is wrong */
                  }
              }
+ 			nServers = j;					/* update the server count */
              break;
  #endif
          }
Index: openafs/src/WINNT/afsd/smb.c
diff -c openafs/src/WINNT/afsd/smb.c:1.55.2.9 openafs/src/WINNT/afsd/smb.c:1.55.2.10
*** openafs/src/WINNT/afsd/smb.c:1.55.2.9	Tue Dec  7 07:49:31 2004
--- openafs/src/WINNT/afsd/smb.c	Mon Dec 13 09:13:09 2004
***************
*** 2118,2124 ****
          op->inCom = inSmbp->com;
      }
      outp->reb = 0x80;	/* SERVER_RESP */
!     outp->flg2 = 0x1;	/* KNOWS_LONG_NAMES */
  
      /* copy fields in generic packet area */
      op->wctp = &outp->wct;
--- 2118,2124 ----
          op->inCom = inSmbp->com;
      }
      outp->reb = 0x80;	/* SERVER_RESP */
!     outp->flg2 = SMB_FLAGS2_KNOWS_LONG_NAMES;
  
      /* copy fields in generic packet area */
      op->wctp = &outp->wct;
***************
*** 2764,2771 ****
           * 32-bit error codes *
           * and NT Find *
           * and NT SMB's *
!          * and raw mode */
          caps = NTNEGOTIATE_CAPABILITY_NTSTATUS |
                 NTNEGOTIATE_CAPABILITY_NTFIND |
                 NTNEGOTIATE_CAPABILITY_RAWMODE |
                 NTNEGOTIATE_CAPABILITY_NTSMB;
--- 2764,2775 ----
           * 32-bit error codes *
           * and NT Find *
           * and NT SMB's *
!          * and raw mode 
!          * and DFS */
          caps = NTNEGOTIATE_CAPABILITY_NTSTATUS |
+ #ifdef DFS_SUPPORT
+                NTNEGOTIATE_CAPABILITY_DFS |
+ #endif
                 NTNEGOTIATE_CAPABILITY_NTFIND |
                 NTNEGOTIATE_CAPABILITY_RAWMODE |
                 NTNEGOTIATE_CAPABILITY_NTSMB;
***************
*** 3372,3378 ****
  
      /* We can handle long names */
      if (vcp->flags & SMB_VCFLAG_USENT)
!         ((smb_t *)outp)->flg2 |= 0x40;	/* IS_LONG_NAME */
  
      /* make sure we got a whole search status */
      if (dataLength < 21) {
--- 3376,3382 ----
  
      /* We can handle long names */
      if (vcp->flags & SMB_VCFLAG_USENT)
!         ((smb_t *)outp)->flg2 |= SMB_FLAGS2_IS_LONG_NAME;
  
      /* make sure we got a whole search status */
      if (dataLength < 21) {
***************
*** 3738,3744 ****
                  CharToOem(op, op);
  
              /* Uppercase if requested by client */
!             if ((((smb_t *)inp)->flg2 & 1) == 0)
                  _strupr(op);
  
              op += 13;
--- 3742,3748 ----
                  CharToOem(op, op);
  
              /* Uppercase if requested by client */
!             if ((((smb_t *)inp)->flg2 & SMB_FLAGS2_KNOWS_LONG_NAMES) == 0)
                  _strupr(op);
  
              op += 13;
***************
*** 6382,6388 ****
                  smbp->reh = (unsigned char) ((NTStatus >> 8) & 0xff);
                  smbp->errLow = (unsigned char) ((NTStatus >> 16) & 0xff);
                  smbp->errHigh = (unsigned char) ((NTStatus >> 24) & 0xff);
!                 smbp->flg2 |= 0x4000;
                  break;
              }
              else {
--- 6386,6392 ----
                  smbp->reh = (unsigned char) ((NTStatus >> 8) & 0xff);
                  smbp->errLow = (unsigned char) ((NTStatus >> 16) & 0xff);
                  smbp->errHigh = (unsigned char) ((NTStatus >> 24) & 0xff);
!                 smbp->flg2 |= SMB_FLAGS2_ERR_STATUS;
                  break;
              }
              else {
Index: openafs/src/WINNT/afsd/smb.h
diff -c openafs/src/WINNT/afsd/smb.h:1.14.2.6 openafs/src/WINNT/afsd/smb.h:1.14.2.7
*** openafs/src/WINNT/afsd/smb.h:1.14.2.6	Tue Dec  7 07:49:33 2004
--- openafs/src/WINNT/afsd/smb.h	Mon Dec 13 09:13:10 2004
***************
*** 35,40 ****
--- 35,75 ----
      unsigned char vdata[1];
  } smb_t;
  
+ /* flg2 values */
+ 
+ #define SMB_FLAGS2_KNOWS_LONG_NAMES        0x0001
+ #define SMB_FLAGS2_KNOWS_EAS               0x0002
+ #define SMB_FLAGS2_SECURITY_SIGNATURE      0x0004
+ #define SMB_FLAGS2_RESERVED1               0x0008
+ #define SMB_FLAGS2_IS_LONG_NAME            0x0040
+ #define SMB_FLAGS2_EXT_SEC                 0x0800
+ #define SMB_FLAGS2_DFS                     0x1000
+ #define SMB_FLAGS2_PAGING_IO               0x2000
+ #define SMB_FLAGS2_ERR_STATUS              0x4000
+ #define SMB_FLAGS2_UNICODE                 0x8000
+ 
+ /* Information Levels */
+ #define SMB_INFO_STANDARD               1
+ #define SMB_INFO_QUERY_EA_SIZE          2
+ #define SMB_INFO_QUERY_EAS_FROM_LIST    3
+ #define SMB_INFO_QUERY_ALL_EAS          4
+ #define SMB_INFO_IS_NAME_VALID          6
+ 
+ #define SMB_QUERY_FILE_BASIC_INFO       0x101
+ #define SMB_QUERY_FILE_STANDARD_INFO    0x102
+ #define SMB_QUERY_FILE_EA_INFO          0x103
+ #define SMB_QUERY_FILE_NAME_INFO        0x104
+ #define SMB_QUERY_FILE_ALL_INFO         0x107
+ #define SMB_QUERY_FILE_ALT_NAME_INFO    0x108
+ #define SMB_QUERY_FILE_STREAM_INFO      0x109
+ #define SMB_QUERY_FILE_COMPRESSION_INFO 0x10B
+ #define SMB_QUERY_FILE_UNIX_BASIC       0x200
+ #define SMB_QUERY_FILE_UNIX_LINK        0x201
+ 
+ #define SMB_SET_FILE_UNIX_BASIC         0x200
+ #define SMB_SET_FILE_UNIX_LINK          0x201
+ #define SMB_SET_FILE_UNIX_HLINK         0x203
+ 
  /* more defines */
  #define SMB_NOPCODES		256	/* # of opcodes in the dispatch table */
  
***************
*** 59,78 ****
  #define NEGOTIATE_SECURITY_SIGNATURES_REQUIRED      0x08
  
  /* Capabilities */
! #define NTNEGOTIATE_CAPABILITY_RAWMODE				0x00000001L
! #define NTNEGOTIATE_CAPABILITY_MPXMODE				0x00000002L
! #define NTNEGOTIATE_CAPABILITY_UNICODE				0x00000004L
! #define NTNEGOTIATE_CAPABILITY_LARGEFILES			0x00000008L
! #define NTNEGOTIATE_CAPABILITY_NTSMB				0x00000010L
! #define NTNEGOTIATE_CAPABILITY_RPCAPI				0x00000020L
! #define NTNEGOTIATE_CAPABILITY_NTSTATUS				0x00000040L
! #define NTNEGOTIATE_CAPABILITY_LEVEL_II_OPLOCKS		0x00000080L
  #define NTNEGOTIATE_CAPABILITY_LOCK_AND_READ		0x00000100L
! #define NTNEGOTIATE_CAPABILITY_NTFIND				0x00000200L
! #define NTNEGOTIATE_CAPABILITY_DFS					0x00001000L
  #define NTNEGOTIATE_CAPABILITY_NT_INFO_PASSTHRU		0x00002000L
  #define NTNEGOTIATE_CAPABILITY_BULK_TRANSFER		0x20000000L
! #define NTNEGOTIATE_CAPABILITY_COMPRESSED			0x40000000L
  #define NTNEGOTIATE_CAPABILITY_EXTENDED_SECURITY	0x80000000L
  
  /* a packet structure for receiving SMB messages; locked by smb_globalLock.
--- 94,113 ----
  #define NEGOTIATE_SECURITY_SIGNATURES_REQUIRED      0x08
  
  /* Capabilities */
! #define NTNEGOTIATE_CAPABILITY_RAWMODE			0x00000001L
! #define NTNEGOTIATE_CAPABILITY_MPXMODE			0x00000002L
! #define NTNEGOTIATE_CAPABILITY_UNICODE			0x00000004L
! #define NTNEGOTIATE_CAPABILITY_LARGEFILES		0x00000008L
! #define NTNEGOTIATE_CAPABILITY_NTSMB			0x00000010L
! #define NTNEGOTIATE_CAPABILITY_RPCAPI			0x00000020L
! #define NTNEGOTIATE_CAPABILITY_NTSTATUS			0x00000040L
! #define NTNEGOTIATE_CAPABILITY_LEVEL_II_OPLOCKS	        0x00000080L
  #define NTNEGOTIATE_CAPABILITY_LOCK_AND_READ		0x00000100L
! #define NTNEGOTIATE_CAPABILITY_NTFIND			0x00000200L
! #define NTNEGOTIATE_CAPABILITY_DFS			0x00001000L
  #define NTNEGOTIATE_CAPABILITY_NT_INFO_PASSTHRU		0x00002000L
  #define NTNEGOTIATE_CAPABILITY_BULK_TRANSFER		0x20000000L
! #define NTNEGOTIATE_CAPABILITY_COMPRESSED		0x40000000L
  #define NTNEGOTIATE_CAPABILITY_EXTENDED_SECURITY	0x80000000L
  
  /* a packet structure for receiving SMB messages; locked by smb_globalLock.
***************
*** 296,311 ****
  #define SMB_FID_NTOPEN			0x100	/* have dscp and pathp */
  
  /*
!  * SMB file attributes
   */
! #define SMB_ATTR_ARCHIVE  0x20
! #define SMB_ATTR_COMPRESSED 0x800 /* file or dir is compressed */
! #define SMB_ATTR_NORMAL 0x80 /* normal file. Only valid if used alone */
! #define SMB_ATTR_HIDDEN 0x2 /* hidden file for the purpose of dir listings */
! #define SMB_ATTR_READONLY 0x1
! #define SMB_ATTR_TEMPORARY 0x100
! #define SMB_ATTR_DIRECTORY 0x10
! #define SMB_ATTR_SYSTEM 0x4
  
  /* for tracking in-progress directory searches */
  typedef struct smb_dirSearch {
--- 331,353 ----
  #define SMB_FID_NTOPEN			0x100	/* have dscp and pathp */
  
  /*
!  * SMB file attributes (32-bit)
   */
! #define SMB_ATTR_READONLY       0x0001
! #define SMB_ATTR_HIDDEN         0x0002 /* hidden file for the purpose of dir listings */
! #define SMB_ATTR_SYSTEM         0x0004
! #define SMB_ATTR_VOLUMEID       0x0008 /* obsolete */
! #define SMB_ATTR_DIRECTORY      0x0010
! #define SMB_ATTR_ARCHIVE        0x0020
! #define SMB_ATTR_DEVICE         0x0040
! #define SMB_ATTR_NORMAL         0x0080 /* normal file. Only valid if used alone */
! #define SMB_ATTR_TEMPORARY      0x0100
! #define SMB_ATTR_SPARSE_FILE    0x0200
! #define SMB_ATTR_REPARSE_POINT  0x0400
! #define SMB_ATTR_COMPRESSED     0x0800 /* file or dir is compressed */
! #define SMB_ATTR_OFFLINE        0x1000
! #define SMB_ATTR_NOT_CONTENT_INDEXED 0x2000
! #define SMB_ATTR_ENCRYPTED      0x4000
  
  /* for tracking in-progress directory searches */
  typedef struct smb_dirSearch {
Index: openafs/src/WINNT/afsd/smb3.c
diff -c openafs/src/WINNT/afsd/smb3.c:1.42.2.13 openafs/src/WINNT/afsd/smb3.c:1.42.2.14
*** openafs/src/WINNT/afsd/smb3.c:1.42.2.13	Tue Dec  7 07:49:33 2004
--- openafs/src/WINNT/afsd/smb3.c	Mon Dec 13 09:13:10 2004
***************
*** 914,919 ****
--- 914,920 ----
  }
  
  #define SMB_SUPPORT_SEARCH_BITS        0x0001
+ #define SMB_SHARE_IS_IN_DFS            0x0002
  
  long smb_ReceiveV3TreeConnectX(smb_vc_t *vcp, smb_packet_t *inp, smb_packet_t *outp)
  {
***************
*** 967,973 ****
          
      tidp = smb_FindTID(vcp, newTid, SMB_FLAG_CREATE);
  
!     if(!ipc) {
          uidp = smb_FindUID(vcp, ((smb_t *)inp)->uid, 0);
  	shareFound = smb_FindShare(vcp, uidp, shareName, &sharePath);
          if (uidp)
--- 968,974 ----
          
      tidp = smb_FindTID(vcp, newTid, SMB_FLAG_CREATE);
  
!     if (!ipc) {
          uidp = smb_FindUID(vcp, ((smb_t *)inp)->uid, 0);
  	shareFound = smb_FindShare(vcp, uidp, shareName, &sharePath);
          if (uidp)
***************
*** 980,986 ****
  	if (vcp->flags & SMB_VCFLAG_USENT)
          {
              int policy = smb_FindShareCSCPolicy(shareName);
!             smb_SetSMBParm(outp, 2, SMB_SUPPORT_SEARCH_BITS | (policy << 2));
          }
      } else {
          smb_SetSMBParm(outp, 2, 0);
--- 981,991 ----
  	if (vcp->flags & SMB_VCFLAG_USENT)
          {
              int policy = smb_FindShareCSCPolicy(shareName);
!             smb_SetSMBParm(outp, 2, SMB_SUPPORT_SEARCH_BITS | 
! #ifdef DFS_SUPPORT
!                             SMB_SHARE_IS_IN_DFS |
! #endif
!                             (policy << 2));
          }
      } else {
          smb_SetSMBParm(outp, 2, 0);
***************
*** 990,996 ****
      lock_ObtainMutex(&tidp->mx);
      tidp->userp = userp;
      tidp->pathname = sharePath;
!     if(ipc) tidp->flags |= SMB_TIDFLAG_IPC;
      lock_ReleaseMutex(&tidp->mx);
      smb_ReleaseTID(tidp);
  
--- 995,1002 ----
      lock_ObtainMutex(&tidp->mx);
      tidp->userp = userp;
      tidp->pathname = sharePath;
!     if (ipc) 
!         tidp->flags |= SMB_TIDFLAG_IPC;
      lock_ReleaseMutex(&tidp->mx);
      smb_ReleaseTID(tidp);
  
***************
*** 998,1003 ****
--- 1004,1010 ----
      ((smb_t *)inp)->tid = newTid;
      tp = smb_GetSMBData(outp, NULL);
      if (!ipc) {
+         /* XXX - why is this a drive letter? - jaltman */
          *tp++ = 'A';
          *tp++ = ':';
          *tp++ = 0;
***************
*** 1135,1141 ****
  
      /* We can handle long names */
      if (vcp->flags & SMB_VCFLAG_USENT)
!         smbp->flg2 |= 0x40;	/* IS_LONG_NAME */
          
      /* now copy important fields from the tran 2 packet */
      smbp->com = t2p->com;
--- 1142,1148 ----
  
      /* We can handle long names */
      if (vcp->flags & SMB_VCFLAG_USENT)
!         smbp->flg2 |= SMB_FLAGS2_IS_LONG_NAME;
          
      /* now copy important fields from the tran 2 packet */
      smbp->com = t2p->com;
***************
*** 1149,1155 ****
          smbp->reh = (unsigned char) ((NTStatus >> 8) & 0xff);
          smbp->errLow = (unsigned char) ((NTStatus >> 16) & 0xff);
          smbp->errHigh = (unsigned char) ((NTStatus >> 24) & 0xff);
!         smbp->flg2 |= 0x4000;
      }
      else {
          smbp->rcls = errClass;
--- 1156,1162 ----
          smbp->reh = (unsigned char) ((NTStatus >> 8) & 0xff);
          smbp->errLow = (unsigned char) ((NTStatus >> 16) & 0xff);
          smbp->errHigh = (unsigned char) ((NTStatus >> 24) & 0xff);
!         smbp->flg2 |= SMB_FLAGS2_ERR_STATUS;
      }
      else {
          smbp->rcls = errClass;
***************
*** 1175,1181 ****
  
      /* We can handle long names */
      if (vcp->flags & SMB_VCFLAG_USENT)
!         smbp->flg2 |= 0x40;	/* IS_LONG_NAME */
  
      /* now copy important fields from the tran 2 packet */
      smbp->com = t2p->com;
--- 1182,1188 ----
  
      /* We can handle long names */
      if (vcp->flags & SMB_VCFLAG_USENT)
!         smbp->flg2 |= SMB_FLAGS2_IS_LONG_NAME;
  
      /* now copy important fields from the tran 2 packet */
      smbp->com = t2p->com;
***************
*** 1600,1608 ****
  
      if (infoLevel == 0)
          totalData = sizeof(smb_rap_share_info_0_t);
!     else if(infoLevel == 1)
          totalData = sizeof(smb_rap_share_info_1_t) + 1; /* + empty string */
!     else if(infoLevel == 2)
          totalData = sizeof(smb_rap_share_info_2_t) + 2; /* + two empty strings */
      else
          return CM_ERROR_INVAL;
--- 1607,1615 ----
  
      if (infoLevel == 0)
          totalData = sizeof(smb_rap_share_info_0_t);
!     else if(infoLevel == SMB_INFO_STANDARD)
          totalData = sizeof(smb_rap_share_info_1_t) + 1; /* + empty string */
!     else if(infoLevel == SMB_INFO_QUERY_EA_SIZE)
          totalData = sizeof(smb_rap_share_info_2_t) + 2; /* + two empty strings */
      else
          return CM_ERROR_INVAL;
***************
*** 1652,1658 ****
          smb_rap_share_info_0_t * info = (smb_rap_share_info_0_t *) outp->datap;
          strncpy(info->shi0_netname, shareName, sizeof(info->shi0_netname)-1);
          info->shi0_netname[sizeof(info->shi0_netname)-1] = 0;
!     } else if(infoLevel == 1) {
          smb_rap_share_info_1_t * info = (smb_rap_share_info_1_t *) outp->datap;
          strncpy(info->shi1_netname, shareName, sizeof(info->shi1_netname)-1);
          info->shi1_netname[sizeof(info->shi1_netname)-1] = 0;
--- 1659,1665 ----
          smb_rap_share_info_0_t * info = (smb_rap_share_info_0_t *) outp->datap;
          strncpy(info->shi0_netname, shareName, sizeof(info->shi0_netname)-1);
          info->shi0_netname[sizeof(info->shi0_netname)-1] = 0;
!     } else if(infoLevel == SMB_INFO_STANDARD) {
          smb_rap_share_info_1_t * info = (smb_rap_share_info_1_t *) outp->datap;
          strncpy(info->shi1_netname, shareName, sizeof(info->shi1_netname)-1);
          info->shi1_netname[sizeof(info->shi1_netname)-1] = 0;
***************
*** 1826,1832 ****
          info0 = (smb_rap_server_info_0_t *) outp->datap;
          cstrp = (char *) (info0 + 1);
          strcpy(info0->sv0_name, "AFS");
!     } else { /* infoLevel == 1 */
          info1 = (smb_rap_server_info_1_t *) outp->datap;
          cstrp = (char *) (info1 + 1);
          strcpy(info1->sv1_name, "AFS");
--- 1833,1839 ----
          info0 = (smb_rap_server_info_0_t *) outp->datap;
          cstrp = (char *) (info0 + 1);
          strcpy(info0->sv0_name, "AFS");
!     } else { /* infoLevel == SMB_INFO_STANDARD */
          info1 = (smb_rap_server_info_1_t *) outp->datap;
          cstrp = (char *) (info1 + 1);
          strcpy(info1->sv1_name, "AFS");
***************
*** 2348,2353 ****
--- 2355,2362 ----
      case 0x103: responseSize = sizeof(qi.u.FSsizeInfo); break;
      case 0x104: responseSize = sizeof(qi.u.FSdeviceInfo); break;
      case 0x105: responseSize = sizeof(qi.u.FSattributeInfo); break;
+     case 0x200: /* CIFS Unix Info */
+     case 0x301: /* Mac FS Info */
      default: return CM_ERROR_INVAL;
      }
  
***************
*** 2520,2532 ****
      cm_InitReq(&req);
  
      infoLevel = p->parmsp[0];
!     if (infoLevel == 6) nbytesRequired = 0;
!     else if (infoLevel == 1) nbytesRequired = 22;
!     else if (infoLevel == 2) nbytesRequired = 26;
!     else if (infoLevel == 0x101) nbytesRequired = 40;
!     else if (infoLevel == 0x102) nbytesRequired = 24;
!     else if (infoLevel == 0x103) nbytesRequired = 4;
!     else if (infoLevel == 0x108) nbytesRequired = 30;
      else {
          osi_Log2(smb_logp, "Bad Tran2 op 0x%x infolevel 0x%x",
                    p->opcode, infoLevel);
--- 2529,2548 ----
      cm_InitReq(&req);
  
      infoLevel = p->parmsp[0];
!     if (infoLevel == SMB_INFO_IS_NAME_VALID) 
!         nbytesRequired = 0;
!     else if (infoLevel == SMB_INFO_STANDARD) 
!         nbytesRequired = 22;
!     else if (infoLevel == SMB_INFO_QUERY_EA_SIZE) 
!         nbytesRequired = 26;
!     else if (infoLevel == SMB_QUERY_FILE_BASIC_INFO) 
!         nbytesRequired = 40;
!     else if (infoLevel == SMB_QUERY_FILE_STANDARD_INFO) 
!         nbytesRequired = 24;
!     else if (infoLevel == SMB_QUERY_FILE_EA_INFO) 
!         nbytesRequired = 4;
!     else if (infoLevel == SMB_QUERY_FILE_ALT_NAME_INFO) 
!         nbytesRequired = 30;
      else {
          osi_Log2(smb_logp, "Bad Tran2 op 0x%x infolevel 0x%x",
                    p->opcode, infoLevel);
***************
*** 2548,2554 ****
       * the syntax, so we just OK things now.  In particular, we're *not*
       * being asked to verify anything about the state of any parent dirs.
       */
!     if (infoLevel == 6) {
          smb_SendTran2Packet(vcp, outp, opx);
          smb_FreeTran2Packet(outp);
          return 0;
--- 2564,2570 ----
       * the syntax, so we just OK things now.  In particular, we're *not*
       * being asked to verify anything about the state of any parent dirs.
       */
!     if (infoLevel == SMB_INFO_IS_NAME_VALID) {
          smb_SendTran2Packet(vcp, outp, opx);
          smb_FreeTran2Packet(outp);
          return 0;
***************
*** 2583,2589 ****
       * yet been evaluated and for directories that haven't yet been
       * fetched.
       */
!     if (infoLevel == 0x101) {
          spacep = cm_GetSpace();
          smb_StripLastComponent(spacep->data, &lastComp,
                                  (char *)(&p->parmsp[3]));
--- 2599,2605 ----
       * yet been evaluated and for directories that haven't yet been
       * fetched.
       */
!     if (infoLevel == SMB_QUERY_FILE_BASIC_INFO) {
          spacep = cm_GetSpace();
          smb_StripLastComponent(spacep->data, &lastComp,
                                  (char *)(&p->parmsp[3]));
***************
*** 2659,2665 ****
  
          goto done;
      }
!     if (infoLevel == 1 || infoLevel == 2) {
          smb_SearchTimeFromUnixTime(&dosTime, scp->clientModTime);
          *((u_long *)op) = dosTime; op += 4;	/* creation time */
          *((u_long *)op) = dosTime; op += 4;	/* access time */
--- 2675,2681 ----
  
          goto done;
      }
!     if (infoLevel == SMB_INFO_STANDARD || infoLevel == SMB_INFO_QUERY_EA_SIZE) {
          smb_SearchTimeFromUnixTime(&dosTime, scp->clientModTime);
          *((u_long *)op) = dosTime; op += 4;	/* creation time */
          *((u_long *)op) = dosTime; op += 4;	/* access time */
***************
*** 2669,2675 ****
          attributes = smb_Attributes(scp);
          *((u_short *)op) = attributes; op += 2;	/* attributes */
      }
!     else if (infoLevel == 0x101) {
          smb_LargeSearchTimeFromUnixTime(&ft, scp->clientModTime);
          *((FILETIME *)op) = ft; op += 8;	/* creation time */
          *((FILETIME *)op) = ft; op += 8;	/* last access time */
--- 2685,2691 ----
          attributes = smb_Attributes(scp);
          *((u_short *)op) = attributes; op += 2;	/* attributes */
      }
!     else if (infoLevel == SMB_QUERY_FILE_BASIC_INFO) {
          smb_LargeSearchTimeFromUnixTime(&ft, scp->clientModTime);
          *((FILETIME *)op) = ft; op += 8;	/* creation time */
          *((FILETIME *)op) = ft; op += 8;	/* last access time */
***************
*** 2679,2685 ****
          *((u_long *)op) = extAttributes; op += 4; /* extended attribs */
          *((u_long *)op) = 0; op += 4;	/* don't know what this is */
      }
!     else if (infoLevel == 0x102) {
          *((LARGE_INTEGER *)op) = scp->length; op += 8;	/* alloc size */
          *((LARGE_INTEGER *)op) = scp->length; op += 8;	/* EOF */
          *((u_long *)op) = scp->linkCount; op += 4;
--- 2695,2701 ----
          *((u_long *)op) = extAttributes; op += 4; /* extended attribs */
          *((u_long *)op) = 0; op += 4;	/* don't know what this is */
      }
!     else if (infoLevel == SMB_QUERY_FILE_STANDARD_INFO) {
          *((LARGE_INTEGER *)op) = scp->length; op += 8;	/* alloc size */
          *((LARGE_INTEGER *)op) = scp->length; op += 8;	/* EOF */
          *((u_long *)op) = scp->linkCount; op += 4;
***************
*** 2688,2699 ****
          *op++ = (scp->fileType == CM_SCACHETYPE_DIRECTORY ? 1 : 0);
          *op++ = 0;
      }
!     else if (infoLevel == 0x103) {
          memset(op, 0, 4); op += 4;	/* EA size */
      }
  
      /* now, if we are being asked about extended attrs, return a 0 size */
!     if (infoLevel == 2) {
          *((u_long *)op) = 0; op += 4;
      }
  
--- 2704,2715 ----
          *op++ = (scp->fileType == CM_SCACHETYPE_DIRECTORY ? 1 : 0);
          *op++ = 0;
      }
!     else if (infoLevel == SMB_QUERY_FILE_EA_INFO) {
          memset(op, 0, 4); op += 4;	/* EA size */
      }
  
      /* now, if we are being asked about extended attrs, return a 0 size */
!     if (infoLevel == SMB_INFO_QUERY_EA_SIZE) {
          *((u_long *)op) = 0; op += 4;
      }
  
***************
*** 2744,2753 ****
      }
  
      infoLevel = p->parmsp[1];
!     if (infoLevel == 0x101) nbytesRequired = 40;
!     else if (infoLevel == 0x102) nbytesRequired = 24;
!     else if (infoLevel == 0x103) nbytesRequired = 4;
!     else if (infoLevel == 0x104) nbytesRequired = 6;
      else {
          osi_Log2(smb_logp, "Bad Tran2 op 0x%x infolevel 0x%x",
                    p->opcode, infoLevel);
--- 2760,2773 ----
      }
  
      infoLevel = p->parmsp[1];
!     if (infoLevel == SMB_QUERY_FILE_BASIC_INFO) 
!         nbytesRequired = 40;
!     else if (infoLevel == SMB_QUERY_FILE_STANDARD_INFO) 
!         nbytesRequired = 24;
!     else if (infoLevel == SMB_QUERY_FILE_EA_INFO)
!         nbytesRequired = 4;
!     else if (infoLevel == SMB_QUERY_FILE_NAME_INFO) 
!         nbytesRequired = 6;
      else {
          osi_Log2(smb_logp, "Bad Tran2 op 0x%x infolevel 0x%x",
                    p->opcode, infoLevel);
***************
*** 2783,2789 ****
       * Marshall the output data.
       */
      op = outp->datap;
!     if (infoLevel == 0x101) {
          smb_LargeSearchTimeFromUnixTime(&ft, scp->clientModTime);
          *((FILETIME *)op) = ft; op += 8;	/* creation time */
          *((FILETIME *)op) = ft; op += 8;	/* last access time */
--- 2803,2809 ----
       * Marshall the output data.
       */
      op = outp->datap;
!     if (infoLevel == SMB_QUERY_FILE_BASIC_INFO) {
          smb_LargeSearchTimeFromUnixTime(&ft, scp->clientModTime);
          *((FILETIME *)op) = ft; op += 8;	/* creation time */
          *((FILETIME *)op) = ft; op += 8;	/* last access time */
***************
*** 2793,2799 ****
          *((u_long *)op) = attributes; op += 4;
          *((u_long *)op) = 0; op += 4;
      }
!     else if (infoLevel == 0x102) {
          *((LARGE_INTEGER *)op) = scp->length; op += 8;	/* alloc size */
          *((LARGE_INTEGER *)op) = scp->length; op += 8;	/* EOF */
          *((u_long *)op) = scp->linkCount; op += 4;
--- 2813,2819 ----
          *((u_long *)op) = attributes; op += 4;
          *((u_long *)op) = 0; op += 4;
      }
!     else if (infoLevel == SMB_QUERY_FILE_STANDARD_INFO) {
          *((LARGE_INTEGER *)op) = scp->length; op += 8;	/* alloc size */
          *((LARGE_INTEGER *)op) = scp->length; op += 8;	/* EOF */
          *((u_long *)op) = scp->linkCount; op += 4;
***************
*** 2802,2811 ****
          *op++ = 0;
          *op++ = 0;
      }
!     else if (infoLevel == 0x103) {
          *((u_long *)op) = 0; op += 4;
      }
!     else if (infoLevel == 0x104) {
          unsigned long len;
          char *name;
  
--- 2822,2831 ----
          *op++ = 0;
          *op++ = 0;
      }
!     else if (infoLevel == SMB_QUERY_FILE_EA_INFO) {
          *((u_long *)op) = 0; op += 4;
      }
!     else if (infoLevel == SMB_QUERY_FILE_NAME_INFO) {
          unsigned long len;
          char *name;
  
***************
*** 2864,2875 ****
          return 0;
      }
  
!     if (infoLevel == 0x102 && !(fidp->flags & SMB_FID_OPENDELETE)) {
          smb_SendTran2Error(vcp, p, op, CM_ERROR_NOACCESS);
          smb_ReleaseFID(fidp);
          return 0;
      }
!     if ((infoLevel == 0x103 || infoLevel == 0x104)
           && !(fidp->flags & SMB_FID_OPENWRITE)) {
          smb_SendTran2Error(vcp, p, op, CM_ERROR_NOACCESS);
          smb_ReleaseFID(fidp);
--- 2884,2895 ----
          return 0;
      }
  
!     if (infoLevel == SMB_QUERY_FILE_STANDARD_INFO && !(fidp->flags & SMB_FID_OPENDELETE)) {
          smb_SendTran2Error(vcp, p, op, CM_ERROR_NOACCESS);
          smb_ReleaseFID(fidp);
          return 0;
      }
!     if ((infoLevel == SMB_QUERY_FILE_EA_INFO || infoLevel == SMB_QUERY_FILE_NAME_INFO)
           && !(fidp->flags & SMB_FID_OPENWRITE)) {
          smb_SendTran2Error(vcp, p, op, CM_ERROR_NOACCESS);
          smb_ReleaseFID(fidp);
***************
*** 2892,2898 ****
  
      scp = fidp->scp;
  
!     if (infoLevel == 0x101) {
          FILETIME lastMod;
          unsigned int attribute;
          cm_attr_t attr;
--- 2912,2918 ----
  
      scp = fidp->scp;
  
!     if (infoLevel == SMB_QUERY_FILE_BASIC_INFO) {
          FILETIME lastMod;
          unsigned int attribute;
          cm_attr_t attr;
***************
*** 2948,2954 ****
          else
              code = 0;
      }               
!     else if (infoLevel == 0x103 || infoLevel == 0x104) {
          LARGE_INTEGER size = *((LARGE_INTEGER *)(p->datap));
          cm_attr_t attr;
  
--- 2968,2974 ----
          else
              code = 0;
      }               
!     else if (infoLevel == SMB_QUERY_FILE_EA_INFO || infoLevel == SMB_QUERY_FILE_NAME_INFO) {
          LARGE_INTEGER size = *((LARGE_INTEGER *)(p->datap));
          cm_attr_t attr;
  
***************
*** 2957,2963 ****
          attr.length.HighPart = size.HighPart;
          code = cm_SetAttr(scp, &attr, userp, &req);
      }       
!     else if (infoLevel == 0x102) {
          if (*((char *)(p->datap))) {
              code = cm_CheckNTDelete(fidp->NTopen_dscp, scp, userp,
                                       &req);
--- 2977,2983 ----
          attr.length.HighPart = size.HighPart;
          code = cm_SetAttr(scp, &attr, userp, &req);
      }       
!     else if (infoLevel == SMB_QUERY_FILE_STANDARD_INFO) {
          if (*((char *)(p->datap))) {
              code = cm_CheckNTDelete(fidp->NTopen_dscp, scp, userp,
                                       &req);
***************
*** 3027,3032 ****
--- 3047,3062 ----
  long 
  smb_ReceiveTran2GetDFSReferral(smb_vc_t *vcp, smb_tran2Packet_t *p, smb_packet_t *outp)
  {
+     /* This is a UNICODE only request (bit15 of Flags2) */
+     /* The TID must be IPC$ */
+ 
+     /* The documentation for the Flags response field is contradictory */
+ 
+     /* Use Version 1 Referral Element Format */
+     /* ServerType = 0; indicates the next server should be queried for the file */
+     /* ReferralFlags = 0x01; PathConsumed characters should be stripped */
+     /* Node = UnicodeString of UNC path of the next share name */
+ 
      osi_Log0(smb_logp,"ReceiveTran2GetDFSReferral - NOT_SUPPORTED");
      return CM_ERROR_BADOP;
  }
***************
*** 3034,3039 ****
--- 3064,3078 ----
  long 
  smb_ReceiveTran2ReportDFSInconsistency(smb_vc_t *vcp, smb_tran2Packet_t *p, smb_packet_t *outp)
  {
+     /* This is a UNICODE only request (bit15 of Flags2) */
+ 
+     /* There is nothing we can do about this operation.  The client is going to
+      * tell us that there is a Version 1 Referral Element for which there is a DFS Error.
+      * Unfortunately, there is really nothing we can do about it other then log it 
+      * somewhere.  Even then I don't think there is anything for us to do.
+      * So let's return an error value.
+      */
+ 
      osi_Log0(smb_logp,"ReceiveTran2ReportDFSInconsistency - NOT_SUPPORTED");
      return CM_ERROR_BADOP;
  }
***************
*** 3893,3899 ****
  
          /* Need 8.3 name? */
          NeedShortName = 0;
!         if (infoLevel == 0x104
               && dep->fid.vnode != 0
               && !cm_Is8Dot3(dep->name)) {
              cm_Gen8Dot3Name(dep, shortName, &shortNameEnd);
--- 3932,3938 ----
  
          /* Need 8.3 name? */
          NeedShortName = 0;
!         if (infoLevel == SMB_QUERY_FILE_NAME_INFO
               && dep->fid.vnode != 0
               && !cm_Is8Dot3(dep->name)) {
              cm_Gen8Dot3Name(dep, shortName, &shortNameEnd);
***************
*** 3933,3944 ****
              /* standard dir entry stuff */
              if (infoLevel < 0x101)
                  ohbytes = 23;	/* pre-NT */
!             else if (infoLevel == 0x103)
                  ohbytes = 12;	/* NT names only */
              else
                  ohbytes = 64;	/* NT */
  
!             if (infoLevel == 0x104)
                  ohbytes += 26;	/* Short name & length */
  
              if (searchFlags & 4) {
--- 3972,3983 ----
              /* standard dir entry stuff */
              if (infoLevel < 0x101)
                  ohbytes = 23;	/* pre-NT */
!             else if (infoLevel == SMB_QUERY_FILE_EA_INFO)
                  ohbytes = 12;	/* NT names only */
              else
                  ohbytes = 64;	/* NT */
  
!             if (infoLevel == SMB_QUERY_FILE_NAME_INFO)
                  ohbytes += 26;	/* Short name & length */
  
              if (searchFlags & 4) {
***************
*** 3975,3981 ****
  
              if (infoLevel <= 0x101)
                  *(origOp + ohbytes - 1) = (unsigned char) onbytes;
!             else if (infoLevel == 0x103)
                  *((u_long *)(op + 8)) = onbytes;
              else
                  *((u_long *)(op + 60)) = onbytes;
--- 4014,4020 ----
  
              if (infoLevel <= 0x101)
                  *(origOp + ohbytes - 1) = (unsigned char) onbytes;
!             else if (infoLevel == SMB_QUERY_FILE_EA_INFO)
                  *((u_long *)(op + 8)) = onbytes;
              else
                  *((u_long *)(op + 60)) = onbytes;
***************
*** 3984,3990 ****
                  CharToOem(origOp+ohbytes, origOp+ohbytes);
  
              /* Short name if requested and needed */
!             if (infoLevel == 0x104) {
                  if (NeedShortName) {
                      strcpy(op + 70, shortName);
                      if (smb_StoreAnsiFilenames)
--- 4023,4029 ----
                  CharToOem(origOp+ohbytes, origOp+ohbytes);
  
              /* Short name if requested and needed */
!             if (infoLevel == SMB_QUERY_FILE_NAME_INFO) {
                  if (NeedShortName) {
                      strcpy(op + 70, shortName);
                      if (smb_StoreAnsiFilenames)
***************
*** 6084,6090 ****
  
      /* We can handle long names */
      if (vcp->flags & SMB_VCFLAG_USENT)
!         ((smb_t *)outp)->flg2 |= 0x40;	/* IS_LONG_NAME */
          
      switch (function) {
      case 6: 
--- 6123,6129 ----
  
      /* We can handle long names */
      if (vcp->flags & SMB_VCFLAG_USENT)
!         ((smb_t *)outp)->flg2 |= SMB_FLAGS2_IS_LONG_NAME;
          
      switch (function) {
      case 6: 
***************
*** 6275,6281 ****
              ((smb_t *) watch)->errLow = 0;
              ((smb_t *) watch)->errHigh = 0;
              /* Set NT Status codes flag */
!             ((smb_t *) watch)->flg2 |= 0x4000;
          }
  
          smb_SendPacket(vcp, watch);
--- 6314,6320 ----
              ((smb_t *) watch)->errLow = 0;
              ((smb_t *) watch)->errHigh = 0;
              /* Set NT Status codes flag */
!             ((smb_t *) watch)->flg2 |= SMB_FLAGS2_ERR_STATUS;
          }
  
          smb_SendPacket(vcp, watch);
***************
*** 6344,6350 ****
              ((smb_t *)watch)->reh = 0x1;
              ((smb_t *)watch)->errLow = 0;
              ((smb_t *)watch)->errHigh = 0xC0;
!             ((smb_t *)watch)->flg2 |= 0x4000;
              smb_SendPacket(vcp, watch);
              if (watch->vcp)
                  smb_ReleaseVC(watch->vcp);
--- 6383,6389 ----
              ((smb_t *)watch)->reh = 0x1;
              ((smb_t *)watch)->errLow = 0;
              ((smb_t *)watch)->errHigh = 0xC0;
!             ((smb_t *)watch)->flg2 |= SMB_FLAGS2_ERR_STATUS;
              smb_SendPacket(vcp, watch);
              if (watch->vcp)
                  smb_ReleaseVC(watch->vcp);
Index: openafs/src/WINNT/afsd/smb3.h
diff -c openafs/src/WINNT/afsd/smb3.h:1.7.2.1 openafs/src/WINNT/afsd/smb3.h:1.7.2.2
*** openafs/src/WINNT/afsd/smb3.h:1.7.2.1	Tue Sep 21 10:07:19 2004
--- openafs/src/WINNT/afsd/smb3.h	Mon Dec 13 09:13:10 2004
***************
*** 41,85 ****
  } smb_tran2Dispatch_t;
  
  typedef struct smb_tran2QFSInfo {
! 	union {
  #pragma pack(push, 2)
! 		struct {
! 			long FSID;			/* file system ID */
!                         long sectorsPerAllocUnit;
!                         long totalAllocUnits;		/* on the disk */
!                         long availAllocUnits;		/* free blocks */
!                         unsigned short bytesPerSector;	/* bytes per sector */
!                 } allocInfo;
  #pragma pack(pop)
!                 struct {
! 			long vsn;	/* volume serial number */
!                         char vnCount;	/* count of chars in label, incl null */
!                         char label[12];	/* pad out with nulls */
!                 } volumeInfo;
! 		struct {
! 			FILETIME vct;	/* volume creation time */
! 			long vsn;	/* volume serial number */
! 			long vnCount;	/* length of volume label in bytes */
! 			char res[2];	/* reserved */
! 			char label[10];	/* volume label */
! 		} FSvolumeInfo;
! 		struct {
! 			osi_hyper_t totalAllocUnits;	/* on the disk */
! 			osi_hyper_t availAllocUnits;	/* free blocks */
! 			long sectorsPerAllocUnit;
! 			long bytesPerSector;		/* bytes per sector */
! 		} FSsizeInfo;
! 		struct {
! 			long devType;	/* device type */
! 			long characteristics;
! 		} FSdeviceInfo;
! 		struct {
! 			long attributes;
! 			long maxCompLength;	/* max path component length */
! 			long FSnameLength;	/* length of file system name */
! 			char FSname[12];
! 		} FSattributeInfo;
!         } u;
  } smb_tran2QFSInfo_t;
  
  /* more than enough opcodes for today, anyway */
--- 41,85 ----
  } smb_tran2Dispatch_t;
  
  typedef struct smb_tran2QFSInfo {
!     union {
  #pragma pack(push, 2)
!         struct {
!             long FSID;			/* file system ID */
!             long sectorsPerAllocUnit;
!             long totalAllocUnits;		/* on the disk */
!             long availAllocUnits;		/* free blocks */
!             unsigned short bytesPerSector;	/* bytes per sector */
!         } allocInfo;
  #pragma pack(pop)
!         struct {
!             long vsn;	        /* volume serial number */
!             char vnCount;	/* count of chars in label, incl null */
!             char label[12];	/* pad out with nulls */
!         } volumeInfo;
!         struct {
!             FILETIME vct;	/* volume creation time */
!             long vsn;	        /* volume serial number */
!             long vnCount;	/* length of volume label in bytes */
!             char res[2];	/* reserved */
!             char label[10];	/* volume label */
!         } FSvolumeInfo;
!         struct {
!             osi_hyper_t totalAllocUnits;	/* on the disk */
!             osi_hyper_t availAllocUnits;	/* free blocks */
!             long sectorsPerAllocUnit;
!             long bytesPerSector;		/* bytes per sector */
!         } FSsizeInfo;
!         struct {
!             long devType;	/* device type */
!             long characteristics;
!         } FSdeviceInfo;
!         struct {
!             long attributes;
!             long maxCompLength;	/* max path component length */
!             long FSnameLength;	/* length of file system name */
!             char FSname[12];
!         } FSattributeInfo;
!     } u;
  } smb_tran2QFSInfo_t;
  
  /* more than enough opcodes for today, anyway */
Index: openafs/src/afs/LINUX/osi_vnodeops.c
diff -c openafs/src/afs/LINUX/osi_vnodeops.c:1.81.2.5 openafs/src/afs/LINUX/osi_vnodeops.c:1.81.2.7
*** openafs/src/afs/LINUX/osi_vnodeops.c:1.81.2.5	Tue Dec  7 01:12:13 2004
--- openafs/src/afs/LINUX/osi_vnodeops.c	Mon Dec 13 14:35:35 2004
***************
*** 22,28 ****
  #include "afs/param.h"
  
  RCSID
!     ("$Header: /cvs/openafs/src/afs/LINUX/osi_vnodeops.c,v 1.81.2.5 2004/12/07 06:12:13 shadow Exp $");
  
  #include "afs/sysincludes.h"
  #include "afsincludes.h"
--- 22,28 ----
  #include "afs/param.h"
  
  RCSID
!     ("$Header: /cvs/openafs/src/afs/LINUX/osi_vnodeops.c,v 1.81.2.7 2004/12/13 19:35:35 shadow Exp $");
  
  #include "afs/sysincludes.h"
  #include "afsincludes.h"
***************
*** 1163,1180 ****
  int
  afs_linux_unlink(struct inode *dip, struct dentry *dp)
  {
!     int code;
      cred_t *credp = crref();
      const char *name = dp->d_name.name;
  
  #if defined(AFS_LINUX26_ENV)
      lock_kernel();
  #endif
      AFS_GLOCK();
      code = afs_remove(ITOAFS(dip), name, credp);
      AFS_GUNLOCK();
      if (!code)
  	d_drop(dp);
  #if defined(AFS_LINUX26_ENV)
      unlock_kernel();
  #endif
--- 1163,1225 ----
  int
  afs_linux_unlink(struct inode *dip, struct dentry *dp)
  {
!     int code = EBUSY;
      cred_t *credp = crref();
      const char *name = dp->d_name.name;
+     struct vcache *tvc = ITOAFS(dp->d_inode);
  
  #if defined(AFS_LINUX26_ENV)
      lock_kernel();
  #endif
+     if (((VREFCOUNT(tvc) > 0) && tvc->opens > 0)
+ 				&& !(tvc->states & CUnlinked)) {
+ 	struct dentry *__dp;
+ 	char *__name;
+ 	extern char *afs_newname();
+ 
+ 	__dp = NULL;
+ 	__name = NULL;
+ 	do {
+ 	    dput(__dp);
+ 
+ 	    AFS_GLOCK();
+ 	    if (__name)
+ 		osi_FreeSmallSpace(__name);
+ 	    __name = afs_newname();
+ 	    AFS_GUNLOCK();
+ 
+ 	    __dp = lookup_one_len(__name, dp->d_parent, strlen(__name));
+ 		
+ 	    if (IS_ERR(__dp))
+ 		goto out;
+ 	} while (__dp->d_inode != NULL);
+ 
+ 	AFS_GLOCK();
+ 	code = afs_rename(ITOAFS(dip), dp->d_name.name, ITOAFS(dip), __dp->d_name.name, credp);
+ 	if (!code) {
+             tvc->mvid = __name;
+             crhold(credp);
+             if (tvc->uncred) {
+                 crfree(tvc->uncred);
+             }
+             tvc->uncred = credp;
+ 	    tvc->states |= CUnlinked;
+ 	}
+ 	AFS_GUNLOCK();
+ 
+ 	if (!code)
+ 	    d_move(dp, __dp);
+ 	dput(__dp);
+ 
+ 	goto out;
+     }
+ 
      AFS_GLOCK();
      code = afs_remove(ITOAFS(dip), name, credp);
      AFS_GUNLOCK();
      if (!code)
  	d_drop(dp);
+ out:
  #if defined(AFS_LINUX26_ENV)
      unlock_kernel();
  #endif
***************
*** 1795,1801 ****
--- 1840,1850 ----
  struct inode_operations afs_symlink_iops = {
  #if defined(AFS_LINUX24_ENV)
    .readlink = 		page_readlink,
+ #if defined(HAVE_KERNEL_PAGE_FOLLOW_LINK)
    .follow_link =	page_follow_link,
+ #else
+   .follow_link =	page_follow_link_light,
+ #endif
    .setattr =		afs_notify_change,
  #else
    .readlink = 		afs_linux_readlink,
Index: openafs/src/afs/VNOPS/afs_vnop_remove.c
diff -c openafs/src/afs/VNOPS/afs_vnop_remove.c:1.31.2.4 openafs/src/afs/VNOPS/afs_vnop_remove.c:1.31.2.5
*** openafs/src/afs/VNOPS/afs_vnop_remove.c:1.31.2.4	Tue Dec  7 01:12:14 2004
--- openafs/src/afs/VNOPS/afs_vnop_remove.c	Mon Dec 13 14:35:05 2004
***************
*** 14,29 ****
   * afs_IsWired (DUX)
   * afsremove
   * afs_remove
!  *
!  * Local:
!  * newname
   *
   */
  #include <afsconfig.h>
  #include "afs/param.h"
  
  RCSID
!     ("$Header: /cvs/openafs/src/afs/VNOPS/afs_vnop_remove.c,v 1.31.2.4 2004/12/07 06:12:14 shadow Exp $");
  
  #include "afs/sysincludes.h"	/* Standard vendor system headers */
  #include "afsincludes.h"	/* Afs-based standard headers */
--- 14,27 ----
   * afs_IsWired (DUX)
   * afsremove
   * afs_remove
!  * afs_newname
   *
   */
  #include <afsconfig.h>
  #include "afs/param.h"
  
  RCSID
!     ("$Header: /cvs/openafs/src/afs/VNOPS/afs_vnop_remove.c,v 1.31.2.5 2004/12/13 19:35:05 shadow Exp $");
  
  #include "afs/sysincludes.h"	/* Standard vendor system headers */
  #include "afsincludes.h"	/* Afs-based standard headers */
***************
*** 193,200 ****
      return (0);
  }
  
! static char *
! newname(void)
  {
      char *name, *sp, *p = ".__afs";
      afs_int32 rd = afs_random() & 0xffff;
--- 191,198 ----
      return (0);
  }
  
! char *
! afs_newname(void)
  {
      char *name, *sp, *p = ".__afs";
      afs_int32 rd = afs_random() & 0xffff;
***************
*** 412,418 ****
  #endif
  #endif
      {
! 	char *unlname = newname();
  
  	ReleaseWriteLock(&adp->lock);
  	if (tdc)
--- 410,416 ----
  #endif
  #endif
      {
! 	char *unlname = afs_newname();
  
  	ReleaseWriteLock(&adp->lock);
  	if (tdc)
Index: openafs/src/cf/linux-test3.m4
diff -c openafs/src/cf/linux-test3.m4:1.8.2.3 openafs/src/cf/linux-test3.m4:1.8.2.4
*** openafs/src/cf/linux-test3.m4:1.8.2.3	Tue Dec  7 01:05:44 2004
--- openafs/src/cf/linux-test3.m4	Mon Dec 13 14:35:34 2004
***************
*** 113,115 ****
--- 113,130 ----
  AC_MSG_RESULT($ac_cv_linux_kernel_sock_create_v)
  CPPFLAGS="$save_CPPFLAGS"])
  
+ AC_DEFUN([LINUX_KERNEL_PAGE_FOLLOW_LINK],[
+ AC_MSG_CHECKING(for page_follow_link_light vs page_follow_link)
+ save_CPPFLAGS="$CPPFLAGS"
+ CPPFLAGS="-I${LINUX_KERNEL_PATH}/include -D__KERNEL__ $CPPFLAGS"
+ AC_CACHE_VAL(ac_cv_linux_kernel_page_follow_link,
+ [
+ AC_TRY_COMPILE(
+   [#include <linux/fs.h>],
+   [
+   page_follow_link(0,0)
+   ],
+   ac_cv_linux_kernel_page_follow_link=yes,
+   ac_cv_linux_kernel_page_follow_link=no)])
+ AC_MSG_RESULT($ac_cv_linux_kernel_page_follow_page)
+ CPPFLAGS="$save_CPPFLAGS"])
Index: openafs/src/kauth/admin_tools.c
diff -c openafs/src/kauth/admin_tools.c:1.16.2.2 openafs/src/kauth/admin_tools.c:1.16.2.3
*** openafs/src/kauth/admin_tools.c:1.16.2.2	Tue Dec  7 01:07:20 2004
--- openafs/src/kauth/admin_tools.c	Mon Dec 13 14:38:51 2004
***************
*** 16,22 ****
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/kauth/admin_tools.c,v 1.16.2.2 2004/12/07 06:07:20 shadow Exp $");
  
  #include <afs/stds.h>
  #include <afs/debug.h>
--- 16,22 ----
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/kauth/admin_tools.c,v 1.16.2.3 2004/12/13 19:38:51 shadow Exp $");
  
  #include <afs/stds.h>
  #include <afs/debug.h>
***************
*** 512,521 ****
      do {
  	tempwhen = 0;
  	code =
! 	    ubik_CallIter(KAM_LockStatus, conn, UPUBIKONLY, &count, name,
! 			  instance, &tempwhen, /*spares */ 0, 0, 0,
! 			  0, 0, 0, 0, 0, 0, 0, 0,
! 			  0);
  	if (code) {
  	    if (seriouserror(code))
  		com_err(whoami, code, "");
--- 512,520 ----
      do {
  	tempwhen = 0;
  	code =
! 	    ubik_CallIter(KAM_LockStatus, conn, UPUBIKONLY, &count, (long) name,
! 			  (long) instance, (long) &tempwhen, 0, 0, 0,
! 			  0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
  	if (code) {
  	    if (seriouserror(code))
  		com_err(whoami, code, "");
***************
*** 550,557 ****
  
      count = 0;
      do {
! 	code = ubik_CallIter(KAM_Unlock, conn, 0, &count, name, instance,
! 			     /*spares */ 0, 0, 0, 0);
  	if (code && (code != UNOSERVERS)) {
  	    server = 0;
  	    if (conn && conn->conns[count - 1]
--- 549,556 ----
  
      count = 0;
      do {
! 	code = ubik_CallIter(KAM_Unlock, conn, 0, &count, (long) name, (long) instance,
! 			     0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
  	if (code && (code != UNOSERVERS)) {
  	    server = 0;
  	    if (conn && conn->conns[count - 1]
Index: openafs/src/kauth/authclient.c
diff -c openafs/src/kauth/authclient.c:1.14.2.3 openafs/src/kauth/authclient.c:1.14.2.4
*** openafs/src/kauth/authclient.c:1.14.2.3	Tue Dec  7 01:07:20 2004
--- openafs/src/kauth/authclient.c	Mon Dec 13 14:38:51 2004
***************
*** 17,23 ****
  #endif
  
  RCSID
!     ("$Header: /cvs/openafs/src/kauth/authclient.c,v 1.14.2.3 2004/12/07 06:07:20 shadow Exp $");
  
  #if defined(UKERNEL)
  #include "afs/sysincludes.h"
--- 17,23 ----
  #endif
  
  RCSID
!     ("$Header: /cvs/openafs/src/kauth/authclient.c,v 1.14.2.4 2004/12/13 19:38:51 shadow Exp $");
  
  #if defined(UKERNEL)
  #include "afs/sysincludes.h"
***************
*** 475,482 ****
  	do {			/* Cycle through the servers */
  	    lcode = code;
  	    code =
! 		ubik_CallIter(aproc, aclient, aflags, &count, p1, p2, p3, p4,
! 			      p5, p6, p7, p8, 0, 0, 0, 0, 0, 0, 0, 0);
  	} while ((code == UNOQUORUM) || (code == UNOTSYNC)
  		 || (code == KALOCKED) || (code == -1));
  
--- 475,484 ----
  	do {			/* Cycle through the servers */
  	    lcode = code;
  	    code =
! 		ubik_CallIter(aproc, aclient, aflags, &count, (long) p1,
! 			      (long) p2, (long) p3, (long) p4,
! 			      (long) p5, (long) p6, (long) p7,
! 			      (long) p8, 0, 0, 0, 0, 0, 0, 0, 0);
  	} while ((code == UNOQUORUM) || (code == UNOTSYNC)
  		 || (code == KALOCKED) || (code == -1));
  
Index: openafs/src/libadmin/kas/afs_kasAdmin.c
diff -c openafs/src/libadmin/kas/afs_kasAdmin.c:1.9.2.1 openafs/src/libadmin/kas/afs_kasAdmin.c:1.9.2.2
*** openafs/src/libadmin/kas/afs_kasAdmin.c:1.9.2.1	Tue Dec  7 01:07:27 2004
--- openafs/src/libadmin/kas/afs_kasAdmin.c	Mon Dec 13 14:39:18 2004
***************
*** 11,17 ****
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/libadmin/kas/afs_kasAdmin.c,v 1.9.2.1 2004/12/07 06:07:27 shadow Exp $");
  
  #include <stdio.h>
  
--- 11,17 ----
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/libadmin/kas/afs_kasAdmin.c,v 1.9.2.2 2004/12/13 19:39:18 shadow Exp $");
  
  #include <stdio.h>
  
***************
*** 36,42 ****
  #undef ENCRYPT
  
  extern int ubik_Call();
- extern int ubik_CallIter();
  
  typedef struct {
      int begin_magic;
--- 36,41 ----
***************
*** 718,724 ****
  	tst =
  	    ubik_CallIter(KAM_LockStatus, kaserver->servers, UPUBIKONLY,
  			  &count, who->principal, who->instance, &locked, 0,
! 			  0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
  	if (tst == 0) {
  	    if (locked) {
  		if ((locked < *lockedUntil) || !once) {
--- 717,723 ----
  	tst =
  	    ubik_CallIter(KAM_LockStatus, kaserver->servers, UPUBIKONLY,
  			  &count, who->principal, who->instance, &locked, 0,
! 			  0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
  	if (tst == 0) {
  	    if (locked) {
  		if ((locked < *lockedUntil) || !once) {
***************
*** 1274,1280 ****
      do {
  	tst =
  	    ubik_CallIter(KAM_Unlock, kaserver.servers, 0, &count,
! 			  who->principal, who->instance, 0, 0, 0, 0);
  	if (tst && (tst != UNOSERVERS)) {
  	    if (save_tst == 0) {
  		save_tst = tst;	/* save the first failure */
--- 1273,1280 ----
      do {
  	tst =
  	    ubik_CallIter(KAM_Unlock, kaserver.servers, 0, &count,
! 			  who->principal, who->instance, 0, 0, 0, 0, 0, 0,
! 			  0, 0, 0, 0, 0, 0, 0, 0);
  	if (tst && (tst != UNOSERVERS)) {
  	    if (save_tst == 0) {
  		save_tst = tst;	/* save the first failure */
Index: openafs/src/lwp/lwp.c
diff -c openafs/src/lwp/lwp.c:1.27.2.1 openafs/src/lwp/lwp.c:1.27.2.2
*** openafs/src/lwp/lwp.c:1.27.2.1	Wed Aug 25 03:03:40 2004
--- openafs/src/lwp/lwp.c	Mon Dec 13 14:40:19 2004
***************
*** 17,23 ****
  #include <afsconfig.h>
  #include <afs/param.h>
  
! RCSID("$Header: /cvs/openafs/src/lwp/lwp.c,v 1.27.2.1 2004/08/25 07:03:40 shadow Exp $");
  
  #include <stdlib.h>
  #include <stdio.h>
--- 17,23 ----
  #include <afsconfig.h>
  #include <afs/param.h>
  
! RCSID("$Header: /cvs/openafs/src/lwp/lwp.c,v 1.27.2.2 2004/12/13 19:40:19 shadow Exp $");
  
  #include <stdlib.h>
  #include <stdio.h>
***************
*** 121,127 ****
  struct QUEUE {
      PROCESS head;
      int count;
! } runnable[MAX_PRIORITIES], blocked, qwaiting;
  /* Invariant for runnable queues: The head of each queue points to the currently running process if it is in that queue, or it points to the next process in that queue that should run. */
  
  /* Offset of stack field within pcb -- used by stack checking stuff */
--- 121,127 ----
  struct QUEUE {
      PROCESS head;
      int count;
! } runnable[MAX_PRIORITIES], blocked;
  /* Invariant for runnable queues: The head of each queue points to the currently running process if it is in that queue, or it points to the next process in that queue that should run. */
  
  /* Offset of stack field within pcb -- used by stack checking stuff */
***************
*** 242,248 ****
  {
      register PROCESS tp;
      (tp = lwp_cpptr)->status = QWAITING;
!     move(tp, &runnable[tp->priority], &qwaiting);
      Set_LWP_RC();
      return LWP_SUCCESS;
  }
--- 242,248 ----
  {
      register PROCESS tp;
      (tp = lwp_cpptr)->status = QWAITING;
!     lwp_remove(tp, &runnable[tp->priority]);
      Set_LWP_RC();
      return LWP_SUCCESS;
  }
***************
*** 253,259 ****
  {
      if (pid->status == QWAITING) {
  	pid->status = READY;
! 	move(pid, &qwaiting, &runnable[pid->priority]);
  	return LWP_SUCCESS;
      } else
  	return LWP_ENOWAIT;
--- 253,259 ----
  {
      if (pid->status == QWAITING) {
  	pid->status = READY;
! 	insert(pid, &runnable[pid->priority]);
  	return LWP_SUCCESS;
      } else
  	return LWP_ENOWAIT;
***************
*** 561,569 ****
  	    for_all_elts(x, blocked, {
  			 Dump_One_Process(x);}
  	)
- 	    for_all_elts(x, qwaiting, {
- 			 Dump_One_Process(x);}
- 	)
      } else
  	printf("***LWP: LWP support not initialized\n");
      return 0;
--- 561,566 ----
***************
*** 604,611 ****
      }
      blocked.head = NULL;
      blocked.count = 0;
-     qwaiting.head = NULL;
-     qwaiting.count = 0;
      lwp_init = (struct lwp_ctl *)malloc(sizeof(struct lwp_ctl));
      temp = (PROCESS) malloc(sizeof(struct lwp_pcb));
      if (lwp_init == NULL || temp == NULL)
--- 601,606 ----
***************
*** 665,673 ****
  	for_all_elts(cur, blocked, {
  		     Free_PCB(cur);}
      )
- 	for_all_elts(cur, qwaiting, {
- 		     Free_PCB(cur);}
-     )
  	free(lwp_init);
      lwp_init = NULL;
      return LWP_SUCCESS;
--- 660,665 ----
***************
*** 792,800 ****
      lwp_remove(pid,
  	       (pid->blockflag || pid->status == WAITING
  		|| pid->status ==
! 		DESTROYED ? &blocked : 
! 		(pid->status == QWAITING) ? &qwaiting :
! 		&runnable[pid->priority]));
      LWPANCHOR.processcnt--;
      return 0;
  }
--- 784,790 ----
      lwp_remove(pid,
  	       (pid->blockflag || pid->status == WAITING
  		|| pid->status ==
! 		DESTROYED ? &blocked : &runnable[pid->priority]));
      LWPANCHOR.processcnt--;
      return 0;
  }
***************
*** 821,829 ****
      case DESTROYED:
  	printf("DESTROYED");
  	break;
-     case QWAITING:
- 	printf("QWAITING");
- 	break;
      default:
  	printf("unknown");
      }
--- 811,816 ----
***************
*** 883,895 ****
  		     printf(" \"%s\"", p->name);
  		     }
  	)
! 	puts("]");
! 	printf("[Qwaiting (%d):", qwaiting.count);
! 	for_all_elts(p, qwaiting, {
! 		     printf(" \"%s\"", p->name);
! 		     }
! 	)
! 	puts("]");
      }
  #endif
  
--- 870,876 ----
  		     printf(" \"%s\"", p->name);
  		     }
  	)
! 	    puts("]");
      }
  #endif
  
Index: openafs/src/packaging/MacOS/OpenAFS.Info.plist
diff -c openafs/src/packaging/MacOS/OpenAFS.Info.plist:1.2.2.2 openafs/src/packaging/MacOS/OpenAFS.Info.plist:1.2.2.3
*** openafs/src/packaging/MacOS/OpenAFS.Info.plist:1.2.2.2	Wed Dec  8 06:12:23 2004
--- openafs/src/packaging/MacOS/OpenAFS.Info.plist	Mon Dec 13 14:46:23 2004
***************
*** 3,15 ****
  <plist version="1.0">
  <dict>
  	<key>CFBundleGetInfoString</key>
! 	<string>OpenAFS 1.3.75</string>
  	<key>CFBundleIdentifier</key>
  	<string>org.openafs.OpenAFS.pkg</string>
  	<key>CFBundleName</key>
  	<string>OpenAFS</string>
  	<key>CFBundleShortVersionString</key>
! 	<string>1.3.75</string>
  	<key>IFMajorVersion</key>
  	<integer>1</integer>
  	<key>IFMinorVersion</key>
--- 3,15 ----
  <plist version="1.0">
  <dict>
  	<key>CFBundleGetInfoString</key>
! 	<string>OpenAFS 1.3.76</string>
  	<key>CFBundleIdentifier</key>
  	<string>org.openafs.OpenAFS.pkg</string>
  	<key>CFBundleName</key>
  	<string>OpenAFS</string>
  	<key>CFBundleShortVersionString</key>
! 	<string>1.3.76</string>
  	<key>IFMajorVersion</key>
  	<integer>1</integer>
  	<key>IFMinorVersion</key>
Index: openafs/src/packaging/MacOS/OpenAFS.info
diff -c openafs/src/packaging/MacOS/OpenAFS.info:1.1.4.2 openafs/src/packaging/MacOS/OpenAFS.info:1.1.4.3
*** openafs/src/packaging/MacOS/OpenAFS.info:1.1.4.2	Wed Dec  8 06:12:23 2004
--- openafs/src/packaging/MacOS/OpenAFS.info	Mon Dec 13 14:46:23 2004
***************
*** 1,5 ****
  Title OpenAFS
! Version 1.3.75
  Description The OpenAFS distributed filesystem. This package installs an almost-ready-to-run client for OpenAFS. see http://www.openafs.org for more information.
  DefaultLocation /
  Diskname (null)
--- 1,5 ----
  Title OpenAFS
! Version 1.3.76
  Description The OpenAFS distributed filesystem. This package installs an almost-ready-to-run client for OpenAFS. see http://www.openafs.org for more information.
  DefaultLocation /
  Diskname (null)
Index: openafs/src/sys/Makefile.in
diff -c openafs/src/sys/Makefile.in:1.27 openafs/src/sys/Makefile.in:1.27.2.1
*** openafs/src/sys/Makefile.in:1.27	Thu Jun 24 13:38:36 2004
--- openafs/src/sys/Makefile.in	Mon Dec 13 14:39:51 2004
***************
*** 189,194 ****
--- 189,201 ----
  ${KERNELDIR}/afs/xfsattrs.h: xfsattrs.h
  	${INSTALL} $? $@
  
+ depinstall: \
+ 	${TOP_INCDIR}/afs/afssyscalls.h \
+ 	${TOP_INCDIR}/afs/afs.exp \
+ 	${TOP_INCDIR}/afs/xfsattrs.h \
+ 	${KERNELDIR}/afs/xfsattrs.h \
+ 	${UKERNELDIR}/afs/afsl.exp
+ 
  install: \
  	${DESTDIR}${libdir}/afs/libsys.a \
  	${DESTDIR}${sbindir}/rmtsysd \
Index: openafs/src/ubik/ubik.p.h
diff -c openafs/src/ubik/ubik.p.h:1.11.2.3 openafs/src/ubik/ubik.p.h:1.11.2.4
*** openafs/src/ubik/ubik.p.h:1.11.2.3	Tue Nov  9 12:09:41 2004
--- openafs/src/ubik/ubik.p.h	Mon Dec 13 14:38:53 2004
***************
*** 354,359 ****
--- 354,365 ----
  
  extern afs_int32 ubik_ClientDestroy(struct ubik_client *aclient);
  
+ extern afs_int32 ubik_CallIter(int (*aproc) (), struct ubik_client *aclient,
+ 			       afs_int32 aflags, int *apos, long p1, long p2,
+ 			       long p3, long p4, long p5, long p6, long p7,
+ 			       long p8, long p9, long p10, long p11, long p12,
+ 			       long p13, long p14, long p15, long p16);
+ 
  /* ubik.c */
  extern int ubik_BeginTrans(register struct ubik_dbase *dbase,
  			   afs_int32 transMode, struct ubik_trans **transPtr);
Index: openafs/src/ubik/ubikclient.c
diff -c openafs/src/ubik/ubikclient.c:1.8.2.1 openafs/src/ubik/ubikclient.c:1.8.2.2
*** openafs/src/ubik/ubikclient.c:1.8.2.1	Wed Aug 25 03:09:43 2004
--- openafs/src/ubik/ubikclient.c	Mon Dec 13 14:38:53 2004
***************
*** 15,21 ****
  #endif
  
  RCSID
!     ("$Header: /cvs/openafs/src/ubik/ubikclient.c,v 1.8.2.1 2004/08/25 07:09:43 shadow Exp $");
  
  #if defined(UKERNEL)
  #include "afs/sysincludes.h"
--- 15,21 ----
  #endif
  
  RCSID
!     ("$Header: /cvs/openafs/src/ubik/ubikclient.c,v 1.8.2.2 2004/12/13 19:38:53 shadow Exp $");
  
  #if defined(UKERNEL)
  #include "afs/sysincludes.h"
***************
*** 46,52 ****
  #endif /* defined(UKERNEL) */
  
  
- afs_int32 ubik_CallIter();
  short ubik_initializationState;	/* initial state is zero */
  
  
--- 46,51 ----
***************
*** 750,777 ****
   * This is part of an iterator.  It doesn't handle finding sync sites
   */
  afs_int32
! ubik_CallIter(aproc, aclient, aflags, apos, p1, p2, p3, p4, p5, p6, p7, p8,
! 	      p9, p10, p11, p12, p13, p14, p15, p16)
!      int (*aproc) ();
!      register struct ubik_client *aclient;
!      afs_int32 aflags;
!      int *apos;
!      long p1;
!      long p2;
!      long p3;
!      long p4;
!      long p5;
!      long p6;
!      long p7;
!      long p8;
!      long p9;
!      long p10;
!      long p11;
!      long p12;
!      long p13;
!      long p14;
!      long p15;
!      long p16;
  {
      return CallIter(aproc, aclient, aflags, apos, p1, p2, p3, p4, p5, p6, p7,
  		    p8, p9, p10, p11, p12, p13, p14, p15, p16, NEED_LOCK);
--- 749,759 ----
   * This is part of an iterator.  It doesn't handle finding sync sites
   */
  afs_int32
! ubik_CallIter(int (*aproc) (), struct ubik_client *aclient,
! 			       afs_int32 aflags, int *apos, long p1, long p2,
! 			       long p3, long p4, long p5, long p6, long p7,
! 			       long p8, long p9, long p10, long p11, long p12,
! 			       long p13, long p14, long p15, long p16)
  {
      return CallIter(aproc, aclient, aflags, apos, p1, p2, p3, p4, p5, p6, p7,
  		    p8, p9, p10, p11, p12, p13, p14, p15, p16, NEED_LOCK);
Index: openafs/src/vol/volume.c
diff -c openafs/src/vol/volume.c:1.35.2.1 openafs/src/vol/volume.c:1.35.2.2
*** openafs/src/vol/volume.c:1.35.2.1	Wed Aug 25 03:14:19 2004
--- openafs/src/vol/volume.c	Mon Dec 13 14:41:10 2004
***************
*** 20,26 ****
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/vol/volume.c,v 1.35.2.1 2004/08/25 07:14:19 shadow Exp $");
  
  #include <rx/xdr.h>
  #include <afs/afsint.h>
--- 20,26 ----
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/vol/volume.c,v 1.35.2.2 2004/12/13 19:41:10 shadow Exp $");
  
  #include <rx/xdr.h>
  #include <afs/afsint.h>
***************
*** 635,641 ****
      }
  
      DiskToVolumeHeader(&iheader, &diskHeader);
!     if (programType == volumeUtility && mode != V_SECRETLY) {
  	if (FSYNC_askfs(iheader.id, partition, FSYNC_NEEDVOLUME, mode)
  	    == FSYNC_DENIED) {
  	    Log("VAttachVolume: attach of volume %u apparently denied by file server\n", iheader.id);
--- 635,641 ----
      }
  
      DiskToVolumeHeader(&iheader, &diskHeader);
!     if (programType == volumeUtility && mode != V_SECRETLY && mode != V_PEEK) {
  	if (FSYNC_askfs(iheader.id, partition, FSYNC_NEEDVOLUME, mode)
  	    == FSYNC_DENIED) {
  	    Log("VAttachVolume: attach of volume %u apparently denied by file server\n", iheader.id);
***************
*** 650,656 ****
  	 * takes the volume offline or not.  If the volume isn't
  	 * offline, we must not return it when we detach the volume,
  	 * or the server will abort */
! 	if (mode == V_READONLY
  	    || (!VolumeWriteable(vp) && (mode == V_CLONE || mode == V_DUMP)))
  	    vp->needsPutBack = 0;
  	else
--- 650,656 ----
  	 * takes the volume offline or not.  If the volume isn't
  	 * offline, we must not return it when we detach the volume,
  	 * or the server will abort */
! 	if (mode == V_READONLY || mode == V_PEEK
  	    || (!VolumeWriteable(vp) && (mode == V_CLONE || mode == V_DUMP)))
  	    vp->needsPutBack = 0;
  	else
***************
*** 667,673 ****
       * for all of that to happen, but if it does, probably the right
       * fix is for the server to allow the return of readonly volumes
       * that it doesn't think are really checked out. */
!     if (programType == volumeUtility && vp == NULL && mode != V_SECRETLY) {
  	FSYNC_askfs(iheader.id, partition, FSYNC_ON, 0);
      } else if (programType == fileServer && vp) {
  	V_needsCallback(vp) = 0;
--- 667,674 ----
       * for all of that to happen, but if it does, probably the right
       * fix is for the server to allow the return of readonly volumes
       * that it doesn't think are really checked out. */
!     if (programType == volumeUtility && vp == NULL &&
! 	mode != V_SECRETLY && mode != V_PEEK) {
  	FSYNC_askfs(iheader.id, partition, FSYNC_ON, 0);
      } else if (programType == fileServer && vp) {
  	V_needsCallback(vp) = 0;
Index: openafs/src/vol/volume.h
diff -c openafs/src/vol/volume.h:1.14.2.1 openafs/src/vol/volume.h:1.14.2.2
*** openafs/src/vol/volume.h:1.14.2.1	Wed Aug 25 03:14:19 2004
--- openafs/src/vol/volume.h	Mon Dec 13 14:41:11 2004
***************
*** 492,497 ****
--- 492,502 ----
  				 * never knows about more than one copy of the same volume--when
  				 * a volume is moved from one partition to another on a single
  				 * server */
+ #define V_PEEK     6		/* "Peek" at the volume without telling the fileserver.  This is
+ 				 * similar to V_SECRETLY, but read-only.  It is used in cases where
+ 				 * not impacting fileserver performance is more important than
+ 				 * getting the most recent data. */
+ 
  
  #if	defined(NEARINODE_HINT)
  #define V_pref(vp,nearInode)  nearInodeHash(V_id(vp),(nearInode)); (nearInode) %= V_partition(vp)->f_files
Index: openafs/src/volser/volprocs.c
diff -c openafs/src/volser/volprocs.c:1.34.2.2 openafs/src/volser/volprocs.c:1.34.2.3
*** openafs/src/volser/volprocs.c:1.34.2.2	Tue Nov  9 12:13:45 2004
--- openafs/src/volser/volprocs.c	Mon Dec 13 14:41:13 2004
***************
*** 11,17 ****
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/volser/volprocs.c,v 1.34.2.2 2004/11/09 17:13:45 shadow Exp $");
  
  #include <stdio.h>
  #include <sys/types.h>
--- 11,17 ----
  #include <afs/param.h>
  
  RCSID
!     ("$Header: /cvs/openafs/src/volser/volprocs.c,v 1.34.2.3 2004/12/13 19:41:13 shadow Exp $");
  
  #include <stdio.h>
  #include <sys/types.h>
***************
*** 1790,1796 ****
  		pntr->volid = volid;
  		goto drop;
  	    }
! 	    tv = VAttachVolumeByName(&error, pname, volname, V_READONLY);
  	    if (error) {
  		pntr->status = 0;	/*things are messed up */
  		strcpy(pntr->name, volname);
--- 1790,1796 ----
  		pntr->volid = volid;
  		goto drop;
  	    }
! 	    tv = VAttachVolumeByName(&error, pname, volname, V_PEEK);
  	    if (error) {
  		pntr->status = 0;	/*things are messed up */
  		strcpy(pntr->name, volname);
***************
*** 2004,2010 ****
  	    /*
  	     * Attach the volume, give up on the volume if we can't.
  	     */
! 	    tv = VAttachVolumeByName(&error, pname, volname, V_READONLY);
  	    if (error) {
  		xInfoP->status = 0;	/*things are messed up */
  		strcpy(xInfoP->name, volname);
--- 2004,2010 ----
  	    /*
  	     * Attach the volume, give up on the volume if we can't.
  	     */
! 	    tv = VAttachVolumeByName(&error, pname, volname, V_PEEK);
  	    if (error) {
  		xInfoP->status = 0;	/*things are messed up */
  		strcpy(xInfoP->name, volname);
***************
*** 2171,2177 ****
  		pntr->volid = volid;
  		goto drop;
  	    }
! 	    tv = VAttachVolumeByName(&error, pname, volname, V_READONLY);
  	    if (error) {
  		pntr->status = 0;	/*things are messed up */
  		strcpy(pntr->name, volname);
--- 2171,2177 ----
  		pntr->volid = volid;
  		goto drop;
  	    }
! 	    tv = VAttachVolumeByName(&error, pname, volname, V_PEEK);
  	    if (error) {
  		pntr->status = 0;	/*things are messed up */
  		strcpy(pntr->name, volname);
***************
*** 2413,2419 ****
  	    /*
  	     * Attach the volume, give up on this volume if we can't.
  	     */
! 	    tv = VAttachVolumeByName(&error, pname, volname, V_READONLY);
  	    if (error) {
  		xInfoP->status = 0;	/*things are messed up */
  		strcpy(xInfoP->name, volname);
--- 2413,2419 ----
  	    /*
  	     * Attach the volume, give up on this volume if we can't.
  	     */
! 	    tv = VAttachVolumeByName(&error, pname, volname, V_PEEK);
  	    if (error) {
  		xInfoP->status = 0;	/*things are messed up */
  		strcpy(xInfoP->name, volname);
